[pmwiki-users] PmWiki Recipe for password system

Henrik Bechmann henrik.bechmann at sympatico.ca
Sat Sep 9 20:39:57 CDT 2006


All/Patrick,

I was going to pass Robert to the documentation page 
http://pmwiki.org/wiki/PmWiki/Passwords as accessed from 
http://pmwiki.org/wiki/PmWiki/DocumentationIndex, but clicking on the 
Passwords selection on the documentation index (for me) generates a 
password challenge.

It's a good joke, but I would have expected a page of documentation on 
setting passwords. :-) (Or am I missing something again?<grin>)

-------

Hi Robert,

SimpleCMS really just deals with switching menus based on current edit 
rights. Setting passwords to obtain these rights is a different issue. 
See above.

The short story: add a line

$DefaultPasswords['edit'] = crypt('secret');

to your config.php file. This should activate the password requirement 
for edit. When the user enters the edit password he/she has edit rights. 
When the user logs out (?action=logout) he/she no longer has edit rights.

Hope this helps,

- Henrik


Robert Neel wrote:
> Henrik,
>
> I think the password system you have provided for PmWiki is what I'm
> looking for.  I just tried to add it to my site, but did not get a
> prompt for a password/login.  Could you help or point me to previous
> answers to the same questions?
>
> 1. Does it matter where I insert the text (pasted below) into my
> config.php file?
> 2. Which file (and where in the file) do I add this?: 
> Then Place the $PageCustodianFmt variable in the appropriate place in
> your page template. On page creation the variable is substituted with
> the appropriate HTML code block from above.
>
> Thank you so much in advance,
>
> Robert 
> robertneel at yahoo.com
>
> Description
> Provides login for authors, and an action menu only seen after login
> (including logout). Login requires only the simple PmWiki default
> password system. 
>
> Add the following to your config.php: 
>
> $pagename = ResolvePageName($pagename);
> $isEditAuthorized = CondAuth($pagename, 'edit'); #detects current
> rights mode
>
> if (!$isEditAuthorized) { #conditionally sets menu layout
>
> $PageCustodianFmt = ' 
> <ul>
> <li><a href="$PageUrl?action=login">Login</a></li>
> </ul>'; 
>
> } else {
>
> $PageCustodianFmt = ' 
> <ul>
> <li><a href="$PageUrl">View page</a></li>
> <li><a href="$PageUrl?action=edit">Edit Page</a></li>
> <li><a href="$PageUrl?action=upload">Attach</a></li>
> <li><a href="$PageUrl?action=print">Print</a></li>
> <li><a href="$ScriptUrl/$SiteGroup.Sidebar?action=edit">Edit
> Sidebar</a></li>
> <li><a href="$PageUrl?action=diff">Page History</a></li>
> <li><a href="$ScriptUrl/$Group.RecentChanges">Group History</a></li>
> <li><a href="$ScriptUrl/$SiteGroup.AllRecentChanges">Site
> History</a></li>
> <li><a href="$PageUrl?action=logout">Logout</a></li>
> </ul>';
>
> }
> Then Place the $PageCustodianFmt variable in the appropriate place in
> your page template. On page creation the variable is substituted with
> the appropriate HTML code block from above. 
>
> Adjust the author menu to your liking, substituting the menu actions
> that you want. 
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
>
>   

-- 

Henrik Bechmann
www.osscommons.ca
www.bechmannsoftware.com
Webmaster, www.dufferinpark.ca





More information about the pmwiki-users mailing list