[pmwiki-users] $Author from $AuthId in b26

Ben Wilson dausha at gmail.com
Fri Feb 24 13:57:07 CST 2006


On 2/24/06, pmwiki-users-request at pmichaud.com > Message: 5
> Date: Fri, 24 Feb 2006 17:07:12 +0100
> From: Roman <romat2 at gmail.com>
> Subject: Re: [pmwiki-users] $Author from $AuthId in b26
> To: pmwiki-users at pmichaud.com
> Message-ID:
>         <3e8cb5c00602240807r7a6755a4qe90d928b49a382cd at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> > If a site administrator wants to enforce that an Author name should
> > always be the same as the login name, then it can be easily done
> > by putting
> >
> >    if (@$AuthId) $Author = $AuthId;
> >
> > after the include_once('scripts/authuser.php');  line (or whatever
> > is setting the value of $AuthId).
>
> That's it, thanks. I went further and wanted to disable Author field
> in edit form at all because I don't want authors to be able to
> ovewrite their login name. So I put this to Site.EditForm
>
> (:if !authid:)
> $[Author]: (:input e_author:)
> (:ifend:)
>
> But it seems that this field is required because either author is not
> filled in RecentChanges (when $EnablePostAuthorRequired = 0;) or I am
> not able to save a page (when $EnablePostAuthorRequired = 1;). So my
> question is: is there a way how to disallow a change of author name if
> user is logged?

What I did was convert the Author field to a hidden field:
(:input hidden author {$Author}:)

dausha.net/Site/EditForm?action=source

This way, there's no monkeying with the Author. My users don't even
know they can. ;-)

--
Ben Wilson
" Mundus vult decipi, ergo decipiatur"




More information about the pmwiki-users mailing list