[pmwiki-users] login with user names

Patrick R. Michaud pmichaud at pobox.com
Sat Feb 24 16:00:13 CST 2007


On Sat, Feb 24, 2007 at 09:06:55AM +0000, Hans wrote:
> Friday, February 23, 2007, 9:53:56 PM, Hans wrote:
> 
> > Can I use authuser to require users logging in with name and password,
> > without keeping  a list of user names, and hand out a general edit
> > password instead? I would like the logged in user name used as $Author
> > and set as author cookie.
> 
> Well I approached this with a fresh mind, and found this solution:
> 
> Edit Site.AuthForm and change
> 
> (:input text name=authid:)
> to
> (:input text name=author:)
> 
> Add in config.php:
> 
> $EnableAuthUser = 1;
> include_once("$FarmD/scripts/author.php");
> 
> $EnableAuthUser = 1; is requird in Site.AuthForm to display the name
> field, and I could have changed it to a different variable name,
> but I guess it is not doing any harm either.

Even easier, avoiding the need for $EnableAuthUser...  add
the following line to Site.AuthForm:

    (:if !enabled $EnableAuthUser:)$[Name]: (:input text name=author:)\\

This says to provide a field for the author if authuser isn't
enabled.  The full form then reads:

    '''$[Password required]'''
    (:messages:)
    (:if enabled InvalidLogin:)* $[Name/password not recognized]
    (:if:)
    (:input auth_form:)
    (:if enabled EnableAuthUser:)$[Name]: (:input text name=authid:)\\
    (:if !enabled $EnableAuthUser:)$[Name]: (:input text name=author:)\\
    (:if:)$[Password]: (:input password name=authpw:)
    (:input submit value='OK':)
    (:input end:)

Pm



More information about the pmwiki-users mailing list