Auth extension for GET login
| From: | Massimiliano Arione | Date: | Fri, 24 Mar 2006 16:41:04 +0000 |
| Subject: | Auth extension for GET login | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-23444@lists.php.net to get a copy of this message | ||
I need to have an authentication based on a GET login.
I tried to extend Auth class, like suggested inside the code (about line 420: "If you wish to use another source apart from $HTTP_POST_VARS/$_POST, you have to derive this function")
So I did this:
<?php
require_once 'Auth.php';
class myAuth extends Auth
{
function assignData()
{
$this->username = $_GET['user'];
$this->password = $_GET['pass'];
}
}
$optAuth = array(
'dsn' => 'mysql://usr:pwd0@dbsrvr/dbnm',
'table' => 'usrtbl',
'usernamecol' => 'usrnmcl',
'passwordcol' => 'pwdcln',
'sessionName' => 'myssnnm',
'cryptType' => 'none',
);
$auth =& new myAuth('DB', $optAuth, '', false);
$auth->start();
?>
Is this correct?
I have some problems: it seems that session works on first page, but fails on subsequent pages, when the user is supposed to be already authenticated.
TIA
--
Massimiliano Arione
http://garakkio.altervista.org