[pmwiki-devel] Login and function PmWikiAuth

Patrick R. Michaud pmichaud at pobox.com
Wed Dec 20 16:37:28 CST 2006


On Wed, Dec 20, 2006 at 06:47:53PM -0000, marc wrote:
> marc said...
> > Hi,
> > 
> > I prefer to use a login form in the sidebar - just username and password 
> > - along with authuser and authuserdb. This works fine except  when an 
> > invalid login occurs. In this case $AuthPromptFmt is opened in the main 
> > page.
> > 
> > This look a bit odd, because there are then two login prompts on the 
> > page: one in the sidebar and one on the main page.
> > 
> > What I am trying to achieve is to retain the main page unchanged, and 
> > simply report login/page access errors in the sidebar form.
> > 
> > I can see that this is handled by the last lines of PmWikiAuth(), but 
> > can't think of a way to change this in situ to do what I want.
> > 
> > Is the best way to copy PmWikiAuth() with appropriate changes, and point 
> > to it via $AuthFunction? Or, more likely, am I way off base? 
> 
> <bump>
> 
> Please let me know if I've not explained the issue well enough. 

It's explained well enough -- I don't have a quick answer (but
I'm thinking about it).

It seems as though putting 

    (:redirect {*$FullName}:)

into Site.AuthForm might get pretty close -- i.e., whenever
someone requests a protected action, it returns them to the
'view' of the page.  But I'm not sure how to get a login/page access
error message into the sidebar in that case.

It may be that it needs some special handling in local/config.php:

    ##  check to see if we have sufficient permission for the
    ##  requested action, if not, then add an error message and
    ##  switch to ?action=browse.
    $page = RetrieveAuthPage($pagename, $HandleAuth[$action], false);
    if (!$page) {
      $MessagesFmt[] = 'Please log in with appropriate privileges';
      $action = 'browse';
    }

You might try something like that.

Pm



More information about the pmwiki-devel mailing list