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

Patrick Ogay lists at basel-inside.ch
Tue Feb 7 06:12:17 CST 2006


Hi Hagan,

>    if (@$_SESSION['authid'] && !$_COOKIE['author']) {
>      $Author = $_SESSION['authid']['0'];
>      setcookie('author',$Author,0,'/');
>   }
>
>$_SESSION['authid'] has been recently changed to an array...
>
>Hagan
>
>
>  
>

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

Patrick O.


pmwiki-2.1.beta22
farmconfig.php 
-----
<?php if (!defined('PmWiki')) exit();
    # Settings performed before field-customizations
#   $TestLogFile = "$FarmD/user.d/pm.log";
    $url = 'http://protecsardinia.com.jovinus-meta.net/pmwiki-2.1.beta22';


    $FarmPubDirUrl = "$url/pub";
    $WikiTitle = 'Protec Wiki';
    $Skin = 'pmwiki-2mod';
    $EnablePathInfo = 1;        // nette URL
    $HTMLPNewline = '<br />';   // Verhalten des linebreaks, wie in Textarea
    $EnableGUIButtons = 1;

    $EnableUpload = 1;
    $UploadDir = $HTTP_SERVER_VARS['DOCUMENT_ROOT']."/pm/protec/uploads";
    $UploadUrlFmt = 
"http://protecsardinia.com.jovinus-meta.net/pm/protec/uploads";
    $DefaultPasswords['upload'] = crypt('blug');
    $UploadMaxSize = 100000;
    $UploadExtSize['pdf'] = 200000;

    $DefaultPasswords['admin'] = '$1$W32gNGnz$qaeRtTf.gwGj8KgFcrS9Ow/';
 /* $AuthUser['pogay']    = '$1$W32gNGnz$qasdftTf.gwGj8KgFcrS9Ow/'; */
    $AuthUser['pwiget']    = crypt('pblaet');
 /* require('/home/httpd/vhosts/protecsardinia.com/httpdocs/.passwd'); */
    $AuthUser['htpasswd'] = 
'/home/httpd/vhosts/protecsardinia.com/httpdocs/.passwd';

    # load the field's global and per-group customizations
    include_once('local/config.php');
    include_once('local/pgcust.php');

    # Override field customizations here + Default-PW

    $DefaultPasswords['read']   = 'id:*'; /*alle die User haben */
#   $DefaultPasswords['read']   = 'id:pogay,pwiget';
    $DefaultPasswords['edit']   = 'id:pogay,pwiget';
    $DefaultPasswords['upload'] = 'id:pogay,pwiget';
    include("$FarmD/scripts/authuser.php");   /* User basierende 
Authenfification */
# Must be after authuser.php
    $EnablePostAuthorRequired = 0;
##  If there's no Author yet, use the verified identity.
#   @session_start();
    if (@$_SESSION['authid']['0'] && !$_COOKIE['author']) {
       $Author = $_SESSION['authid']['0'];
       setcookie('author',$Author,0,'/');
    }
    echo "Hello {$_SERVER['PHP_AUTH_USER']} --";
    echo ($_SESSION['AuthId']['0']); echo ("bla0");
    echo ($_SESSION['authid']['0']); echo ("bla1"); 
($AuthId.'|'.$_SESSION['$authid'].'/'.$_SESSION['$AuthId'].'/'.$_COOKIE['author'].'/'.$Author);

#   $EnableUpload = 0;            # disable uploads

## Addition Functions mainly Test
## Testlog -------------------------------------------------------
## $TestLogFile = "$FarmD/user.d/pm.log";  aktivate Log, Dir writable!
function TestLog($output) {
     global $FarmD,$TestLogFile;
     if ($TestLogFile) {
    #$path = realpath("./"); --  working Dir
     if ($txtfp = fopen($TestLogFile,"a")) {
       fputs($txtfp,"$output \n");
       fclose($txtfp);
       }
     else
      Abort("Unable to open TestLog: $TestLogFile ");
     }
}


?>





More information about the pmwiki-users mailing list