[pmwiki-users] Auth User & New User Registration

The Editor editor at fast.st
Tue Mar 14 08:05:48 CST 2006


Hi all.

Was talking with D'Faure about adjusting the Htpasswd script to be
useful for creating new user accounts, and after looking carefully at
the script, decided it looked simple enough to try it out myself. 
After a couple tweaks, worked like a jewel!  A big thanks to D'Faure's
clear coding style!  I do need help with one part however, as I am not
too great with php syntax:

These lines below need to be written to flow something like this:

if Auth=Admin go to HtpasswdAdmForm function
if AuthId (authenticated user) go to HtpasswdUserForm function, and
if !AuthId (non-authenticated user) go to HtpasswdNewForm function.

(lines 40-44 htpasswdform from the cookbook)
function HtpasswdForm($pagename) {
 global $HtpasswordAuth;
 return RetrieveAuthPage($pagename, $HtpasswordAuth, false) ?
   HtpasswdAdmForm($pagename) : HtpasswdUsrForm($pagename);
}

Could anyone help with this? As it stands, anyone with admin
permission gets to administer the password file.  Anyone without (even
non authenticated users) can update their password. It should be, only
authenticated users can update passwords, and non authenticated users
are sent to a function creating a new user account (I have that
function already working).

Once I get these lines rewritten I'll post it in the cookbook for
others who might have a need for a very simple user authentication
system.  Thanks a million!   PmWiki is great...

Caveman




More information about the pmwiki-users mailing list