@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | if ($ex->getCode() === Http::STATUS_UNAUTHORIZED) { |
| 91 | 91 | // remote server revoked access to the address book, remove it |
| 92 | 92 | $this->backend->deleteAddressBook($addressBookId); |
| 93 | - $this->logger->info('Authorization failed, remove address book: ' . $url, ['app' => 'dav']); |
|
| 93 | + $this->logger->info('Authorization failed, remove address book: '.$url, ['app' => 'dav']); |
|
| 94 | 94 | throw $ex; |
| 95 | 95 | } |
| 96 | 96 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | */ |
| 142 | 142 | protected function requestSyncReport($url, $userName, $sharedSecret, $syncToken) { |
| 143 | 143 | $settings = [ |
| 144 | - 'baseUri' => $url . '/', |
|
| 144 | + 'baseUri' => $url.'/', |
|
| 145 | 145 | 'userName' => $userName, |
| 146 | 146 | 'password' => $sharedSecret, |
| 147 | 147 | ]; |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | */ |
| 255 | 255 | public function deleteUser($userOrCardId) { |
| 256 | 256 | $systemAddressBook = $this->getLocalSystemAddressBook(); |
| 257 | - if ($userOrCardId instanceof IUser){ |
|
| 257 | + if ($userOrCardId instanceof IUser) { |
|
| 258 | 258 | $name = $userOrCardId->getBackendClassName(); |
| 259 | 259 | $userId = $userOrCardId->getUID(); |
| 260 | 260 | |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | if (is_null($this->localSystemAddressBook)) { |
| 271 | 271 | $systemPrincipal = "principals/system/system"; |
| 272 | 272 | $this->localSystemAddressBook = $this->ensureSystemAddressBookExists($systemPrincipal, 'system', [ |
| 273 | - '{' . Plugin::NS_CARDDAV . '}addressbook-description' => 'System addressbook which holds all users of this instance' |
|
| 273 | + '{'.Plugin::NS_CARDDAV.'}addressbook-description' => 'System addressbook which holds all users of this instance' |
|
| 274 | 274 | ]); |
| 275 | 275 | } |
| 276 | 276 | |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | |
| 289 | 289 | // remove no longer existing |
| 290 | 290 | $allCards = $this->backend->getCards($systemAddressBook['id']); |
| 291 | - foreach($allCards as $card) { |
|
| 291 | + foreach ($allCards as $card) { |
|
| 292 | 292 | $vCard = Reader::read($card['carddata']); |
| 293 | 293 | $uid = $vCard->UID->getValue(); |
| 294 | 294 | // load backend and see if user exists |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | |
| 41 | 41 | function xmlSerialize(Writer $writer) { |
| 42 | 42 | foreach ($this->groups as $group) { |
| 43 | - $writer->writeElement('{' . self::NS_OWNCLOUD . '}group', $group); |
|
| 43 | + $writer->writeElement('{'.self::NS_OWNCLOUD.'}group', $group); |
|
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -45,15 +45,15 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | if (strrpos($principal, 'principals/users', -strlen($principal)) !== false) { |
| 47 | 47 | list(, $principalId) = URLUtil::splitPath($principal); |
| 48 | - return self::ADDRESSBOOK_ROOT . '/users/' . $principalId; |
|
| 48 | + return self::ADDRESSBOOK_ROOT.'/users/'.$principalId; |
|
| 49 | 49 | } |
| 50 | 50 | if (strrpos($principal, 'principals/groups', -strlen($principal)) !== false) { |
| 51 | 51 | list(, $principalId) = URLUtil::splitPath($principal); |
| 52 | - return self::ADDRESSBOOK_ROOT . '/groups/' . $principalId; |
|
| 52 | + return self::ADDRESSBOOK_ROOT.'/groups/'.$principalId; |
|
| 53 | 53 | } |
| 54 | 54 | if (strrpos($principal, 'principals/system', -strlen($principal)) !== false) { |
| 55 | 55 | list(, $principalId) = URLUtil::splitPath($principal); |
| 56 | - return self::ADDRESSBOOK_ROOT . '/system/' . $principalId; |
|
| 56 | + return self::ADDRESSBOOK_ROOT.'/system/'.$principalId; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | throw new \LogicException('This is not supposed to happen'); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | if ($node instanceof AddressBook) { |
| 74 | 74 | |
| 75 | - $propFind->handle($ns . 'groups', function () use ($node) { |
|
| 75 | + $propFind->handle($ns.'groups', function() use ($node) { |
|
| 76 | 76 | return new Groups($node->getContactsGroups()); |
| 77 | 77 | }); |
| 78 | 78 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | function getACL() { |
| 93 | - $acl = [ |
|
| 93 | + $acl = [ |
|
| 94 | 94 | [ |
| 95 | 95 | 'privilege' => '{DAV:}read', |
| 96 | 96 | 'principal' => $this->getOwner(), |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | 'protected' => true, |
| 103 | 103 | ]; |
| 104 | 104 | if ($this->getOwner() !== parent::getOwner()) { |
| 105 | - $acl[] = [ |
|
| 105 | + $acl[] = [ |
|
| 106 | 106 | 'privilege' => '{DAV:}read', |
| 107 | 107 | 'principal' => parent::getOwner(), |
| 108 | 108 | 'protected' => true, |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | function delete() { |
| 161 | 161 | if (isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) { |
| 162 | - $principal = 'principal:' . parent::getOwner(); |
|
| 162 | + $principal = 'principal:'.parent::getOwner(); |
|
| 163 | 163 | $shares = $this->getShares(); |
| 164 | 164 | $shares = array_filter($shares, function($share) use ($principal){ |
| 165 | 165 | return $share['href'] === $principal; |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | 'image/gif', |
| 130 | 130 | ]; |
| 131 | 131 | |
| 132 | - if(!in_array($type, $allowedContentTypes, true)) { |
|
| 132 | + if (!in_array($type, $allowedContentTypes, true)) { |
|
| 133 | 133 | $type = 'application/octet-stream'; |
| 134 | 134 | } |
| 135 | 135 | |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | 'Content-Type' => $type, |
| 138 | 138 | 'body' => $val |
| 139 | 139 | ]; |
| 140 | - } catch(\Exception $ex) { |
|
| 140 | + } catch (\Exception $ex) { |
|
| 141 | 141 | $this->logger->logException($ex); |
| 142 | 142 | } |
| 143 | 143 | return false; |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | if (strpos($type, 'image/') === 0) { |
| 162 | 162 | return $type; |
| 163 | 163 | } else { |
| 164 | - return 'image/' . strtolower($type); |
|
| 164 | + return 'image/'.strtolower($type); |
|
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | return ''; |
@@ -106,13 +106,13 @@ |
||
| 106 | 106 | $tag = $this->tagManager->getTagsByIds([$name]); |
| 107 | 107 | $tag = current($tag); |
| 108 | 108 | if (!$this->tagManager->canUserSeeTag($tag, $this->userSession->getUser())) { |
| 109 | - throw new NotFound('Tag with id ' . $name . ' not found'); |
|
| 109 | + throw new NotFound('Tag with id '.$name.' not found'); |
|
| 110 | 110 | } |
| 111 | 111 | return $this->makeNode($tag); |
| 112 | 112 | } catch (\InvalidArgumentException $e) { |
| 113 | 113 | throw new BadRequest('Invalid tag id', 0, $e); |
| 114 | 114 | } catch (TagNotFoundException $e) { |
| 115 | - throw new NotFound('Tag with id ' . $name . ' not found', 0, $e); |
|
| 115 | + throw new NotFound('Tag with id '.$name.' not found', 0, $e); |
|
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 | |
@@ -120,7 +120,7 @@ |
||
| 120 | 120 | */ |
| 121 | 121 | function getChild($objectId) { |
| 122 | 122 | // make sure the object exists and is reachable |
| 123 | - if(!$this->childExists($objectId)) { |
|
| 123 | + if (!$this->childExists($objectId)) { |
|
| 124 | 124 | throw new NotFound('Entity does not exist or is not available'); |
| 125 | 125 | } |
| 126 | 126 | return new SystemTagsObjectMappingCollection( |
@@ -156,15 +156,15 @@ |
||
| 156 | 156 | public function delete() { |
| 157 | 157 | try { |
| 158 | 158 | if (!$this->tagManager->canUserSeeTag($this->tag, $this->user)) { |
| 159 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' not found'); |
|
| 159 | + throw new NotFound('Tag with id '.$this->tag->getId().' not found'); |
|
| 160 | 160 | } |
| 161 | 161 | if (!$this->tagManager->canUserAssignTag($this->tag, $this->user)) { |
| 162 | - throw new Forbidden('No permission to unassign tag ' . $this->tag->getId()); |
|
| 162 | + throw new Forbidden('No permission to unassign tag '.$this->tag->getId()); |
|
| 163 | 163 | } |
| 164 | 164 | $this->tagMapper->unassignTags($this->objectId, $this->objectType, $this->tag->getId()); |
| 165 | 165 | } catch (TagNotFoundException $e) { |
| 166 | 166 | // can happen if concurrent deletion occurred |
| 167 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' not found', 0, $e); |
|
| 167 | + throw new NotFound('Tag with id '.$this->tag->getId().' not found', 0, $e); |
|
| 168 | 168 | } |
| 169 | 169 | } |
| 170 | 170 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | if ($node instanceof SystemTagsObjectMappingCollection) { |
| 136 | 136 | // also add to collection |
| 137 | 137 | $node->createFile($tag->getId()); |
| 138 | - $url = $request->getBaseUrl() . 'systemtags/'; |
|
| 138 | + $url = $request->getBaseUrl().'systemtags/'; |
|
| 139 | 139 | } else { |
| 140 | 140 | $url = $request->getUrl(); |
| 141 | 141 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $url .= '/'; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - $response->setHeader('Content-Location', $url . $tag->getId()); |
|
| 147 | + $response->setHeader('Content-Location', $url.$tag->getId()); |
|
| 148 | 148 | |
| 149 | 149 | // created |
| 150 | 150 | $response->setStatus(201); |
@@ -179,11 +179,11 @@ discard block |
||
| 179 | 179 | $userAssignable = true; |
| 180 | 180 | |
| 181 | 181 | if (isset($data['userVisible'])) { |
| 182 | - $userVisible = (bool)$data['userVisible']; |
|
| 182 | + $userVisible = (bool) $data['userVisible']; |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | if (isset($data['userAssignable'])) { |
| 186 | - $userAssignable = (bool)$data['userAssignable']; |
|
| 186 | + $userAssignable = (bool) $data['userAssignable']; |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | $groups = []; |
@@ -194,8 +194,8 @@ discard block |
||
| 194 | 194 | } |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | - if($userVisible === false || $userAssignable === false || !empty($groups)) { |
|
| 198 | - if(!$this->userSession->isLoggedIn() || !$this->groupManager->isAdmin($this->userSession->getUser()->getUID())) { |
|
| 197 | + if ($userVisible === false || $userAssignable === false || !empty($groups)) { |
|
| 198 | + if (!$this->userSession->isLoggedIn() || !$this->groupManager->isAdmin($this->userSession->getUser()->getUID())) { |
|
| 199 | 199 | throw new BadRequest('Not sufficient permissions'); |
| 200 | 200 | } |
| 201 | 201 | } |