[pmwiki-users] private group access question(s)

Patrick R. Michaud pmichaud at pobox.com
Fri Mar 4 11:38:38 CST 2005


On Fri, Mar 04, 2005 at 11:26:31AM -0500, Neil Herber wrote:
> I am running a password-protected PmWiki for a client. All users are 
> granted access via Apache basic authentication. I have a group called 
> "Private" which is used to store information that only my direct client and 
> I can access (I assigned a read password to the group). However, seeing the 
> Private group requires re-entry of the user's password, which is a pain.
> 
> What magic bits of PHP can I add to config.php so that:
>         if authorized username is "Neil" or "Bob"
>                 allow access to Private group
>         else
>                 do not allow access
>         endif

When you indicate that users are granted access via Apache basic
authentication, do you mean literally .htaccess files, or basic
authentication through PmWiki's httpauth.php script?

Are there any other passwords on the Private group that I would
need to be aware of, or just the read password on the entire
group?

Assuming you're using .htaccess authentication, the basic
answer is going to be something along the lines of:

    if (@$_SERVER['REMOTE_USER'] != 'Neil'
        && @$_SERVER['REMOTE_USER'] != 'Bob')  { ... }

but I'm not quite sure what to put in the { ... } yet.

> One solution I can think of is to add an access restriction to Apache:
>         <Directory "X:/path/to/wiki/Private">
>                 AuthType Basic
>                 AuthName "Private"
>                 AuthUserFile userfile.name
>                 AuthGroupFile groupfile.name
>                 Require group private
>         </Directory>

Alas, probably not.  Since there is no /path/to/wiki/Private directory
on the server, the above settings would never take effect.
You might be able to get away with

    <Location "/url/to/wiki/Private">
        ...
    </Location>

but even here I wouldn't make a strong bet on it working.

Pm



More information about the pmwiki-users mailing list