[pmwiki-users] Set a password for some actions | need help, please

Patrick R. Michaud pmichaud at pobox.com
Wed Mar 8 21:48:00 CST 2006


On Thu, Mar 09, 2006 at 02:05:46AM +0100, kirpi at kirpi.it wrote:
> > Is the ?action=search actually taking place from a page in the
> > Group, or is it coming from the Site.Search page?  (Changing $HandleAuth
> > in Group.php won't have any effect if Site.Search is the page being loaded.)
> 
> Ok, I think now I better understand what you ask.
> ?action=search is *not* coming from Site.Search page?

Oops, there's a bug in ?action=search that doesn't use the
parameter from $HandleAuth.  Sorry about that.  It'll be fixed
in beta38.

Pm

> > How about...?
> >
> >    if ($action != 'pdf') $HandleAuth[$action] = 'admin';
> >
> > Basically this says that one can only do ?action=pdf on a page,
> > everything else will require admin permissions.
> 
> Where should I insert the line you suggest, please?

If you want it to be done for a specific page (e.g., Group.PageName), 
then create a local/Group.PageName.php file and put the following
in it:

    <?php if (!defined('PmWiki')) exit();
      if ($action != 'pdf') $HandleAuth[$action] = 'admin';

This will change the handling of $action for that particular page.

Or, in local/config.php, you can do

    $pagename = ResolvePageName($pagename);
    if ($pagename == 'Group.PageName' && $action != 'pdf')
      $HandleAuth[$action] = 'admin';

Pm




More information about the pmwiki-users mailing list