[pmwiki-users] UserAuth and CommentBox -- bypass authentication

Tomasz Dymek tomek at rabarbar.eu.org
Thu Feb 9 09:34:01 CST 2006


Hi! I'm trying to setup UserAuth with CMSLike and add finctionality of
CommentBox. Wiki pages are readable to any one but editable only for admins.
CommentBox has some code do bypass PmWikiAuth but it unfortunately does't work
with UserAuth. As a result guest user trying to add comment is asked to login.

Code fragment from commnetboxstyled.php:

function HandleCommentPost($pagename) {
  global $_POST,$JournalPattern,$DiaryPattern;
  global $AuthFunction, $oAuthFunction,$Auth, $EnableBypassAuth;
  if (!@$_POST['post']) Redirect($pagename);
  SDV($AuthFunction,'PmWikiAuth');
  $oAuthFunction = $AuthFunction;
  $AuthFunction = 'BypassAuth';
  if (preg_match($JournalPattern,$pagename)) HandleJournalPost($pagename);
  elseif (preg_match($DiaryPattern,$pagename)) HandleDiaryPost($pagename);
  else HandleMessagePost($pagename);
  HandleEdit($pagename);
  exit;
}


Any ideas?


-- 
                                       Tomasz Dymek (tomek at rabarbar.eu.org)






More information about the pmwiki-users mailing list