diff options
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/ddate.pm | 2 | ||||
-rw-r--r-- | IkiWiki/Plugin/inline.pm | 2 | ||||
-rw-r--r-- | IkiWiki/Plugin/lockedit.pm | 13 | ||||
-rw-r--r-- | IkiWiki/Plugin/opendiscussion.pm | 2 | ||||
-rw-r--r-- | IkiWiki/Plugin/prettydate.pm | 2 | ||||
-rw-r--r-- | IkiWiki/Plugin/signinedit.pm | 9 |
6 files changed, 20 insertions, 10 deletions
diff --git a/IkiWiki/Plugin/ddate.pm b/IkiWiki/Plugin/ddate.pm index 7382d4160..6b67f4202 100644 --- a/IkiWiki/Plugin/ddate.pm +++ b/IkiWiki/Plugin/ddate.pm @@ -6,7 +6,7 @@ use IkiWiki 2.00; no warnings; sub import { #{{{ - hook(type => "checkconfig", id => "skeleton", call => \&checkconfig); + hook(type => "checkconfig", id => "ddate", call => \&checkconfig); } # }}} sub checkconfig () { #{{{ diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index b16636a70..53b051816 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -14,7 +14,7 @@ my %page_numfeeds; sub import { #{{{ hook(type => "getopt", id => "inline", call => \&getopt); hook(type => "checkconfig", id => "inline", call => \&checkconfig); - hook(type => "sessioncgi", id => "skeleton", call => \&sessioncgi); + hook(type => "sessioncgi", id => "inline", call => \&sessioncgi); hook(type => "preprocess", id => "inline", call => \&IkiWiki::preprocess_inline); hook(type => "pagetemplate", id => "inline", diff --git a/IkiWiki/Plugin/lockedit.pm b/IkiWiki/Plugin/lockedit.pm index a829df1cf..010705c49 100644 --- a/IkiWiki/Plugin/lockedit.pm +++ b/IkiWiki/Plugin/lockedit.pm @@ -21,10 +21,15 @@ sub canedit ($$) { #{{{ foreach my $admin (@{$config{adminuser}}) { if (pagespec_match($page, IkiWiki::userinfo_get($admin, "locked_pages"))) { - IkiWiki::needsignin($cgi, $session) unless defined $user; - return sprintf(gettext("%s is locked by %s and cannot be edited"), - htmllink("", "", $page, noimageinline => 1), - IkiWiki::userlink($admin)); + if (! defined $user || + ! IkiWiki::userinfo_get($session->param("name"), "regdate")) { + return sub { IkiWiki::needsignin($cgi, $session) }; + } + else { + return sprintf(gettext("%s is locked by %s and cannot be edited"), + htmllink("", "", $page, noimageinline => 1), + IkiWiki::userlink($admin)); + } } } diff --git a/IkiWiki/Plugin/opendiscussion.pm b/IkiWiki/Plugin/opendiscussion.pm index fd5c9673d..c835f0106 100644 --- a/IkiWiki/Plugin/opendiscussion.pm +++ b/IkiWiki/Plugin/opendiscussion.pm @@ -15,7 +15,7 @@ sub canedit ($$) { #{{{ my $session=shift; my $discussion=gettext("discussion"); - return "" if $page=~/\/\Q$discussion\E$/; + return "" if $page=~/(\/|^)\Q$discussion\E$/; return undef; } #}}} diff --git a/IkiWiki/Plugin/prettydate.pm b/IkiWiki/Plugin/prettydate.pm index b31d30cd0..b6110e427 100644 --- a/IkiWiki/Plugin/prettydate.pm +++ b/IkiWiki/Plugin/prettydate.pm @@ -40,7 +40,7 @@ sub default_timetable { } sub import { #{{{ - hook(type => "checkconfig", id => "skeleton", call => \&checkconfig); + hook(type => "checkconfig", id => "prettydate", call => \&checkconfig); } # }}} sub checkconfig () { #{{{ diff --git a/IkiWiki/Plugin/signinedit.pm b/IkiWiki/Plugin/signinedit.pm index 08932e2f6..84ab3a4d0 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") || + ! IkiWiki::userinfo_get($session->param("name"), "regdate")) { + return sub { IkiWiki::needsignin($cgi, $session) }; + } + else { + return ""; + } } #}}} 1 |