| version 1.18, 2009/10/14 11:45:40 |
version 1.19, 2024/11/07 17:39:57 |
|
|
| * http://platon.sk/projects/phpPlatonLib/ |
* http://platon.sk/projects/phpPlatonLib/ |
| */ |
*/ |
| |
|
| /* $Platon: phpPlatonLib/Auth_AuthDB/AuthDB.php,v 1.17 2008-05-01 14:15:57 nepto Exp $ */ |
/* $Platon: phpPlatonLib/Auth_AuthDB/AuthDB.php,v 1.18 2009/10/14 11:45:40 nepto Exp $ */ |
| |
|
| /* |
/* |
| * History: |
* History: |
| Line 53 define('AUTH_DB_FAILED', -5); |
|
| Line 53 define('AUTH_DB_FAILED', -5); |
|
| |
|
| class AuthDB |
class AuthDB |
| { |
{ |
| var $_status = AUTH_DB_UNDEFINED; |
private $_status = AUTH_DB_UNDEFINED; |
| var $_options = null; |
private $_options = null; |
| var $_db = null; |
private $_db = null; |
| var $_logged_fnc = null; |
private $_logged_fnc = null; |
| var $_props = array( |
private $_props = array( |
| 'username' => null, |
'username' => null, |
| 'password' => null, |
'password' => null, |
| 'session_id' => null, |
'session_id' => null, |
|
|
| 'remote_ip' => null |
'remote_ip' => null |
| ); |
); |
| |
|
| function AuthDB($options) /* {{{ */ |
function __construct($options) /* {{{ */ |
| { |
{ |
| $this->_options = $options; |
$this->_options = $options; |
| $this->_checkOptions(); |
$this->_checkOptions(); |
|
|
| $this->_DBupdateTimeout(); |
$this->_DBupdateTimeout(); |
| |
|
| $status = $this->_DBcheckLogin(); |
$status = $this->_DBcheckLogin(); |
| |
|
| /* If there is a defined login status returns it. |
/* If there is a defined login status returns it. |
| Exception is, if we are in "logged" mode, which means we are |
Exception is, if we are in "logged" mode, which means we are |
| authentificated via another cooperative authentification interface. |
authentificated via another cooperative authentification interface. |
|
|
| |
|
| function _checkDB() /* {{{ */ |
function _checkDB() /* {{{ */ |
| { |
{ |
| if (! isset($this->_db)) { |
if (! isset($this->_db) |
| |
&& isset($this->_options)) |
| |
{ |
| $this->_db = DB::connect($this->_options['dsn']); |
$this->_db = DB::connect($this->_options['dsn']); |
| DB::isError($this->_db) && $this->_error($this->_db); |
DB::isError($this->_db) && $this->_error($this->_db); |
| $this->_db->setFetchMode(DB_FETCHMODE_ASSOC); |
$this->_db->setFetchMode(DB_FETCHMODE_ASSOC); |