2 /** @package verysimple::Authentication */
3 require_once("IAuthenticatable.php");
6 * simple implementation of IAuthenticatable for using a basic
7 * hard-coded username/password combination.
9 * @package verysimple::Authentication
10 * @author VerySimple Inc.
11 * @copyright 1997-2007 VerySimple, Inc.
12 * @license http://www.gnu.org/licenses/lgpl.html LGPL
15 class SimpleAccount
implements IAuthenticatable
17 private $_authenticated = false;
20 public function __construct($required_username, $required_password)
22 $this->_username
= $required_username;
23 $this->_password
= $required_password;
25 public function IsAnonymous()
27 return (! $this->_authenticated
);
29 public function IsAuthorized($permission)
31 return $this->_authenticated
;
33 public function Login($username, $password)
35 if ($this->_username
== $username && $this->_password
== $password) {
36 $this->_authenticated
= true;
44 * This is implemented only for Phreeze but is not utilized
49 public function Refresh($obj)