@@ -41,7 +41,7 @@ |
||
41 | 41 | public function getLanguageStrings() { |
42 | 42 | $translations = array( |
43 | 43 | // js/app/controllers/bookmarklet.js |
44 | - 'generating.sharing.keys' => $this->trans->t('Generating sharing keys ( %s / 2)','%step'), |
|
44 | + 'generating.sharing.keys' => $this->trans->t('Generating sharing keys ( %s / 2)', '%step'), |
|
45 | 45 | 'invalid.vault.key' => $this->trans->t('Incorrect vault password!'), |
46 | 46 | 'password.do.not.match' => $this->trans->t('Passwords do not match'), |
47 | 47 | 'general' => $this->trans->t('General'), |
@@ -140,8 +140,8 @@ discard block |
||
140 | 140 | 'password.r' => $this->trans->t('Repeat password'), |
141 | 141 | 'add.tag' => $this->trans->t('Add tag'), |
142 | 142 | 'pick.icon' => $this->trans->t('Pick an icon'), |
143 | - 'pick.icon.search' => $this->trans->t('Search icons'), |
|
144 | - 'pick.icon.custom.label' => $this->trans->t('Upload a custom icon:'), |
|
143 | + 'pick.icon.search' => $this->trans->t('Search icons'), |
|
144 | + 'pick.icon.custom.label' => $this->trans->t('Upload a custom icon:'), |
|
145 | 145 | 'use.icon' => $this->trans->t('Use this icon'), |
146 | 146 | 'use.icon.delete' => $this->trans->t('Delete current icon'), |
147 | 147 | 'use.icon.refresh' => $this->trans->t('Get icon from page'), |
@@ -351,15 +351,15 @@ discard block |
||
351 | 351 | 'decline' => $this->trans->t('Decline'), |
352 | 352 | 'session.time.left' => $this->trans->t('You have {{session_time}} left before logout.'), |
353 | 353 | 'vault.locked' => $this->trans->t('Your vault has been locked for {{time}} because of {{tries}} failed attempts!'), |
354 | - 'vault.hint.hello' => $this->trans->t('Hello there!'), |
|
355 | - 'vault.hint.hello.add' => $this->trans->t('It does not seem that you have any passwords. Do you want to add one?'), |
|
356 | - 'vault.hint.list.nogood' => $this->trans->t('You don\'t have good credentials'), |
|
357 | - 'vault.hint.list.nomedium' => $this->trans->t('You don\'t have medium credentials'), |
|
358 | - 'vault.hint.list.nobad' => $this->trans->t('You don\'t have bad credentials'), |
|
359 | - 'vault.hint.list.noexpired' => $this->trans->t('You don\'t have expired credentials'), |
|
360 | - 'vault.hint.list.nodeleted' => $this->trans->t('You don\'t have deleted credentials'), |
|
361 | - 'vault.hint.list.notags' => $this->trans->t('There are no credentials with your selected tags'), |
|
362 | - 'vault.hint.list.nosearch' => $this->trans->t('There are no credentials matching'), |
|
354 | + 'vault.hint.hello' => $this->trans->t('Hello there!'), |
|
355 | + 'vault.hint.hello.add' => $this->trans->t('It does not seem that you have any passwords. Do you want to add one?'), |
|
356 | + 'vault.hint.list.nogood' => $this->trans->t('You don\'t have good credentials'), |
|
357 | + 'vault.hint.list.nomedium' => $this->trans->t('You don\'t have medium credentials'), |
|
358 | + 'vault.hint.list.nobad' => $this->trans->t('You don\'t have bad credentials'), |
|
359 | + 'vault.hint.list.noexpired' => $this->trans->t('You don\'t have expired credentials'), |
|
360 | + 'vault.hint.list.nodeleted' => $this->trans->t('You don\'t have deleted credentials'), |
|
361 | + 'vault.hint.list.notags' => $this->trans->t('There are no credentials with your selected tags'), |
|
362 | + 'vault.hint.list.nosearch' => $this->trans->t('There are no credentials matching'), |
|
363 | 363 | |
364 | 364 | |
365 | 365 | // templates/views/vaults.html |
@@ -405,15 +405,15 @@ discard block |
||
405 | 405 | 'deleted.credentials' => $this->trans->t('Deleted credentials'), |
406 | 406 | 'logout' => $this->trans->t('Logout'), |
407 | 407 | 'donate' => $this->trans->t('Donate'), |
408 | - 'navigation.show.all' => $this->trans->t('Show All'), |
|
409 | - 'navigation.tags' => $this->trans->t('Tags'), |
|
410 | - 'navigation.tags.search' => $this->trans->t('Search Tags'), |
|
411 | - 'navigation.strength.good' => $this->trans->t('Good Strength'), |
|
412 | - 'navigation.strength.medium' => $this->trans->t('Medium Strength'), |
|
413 | - 'navigation.strength.bad' => $this->trans->t('Bad Strength'), |
|
414 | - 'navigation.expired' => $this->trans->t('Expired'), |
|
415 | - 'navigation.advanced.filter' => $this->trans->t('Filter Tags'), |
|
416 | - 'navigation.advanced.checkbox' => $this->trans->t('Simple Navigation'), |
|
408 | + 'navigation.show.all' => $this->trans->t('Show All'), |
|
409 | + 'navigation.tags' => $this->trans->t('Tags'), |
|
410 | + 'navigation.tags.search' => $this->trans->t('Search Tags'), |
|
411 | + 'navigation.strength.good' => $this->trans->t('Good Strength'), |
|
412 | + 'navigation.strength.medium' => $this->trans->t('Medium Strength'), |
|
413 | + 'navigation.strength.bad' => $this->trans->t('Bad Strength'), |
|
414 | + 'navigation.expired' => $this->trans->t('Expired'), |
|
415 | + 'navigation.advanced.filter' => $this->trans->t('Filter Tags'), |
|
416 | + 'navigation.advanced.checkbox' => $this->trans->t('Simple Navigation'), |
|
417 | 417 | |
418 | 418 | |
419 | 419 | // templates/public_share.php |
@@ -27,12 +27,12 @@ |
||
27 | 27 | private $appManager; |
28 | 28 | |
29 | 29 | public function __construct($AppName, |
30 | - IRequest $request, |
|
31 | - $UserId, |
|
32 | - CredentialService $credentialService, |
|
33 | - IConfig $config, |
|
34 | - IManager $IManager, |
|
35 | - IAppManager $appManager |
|
30 | + IRequest $request, |
|
31 | + $UserId, |
|
32 | + CredentialService $credentialService, |
|
33 | + IConfig $config, |
|
34 | + IManager $IManager, |
|
35 | + IAppManager $appManager |
|
36 | 36 | ) { |
37 | 37 | parent::__construct( |
38 | 38 | $AppName, |
@@ -60,7 +60,7 @@ |
||
60 | 60 | private $fileService; |
61 | 61 | |
62 | 62 | public function __construct(EncryptService $encryptService, IDBConnection $db, LoggerInterface $logger, CredentialService $credentialService, CredentialRevisionService $revisionService, |
63 | - FileService $fileService, IConfig $config) { |
|
63 | + FileService $fileService, IConfig $config) { |
|
64 | 64 | $this->encryptService = $encryptService; |
65 | 65 | $this->db = $db; |
66 | 66 | $this->logger = $logger; |
@@ -101,7 +101,9 @@ discard block |
||
101 | 101 | * @return Entity |
102 | 102 | */ |
103 | 103 | public function createACLEntry(SharingACL $acl) { |
104 | - if ($acl->getCreated() === null) $acl->setCreated((new \DateTime())->getTimestamp()); |
|
104 | + if ($acl->getCreated() === null) { |
|
105 | + $acl->setCreated((new \DateTime())->getTimestamp()); |
|
106 | + } |
|
105 | 107 | return $this->sharingACL->createACLEntry($acl); |
106 | 108 | } |
107 | 109 | |
@@ -159,13 +161,17 @@ discard block |
||
159 | 161 | $return = []; |
160 | 162 | foreach ($entries as $entry) { |
161 | 163 | // Check if the user can read the credential, probably unnecesary, but just to be sure |
162 | - if (!$entry->hasPermission(SharingACL::READ)) continue; |
|
164 | + if (!$entry->hasPermission(SharingACL::READ)) { |
|
165 | + continue; |
|
166 | + } |
|
163 | 167 | $tmp = $entry->jsonSerialize(); |
164 | 168 | $credential = $this->credential->getCredentialById($entry->getItemId()); |
165 | 169 | $credential = $this->encryptService->decryptCredential($credential); |
166 | 170 | $tmp['credential_data'] = $credential->jsonSerialize(); |
167 | 171 | |
168 | - if (!$entry->hasPermission(SharingACL::FILES)) unset($tmp['credential_data']['files']); |
|
172 | + if (!$entry->hasPermission(SharingACL::FILES)) { |
|
173 | + unset($tmp['credential_data']['files']); |
|
174 | + } |
|
169 | 175 | unset($tmp['credential_data']['shared_key']); |
170 | 176 | $return[] = $tmp; |
171 | 177 | } |
@@ -194,7 +200,9 @@ discard block |
||
194 | 200 | $acl = $this->sharingACL->getItemACL($user_id, $item_guid); |
195 | 201 | |
196 | 202 | // Check if the user can read the credential, probably unnecesary, but just to be sure |
197 | - if (!$acl->hasPermission(SharingACL::READ)) throw new DoesNotExistException("Item not found or wrong access level"); |
|
203 | + if (!$acl->hasPermission(SharingACL::READ)) { |
|
204 | + throw new DoesNotExistException("Item not found or wrong access level"); |
|
205 | + } |
|
198 | 206 | |
199 | 207 | $tmp = $acl->jsonSerialize(); |
200 | 208 | $credential = $this->credential->getCredentialById($acl->getItemId()); |
@@ -202,7 +210,9 @@ discard block |
||
202 | 210 | |
203 | 211 | $tmp['credential_data'] = $credential->jsonSerialize(); |
204 | 212 | |
205 | - if (!$acl->hasPermission(SharingACL::FILES)) unset($tmp['credential_data']['files']); |
|
213 | + if (!$acl->hasPermission(SharingACL::FILES)) { |
|
214 | + unset($tmp['credential_data']['files']); |
|
215 | + } |
|
206 | 216 | unset($tmp['credential_data']['shared_key']); |
207 | 217 | |
208 | 218 | return $tmp; |
@@ -217,7 +227,9 @@ discard block |
||
217 | 227 | */ |
218 | 228 | public function getItemHistory(string $user_id, string $item_guid) { |
219 | 229 | $acl = $this->sharingACL->getItemACL($user_id, $item_guid); |
220 | - if (!$acl->hasPermission(SharingACL::READ | SharingACL::HISTORY)) return []; |
|
230 | + if (!$acl->hasPermission(SharingACL::READ | SharingACL::HISTORY)) { |
|
231 | + return []; |
|
232 | + } |
|
221 | 233 | |
222 | 234 | return $this->revisions->getRevisions($acl->getItemId()); |
223 | 235 | } |
@@ -80,7 +80,7 @@ |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | if ($data !== false) { |
83 | - $version = (string)$data->version; |
|
83 | + $version = (string) $data->version; |
|
84 | 84 | } else { |
85 | 85 | libxml_clear_errors(); |
86 | 86 | } |
@@ -267,7 +267,7 @@ |
||
267 | 267 | 'apps' => array(self::FILTER_PASSMAN => |
268 | 268 | array( |
269 | 269 | 'id' => 'passman', |
270 | - 'name' => (string)$l->t('Passwords'), |
|
270 | + 'name' => (string) $l->t('Passwords'), |
|
271 | 271 | 'url' => $this->URLGenerator->linkToRoute('activity.Activities.showList', ['filter' => self::FILTER_PASSMAN]), |
272 | 272 | ), |
273 | 273 | ), |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | // Deal with known subjects |
53 | 53 | case 'credential_expired': |
54 | 54 | $notification->setParsedSubject( |
55 | - (string)$l->t('Your credential "%s" expired, click here to update the credential.', $notification->getSubjectParameters()) |
|
55 | + (string) $l->t('Your credential "%s" expired, click here to update the credential.', $notification->getSubjectParameters()) |
|
56 | 56 | ); |
57 | 57 | |
58 | 58 | // Deal with the actions for a known subject |
@@ -60,13 +60,13 @@ discard block |
||
60 | 60 | switch ($action->getLabel()) { |
61 | 61 | case 'remind': |
62 | 62 | $action->setParsedLabel( |
63 | - (string)$l->t('Remind me later') |
|
63 | + (string) $l->t('Remind me later') |
|
64 | 64 | ); |
65 | 65 | break; |
66 | 66 | |
67 | 67 | case 'ignore': |
68 | 68 | $action->setParsedLabel( |
69 | - (string)$l->t('Ignore') |
|
69 | + (string) $l->t('Ignore') |
|
70 | 70 | ); |
71 | 71 | break; |
72 | 72 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | case 'credential_shared': |
80 | 80 | $notification->setParsedSubject( |
81 | - (string)$l->t('%s shared "%s" with you. Click here to accept', $notification->getSubjectParameters()) |
|
81 | + (string) $l->t('%s shared "%s" with you. Click here to accept', $notification->getSubjectParameters()) |
|
82 | 82 | ); |
83 | 83 | |
84 | 84 | // Deal with the actions for a known subject |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | switch ($action->getLabel()) { |
87 | 87 | case 'decline': |
88 | 88 | $action->setParsedLabel( |
89 | - (string)$l->t('Decline') |
|
89 | + (string) $l->t('Decline') |
|
90 | 90 | ); |
91 | 91 | break; |
92 | 92 | } |
@@ -97,13 +97,13 @@ discard block |
||
97 | 97 | |
98 | 98 | case 'credential_share_denied': |
99 | 99 | $notification->setParsedSubject( |
100 | - (string)$l->t('%s has declined your share request for "%s".', $notification->getSubjectParameters()) |
|
100 | + (string) $l->t('%s has declined your share request for "%s".', $notification->getSubjectParameters()) |
|
101 | 101 | ); |
102 | 102 | return $notification; |
103 | 103 | |
104 | 104 | case 'credential_share_accepted': |
105 | 105 | $notification->setParsedSubject( |
106 | - (string)$l->t('%s has accepted your share request for "%s".', $notification->getSubjectParameters()) |
|
106 | + (string) $l->t('%s has accepted your share request for "%s".', $notification->getSubjectParameters()) |
|
107 | 107 | ); |
108 | 108 | return $notification; |
109 | 109 | default: |
@@ -74,18 +74,18 @@ discard block |
||
74 | 74 | |
75 | 75 | $context->registerSearchProvider(Provider::class); |
76 | 76 | |
77 | - $context->registerService(View::class, function () { |
|
77 | + $context->registerService(View::class, function() { |
|
78 | 78 | return new View(''); |
79 | 79 | }, false); |
80 | 80 | |
81 | - $context->registerService('isCLI', function () { |
|
81 | + $context->registerService('isCLI', function() { |
|
82 | 82 | return \OC::$CLI; |
83 | 83 | }); |
84 | 84 | |
85 | 85 | $context->registerMiddleware(ShareMiddleware::class); |
86 | 86 | $context->registerMiddleware(APIMiddleware::class); |
87 | 87 | |
88 | - $context->registerService('ShareController', function (ContainerInterface $c) { |
|
88 | + $context->registerService('ShareController', function(ContainerInterface $c) { |
|
89 | 89 | /** @var IUserManager $userManager */ |
90 | 90 | $userManager = $c->get(IUserManager::class); |
91 | 91 | /** @var IGroupManager $groupManager */ |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | }); |
112 | 112 | |
113 | 113 | |
114 | - $context->registerService('CronService', function (ContainerInterface $c) { |
|
114 | + $context->registerService('CronService', function(ContainerInterface $c) { |
|
115 | 115 | return new CronService( |
116 | 116 | $c->get(CredentialService::class), |
117 | 117 | $c->get(LoggerInterface::class), |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | ); |
123 | 123 | }); |
124 | 124 | |
125 | - $context->registerService('Logger', function (ContainerInterface $c) { |
|
125 | + $context->registerService('Logger', function(ContainerInterface $c) { |
|
126 | 126 | return $c->get(ServerContainer::class)->getLogger(); |
127 | 127 | }); |
128 | 128 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | /** @var INavigationManager $navigationManager */ |
144 | 144 | $navigationManager = $c->get(INavigationManager::class); |
145 | 145 | |
146 | - $navigationEntry = function () use ($c) { |
|
146 | + $navigationEntry = function() use ($c) { |
|
147 | 147 | /** @var IURLGenerator $urlGenerator */ |
148 | 148 | $urlGenerator = $c->get(IURLGenerator::class); |
149 | 149 | return [ |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | use OCP\IUserManager; |
27 | 27 | |
28 | 28 | class Utils { |
29 | - /** |
|
30 | - * Gets the unix epoch UTC timestamp |
|
31 | - * @return int |
|
32 | - */ |
|
29 | + /** |
|
30 | + * Gets the unix epoch UTC timestamp |
|
31 | + * @return int |
|
32 | + */ |
|
33 | 33 | public static function getTime() { |
34 | 34 | return (new \DateTime())->getTimestamp(); |
35 | 35 | } |
@@ -40,10 +40,10 @@ discard block |
||
40 | 40 | return microtime(true); |
41 | 41 | } |
42 | 42 | |
43 | - /** |
|
44 | - * Generates a Globally Unique ID |
|
45 | - * @return string |
|
46 | - */ |
|
43 | + /** |
|
44 | + * Generates a Globally Unique ID |
|
45 | + * @return string |
|
46 | + */ |
|
47 | 47 | public static function GUID() { |
48 | 48 | if (function_exists('com_create_guid') === true) |
49 | 49 | { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @param IUserManager $userManager |
59 | 59 | * @return string |
60 | 60 | */ |
61 | - public static function getNameByUid(string $uid, IUserManager $userManager){ |
|
61 | + public static function getNameByUid(string $uid, IUserManager $userManager) { |
|
62 | 62 | $u = $userManager->get($uid); |
63 | 63 | return $u->getDisplayName(); |
64 | 64 | } |
@@ -68,14 +68,14 @@ discard block |
||
68 | 68 | * @param array $results |
69 | 69 | * @return array|mixed |
70 | 70 | */ |
71 | - public static function getDirContents(string $dir, &$results = array()){ |
|
71 | + public static function getDirContents(string $dir, &$results = array()) { |
|
72 | 72 | $files = scandir($dir); |
73 | 73 | |
74 | - foreach($files as $value){ |
|
75 | - $path = realpath($dir.DIRECTORY_SEPARATOR.$value); |
|
76 | - if(!is_dir($path)) { |
|
74 | + foreach ($files as $value) { |
|
75 | + $path = realpath($dir . DIRECTORY_SEPARATOR . $value); |
|
76 | + if (!is_dir($path)) { |
|
77 | 77 | $results[] = $path; |
78 | - } else if($value != "." && $value != "..") { |
|
78 | + } else if ($value != "." && $value != "..") { |
|
79 | 79 | Utils::getDirContents($path, $results); |
80 | 80 | $results[] = $path; |
81 | 81 | } |
@@ -45,8 +45,7 @@ discard block |
||
45 | 45 | * @return string |
46 | 46 | */ |
47 | 47 | public static function GUID() { |
48 | - if (function_exists('com_create_guid') === true) |
|
49 | - { |
|
48 | + if (function_exists('com_create_guid') === true) { |
|
50 | 49 | return trim(com_create_guid(), '{}'); |
51 | 50 | } |
52 | 51 | |
@@ -58,7 +57,7 @@ discard block |
||
58 | 57 | * @param IUserManager $userManager |
59 | 58 | * @return string |
60 | 59 | */ |
61 | - public static function getNameByUid(string $uid, IUserManager $userManager){ |
|
60 | + public static function getNameByUid(string $uid, IUserManager $userManager) { |
|
62 | 61 | $u = $userManager->get($uid); |
63 | 62 | return $u->getDisplayName(); |
64 | 63 | } |
@@ -68,10 +67,10 @@ discard block |
||
68 | 67 | * @param array $results |
69 | 68 | * @return array|mixed |
70 | 69 | */ |
71 | - public static function getDirContents(string $dir, &$results = array()){ |
|
70 | + public static function getDirContents(string $dir, &$results = array()) { |
|
72 | 71 | $files = scandir($dir); |
73 | 72 | |
74 | - foreach($files as $value){ |
|
73 | + foreach($files as $value) { |
|
75 | 74 | $path = realpath($dir.DIRECTORY_SEPARATOR.$value); |
76 | 75 | if(!is_dir($path)) { |
77 | 76 | $results[] = $path; |