2 # Ikiwiki email address as login
3 package IkiWiki::Plugin::emailauth;
10 hook(type => "getsetup", id => "emailauth", "call" => \&getsetup);
11 hook(type => "auth", id => "emailauth", call => \&auth);
12 IkiWiki::loadplugin("loginselector");
13 IkiWiki::Plugin::loginselector::register_login_plugin(
30 sub email_setup ($$) {
37 sub email_check_input ($) {
39 defined $cgi->param('do')
40 && $cgi->param("do") eq "signin"
41 && defined $cgi->param('Email_entry')
42 && length $cgi->param('Email_entry');
45 sub email_auth ($$$) {
48 my $errordisplayer=shift;
50 unless ($cgi->param('Email_entry') =~ /.\@./) {
51 $errordisplayer->("Invalid email address.");
59 # While this hook is not currently used, it needs to exist
60 # so ikiwiki knows that the wiki supports logins, and will
61 # enable the Preferences page.