[PHP] Pear Auth problem
Hello. I am trying to use pear Auth packet but am doing something wrong. I am currently looking at the simple example in the documentation, but something is wrong in my source code, because if I write a username and a password in the fields and hit the submit button, I receive a blank pages without any informatio at all.. Here is my source code: --- ?php require_once('Auth.php'); if(!isset($_POST['submit'])){ function loginFunction($username = null, $status = null, $auth = null){ ? form action=index.php method=post fieldset legendLogin:/legend p label for=usernameUsername:/labelbr input id=username name=username type=text /p p label for=passwordPassword:/labelbr input id=password name=password type=password /p p input id=submit name=submit type=submit value=Login /p /fieldset /form ?php } $options = array( 'dsn' = mysql://username:password@localhost/database, ); $a = new Auth(DB, $options, loginFunction); $a-start(); if($a-checkAuth()){ header(Location: http://www.karl-arne.name/;); } } ? The example is located at: http://pear.php.net/manual/en/package.authentication.auth.intro.php Thanks for your time. Karl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pear Auth problem
Hello. I am trying to use pear Auth packet but am doing something wrong. I am currently looking at the simple example in the documentation, but something is wrong in my source code, because if I write a username and a password in the fields and hit the submit button, I receive a blank pages without any informatio at all.. Here is my source code: --- ?php require_once('Auth.php'); if(!isset($_POST['submit'])){ function loginFunction($username = null, $status = null, $auth = null){ ? form action=index.php method=post fieldset legendLogin:/legend p label for=usernameUsername:/labelbr input id=username name=username type=text /p p label for=passwordPassword:/labelbr input id=password name=password type=password /p p input id=submit name=submit type=submit value=Login /p /fieldset /form ?php } $options = array( 'dsn' = mysql://username:password@localhost/database, ); $a = new Auth(DB, $options, loginFunction); $a-start(); if($a-checkAuth()){ header(Location: http://www.karl-arne.name/;); } } ? The example is located at: http://pear.php.net/manual/en/package.authentication.auth.intro.php Karl, You'll want to turn on error reporting so you can start to get a peak into what is happening.. Do you know how to do that? (... so that you get more info. than just a blank page). -Govinda -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PEAR AUTH - Login Session not expiring?
Hi All, Trying to use the PEAR Auth library. I'm set up, and after a successful login, I'm making the $auth-setExpire(30*60) call to set up for expiration after 30 minutes. But I left the web site last night, and this morning went back, and it was still active, so it didn't ask for a password. I also set the setIdle to 10*60 to set for 10 minutes IDLE time. Is there something I'm missing? Also - is there a way to modify the SQL the Auth program uses to look for an enabled flag? As currently implemented, if the username/password exists, the user can login. I need an additional flag for whether they have paid or not. Am I best off writing my own Auth, or subclassing, or something? Suggestions welcome. Thanks. -Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PEAR::Auth
Concerning PEAR::Auth I can't tune interaction between PEAR::Auth and MySQL auth table . Typical code from manual ?php $dbtype = 'mysql'; $dbhost = 'localhost'; $dbuser = ''; $dbpass = ''; $dbname = cosmos; $dsn = $dbtype://$dbuser:[EMAIL PROTECTED]/$dbname; $conn = mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname); require_once Auth/Auth.php; function loginFunction(){ echo form method=\post\ action=\ . $_SERVER['PHP_SELF'] . \; echo input type=\text\ name=\username\; echo input type=\password\ name=\password\; echo input type=\submit\; echo /form; } $a = new Auth(DB, $dsn, loginFunction); $a-start(); if ($a-getAuth()){ echo OK; } ? With typical SQL statement from manual: CREATE TABLE auth( username VARCHAR(50) default '' NOT NULL, password VARCHAR(32) default '' NOT NULL, PRIMARY KEY (username), KEY (password)); I tried: INSERT INTO auth VALUES ('qq', 'pp'); After submitting the login form the process buzzes on the procedure start(); I tried too: INSERT INTO auth VALUES ('qq', PASSWORD('pp')); I tried (using phpMyAdmin): GRANT SELECT , INSERT , UPDATE , DELETE , CREATE , INDEX , ALTER ON * . * TO qq@ localhost WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 ; But process buzzes on the procedure 'start()' as before; Could you show me the simple but concrete example of MySQL query that make the above php-code working with login (for instance) 'qq' and password 'pp'. Thank you Vlad Alivanov
[PHP] PEAR::Auth
Concerning PEAR::Auth I can't tune interaction between PEAR::Auth and MySQL. Typical code ?php $dbtype = 'mysql'; $dbhost = 'localhost'; $dbuser = ''; $dbpass = ''; $dbname = cosmos; $dsn = $dbtype://$dbuser:[EMAIL PROTECTED]/$dbname; $conn = mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname); require_once Auth/Auth.php; function loginFunction(){ echo form method=\post\ action=\ . $_SERVER['PHP_SELF'] . \; echo input type=\text\ name=\username\; echo input type=\password\ name=\password\; echo input type=\submit\; echo /form; } $a = new Auth(DB, $dsn, loginFunction); $a-start(); if ($a-getAuth()){ echo OK; } ? With typical SQL statement: CREATE TABLE auth( username VARCHAR(50) default '' NOT NULL, password VARCHAR(32) default '' NOT NULL, PRIMARY KEY (username), KEY (password)); I tried: INSERT INTO auth VALUES ('qq', 'pp'); after submitting the login form the process buzzes on the procedure start(); I tried too: INSERT INTO auth VALUES ('qq', PASSWORD('pp')); I tried (using phpMyAdmin): GRANT SELECT , INSERT , UPDATE , DELETE , CREATE , INDEX , ALTER ON * . * TO qq@ localhost WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 ; But process buzzes on the procedure start() as before; How to set username and password? Vlad Alivanov
[PHP] PEAR Auth
I was working with Auth class.That was working good. But i receive following errror: Fatal error: Undefined class name 'db' in /var/www/html/votting/Auth/Container/DB.php on line 130 Please guide me. = -DIGITAL SIGNATURE--- ///Mohsen Pahlevanzadeh Network administrator programmer My home phone is: +98213810146 My email address is m_pahlevanzadeh at yahoo dot com My website is: http://webnegar.net ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PEAR Auth
On Tue, 5 Oct 2004 07:06:53 -0700 (PDT), Pahlevanzadeh Mohsen [EMAIL PROTECTED] wrote: I was working with Auth class.That was working good. But i receive following errror: Fatal error: Undefined class name 'db' in /var/www/html/votting/Auth/Container/DB.php on line 130 Please guide me. Where's your code? -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PEAR - Auth
Hi guys, I'd like to use one of the auth classes from pear. Any suggestion for the best one? cheers alessandro -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PEAR AUTH :: Need some advice
Hi Folks! I am working with pear auth package in order to authenticate some users on a project. Well, I have a mysql table with the following columns: uid username password name I can authenticate the user against his username/password without problems, but I need also to include the uid, name and age on the session generated by Auth. The only data I get is: Array ( [auth] = Array ( [registered] = 1 [username] = geddylee [timestamp] = 1047172433 [idle] = 1047172433 ) ) The desired results should be: Array ( [auth] = Array ( [registered] = 1 [username] = geddylee [uid] = 2112 [name] = Gary Lee Weinrib [timestamp] = 1047172433 [idle] = 1047172433 ) ) I read the docs and the mailing list archives, but find nothing about it. Any tips? Thanks in advance. Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php