[pmwiki-users] authuser / Setting the author automatically
Dominique Faure
dominique.faure at gmail.com
Thu Feb 9 03:21:23 CST 2006
2006/2/9, Patrick R. Michaud <pmichaud at pobox.com>:
> Because of the mailing list problems I apparently didn't get any
> of the messages in the thread concerning this topic. Here's my
> answer...
>
> I spent a good portion of lunch today thinking about setting
> $Author based on $AuthId, and I think I've come to the conclusion
> that it will be built-in by default in author.php.
>
> Thus, author.php will use the following logic to set the value
> of $Author (some cookie details omitted for clarity):
>
> if (!isset($Author)) {
> if (!isset($_POST['author'])) $Author = $_POST['author'];
> elseif ($_COOKIE['author']) $Author = $_COOKIE['author'];
> else $Author = $AuthId;
> }
>
> This leaves us with the following:
>
> - If a site isn't using authuser.php or otherwise setting $AuthId,
> then things work as they always have.
>
> - If a site includes authuser.php or sets $AuthId, then $Author
> defaults to $AuthId but the author has the ability to set or change
> it.
>
> - If a site administrator wishes to force $Author = $AuthId such that
> an author cannot override it, use:
>
> include_once("$FarmD/scripts/authuser.php");
> $Author = $AuthId;
>
> - If a site administrator wants user-based authentication but doesn't
> want $Author to default to $AuthId, use:
>
> include_once("$FarmD/scripts/author.php");
> include_once("$FarmD/scripts/authuser.php");
>
> I think that covers all of the cases. Comments?
>
Anyway, thinking of authuser.php as a kind of PAM modules host, this
should be the authuser.php responsability to provide supplementary
user informations like author's name, and having $Author defaulting to
$AuthId seems natural when nothing else is available.
Ref.: http://www.freebsd.org/doc/en_US.ISO8859-1/articles/pam/
I vote for it.
Dom
More information about the pmwiki-users
mailing list