]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
avoid showing password prefs for emailauth user
authorJoey Hess <joeyh@joeyh.name>
Thu, 14 May 2015 03:23:53 +0000 (23:23 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 14 May 2015 03:24:07 +0000 (23:24 -0400)
IkiWiki.pm
IkiWiki/Plugin/passwordauth.pm

index f414996db377d12a27dc7c408a766e6302b9cf02..53eb8235bf85a6f7a419cec8206c397da10fdf06 100644 (file)
@@ -165,7 +165,7 @@ sub getsetup () {
        default_plugins => {
                type => "internal",
                default => [qw{mdwn link inline meta htmlscrubber passwordauth
        default_plugins => {
                type => "internal",
                default => [qw{mdwn link inline meta htmlscrubber passwordauth
-                               openid signinedit lockedit conditional
+                               openid emailauth signinedit lockedit conditional
                                recentchanges parentlinks editpage
                                templatebody}],
                description => "plugins to enable by default",
                                recentchanges parentlinks editpage
                                templatebody}],
                description => "plugins to enable by default",
@@ -1464,6 +1464,14 @@ sub openiduser ($) {
        return;
 }
 
        return;
 }
 
+sub emailuser ($) {
+       my $user=shift;
+       if (defined $user && $user =~ m/(.+)@/) {
+               return $1;
+       }
+       return;
+}
+
 sub htmlize ($$$$) {
        my $page=shift;
        my $destpage=shift;
 sub htmlize ($$$$) {
        my $page=shift;
        my $destpage=shift;
index 0cf2a26ea99380b6dd395824945bfcebd42c33b9..7c01bb3ffe11b0f7d36160e69de957efb659ffb7 100644 (file)
@@ -277,7 +277,7 @@ sub formbuilder_setup (@) {
        }
        elsif ($form->title eq "preferences") {
                my $user=$session->param("name");
        }
        elsif ($form->title eq "preferences") {
                my $user=$session->param("name");
-               if (! IkiWiki::openiduser($user)) {
+               if (! IkiWiki::openiduser($user) && ! IkiWiki::emailuser($user)) {
                        $form->field(name => "name", disabled => 1, 
                                value => $user, force => 1,
                                fieldset => "login");
                        $form->field(name => "name", disabled => 1, 
                                value => $user, force => 1,
                                fieldset => "login");