1 This plugin is still in development. Currently it does bring up the login page and the login page does, with proper credentials, log in the user, but the returning page goes to prefs. I have no idea why.
3 Place this code into a page:
5 <form action="http://portable.local/cgi-bin/ikiwiki.cgi" method="get">
7 <input type="hidden" name="do" value="justlogin" />
9 <input type="submit" value="Login" /></form>
11 This is the plugin so far:
13 # Bring up a login page that returns to the calling page
14 package IkiWiki::Plugin::justlogin;
21 hook(type => "sessioncgi", id => "justlogin", call => \&sessioncgi);
28 debug("jl sessioncgi1 running.");
30 if ($q->param("do") eq "justlogin") {
31 debug("jl do=justlogin running.");
32 if (! defined $session->param("name") ) {
33 debug("jl param!defined running.");
34 $session->param("postsignin" => $ENV{HTTP_REFERER} );
35 $session->param("do" => "justgoback" );
36 IkiWiki::cgi_signin($q, $session);
37 IkiWiki::cgi_savesession($session);
40 } elsif ($session->param("do") eq "justgoback") {
41 debug("jl justgoback running.");
42 my $page=$q->param("postsignin");
43 $session->clear("postsignin");
44 $session->clear("do");
45 IkiWiki::cgi_savesession($session);
46 IkiWiki::redirect($q, $page);