X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/fa52a730ff3b30c7d2cdd8cd5f9c8c25a0c0a2a5..5023f2301d42319cb552102c532452b8fb4744af:/IkiWiki/Plugin/lockedit.pm?ds=inline diff --git a/IkiWiki/Plugin/lockedit.pm b/IkiWiki/Plugin/lockedit.pm index f204e72c0..a829df1cf 100644 --- a/IkiWiki/Plugin/lockedit.pm +++ b/IkiWiki/Plugin/lockedit.pm @@ -3,7 +3,7 @@ package IkiWiki::Plugin::lockedit; use warnings; use strict; -use IkiWiki; +use IkiWiki 2.00; sub import { #{{{ hook(type => "canedit", id => "lockedit", call => \&canedit); @@ -20,7 +20,8 @@ sub canedit ($$) { #{{{ return undef if defined $user && IkiWiki::is_admin($user); foreach my $admin (@{$config{adminuser}}) { - if (pagespec_match($page, IkiWiki::userinfo_get($admin, "locked_pages"), "")) { + 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)); @@ -40,7 +41,8 @@ sub formbuilder_setup (@) { #{{{ if ($form->title eq "preferences") { $form->field(name => "locked_pages", size => 50, - comment => "(".htmllink("", "", "PageSpec", noimageinline => 1).")"); + fieldset => "admin", + comment => "(".htmllink("", "", "ikiwiki/PageSpec", noimageinline => 1).")"); if (! IkiWiki::is_admin($user_name)) { $form->field(name => "locked_pages", type => "hidden"); }