summaryrefslogtreecommitdiffstats
path: root/lib/private/User
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-25 23:01:03 +0100
committerMorris Jobke <hey@morrisjobke.de>2018-01-25 23:01:03 +0100
commit16a558871cf371aec59dfb2ec7b672f0a4ab166f (patch)
tree564754363d080c57dd115aeab26c5d3cda4ea13b /lib/private/User
parentb9bbb894f8b01e000bb5e3a8a82db7bebad3ea00 (diff)
downloadnextcloud-server-16a558871cf371aec59dfb2ec7b672f0a4ab166f.tar.gz
nextcloud-server-16a558871cf371aec59dfb2ec7b672f0a4ab166f.zip
Use proper code flow instead of not needed else branch
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/User')
-rw-r--r--lib/private/User/Session.php22
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);
}
/**