[pmwiki-users] How to set nopass in script

Patrick R. Michaud pmichaud at pobox.com
Sun Aug 27 08:47:21 CDT 2006


On Sun, Aug 27, 2006 at 08:41:28AM -0500, Patrick R. Michaud wrote:
> On Sun, Aug 27, 2006 at 10:58:56PM +1200, Allister Jenks wrote:
> > Now I want to do something slightly different like this.
> > 
> >     $page2 = ReadPage('FreeStuff.GroupAttributes');
> >     if ($page['passwdread'] = '@lock') {
> >       $page['passwdread'] = 'nopass';
> >       WritePage('FreeStuff.GroupAttributes', $page);
> >     }
> > 
> > This to launch a new section which is currently set to @lock for read
> > permission.  The script removes the @lock and the setting shows on the
> > GroupAttributes attributes as **** but I still seem to need a password
> > to access the section.  What should I be putting where I have
> > 'nopass'?
> 
> 'nopass' is deprecated, use '@nopass' instead.

Oops, I just realized I should probably provide some background
as to why plain 'nopass' isn't working for you, since using
the attribute form to set "nopass" *does* work (even though it's
deprecated in favor of "@nopass").

PmWiki never stores passwords as cleartext -- they're always in 
encrypted form.  Thus in order to get a password of 'nopass' into
a page, one would have to do

    $page['passwdread'] = crypt('nopass');

Then the above would've worked.  However, I still recommend using
"@nopass" instead, because it's simpler and because the ?action=attr
will show "@nopass" instead of "****".

Pm




More information about the pmwiki-users mailing list