diff options
author | Joey Hess <joey@kitenet.net> | 2012-04-02 12:17:07 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-04-02 12:17:07 -0400 |
commit | 1d1ef2003432d6993f0169b58e7b5f176948eb35 (patch) | |
tree | a488c995eac9a3d3577d5bccbc6d6d549c0b06ac /IkiWiki/Plugin/passwordauth.pm | |
parent | 5c55e804771a7c3195df62016ad01993581d931a (diff) | |
download | ikiwiki-1d1ef2003432d6993f0169b58e7b5f176948eb35.tar ikiwiki-1d1ef2003432d6993f0169b58e7b5f176948eb35.tar.gz |
add support for a passwordless login token
The plan is to use this for accounts that are created implicitly, as when
a non-logged-in user subscribes to notifyemail. Such an account has no
password, and login can be accomplished by way of a url that is sent to
them in email.
When the user sets a password, the passwordless login token is disabled.
Diffstat (limited to 'IkiWiki/Plugin/passwordauth.pm')
-rw-r--r-- | IkiWiki/Plugin/passwordauth.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/passwordauth.pm b/IkiWiki/Plugin/passwordauth.pm index c167f52b5..6a5153efd 100644 --- a/IkiWiki/Plugin/passwordauth.pm +++ b/IkiWiki/Plugin/passwordauth.pm @@ -96,6 +96,12 @@ sub setpassword ($$;$) { else { IkiWiki::userinfo_set($user, $field, $password); } + + # Setting the password clears any passwordless login token. + if ($field ne 'passwordless') { + IkiWiki::userinfo_set($user, "cryptpasswordless", ""); + IkiWiki::userinfo_set($user, "passwordless", ""); + } } sub formbuilder_setup (@) { |