[pmwiki-users] two sources for the 'password required' page

Tegan Dowling tmdowling at gmail.com
Tue May 16 07:20:32 CDT 2006


On 5/16/06, Dominique Faure <dominique.faure at gmail.com> wrote:
> On 5/16/06, Tegan Dowling <tmdowling at gmail.com> wrote:
> > On 5/16/06, Dominique Faure <dominique.faure at gmail.com> wrote:
> > > On 5/15/06, Tegan Dowling <tmdowling at gmail.com> wrote:
> > > > On 5/15/06, Ben Wilson <dausha at gmail.com> wrote:
> > > > > On 5/15/06, Tegan Dowling <tmdowling at gmail.com> wrote:
> > > > > > There are two sources for the 'password required' page - the first
> > > > > > one, the full-screen page, comes from the pmwiki.php file itself, and
> > > > > > the other is the wiki page Site/AuthForm.  I'd like to be able to
> > > > > > customize the first one - is there anything I can do to tell the wiki
> > > > > > to get that content from the wiki page Site/AuthForm as well?
> > > > > >
> > > > > > OR,
> > > > > >
> > > > > > If that screen must be generated by pmwiki.php, then I'll edit
> > > > > > pmwiki.php, although I don't like to do that, since I'll have to
> > > > > > remember to do it again with each upgrade.  If I do, though, is there
> > > > > > a way to embed a link in the text I enter there?  I tried
> > > > > > [[http://example.com | example]] and I tried <a
> > > > > > href="http://example.com">example</a>, and both rendered as plaintext
> > > > > > instead of becoming links.
> > > > > >
> > > > > > Thanks!
> > > > > >
> > > > > > Tegan
> > > > >
> > > > > Don't you just have to set $AuthPromptFmt to effect the change you want?
> > > > >
> > > > > Ben
> > > >
> > > > Yay:  http://www.pmwiki.org/wiki/Cookbook/MakingPasswordRequestsExplicit
> > > > Thanks!
> > > >
> > >
> > > An other (cleanest?) way could be to fill dynamically some text into
> > > the (:messages:) markup already present in the Site/AuthForm wiki
> > > page:
> > >
> > > function SetAuthMessage($pagename) {
> > >   global $MessagesFmt, $action;
> > >   $actionText = array(
> > >   'attr' => 'administer',
> > >   'upload' => 'upload files related to',
> > >   );
> > >   $handle = @$actionText[$action];
> > >   if(!$handle) $handle = $action;
> > >   $MessagesFmt[] =
> > >   "<p><i>You need to authenticate yourself to $handle this page.</i></p>";
> > > }
> > > $AuthPromptFmt = array(&$PageStartFmt,
> > >   'function:SetAuthMessage',
> > >   'page:{$SiteGroup}.AuthForm',
> > >   "<script language='javascript' type='text/javascript'><!--
> > >     try { document.authform.authid.focus(); }
> > >     catch(e) { document.authform.authpw.focus(); } //--></script>",
> > >   &$PageEndFmt);
> >
> > Where would I put that? In config.php? Or right on the AuthForm?
>
> You may add it into your config.php. The Site.AuthForm already
> contains the affected (:messages:) markup.

I put it in config.php. Now when I attempt to access a read -protected
page, I get a white screen with this text on it:

'''$[Password required]''' (:messages:) (:if enabled InvalidLogin:)*
$[Name/password not recognized] (:if:) (:input auth_form:) (:if
enabled EnableAuthUser:)$[Name]: (:input text name=authid:)\\
(:if:)$[Password]: (:input password name=authpw:) (:input submit
value='OK':) (:input end:) <:block>




More information about the pmwiki-users mailing list