[pmwiki-users] authuser.php crash (ref PITS 00737)

Ben Wilson dausha at gmail.com
Wed May 31 12:13:48 CDT 2006


I just posted dbauth-0.2.php. This _should_ work better. Dbauth has no
knowledge of groups--it leaves Site.AuthUser to store those. It simply
expects username and password, and when it finds a match it returns
true.

I need to fix this script so the administrator does not have to edit
the recipe to set values. I'll try to get a newer version out _soon_.
The only problem is today is one of my long days in class (5 hours
straight). Being the first week, I have to actually pay attention. So,
expect the next release to include the site-specific flexibility.

After that, I should try to leave some integration hooks with
htpassword.php and membership.php. I would also like to add group
support and include the SQL to build an appropriate table.

As a word of background. I wrote dbauth to access the user table of a
PunBB forum--and had users register there to access a restricted site.
This was written well over a year ago and I have not tried to spruce
up the code. This past fortnight was my own private Summer of Code,
and I left that recipe out. Perhaps I can squeeze out one-more-week.

Regards,
Ben Wilson

On 5/31/06, Ben Wilson <dausha at gmail.com> wrote:
> Hmm. I believe I cobbled together dbauth. The currently published
> version has issues. Let me hunt down and publish my corrected version.
>
> Ben
>
> On 5/31/06, marc <gmane at auxbuss.com> wrote:
> > Hi,
> >
> > I'm new to PmWiki, so apologies if my terminology is somewhat shaky.
> >
> > All is well with my installation, and after getting my head around
> > authuser and authorization groups, I decided to give authorization via
> > MySQL a spin (using dbauth.php).
> >
> > No problems here either, authentication via the db works fine.
> > Excellent.
> >
> > However, when I add my testing db username to one of my existing
> > authorization groups (e.g. @testers: marc changed to @testers: marc,
> > test), then attempt to login, authuser.php crashes with:
> >
> > Fatal error: [] operator not supported for strings in blah\pmwiki
> > \scripts\authuser.php on line 60
> >
> > This is the same bug described here:
> > http://www.pmwiki.org/wiki/PITS/00737
> >
> > Now, usually I would launch into debug mode, but I'm still unfamiliar
> > with PmWiki and the crashing code is rather symbolic, so I though I'd
> > ask here first.
> >
> > The offending line 60 in authuser.php is:
> >
> >         foreach($v[0] as $g) $auth[$g][] = $m[1];
> >
> > in the code snippet below.
> >
> >   $pn = FmtPageName($AuthUserPageFmt, $pagename);
> >   $apage = ReadPage($pn, READPAGE_CURRENT);
> >   if ($apage && preg_match_all("/^\\s*([@\\w][^\\s:]*):(.*)/m",
> >                                $apage['text'], $matches,
> > PREG_SET_ORDER)) {
> >     foreach($matches as $m) {
> >       if (!preg_match_all('/\\bldap:\\S+|[^\\s,]+/', $m[2], $v))
> >         continue;
> >       if ($m[1]{0} == '@')
> >         foreach($v[0] as $g) $auth[$g][] = $m[1];
> >       else $auth[$m[1]] = array_merge((array)@$auth[$m[1]], $v[0]);
> >     }
> >   }
> >
> > The error message is: [] operator not supported for strings, so can
> > anyone suggest the next step?
> >
> > I presume that dbauth.php is passing authuser.php something bad, but I'm
> > not sure what.
> >
> > --
> > Best,
> > Marc
> >
> >
> > _______________________________________________
> > pmwiki-users mailing list
> > pmwiki-users at pmichaud.com
> > http://host.pmichaud.com/mailman/listinfo/pmwiki-users
> >
>
>
> --
> Ben Wilson
> "Mundus vult decipi, ergo decipiatur"
>


-- 
Ben Wilson
"Mundus vult decipi, ergo decipiatur"




More information about the pmwiki-users mailing list