diff options
Diffstat (limited to 'lib/private/User')
-rw-r--r-- | lib/private/User/Session.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index 34319760c86..c2b58c37cdb 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -295,15 +295,15 @@ class Session implements IUserSession, Emitter { public function getLoginName() { if ($this->activeUser) { return $this->session->get('loginname'); - } else { - $uid = $this->session->get('user_id'); - if ($uid) { - $this->activeUser = $this->manager->get($uid); - return $this->session->get('loginname'); - } else { - return null; - } } + + $uid = $this->session->get('user_id'); + if ($uid) { + $this->activeUser = $this->manager->get($uid); + return $this->session->get('loginname'); + } + + return null; } /** @@ -369,10 +369,10 @@ class Session implements IUserSession, Emitter { if($this->isLoggedIn()) { $this->prepareUserLogin($firstTimeLogin, $regenerateSessionId); return true; - } else { - $message = \OC::$server->getL10N('lib')->t('Login canceled by app'); - throw new LoginException($message); } + + $message = \OC::$server->getL10N('lib')->t('Login canceled by app'); + throw new LoginException($message); } /** |