[pmwiki-users] Attributes - edit password
Patrick R. Michaud
pmichaud at pobox.com
Fri Mar 31 12:07:21 CST 2006
On Fri, Mar 31, 2006 at 09:38:55AM -0800, Ajitabh Pandey wrote:
> PM,
>
> My requirement is also similar, but I want to set the
> default edit restrictions on a user's page to whatever
> the users password is:
>
> If I do something like this will it be ok:
>
> # Added following lines in the local/Profiles.php
> # in order to apply restrictions page wise
> $pagename = ResolvePageName($pagename);
> $userid = substr($pagename, 9);
> if ($pagename != "Profiles.Profiles" ||
> $pagename!="Profiles.HomePage")
> $DefaultPasswords['edit'] = "$userid";
Try:
$pagename = ResolvePageName($pagename);
if (preg_match('/^Profiles\\./', $pagename))
$DefaultPasswords['edit'] = "id:".Pagevar($pagename, '$Name');
This means that Profiles.Alice can only be edited by "Alice",
Profiles.Bob can only be edited by "Bob", etc. (Unless of
course someone sets a different edit password on the page or group.)
More information about the pmwiki-users
mailing list