[pmwiki-users] wildcard user name in authuser

Jon Haupt jhaupt at gmail.com
Tue Mar 21 09:25:31 CST 2006


On 3/21/06, Neil Herber <nospam at eton.ca> wrote:
> At 2006-03-21  08:59 AM -0500, The Editor is rumored to have said:
> >If so, these lines in your config.php file will set $Author to
> >$AuthId, and force it to be recorded--even if they try and change the
> >author name to something else when they edit a page.
> >
> >include_once("$FarmD/scripts/authuser.php");
> >$EnablePostAuthorRequired = 1;
> >$Author = $AuthId;
>
> I have given this a try, and it almost works.
>
> $EnablePostAuthorRequired = 1;   is set in farmconfig.php because all
> my wikis forbid anonymous posts
>
> In the wiki's config.php file I have:
> $DefaultPasswords['edit'] = crypt('xxxxxx');
> $DefaultPasswords['read'] = crypt('yyyyyyy');
> .....
> #Get the buggers to log on to read and capture their Author name as a result
> include_once("$FarmD/scripts/authuser.php");
> $Author = $AuthId;
>
> The $Author does not get set to the login name. I don't have a clue
> why. Using Gemini 10 skin, and it does not show the login name.
>
>   .... thinks while typing ....
>
> The problem may be a farmconfig setting:
> ## This will set the author field on all requests authenticated by
> the webserver.
> ## It will even override anything the author happens to put in the "Author"
> ## box on the edit form.
> if (@$_SERVER['REMOTE_USER']) $Author = $_SERVER['REMOTE_USER'];
>
> but I am not using Apache BA on this site, so I don't see why it
> would be a problem.
>
> Remaining hair being pulled out while waiting for answer ....
>

I don't think you can just do $Author = $AuthId.  I'm pretty sure in
order to set the Author to be the same as AuthId you need to use
something more along the lines of

## Enforce author tracking
if ($action == 'edit') @session_start();
if ($_SESSION['authid'][0]) $Author=$_SESSION['authid'][0];

And you could do this at another moment other than edit, I think.

Jon

--
Jon Haupt
Fine & Performing Arts Librarian
Iowa State University
152 Parks Library
Ames, IA 50011
515-294-0904
jhaupt at iastate.edu




More information about the pmwiki-users mailing list