Using Auth_HTTP
| From: | Dennis Sterzenbach | Date: | Tue, 30 Sep 2003 14:28:00 +0000 |
| Subject: | Using Auth_HTTP | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-8146@lists.php.net to get a copy of this message | ||
Hello all,
I try to use Auth_HTTP to authenticate via HTTP auth.
My usernames are e-mail addresses, passwords are md5 encrypted with
everything is stored in a table logins in my database.
IMO, the following code should be okay, but it isn't:
require_once 'Auth/Auth_HTTP.php';
$auth =& new Auth_HTTP("DB", $dsn);
$auth->setRealm("TestLogin");
$auth->setCancelText("Login fail");
Header('Content-Type: text/plain');
$auth->storage->options['table'] = "logins";
$auth->storage->options['usernamecol'] = "email";
$auth->storage->options['passwordcol'] = "pass";
$auth->storage->options['cryptType'] = "md5";
$auth->assignData();
$auth->start();
I tested the value $dsn handed to the Auth_Container_DB storage
container used: it's ok, it leads to the expected instance of DB_mysql.
Credentials for user also must be okay, since I am using the same for
phpMyAdmin connections and can select,update and insert values to the
corresponding table: testdb.logins
I checked against typos, looked through the documentation, but am
unable to find anything wrong.
After all does anyone have an idea what's wrong with it?
Thanks in advance.
--
Dennis Sterzenbach