X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/497513e737a92d2115f5d2a16610561b8a1dffdc..a6e69822f68864512d49a954a4581511246f0e0b:/IkiWiki/Plugin/passwordauth.pm diff --git a/IkiWiki/Plugin/passwordauth.pm b/IkiWiki/Plugin/passwordauth.pm index 7c01bb3ff..c966087ce 100644 --- a/IkiWiki/Plugin/passwordauth.pm +++ b/IkiWiki/Plugin/passwordauth.pm @@ -231,7 +231,7 @@ sub formbuilder_setup (@) { $form->field( name => "password", validate => sub { - checkpassword($form->field("name"), shift); + checkpassword(scalar $form->field("name"), shift); }, ); } @@ -251,6 +251,12 @@ sub formbuilder_setup (@) { my $name=shift; length $name && $name=~/$config{wiki_file_regexp}/ && + # don't allow registering + # accounts that look like + # openids, or email + # addresses, even if the + # file regexp allows it + $name!~/[\/:\@]/ && ! IkiWiki::userinfo_get($name, "regdate"); }, ); @@ -389,7 +395,7 @@ sub formbuilder (@) { if ($form->submitted eq "Save Preferences" && $form->validate) { my $user_name=$form->field('name'); if (defined $form->field("password") && length $form->field("password")) { - setpassword($user_name, $form->field('password')); + setpassword($user_name, scalar $form->field('password')); } } }