[pmwiki-users] AuthUser group problem

akc jdcwki at jctux.selfip.org
Wed Aug 23 00:07:44 CDT 2006

Hi List,

I am having a problem with the way the AuthUser script builds the $auth
array for authorization groups.  Several of the userids I need to be
included in authorization groups contain one or more spaces, which is
causing such userids to be considered as 2 or more separate usernames 
when building the $auth array.  My groups as specified in Site.AuthUser 
are similar to: 
 @usrgroup: user1, BarFoo, foo bar, user4, bar foo barbar, user6

I think the code in authuser.php that is causing the problem is:

  $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('/\\bldaps?:\\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]);

I believe the regular expression patterns are the source of my problem, 
but I do not know enough about expression pattern syntax to resolve 

Any suggestions?

More information about the pmwiki-users mailing list