[pmwiki-users] authuser / Setting the Author Automatically - all blank

H. Fox haganfox at users.sourceforge.net
Tue Feb 7 14:18:58 CST 2006


On 2/7/06, Patrick Ogay <lists at basel-inside.ch> wrote:
> Hi Hagan,
>
> >    if (@$_SESSION['authid'] && !$_COOKIE['author']) {
> >      $Author = $_SESSION['authid']['0'];
> >      setcookie('author',$Author,0,'/');
> >   }
> >
> >$_SESSION['authid'] has been recently changed to an array...
> >
>
> Thanks for the hint, I tried a few things (doesn't seem to make a
> difference)
> *The authid array,
> *to check the values in config.php, (not only farmconfig)
> *changed include_once to include (for authuser)
>
> $_SESSION['authid']['0']);  is empty/blank
>
[...]
>     if (@$_SESSION['authid']['0'] && !$_COOKIE['author']) {
>        $Author = $_SESSION['authid']['0'];
>        setcookie('author',$Author,0,'/');
>     }

Try

    if ($AuthId && ! $_COOKIE['author']) { $Author = $AuthId;
      setcookie($CookiePrefix.'author', $Author, 0, '/'); }

Keep in mind you need to log out and log back in to test it.

Also, at the top of local/config.php (not farmconfig.php), put

   ## Produce a unique cookie prefix for this fie.
   $CookiePrefix = substr($tmp = md5(__FILE__), 0, 5).'_';

Hagan




More information about the pmwiki-users mailing list