@@ -109,10 +109,10 @@ discard block |
||
| 109 | 109 | return new JSONResponse(array('success' => true)); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - public function listRequests(){ |
|
| 112 | + public function listRequests() { |
|
| 113 | 113 | $requests = $this->deleteVaultRequestService->getDeleteRequests(); |
| 114 | 114 | $results = array(); |
| 115 | - foreach($requests as $request){ |
|
| 115 | + foreach($requests as $request) { |
|
| 116 | 116 | $r = $request->jsonSerialize(); |
| 117 | 117 | $r['displayName'] = Utils::getNameByUid($request->getRequestedBy()); |
| 118 | 118 | array_push($results, $r); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | return new JSONResponse($results); |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - public function acceptRequestDeletion($vault_guid, $requested_by){ |
|
| 123 | + public function acceptRequestDeletion($vault_guid, $requested_by) { |
|
| 124 | 124 | $req = $this->deleteVaultRequestService->getDeleteRequestForVault($vault_guid); |
| 125 | 125 | try{ |
| 126 | 126 | $vault = $this->vaultService->getByGuid($vault_guid, $requested_by); |
@@ -128,14 +128,14 @@ discard block |
||
| 128 | 128 | //Ignore |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - if(isset($vault)){ |
|
| 131 | + if(isset($vault)) { |
|
| 132 | 132 | $credentials = $this->credentialService->getCredentialsByVaultId($vault->getId(), $requested_by); |
| 133 | - foreach($credentials as $credential){ |
|
| 133 | + foreach($credentials as $credential) { |
|
| 134 | 134 | $revisions = $this->revisionService->getRevisions($credential->getId()); |
| 135 | - foreach($revisions as $revision){ |
|
| 135 | + foreach($revisions as $revision) { |
|
| 136 | 136 | $this->revisionService->deleteRevision($revision['revision_id'], $requested_by); |
| 137 | 137 | } |
| 138 | - if($credential instanceof Credential){ |
|
| 138 | + if($credential instanceof Credential) { |
|
| 139 | 139 | $this->credentialService->deleteCredential($credential); |
| 140 | 140 | } |
| 141 | 141 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | public function requestDeletion($vault_guid, $reason) { |
| 155 | 155 | $req = $this->deleteVaultRequestService->getDeleteRequestForVault($vault_guid); |
| 156 | - if($req){ |
|
| 156 | + if($req) { |
|
| 157 | 157 | return new JSONResponse('Already exists'); |
| 158 | 158 | } |
| 159 | 159 | $vault = $this->vaultService->getByGuid($vault_guid, $this->userId); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * @param DeleteVaultRequest $request |
| 43 | 43 | * @return \OCP\AppFramework\Db\Entity |
| 44 | 44 | */ |
| 45 | - public function createRequest(DeleteVaultRequest $request){ |
|
| 45 | + public function createRequest(DeleteVaultRequest $request) { |
|
| 46 | 46 | return $this->insert($request); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * Get all delete requests |
| 51 | 51 | * @return \OCP\AppFramework\Db\Entity |
| 52 | 52 | */ |
| 53 | - public function getDeleteRequests(){ |
|
| 53 | + public function getDeleteRequests() { |
|
| 54 | 54 | $q = "SELECT * FROM *PREFIX*" . self::TABLE_NAME; |
| 55 | 55 | return $this->findEntities($q); |
| 56 | 56 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * @param $vault_id integer The vault id |
| 61 | 61 | * @return \OCP\AppFramework\Db\Entity |
| 62 | 62 | */ |
| 63 | - public function getDeleteRequestsForVault($vault_guid){ |
|
| 63 | + public function getDeleteRequestsForVault($vault_guid) { |
|
| 64 | 64 | $q = "SELECT * FROM *PREFIX*" . self::TABLE_NAME .' WHERE `vault_guid` = ?'; |
| 65 | 65 | return $this->findEntity($q, [$vault_guid]); |
| 66 | 66 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * @param DeleteVaultRequest $request Request to delete |
| 71 | 71 | * @return DeleteVaultRequest The deleted request |
| 72 | 72 | */ |
| 73 | - public function removeDeleteVaultRequest(DeleteVaultRequest $request){ |
|
| 73 | + public function removeDeleteVaultRequest(DeleteVaultRequest $request) { |
|
| 74 | 74 | return $this->delete($request); |
| 75 | 75 | } |
| 76 | 76 | |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | |
| 50 | 50 | public function expireCredentials() { |
| 51 | 51 | $expired_credentials = $this->credentialService->getExpiredCredentials($this->utils->getTime()); |
| 52 | - foreach($expired_credentials as $credential){ |
|
| 52 | + foreach($expired_credentials as $credential) { |
|
| 53 | 53 | $link = ''; // @TODO create direct link to credential |
| 54 | 54 | |
| 55 | 55 | $sql = 'SELECT count(*) as rows from `*PREFIX*notifications` WHERE `subject`= \'credential_expired\' AND object_id=?'; |
@@ -181,7 +181,7 @@ |
||
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | |
| 184 | - private function parseLinkElement($htmlHead, $pageUrlInfo, $base_href){ |
|
| 184 | + private function parseLinkElement($htmlHead, $pageUrlInfo, $base_href) { |
|
| 185 | 185 | if (preg_match('#<\s*link[^>]*(rel=(["\'])[^>\2]*icon[^>\2]*\2)[^>]*>#i', $htmlHead, $matches)) { |
| 186 | 186 | $link_tag = $matches[0]; |
| 187 | 187 | $this->debugInfo['link_tag'] = $link_tag; |
@@ -43,8 +43,7 @@ discard block |
||
| 43 | 43 | * @return string |
| 44 | 44 | */ |
| 45 | 45 | public static function GUID() { |
| 46 | - if (function_exists('com_create_guid') === true) |
|
| 47 | - { |
|
| 46 | + if (function_exists('com_create_guid') === true) { |
|
| 48 | 47 | return trim(com_create_guid(), '{}'); |
| 49 | 48 | } |
| 50 | 49 | |
@@ -55,16 +54,16 @@ discard block |
||
| 55 | 54 | * @param $uid |
| 56 | 55 | * @return string |
| 57 | 56 | */ |
| 58 | - public static function getNameByUid($uid){ |
|
| 57 | + public static function getNameByUid($uid) { |
|
| 59 | 58 | $um = \OC::$server->getUserManager(); |
| 60 | 59 | $u = $um->get($uid); |
| 61 | 60 | return $u->getDisplayName(); |
| 62 | 61 | } |
| 63 | 62 | |
| 64 | - public static function getDirContents($dir, &$results = array()){ |
|
| 63 | + public static function getDirContents($dir, &$results = array()) { |
|
| 65 | 64 | $files = scandir($dir); |
| 66 | 65 | |
| 67 | - foreach($files as $value){ |
|
| 66 | + foreach($files as $value) { |
|
| 68 | 67 | $path = realpath($dir.DIRECTORY_SEPARATOR.$value); |
| 69 | 68 | if(!is_dir($path)) { |
| 70 | 69 | $results[] = $path; |
@@ -134,7 +134,7 @@ |
||
| 134 | 134 | $icon['mimetype'] = mime_content_type($iconPath); |
| 135 | 135 | $icon['url'] = $this->urlGenerator->linkTo('passman', $path[1]); |
| 136 | 136 | $icon['pack'] = $pack; |
| 137 | - if(!isset($icons[$pack])){ |
|
| 137 | + if(!isset($icons[$pack])) { |
|
| 138 | 138 | $icons[$pack] = []; |
| 139 | 139 | } |
| 140 | 140 | $icons[$pack][] = $icon; |