[pmwiki-devel] ldap syntax in SiteAdmin.AuthUser (regex question)

Peter Bowers pbowers at pobox.com
Fri Jul 2 12:23:25 CDT 2010


I have been looking around at the various pieces of documentation of
the syntax in SiteAdmin.AuthUser and simply cannot find an answer to
this question.  It's probably right there in front of me, but I'm not
seeing it.

On line 61 of scripts/authuser.php we have this:

      if (!preg_match_all('/\\bldaps?:\\S+|[^\\s,]+/', $m[2], $v))

$m[2] is populated with this default regex and preg_match_all() call:

  SDV($AuthUserPat, "/^\\s*([@\\w][^\\s:]*):(.*)/m");
...
  if ($apage && preg_match_all($AuthUserPat,
                               $apage['text'], $matches, PREG_SET_ORDER)) {

To my mind this means that $m[2] is containing a list of everything
*after* a colon on the line (simplifying somewhat).  What I'm not
getting is why that initial regex contains the part preceding the
vertical bar: \\bldaps?:\\S+

Does this mean that AuthUser could contain a line that had something like this:

user: ldap: @group

or something like that?  I just can't figure out what the point of
that ldaps?: section of the regex is for...

As I look at the documentation for ldap it appears that most of it is
described through config.php rather than SiteAdmin.AuthUser page text,
so I may just be missing something there...

Any help appreciated.  I'm working with AuthUser page text and so I
need to understand pretty exactly what I might expect...

-Peter



More information about the pmwiki-devel mailing list