aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2015-05-13 23:32:29 -0400
committerJoey Hess <joeyh@joeyh.name>2015-05-13 23:32:29 -0400
commit70cf5bb7654a551511c0b05cd782349dbbde2c78 (patch)
treee100944734c3d2e5096e0c1b35b9e1df52ccd1c2 /IkiWiki/Plugin
parent7a68c4a01c5f8c044b9326a2efc8293cb8825cb6 (diff)
downloadikiwiki-70cf5bb7654a551511c0b05cd782349dbbde2c78.tar
ikiwiki-70cf5bb7654a551511c0b05cd782349dbbde2c78.tar.gz
don't let emailauth user's email address be changed on preferences page
There's no real problem if they do change it, except they may get confused and expect to be able to log in with the changed email and get the same user account.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/emailauth.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/emailauth.pm b/IkiWiki/Plugin/emailauth.pm
index 57100a2d7..aa067238f 100644
--- a/IkiWiki/Plugin/emailauth.pm
+++ b/IkiWiki/Plugin/emailauth.pm
@@ -8,7 +8,8 @@ use IkiWiki 3.00;
sub import {
hook(type => "getsetup", id => "emailauth", "call" => \&getsetup);
- hook(type => "cgi", id => "cgi", "call" => \&cgi);
+ hook(type => "cgi", id => "emailauth", "call" => \&cgi);
+ hook(type => "formbuilder_setup", id => "emailauth", "call" => \&formbuilder_setup);
IkiWiki::loadplugin("loginselector");
IkiWiki::Plugin::loginselector::register_login_plugin(
"emailauth",
@@ -111,6 +112,17 @@ sub cgi ($$) {
}
}
+sub formbuilder_setup (@) {
+ my %params=@_;
+ my $form=$params{form};
+ my $session=$params{session};
+
+ if ($form->title eq "preferences" &&
+ IkiWiki::emailuser($session->param("name"))) {
+ $form->field(name => "email", disabled => 1);
+ }
+}
+
# Generates the token that will be used in the authurl to log the user in.
# This needs to be hard to guess, and relatively short. Generating a cgi
# session id will make it as hard to guess as any cgi session.