[pmwiki-users] New wiki not sending users to HomePage

H. Fox haganfox at users.sourceforge.net
Sat May 13 17:16:34 CDT 2006


On 5/13/06, Tegan Dowling <tmdowling at gmail.com> wrote:
> On 5/13/06, H. Fox <haganfox at users.sourceforge.net> wrote:
> > On 5/13/06, Tegan Dowling <tmdowling at gmail.com> wrote:
> > > Now going to http://gladprofusion.com/Main/HomePage works without any
> > > problem. And likewise, going to just plain http://gladprofusion.com
> > > **should** bring up http://gladprofusion.com/Main/HomePage without any
> > > problem.
> > >
> > > *But it doesn't* - it demands a password, instead. Users **cannot go**
> > > to http://gladprofusion.com and automatically be sent to
> > > http://gladprofusion.com/Main/HomePage.
> >
> > Try this at the top of your config.php file:
> >
> > if (!$pagename) $pagename = 'Main.HomePage';
> >
> > Hagan
> >
> Hagan:  Thanks, so much!  That gets us part of the way there:  now
> going to just plain http://gladprofusion.com DOES automatically
> redirecect to going to just plain
> http://gladprofusion.com/Main/HomePage.
>
> But the other half of the problem is still there: someone who's used
> the read password for  the Test group, who then asks to go to
> http://gladprofusion.com/Test will get the password prompt.  This is
> the one that's built into pmwiki.php, by the way, not the
> Site.AuthForm.
>
> Anyone else - other ideas?

There's always good old brute force.  :-)

   if (!preg_match('!(\\.|/)!', $pagename))
     $pagename = "$pagename.HomePage";

Put this _after_ the other line.  Roughly it's "If $pagename doesn't
contain a '.' or a '/', append '.HomePage' to it".  Someone with a
different home page naming preference might use

   if (!preg_match('!(\\.|/)!', $pagename))
     $pagename = "$pagename.$pagename";

Hagan




More information about the pmwiki-users mailing list