18,7 → 18,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: Container.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: Container.php,v 1.3 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
*/ |
|
31,7 → 31,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.2 $ |
* @version Release: 1.5.4 File: $Revision: 1.3 $ |
* @link http://pear.php.net/package/Auth |
*/ |
class Auth_Container |
46,6 → 46,13 |
*/ |
var $activeUser = ""; |
|
/** |
* The Auth object this container is attached to. |
* |
* @access public |
*/ |
var $_auth_obj = null; |
|
// }}} |
// {{{ Auth_Container() [constructor] |
|
72,6 → 79,7 |
*/ |
function fetchData($username, $password, $isChallengeResponse=false) |
{ |
$this->log('Auth_Container::fetchData() called.', AUTH_LOG_DEBUG); |
} |
|
// }}} |
90,6 → 98,7 |
*/ |
function verifyPassword($password1, $password2, $cryptType = "md5") |
{ |
$this->log('Auth_Container::verifyPassword() called.', AUTH_LOG_DEBUG); |
switch ($cryptType) { |
case "crypt" : |
return ((string)crypt($password1, $password2) === (string)$password2); |
104,7 → 113,7 |
default : |
if (function_exists($cryptType)) { |
return ((string)$cryptType($password1) === (string)$password2); |
} elseif (method_exists($this,$cryptType)) { |
} elseif (method_exists($this,$cryptType)) { |
return ((string)$this->$cryptType($password1) === (string)$password2); |
} else { |
return false; |
115,9 → 124,9 |
|
// }}} |
// {{{ supportsChallengeResponse() |
|
|
/** |
* Returns true if the container supports Challenge Response |
* Returns true if the container supports Challenge Response |
* password authentication |
*/ |
function supportsChallengeResponse() |
127,7 → 136,7 |
|
// }}} |
// {{{ getCryptType() |
|
|
/** |
* Returns the crypt current crypt type of the container |
* |
146,6 → 155,7 |
*/ |
function listUsers() |
{ |
$this->log('Auth_Container::listUsers() called.', AUTH_LOG_DEBUG); |
return AUTH_METHOD_NOT_SUPPORTED; |
} |
|
161,6 → 171,7 |
*/ |
function getUser($username) |
{ |
$this->log('Auth_Container::getUser() called.', AUTH_LOG_DEBUG); |
$users = $this->listUsers(); |
if ($users === AUTH_METHOD_NOT_SUPPORTED) { |
return AUTH_METHOD_NOT_SUPPORTED; |
187,6 → 198,7 |
*/ |
function addUser($username, $password, $additional=null) |
{ |
$this->log('Auth_Container::addUser() called.', AUTH_LOG_DEBUG); |
return AUTH_METHOD_NOT_SUPPORTED; |
} |
|
200,6 → 212,7 |
*/ |
function removeUser($username) |
{ |
$this->log('Auth_Container::removeUser() called.', AUTH_LOG_DEBUG); |
return AUTH_METHOD_NOT_SUPPORTED; |
} |
|
214,11 → 227,36 |
*/ |
function changePassword($username, $password) |
{ |
$this->log('Auth_Container::changePassword() called.', AUTH_LOG_DEBUG); |
return AUTH_METHOD_NOT_SUPPORTED; |
} |
|
// }}} |
// {{{ log() |
|
/** |
* Log a message to the Auth log |
* |
* @param string The message |
* @param int |
* @return boolean |
*/ |
function log($message, $level = AUTH_LOG_DEBUG) { |
|
if (is_null($this->_auth_obj)) { |
|
return false; |
|
} else { |
|
return $this->_auth_obj->log($message, $level); |
|
} |
|
} |
|
// }}} |
|
} |
|
?> |