diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2010-01-04 19:40:33 -0500 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2010-01-04 19:40:33 -0500 |
commit | 264f46989470db93293938e327744554b5177f82 (patch) | |
tree | 0251e397f23753980b2a543d5c110200517b2c54 /IkiWiki | |
parent | 3e6331127b57fe4f3e48d3cf10536b2f2b70eefb (diff) |
lockedit can make sense with no auth plugins
On second though, you might want a wide-open wiki with some locked
pages that cannot be edited online.
So, the right thing for lockedit to do when there are no auth plugins is
to just say the page cannot be edited.
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/lockedit.pm | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/IkiWiki/Plugin/lockedit.pm b/IkiWiki/Plugin/lockedit.pm index 8914ba498..74ddbb153 100644 --- a/IkiWiki/Plugin/lockedit.pm +++ b/IkiWiki/Plugin/lockedit.pm @@ -7,7 +7,6 @@ use IkiWiki 3.00; sub import { hook(type => "getsetup", id => "lockedit", call => \&getsetup); - hook(type => "checkconfig", id => "lockedit", call => \&checkconfig); hook(type => "canedit", id => "lockedit", call => \&canedit); } @@ -27,12 +26,6 @@ sub getsetup () { }, } -sub checkconfig () { - if (! exists $IkiWiki::hooks{auth}) { - error gettext("lockedit plugin is enabled, but no authentication plugins are enabled"); - } -} - sub canedit ($$) { my $page=shift; my $cgi=shift; @@ -46,8 +39,9 @@ sub canedit ($$) { user => $session->param("name"), ip => $ENV{REMOTE_ADDR}, )) { - if (! defined $user || - ! IkiWiki::userinfo_get($session->param("name"), "regdate")) { + if ((! defined $user || + ! IkiWiki::userinfo_get($session->param("name"), "regdate")) && + exists $IkiWiki::hooks{auth}) { return sub { IkiWiki::needsignin($cgi, $session) }; } else { |