Re: newbie - Auth
| From: | Sylvain Gourvil | Date: | Thu, 04 Aug 2005 13:18:09 +0000 |
| Subject: | Re: newbie - Auth | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-20269@lists.php.net to get a copy of this message | ||
mel list_php wrote:
The modified code on your template: $auth = new Auth("DB", $params, "loginFunction" ); $auth->setExpire(7200, 'false'); $auth->setIdle(1200, 'false'); print_r($auth); $auth->start(); Before calling the method: DB OK Object ( [expire] => 7200 [expired] => [idle] => 1200 [idled] => [storage] => [loginFunction] => loginFunction [showLogin] => 1 [allowLogin] => 1 [status] => [username] => [password] => [loginCallback] => [loginFailedCallback] => [logoutCallback] => [_sessionName] => _authsession [version] => @version@ [advancedsecurity] => [_postUsername] => username [_postPassword] => password [session] => [server] and so on.... after calling it nothing (except "DB OK" which is my DB connection test). I think that [storage] should be instantiated as well?shouldn't it be DB? So Auth is well installed and running, I downloaded it yesterday and didn't modify it. The database is ok as well, I can run queries on it: $db = DB::connect($dsn); $sql = "select * from test"; $res = $db->query($sql); while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { $id = $row->targetId; $text = $row->text_name; echo " id: $id et $text<br>"; } works fine. Sorry if a bit fastidious, but I try to eliminate all the possible error sources... Thank you very much! melanieBefore using auth, you do not need to connect. PEAR::Auth will do it itself. Here's a extend I have create: [CODE file class_my_auth.php5] require_once 'Auth/Auth.php'; class MyAuth extends Auth{What do you have if you do a 'print_r($a) before and after the start method ? -- --------------------- Sylvain Gourvil Développeur PHP5, PEAR, SMARTY, POSTGRESQL Antiquités en France -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php_________________________________________________________________ Be the first to hear what's new at MSN - sign up to our free newsletters! http://www.msn.co.uk/newsletters
var $opt = array('dsn' => 'pgsql://xxx:yyy@localhost/france',
'table' => 'zzz',
'usernamecol' => 'login',
'passwordcol' => 'password');
var $_sessionName = "_coinPros";
function __construct(){
$this->Auth('DB',$this->opt);
}
}
[/CODE]
It works well if your ôpt array is well done.
Sorry, I could not test your code. I am at work. Hope you can succeed.
--
---------------------
Sylvain Gourvil
Développeur PHP5, PEAR, SMARTY, POSTGRESQL
Antiquités en France