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

marc gmane at auxbuss.com
Wed May 31 09:54:56 CDT 2006


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. 

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:

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, 
    foreach($matches as $m) {
      if (!preg_match_all('/\\bldap:\\S+|[^\\s,]+/', $m[2], $v))
      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.


More information about the pmwiki-users mailing list