Source for file HardcodedAccounts.php
Documentation is available at HardcodedAccounts.php
* @author Dirk Merkel <dirk@waferthin.com>
* @subpackage Authentication
* @copyright Waferthin Web Works LLC
* @license http://www.gnu.org/copyleft/gpl.html Freely available under GPL
* <i>Authentication_HardcodedAccounts</i> class
* This class implements the login method needed to handle
* actual user authentication. It extends <i>Authentication</i>
* and implements the <i>Accountable</i> interface.
* @subpackage Authentication
* @author Dirk Merkel <dirk@waferthin.com>
* Referece to <i>Users</i> object
* Authentication_HardcodedAccounts constructor
* Instantiates a new {@link Users} object and stores a reference
* in the {@link users} property.
$this->users =
new Users();
* Uses the reference {@link Users} class to handle
* @todo Decide which validate method to user instead of both
* @param string $user account user name
* @param string $password account password
public function login($user, $password)
if (empty($user) ||
empty($password)) {
// both validation methods should work ...
// user static method to validate account
// use magic method validate<username>($password)
$userLoginFunction =
'validate' .
$user;
$secondValidation =
$this->users->$userLoginFunction($password);
return ($firstValidation &&
$secondValidation);
Documentation generated on Mon, 26 Jul 2010 22:07:04 +0100 by phpDocumentor 1.4.3