aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/signinedit.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-01-07 16:34:13 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-01-07 16:34:13 -0500
commitc487b847e2053b13c4eea0ccfeecf5a41c396412 (patch)
treec58c8a1dcc3372907fdc2e2940dcc3cc5faf4adf /IkiWiki/Plugin/signinedit.pm
parent45de8dc710bf5844ed99514342bade439c396084 (diff)
downloadikiwiki-c487b847e2053b13c4eea0ccfeecf5a41c396412.tar
ikiwiki-c487b847e2053b13c4eea0ccfeecf5a41c396412.tar.gz
* Improved the canedit hook interface, allowing a callback function to be
returned (and not run in some cases) rather than the plugins directly forcing a user to log in. * opendiscussion: allow editing of the toplevel discussion page, and, indirectly, allow creating new discussion pages.
Diffstat (limited to 'IkiWiki/Plugin/signinedit.pm')
-rw-r--r--IkiWiki/Plugin/signinedit.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/signinedit.pm b/IkiWiki/Plugin/signinedit.pm
index 08932e2f6..d5729f702 100644
--- a/IkiWiki/Plugin/signinedit.pm
+++ b/IkiWiki/Plugin/signinedit.pm
@@ -18,8 +18,13 @@ sub canedit ($$$) { #{{{
# Have the user sign in, if they are not already. This is why the
# hook runs last, so that any hooks that don't need the user to
# signin can override this.
- IkiWiki::needsignin($cgi, $session);
- return "";
+ if (! defined $session->param("name") ||
+ ! userinfo_get($session->param("name"), "regdate")) {
+ return sub { IkiWiki::needsignin($cgi, $session) };
+ }
+ else {
+ return "";
+ }
} #}}}
1