[pmwiki-users] syntax question php for a Profiles.php

H. Fox haganfox at users.sourceforge.net
Fri Nov 17 20:53:10 CST 2006


On 11/17/06, Florian Fischer <Flori-Fischer at gmx.net> wrote:
> Hello,
>
> i'm using Userauth and since i haven't found a possibility to restrict the edit-access to the pages of a user, i try it with a workaround. My Users have edit-rights for the Group Profiles. But User B shouldn't be able to edit the pages of User A. There is no automatic way to do this. I try it with a Profiles.php file
>
> $pagename = ResolvePageName($pagename);
>   $isAdminAuthorized = CondAuth($pagename, 'admin');
>   global $Author;
>   if (!$isAdminAuthorized) {
>      if ($pagename != '{$Author}' || $pagename != '{$Author}-Contribution' || $pagename != '{$Author}-Watchlist'){
>      if ($action == 'edit') $action = 'browse';}
>
>   }
>
> But i don't know how to turn the if clause right

Here's a guess:

$pagename = ResolvePageName($pagename);
$name = PageVar($pagename, '$Name');
$isAdminAuthorized = CondAuth($pagename, 'admin');
global $Author;
if (!$isAdminAuthorized
  && $action == edit
  && !($name == {$Author}
    || $name == {$Author}.'-Contribution'
    || $name == {$Author}.'-Watchlist')) {
  $action = 'browse';
}

Hagan




More information about the pmwiki-users mailing list