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 errors.
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>
13 This is the plugin so far:
16 # Bring up a login page that returns to the calling page
17 package IkiWiki::Plugin::justlogin;
24 hook(type => "sessioncgi", id => "justlogin", call => \&sessioncgi);
25 hook(type => "auth", id => "justlogin", call => \&auth);
32 debug("jl sessioncgi1 running.");
34 if ($q->param('do') eq 'justlogin') {
35 debug("Justlogin do=justlogin running.");
36 if (! defined $session->param("name") ) {
37 debug("Justlogin param!defined running.");
38 $session->param(postsignin => $ENV{HTTP_REFERER} );
39 $session->param("do" => "justgoback" );
40 IkiWiki::cgi_savesession($session);
41 IkiWiki::cgi_signin($q, $session);
44 } elsif ($session->param('do') eq 'justgoback') {
45 debug("jl justgoback running.");
46 if (! defined $session->param("name")) {
47 debug("Justlogin redir running.");
48 my $page=IkiWiki::possibly_foolish_untaint($q->param('postsignin'));
49 $session->clear("postsignin");
50 $session->clear("do");
51 IkiWiki::cgi_savesession($session);
52 IkiWiki::redirect($q, $page);
58 # While this hook is not currently used, it needs to exist
59 # so ikiwiki knows that the wiki supports logins, and will
60 # enable the Preferences page.