$form->field(
name => "password",
validate => sub {
- checkpassword($form->field("name"), shift);
+ checkpassword(scalar $form->field("name"), shift);
},
);
}
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");
},
);
}
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");
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'));
}
}
}