コード例 #1
0
 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         $class = __CLASS__;
         self::$instance = new $class();
     }
     return self::$instance;
 }
コード例 #2
0
 public function doAuthentication($request)
 {
     $objUsersDO = new UsersDO();
     $objUsersDO->setUsername($request['username']);
     $objUsersDO->setPassword($this->hashPassword($request['password'], $request['username']));
     $objUsersDAOFactory = UsersDAOFactory::getInstance()->createDAO();
     if ($username = $objUsersDAOFactory->doAuthentication($objUsersDO)) {
         $connection = Crypto::encrypt(implode("|Z|1|Z|", array($username, time())), _Key_New);
         $this->setAuthenticated($connection);
         return true;
     } else {
         return false;
     }
 }