Highway to PSR2
[openemr.git] / portal / patient / fwk / libs / verysimple / Authentication / SimpleAccount.php
blob05061df65be9d4251ae08c88f2f92b2d13122918
1 <?php
2 /** @package verysimple::Authentication */
3 require_once("IAuthenticatable.php");
5 /**
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
13 * @version 1.0
15 class SimpleAccount implements IAuthenticatable
17 private $_authenticated = false;
18 private $_username;
19 private $_password;
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;
37 return true;
40 return false;
43 /**
44 * This is implemented only for Phreeze but is not utilized
46 * @param
47 * object
49 public function Refresh($obj)