[pmwiki-users] (:pagelist:) broken when using UserAuth2 and beta45

ThomasP pmwikidev at sigproc.de
Sat May 19 08:32:40 CDT 2007


Hello,

as I discover, the pagelist markup is indeed broken when using UserAuth2.
(It didn't do this with the old pmwiki.)

Patrick, do you have any idea why this could happen? All permission
queries are passed, and I hope also I delivered the right return value
back from the $AuthFunction. (see below)

Just discovered: May there be some new fields in the page array that would
be worth setting by UserAuth2 as well?

from pagelist.php PageListProtect():

 if (@$opt['=protectsafe'][$pn]) return 1;
 $page = RetrieveAuthPage($pn, 'ALWAYS', false, READPAGE_CURRENT);
 $opt['=readc']++;
 if (!$page['=auth']['read']) $opt['=protectexclude'][$pn] = 1; // <<<<<
 if (!$page['=passwd']['read']) $opt['=protectsafe'][$pn] = 1;  // <<<<<

(When I commented out the last two lines it worked.)

Thomas

----

function UserAuth2($pagename, $level, $authprompt=true) {
  if ($authprompt)
    return TryAccessingPage($pagename, $level);
  else {
    if (HasCurrentUserPerm($pagename, $level)) {
      $page = ReadPage($pagename);
      if (!$page) { return false; }
      return $page;
    }
  }
  return false;
}





More information about the pmwiki-users mailing list