From 823d71ced9b4947b1a5a5ade7245d521ed490061 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 7 Jun 2016 15:17:49 +0200 Subject: * renaming php directory --- app/php/user/DbUser.php | 60 ------------------------------------------------- app/php/user/config.xml | 9 -------- 2 files changed, 69 deletions(-) delete mode 100644 app/php/user/DbUser.php delete mode 100644 app/php/user/config.xml (limited to 'app/php/user') diff --git a/app/php/user/DbUser.php b/app/php/user/DbUser.php deleted file mode 100644 index d636e8b..0000000 --- a/app/php/user/DbUser.php +++ /dev/null @@ -1,60 +0,0 @@ -_record = $record; - } - - public function getDbRecord() { - if (!$this->_record) { - $this->_record = UserFacade::getInstance()->findByLogin($this->Name); - } - return $this->_record; - } - - public function createUser($username) { - $dbUser = UserFacade::getInstance()->findByLogin($username); - if (!$dbUser) { - return NULL; - } - $user = new DbUser($this->Manager); - $user->setDbRecord($dbUser); - $user->Name = $dbUser->Login; - if ($dbUser->IsAdmin) { - $user->Roles = 'Admin'; - } - $user->IsGuest = FALSE; - return $user; - } - - public function validateUser($login, $password) { - $user = UserFacade::getInstance()->findByLogin($login); - $dbPassword = $user ? $user->Password : ''; - if (UserFacade::getInstance()->verifyPassword($password, $dbPassword) - && $user) { - $user->LastLogin = date('Y-m-d H:i:s'); - $user->save(); - return TRUE; - } else { - return FALSE; - } - } - - public function __call($name, $args) { - $match = []; - if (preg_match('/^getIs(.+)$/', $name, $match)) { - return $this->isInRole($match[1]); - } - throw new Exception('Unimplemented CustomDbUser method'); - } - -} - -?> diff --git a/app/php/user/config.xml b/app/php/user/config.xml deleted file mode 100644 index 80027e5..0000000 --- a/app/php/user/config.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - -- cgit v1.2.3