[pmwiki-users] Require Author broken?

Tegan Dowling tmdowling at gmail.com
Tue Apr 11 11:45:54 CDT 2006


On 4/8/06, Tegan Dowling <tmdowling at gmail.com> wrote:
>
> I'm running 2.1.5.  Am not using any user-based authentication scheme -
> just the default requirements for passwords in order to edit.
>
> In Config.php, I have
>          $EnablePostAuthorRequired = 1;
> as instructed on http://www.pmwiki.org/wiki/Cookbook/RequireAuthor
>
>
> But once logged in with an edit-enabling password, I can save changes
> without entering an Author name.
>

It turns out that *either one* of two bits of code in my config.php will
cause this - and don't you know *that* was fun to find!!!  Can anyone
suggest how to modify either of these to get it to do what I want, without
also having this side-effect of disabling the RequireAuthor setting?

1) As I said above, I'm not using any user-based authentication, but I do
still want the author cookie to work for my authors, so they don't have to
re-enter author name with every edit in the same session; a friend who knows
some php came up with this:

    //Author cookie
    include_once("$FarmD/scripts/author.php");
    if($AuthId && !@$_COOKIE[$AuthorCookie]) {
    $Author = $AuthId; setcookie($AuthorCookie,
    $Author, $AuthorCookieExpires, $AuthorCookieDir);
    }

This keeps the author name alive for the editing session, which is really
nice, but it turns out that it disables the RequireAuthor setting.

2) Switched methods of tracking Author Contributions:

A) Used to use the old-style Author Contributions recipe, which created
AuthorName pages in a Contributions wikigroup, using the recipe
authorcontribution.php, which used to be downloadable from
http://www.pmwiki.org/wiki/Cookbook/Authorcontribution-OldVersion (it is
more complex than the 4 lines that now appear on that cookbook page, and I
can forward it if anyone would find that useful) - this one didn't interfere
with the RequireAuthor setting.
B) Now using the new-style, which creates AuthorName-Contrib pages in the
Profiles wikigroup. This one uses the authorcontrib.php recipe, which is
currently downloadable from
http://www.pmwiki.org/wiki/Cookbook/AuthorContribution.  The new one is
called from config.php with
if ($action == 'edit' || $action == 'comment')
{include_once("$FarmD/cookbook/authorcontrib.php"); }

And this, too, will disable the RequireAuthor setting, even if I comment out
the Author-Cookies thinger listed as Item 1.

I really hate to give either one of these up, so I sure hope some
PHP-parsing person can spot what's wrong with them!

Thanks so much,

Tegan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20060411/cbd83c62/attachment.html 


More information about the pmwiki-users mailing list