diff options
author | emkael <emkael@tlen.pl> | 2016-03-10 13:42:11 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-03-10 13:42:11 +0100 |
commit | 153b7f441b006d5b5ae630fc5b17772ee4ff9781 (patch) | |
tree | bc81349ef54c0108d155c6cd57246410f099cdb7 /app/php/user | |
parent | 0d538c464954334652c86f74fdeb7b756713bf53 (diff) |
* retrieving User record for DbUser properly
Diffstat (limited to 'app/php/user')
-rw-r--r-- | app/php/user/DbUser.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/php/user/DbUser.php b/app/php/user/DbUser.php index e864bc0..c8273f7 100644 --- a/app/php/user/DbUser.php +++ b/app/php/user/DbUser.php @@ -12,6 +12,9 @@ class DbUser extends TDbUser { } public function getDbRecord() { + if (!$this->_record) { + $this->_record = User::finder()->findByLogin($this->Name); + } return $this->_record; } @@ -21,7 +24,7 @@ class DbUser extends TDbUser { return NULL; } $user = new DbUser($this->Manager); - $user->DbRecord = $dbUser; + $user->setDbRecord($dbUser); $user->Name = $dbUser->Login; if ($dbUser->IsAdmin) { $user->Roles = 'Admin'; |