Bug #3692 [Opn]: Auth_HTTP Example 2

From: Date: Thu, 03 Mar 2005 17:49:35 +0000
Subject: Bug #3692 [Opn]: Auth_HTTP Example 2
References: 1  Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-5608@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=3692&edit=1 ID: 3692 User updated by: wim at volh dot be Reported By: wim at volh dot be Status: Open Type: Bug Package: Documentation Operating System: Linux Fedora Core 2 PHP Version: 4.3.10 New Comment: Example code: http://www.volh.be/privaat/test/ You can login with Test - T4uWI9YE7h Normally you must get more than 'Your details on file are: ' The code is: // example of Auth_HTTP basic implementation require_once("/usr/share/php/Auth/HTTP.php"); // setting the database connection options $AuthOptions = array( 'dsn'=>"mysql://xxx:xxx@localhost/volh_1", 'table'=>"tblGebruikers", // your table name 'usernamecol'=>"strGebruikerNaam", // the table username column 'passwordcol'=>"strGebruikerWachtwoord", // the table password column 'cryptType'=>"md5", // password encryption type in your db 'db_fields'=>"*", // enabling fetch for other db columns ); $a = new Auth_HTTP("DB", $AuthOptions); $a->setRealm('yourrealm'); // realm name $a->setCancelText('<h2>Error 401</h2>'); // error message if authentication fails $a->start(); // starting the authentication process if($a->getAuth()) // checking for autenticated user { echo "Hello $a->username welcome to my secret page <BR>"; echo "Your details on file are: <BR>"; echo $a->getAuthData('fkIntGroepID'); // retriving other details from the database row }; The value in the database for fkIntGroepID = 5 Previous Comments: ------------------------------------------------------------------------ [2005-03-03 12:40:24] wim at volh dot be Description: ------------ When you want to try the example 2 code that is published on the pear website, you don't get the wanted result. Normally the getAuthData('xxx') method must give you extra information stored in the usertable. But it don't give a result. Reproduce code: --------------- http://pear.php.net/manual/en/package.authentication.auth-http.auth-http.example2.php Expected result: ---------------- Normally you want to have the email, telephone and userid. Actual result: -------------- the getAuthDate give a NULL as result. ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=3692&edit=1

« previous php.pear.doc (#5608) next »