* Add sessioncgi hook.
parent
06e7403577
commit
8e2fb374e0
|
@ -688,7 +688,10 @@ sub cgi (;$$) { #{{{
|
||||||
print gettext("You are banned.");
|
print gettext("You are banned.");
|
||||||
cgi_savesession($session);
|
cgi_savesession($session);
|
||||||
}
|
}
|
||||||
elsif ($do eq 'signin') {
|
|
||||||
|
run_hooks(sessioncgi => sub { shift->($q, $session) });
|
||||||
|
|
||||||
|
if ($do eq 'signin') {
|
||||||
cgi_signin($q, $session);
|
cgi_signin($q, $session);
|
||||||
cgi_savesession($session);
|
cgi_savesession($session);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,9 @@ ikiwiki (2.6) UNRELEASED; urgency=low
|
||||||
* pagetemplate: don't display template name
|
* pagetemplate: don't display template name
|
||||||
* Add rel=tag attribute to tag links, supporting that microformat, as well
|
* Add rel=tag attribute to tag links, supporting that microformat, as well
|
||||||
as allowing them to be styled specially. Thanks, NicolasLimare.
|
as allowing them to be styled specially. Thanks, NicolasLimare.
|
||||||
|
* Add sessioncgi hook.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Sun, 05 Aug 2007 13:35:37 -0700
|
-- Joey Hess <joeyh@debian.org> Sun, 05 Aug 2007 14:36:55 -0700
|
||||||
|
|
||||||
ikiwiki (2.5) unstable; urgency=low
|
ikiwiki (2.5) unstable; urgency=low
|
||||||
|
|
||||||
|
|
|
@ -208,6 +208,15 @@ object's "name" parameter to the authenticated user's name. Note that
|
||||||
if the name is set to the name of a user who is not registered,
|
if the name is set to the name of a user who is not registered,
|
||||||
a basic registration of the user will be automatically performed.
|
a basic registration of the user will be automatically performed.
|
||||||
|
|
||||||
|
### sessioncgi
|
||||||
|
|
||||||
|
hook(type => "sessioncgi", id => "foo", call => \&sessioncgi);
|
||||||
|
|
||||||
|
Unlike the cgi hook, which is run as soon as possible, the sessioncgi hook
|
||||||
|
is only run once a session object is available. It is passed both a CGI
|
||||||
|
object and a session object. To check if the user is in fact signed in, you
|
||||||
|
can check if the session object has a "name" parameter set.
|
||||||
|
|
||||||
### canedit
|
### canedit
|
||||||
|
|
||||||
hook(type => "canedit", id => "foo", call => \&pagelocked);
|
hook(type => "canedit", id => "foo", call => \&pagelocked);
|
||||||
|
|
|
@ -1,2 +1,5 @@
|
||||||
How about a hook to allow CGI objects to insist on authenticated users
|
How about a hook to allow CGI objects to insist on authenticated users
|
||||||
only? I think "authcgi" would be a good name. --Ethan
|
only? I think "authcgi" would be a good name. --Ethan
|
||||||
|
|
||||||
|
> This is now [[done]], although I called it sessioncgi since the user may
|
||||||
|
> or may not be authed. --[[Joey]]
|
||||||
|
|
Loading…
Reference in New Issue