Browse Source
Simplify return statement
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
pull/8338/head
Morris Jobke
8 years ago
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
9 changed files with
13 additions and
33 deletions
-
apps/dav/lib/CardDAV/SyncService.php
-
apps/dav/lib/Connector/Sabre/Auth.php
-
apps/dav/lib/Upload/UploadHome.php
-
apps/encryption/lib/Crypto/Crypt.php
-
apps/files_sharing/lib/Helper.php
-
apps/user_ldap/lib/Access.php
-
apps/user_ldap/lib/Group_LDAP.php
-
apps/user_ldap/lib/Jobs/CleanUp.php
-
lib/private/Files/Storage/Wrapper/Encryption.php
|
|
|
@ -236,9 +236,7 @@ class SyncService { |
|
|
|
$root->appendChild($sync); |
|
|
|
$root->appendChild($prop); |
|
|
|
$dom->appendChild($root); |
|
|
|
$body = $dom->saveXML(); |
|
|
|
|
|
|
|
return $body; |
|
|
|
return $dom->saveXML(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
@ -152,8 +152,7 @@ class Auth extends AbstractBasic { |
|
|
|
*/ |
|
|
|
function check(RequestInterface $request, ResponseInterface $response) { |
|
|
|
try { |
|
|
|
$result = $this->auth($request, $response); |
|
|
|
return $result; |
|
|
|
return $this->auth($request, $response); |
|
|
|
} catch (NotAuthenticated $e) { |
|
|
|
throw $e; |
|
|
|
} catch (Exception $e) { |
|
|
|
|
|
|
|
@ -90,7 +90,6 @@ class UploadHome implements ICollection { |
|
|
|
} |
|
|
|
$view = new View('/' . $user->getUID() . '/uploads'); |
|
|
|
$rootInfo = $view->getFileInfo(''); |
|
|
|
$impl = new Directory($view, $rootInfo); |
|
|
|
return $impl; |
|
|
|
return new Directory($view, $rootInfo); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -196,9 +196,7 @@ class Crypt { |
|
|
|
// combine content to encrypt the IV identifier and actual IV
|
|
|
|
$catFile = $this->concatIV($encryptedContent, $iv); |
|
|
|
$catFile = $this->concatSig($catFile, $sig); |
|
|
|
$padded = $this->addPadding($catFile); |
|
|
|
|
|
|
|
return $padded; |
|
|
|
return $this->addPadding($catFile); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -495,8 +493,7 @@ class Crypt { |
|
|
|
*/ |
|
|
|
private function createSignature($data, $passPhrase) { |
|
|
|
$passPhrase = hash('sha512', $passPhrase . 'a', true); |
|
|
|
$signature = hash_hmac('sha256', $data, $passPhrase); |
|
|
|
return $signature; |
|
|
|
return hash_hmac('sha256', $data, $passPhrase); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -210,9 +210,7 @@ class Helper { |
|
|
|
} |
|
|
|
|
|
|
|
$sliced = array_slice($split, 2); |
|
|
|
$relPath = implode('/', $sliced); |
|
|
|
|
|
|
|
return $relPath; |
|
|
|
return implode('/', $sliced); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
@ -419,8 +419,7 @@ class Access extends LDAPUtility implements IUserTools { |
|
|
|
$domainParts[] = $part; |
|
|
|
} |
|
|
|
} |
|
|
|
$domainDN = implode(',', $domainParts); |
|
|
|
return $domainDN; |
|
|
|
return implode(',', $domainParts); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -800,8 +799,7 @@ class Access extends LDAPUtility implements IUserTools { |
|
|
|
public function fetchUsersByLoginName($loginName, $attributes = array('dn')) { |
|
|
|
$loginName = $this->escapeFilterPart($loginName); |
|
|
|
$filter = str_replace('%uid', $loginName, $this->connection->ldapLoginFilter); |
|
|
|
$users = $this->fetchListOfUsers($filter, $attributes); |
|
|
|
return $users; |
|
|
|
return $this->fetchListOfUsers($filter, $attributes); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -814,8 +812,7 @@ class Access extends LDAPUtility implements IUserTools { |
|
|
|
public function countUsersByLoginName($loginName) { |
|
|
|
$loginName = $this->escapeFilterPart($loginName); |
|
|
|
$filter = str_replace('%uid', $loginName, $this->connection->ldapLoginFilter); |
|
|
|
$users = $this->countUsers($filter); |
|
|
|
return $users; |
|
|
|
return $this->countUsers($filter); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
@ -370,9 +370,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD |
|
|
|
} |
|
|
|
$filterParts[] = $this->access->connection->ldapGidNumber .'=' . $groupID; |
|
|
|
|
|
|
|
$filter = $this->access->combineFilterWithAnd($filterParts); |
|
|
|
|
|
|
|
return $filter; |
|
|
|
return $this->access->combineFilterWithAnd($filterParts); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -534,9 +532,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD |
|
|
|
} |
|
|
|
$filterParts[] = 'primaryGroupID=' . $groupID; |
|
|
|
|
|
|
|
$filter = $this->access->combineFilterWithAnd($filterParts); |
|
|
|
|
|
|
|
return $filter; |
|
|
|
return $this->access->combineFilterWithAnd($filterParts); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
@ -172,9 +172,7 @@ class CleanUp extends TimedJob { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
$enabled = $this->isCleanUpEnabled(); |
|
|
|
|
|
|
|
return $enabled; |
|
|
|
return $this->isCleanUpEnabled(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
@ -351,9 +351,7 @@ class Encryption extends Wrapper { |
|
|
|
// need to stream copy file by file in case we copy between a encrypted
|
|
|
|
// and a unencrypted storage
|
|
|
|
$this->unlink($path2); |
|
|
|
$result = $this->copyFromStorage($this, $path1, $path2); |
|
|
|
|
|
|
|
return $result; |
|
|
|
return $this->copyFromStorage($this, $path1, $path2); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|