[pmwiki-users] help modifying php code
    Chris Carter 
    ccarter at lbcc.edu
       
    Wed Sep 26 19:48:32 CDT 2007
    
    
  
Hi,
I figured out how to get it to work...
 
## Require no password to edit Group.Housing (etc.) pages. (C. Carter)
 if ($action=='edit'
    && preg_match('/\\.(Housing|HealthSafety|DailyLife|Food|Interpersonal|Language|MustSee|OfficialDocs|WeekendFun|WhereStay)$/', $pagename))
  { $DefaultPasswords['edit'] = ''; }
 
I'm going to become a programmer before I know it!
 
Chris
________________________________
From: pmwiki-users-bounces at pmichaud.com on behalf of Chris Carter
Sent: Wed 9/26/2007 10:39 AM
To: pmwiki-users at pmichaud.com
Subject: [pmwiki-users] help modifying php code
Hi everyone,
I'm trying to modify the code from http://www.pmichaud.com/wiki/PmWiki/Security#wikivandalism, which is as follows:
## Require admin password to edit RecentChanges (etc.) pages.
if ($action=='edit'
&& preg_match('/\\.(Search|Group(Header|Footer)|(All)?RecentChanges)$/', $pagename))
{ $DefaultPasswords['edit'] = crypt('secret phrase'); }
I want to modify this so that some pages in various groups DO NOT require a password to edit-- such as Bolivia.Housing, Bolivia.MustSee, Chile.Housing, Chile.MustSee, etc.
I don't know php, but have tried to modify as follows:
## Require no password to edit Group.Housing (etc.) pages.
if ($action=='edit'   &&preg_match('/\\ $Group.(Housing|HealthSafety|DailyLife|Food|Interpersonal|Language|MustSee|OfficialDocs|WeekendFun|WhereStay $/'))
{ $DefaultPasswords['edit'] = ''; }
As you can see, I have removed $pagename at the end and added $Group at the beginning.  I have also set $DefaultPasswords to '' for no password. 
Can anyone proofread this code?  Not being a programmer I'm sure it is not perfect.
Thanks.
Chris Carter
________________________________
_______________________________________________
pmwiki-users mailing list
pmwiki-users at pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users
    
    
More information about the pmwiki-users
mailing list