From 800d165037ee9bc3362e21048ab07bdd120dcfe0 Mon Sep 17 00:00:00 2001 From: Jogo Date: Sat, 10 Oct 2009 04:22:41 -0400 Subject: --- doc/plugins/lockedit/discussion.mdwn | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 doc/plugins/lockedit/discussion.mdwn (limited to 'doc/plugins/lockedit/discussion.mdwn') diff --git a/doc/plugins/lockedit/discussion.mdwn b/doc/plugins/lockedit/discussion.mdwn new file mode 100644 index 000000000..b058b2b07 --- /dev/null +++ b/doc/plugins/lockedit/discussion.mdwn @@ -0,0 +1,21 @@ +This plugin not only locks pages but ensures too a user is logged in. This seems to me redundant with signedit. I propose : + + sub canedit ($$) { + my $page=shift; + my $cgi=shift; + my $session=shift; + + my $user=$session->param("name"); + return undef if defined $user && IkiWiki::is_admin($user); + + if (defined $config{locked_pages} && length $config{locked_pages} && + pagespec_match($page, $config{locked_pages}, + user => $session->param("name"), + ip => $ENV{REMOTE_ADDR}, + )) { + return sprintf(gettext("%s is locked and cannot be edited"), + htmllink("", "", $page, noimageinline => 1)); + } + + return undef; + } -- cgit v1.2.3 From 6993d1f905c35bbad415d3f60cde924da32e80a4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 11 Oct 2009 22:58:17 -0400 Subject: response --- doc/plugins/lockedit/discussion.mdwn | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'doc/plugins/lockedit/discussion.mdwn') diff --git a/doc/plugins/lockedit/discussion.mdwn b/doc/plugins/lockedit/discussion.mdwn index b058b2b07..8a08edaad 100644 --- a/doc/plugins/lockedit/discussion.mdwn +++ b/doc/plugins/lockedit/discussion.mdwn @@ -1,21 +1,8 @@ -This plugin not only locks pages but ensures too a user is logged in. This seems to me redundant with signedit. I propose : +This plugin not only locks pages but ensures too a user is logged in. This +seems to me redundant with signedit. I propose [removing the if block that +calls needsignin ]. - sub canedit ($$) { - my $page=shift; - my $cgi=shift; - my $session=shift; - - my $user=$session->param("name"); - return undef if defined $user && IkiWiki::is_admin($user); - - if (defined $config{locked_pages} && length $config{locked_pages} && - pagespec_match($page, $config{locked_pages}, - user => $session->param("name"), - ip => $ENV{REMOTE_ADDR}, - )) { - return sprintf(gettext("%s is locked and cannot be edited"), - htmllink("", "", $page, noimageinline => 1)); - } - - return undef; - } +> That was added because the most typical reason for being unable to edit a +> page is that you are not logged in. And without the jump to logging the +> user in, there is no way for the user to log in, without navigating away +> from the page they were trying to edit. --[[Joey]] -- cgit v1.2.3 From 7272938a116b2c87f8c34057034b5f4e9244cdf8 Mon Sep 17 00:00:00 2001 From: Jogo Date: Mon, 12 Oct 2009 16:44:12 -0400 Subject: --- doc/plugins/lockedit/discussion.mdwn | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'doc/plugins/lockedit/discussion.mdwn') diff --git a/doc/plugins/lockedit/discussion.mdwn b/doc/plugins/lockedit/discussion.mdwn index 8a08edaad..867fc6a51 100644 --- a/doc/plugins/lockedit/discussion.mdwn +++ b/doc/plugins/lockedit/discussion.mdwn @@ -6,3 +6,13 @@ calls needsignin ]. > page is that you are not logged in. And without the jump to logging the > user in, there is no way for the user to log in, without navigating away > from the page they were trying to edit. --[[Joey]] + +>> Ok, but the problem is that when you don't want any signin form you end up +>> with a lone login button. That might happend if you lock pages only on IP +>> adresses, if you use another cookie from another webapp... + +>> That happends to me and I had to reimplement lockedit in my private auth +>> plugin. + +>> Perhaps you could return undef on that case and let another plugin do the +>> needsignin call ? -- [[Jogo]] -- cgit v1.2.3