Browse Source
Use proper code flow instead of not needed else branch
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
pull/8060/head
Morris Jobke
8 years ago
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
3 changed files with
12 additions and
14 deletions
-
apps/files_external/lib/Lib/Storage/AmazonS3.php
-
lib/private/Files/Cache/Cache.php
-
lib/private/User/Session.php
|
|
|
@ -232,7 +232,6 @@ class AmazonS3 extends \OC\Files\Storage\Common { |
|
|
|
} catch (\Exception $e) { |
|
|
|
return $this->batchDelete(); |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
private function batchDelete($path = null) { |
|
|
|
|
|
|
|
@ -208,9 +208,8 @@ class Cache implements ICache { |
|
|
|
return array_map(function (array $data) { |
|
|
|
return self::cacheEntryFromData($data, $this->mimetypeLoader);; |
|
|
|
}, $files); |
|
|
|
} else { |
|
|
|
return array(); |
|
|
|
} |
|
|
|
return []; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
@ -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); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|