@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $secure = $protocol === 'https'; |
82 | 82 | $federatedSharingEndpoints = $discoveryService->discover($this->cloudId->getRemote(), 'FEDERATED_SHARING'); |
83 | 83 | $webDavEndpoint = isset($federatedSharingEndpoints['webdav']) ? $federatedSharingEndpoints['webdav'] : '/public.php/webdav'; |
84 | - $root = rtrim($root, '/') . $webDavEndpoint; |
|
84 | + $root = rtrim($root, '/').$webDavEndpoint; |
|
85 | 85 | $this->mountPoint = $options['mountpoint']; |
86 | 86 | $this->token = $options['token']; |
87 | 87 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | 'host' => $host, |
91 | 91 | 'root' => $root, |
92 | 92 | 'user' => $options['token'], |
93 | - 'password' => (string)$options['password'] |
|
93 | + 'password' => (string) $options['password'] |
|
94 | 94 | ]); |
95 | 95 | } |
96 | 96 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * @return string |
131 | 131 | */ |
132 | 132 | public function getId() { |
133 | - return 'shared::' . md5($this->token . '@' . $this->getRemote()); |
|
133 | + return 'shared::'.md5($this->token.'@'.$this->getRemote()); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | public function getCache($path = '', $storage = null) { |
@@ -251,9 +251,9 @@ discard block |
||
251 | 251 | */ |
252 | 252 | protected function testRemote() { |
253 | 253 | try { |
254 | - return $this->testRemoteUrl($this->getRemote() . '/ocs-provider/index.php') |
|
255 | - || $this->testRemoteUrl($this->getRemote() . '/ocs-provider/') |
|
256 | - || $this->testRemoteUrl($this->getRemote() . '/status.php'); |
|
254 | + return $this->testRemoteUrl($this->getRemote().'/ocs-provider/index.php') |
|
255 | + || $this->testRemoteUrl($this->getRemote().'/ocs-provider/') |
|
256 | + || $this->testRemoteUrl($this->getRemote().'/status.php'); |
|
257 | 257 | } catch (\Exception $e) { |
258 | 258 | return false; |
259 | 259 | } |
@@ -265,8 +265,8 @@ discard block |
||
265 | 265 | */ |
266 | 266 | private function testRemoteUrl($url) { |
267 | 267 | $cache = $this->memcacheFactory->createDistributed('files_sharing_remote_url'); |
268 | - if($cache->hasKey($url)) { |
|
269 | - return (bool)$cache->get($url); |
|
268 | + if ($cache->hasKey($url)) { |
|
269 | + return (bool) $cache->get($url); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | $client = $this->httpClient->newClient(); |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $returnValue = false; |
286 | 286 | } |
287 | 287 | |
288 | - $cache->set($url, $returnValue, 60*60*24); |
|
288 | + $cache->set($url, $returnValue, 60 * 60 * 24); |
|
289 | 289 | return $returnValue; |
290 | 290 | } |
291 | 291 | |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | * @return bool |
297 | 297 | */ |
298 | 298 | public function remoteIsOwnCloud() { |
299 | - if(defined('PHPUNIT_RUN') || !$this->testRemoteUrl($this->getRemote() . '/status.php')) { |
|
299 | + if (defined('PHPUNIT_RUN') || !$this->testRemoteUrl($this->getRemote().'/status.php')) { |
|
300 | 300 | return false; |
301 | 301 | } |
302 | 302 | return true; |
@@ -314,11 +314,11 @@ discard block |
||
314 | 314 | $password = $this->getPassword(); |
315 | 315 | |
316 | 316 | // If remote is not an ownCloud do not try to get any share info |
317 | - if(!$this->remoteIsOwnCloud()) { |
|
317 | + if (!$this->remoteIsOwnCloud()) { |
|
318 | 318 | return ['status' => 'unsupported']; |
319 | 319 | } |
320 | 320 | |
321 | - $url = rtrim($remote, '/') . '/index.php/apps/files_sharing/shareinfo?t=' . $token; |
|
321 | + $url = rtrim($remote, '/').'/index.php/apps/files_sharing/shareinfo?t='.$token; |
|
322 | 322 | |
323 | 323 | // TODO: DI |
324 | 324 | $client = \OC::$server->getHTTPClientService()->newClient(); |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | try { |
387 | 387 | $ocmPermissions = json_decode($ocmPermissions); |
388 | 388 | $ncPermissions = 0; |
389 | - foreach($ocmPermissions as $permission) { |
|
389 | + foreach ($ocmPermissions as $permission) { |
|
390 | 390 | switch (strtolower($permission)) { |
391 | 391 | case 'read': |
392 | 392 | $ncPermissions += Constants::PERMISSION_READ; |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * @return string |
184 | 184 | */ |
185 | 185 | public function getId() { |
186 | - return 'shared::' . $this->getMountPoint(); |
|
186 | + return 'shared::'.$this->getMountPoint(); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | /** |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | } |
287 | 287 | } |
288 | 288 | $info = [ |
289 | - 'target' => $this->getMountPoint() . $path, |
|
289 | + 'target' => $this->getMountPoint().$path, |
|
290 | 290 | 'source' => $source, |
291 | 291 | 'mode' => $mode, |
292 | 292 | ]; |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | if (!$storage) { |
380 | 380 | $storage = $this; |
381 | 381 | } |
382 | - $sourceRoot = $this->getSourceRootInfo(); |
|
382 | + $sourceRoot = $this->getSourceRootInfo(); |
|
383 | 383 | if ($this->storage instanceof FailedStorage) { |
384 | 384 | return new FailedCache(); |
385 | 385 | } |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | |
486 | 486 | public function file_get_contents($path) { |
487 | 487 | $info = [ |
488 | - 'target' => $this->getMountPoint() . '/' . $path, |
|
488 | + 'target' => $this->getMountPoint().'/'.$path, |
|
489 | 489 | 'source' => $this->getUnjailedPath($path), |
490 | 490 | ]; |
491 | 491 | \OCP\Util::emitHook('\OC\Files\Storage\Shared', 'file_get_contents', $info); |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | |
495 | 495 | public function file_put_contents($path, $data) { |
496 | 496 | $info = [ |
497 | - 'target' => $this->getMountPoint() . '/' . $path, |
|
497 | + 'target' => $this->getMountPoint().'/'.$path, |
|
498 | 498 | 'source' => $this->getUnjailedPath($path), |
499 | 499 | ]; |
500 | 500 | \OCP\Util::emitHook('\OC\Files\Storage\Shared', 'file_put_contents', $info); |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | |
222 | 222 | protected function authSucceeded() { |
223 | 223 | // For share this was always set so it is still used in other apps |
224 | - $this->session->set('public_link_authenticated', (string)$this->share->getId()); |
|
224 | + $this->session->set('public_link_authenticated', (string) $this->share->getId()); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | protected function authFailed() { |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | $itemType = $itemSource = $uidOwner = ''; |
243 | 243 | $token = $share; |
244 | 244 | $exception = null; |
245 | - if($share instanceof \OCP\Share\IShare) { |
|
245 | + if ($share instanceof \OCP\Share\IShare) { |
|
246 | 246 | try { |
247 | 247 | $token = $share->getToken(); |
248 | 248 | $uidOwner = $share->getSharedBy(); |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | 'errorCode' => $errorCode, |
262 | 262 | 'errorMessage' => $errorMessage, |
263 | 263 | ]); |
264 | - if(!is_null($exception)) { |
|
264 | + if (!is_null($exception)) { |
|
265 | 265 | throw $exception; |
266 | 266 | } |
267 | 267 | } |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | $shareTmpl['previewURL'] = $shareTmpl['downloadURL']; |
407 | 407 | |
408 | 408 | if ($shareTmpl['previewSupported']) { |
409 | - $shareTmpl['previewImage'] = $this->urlGenerator->linkToRouteAbsolute( 'files_sharing.PublicPreview.getPreview', |
|
409 | + $shareTmpl['previewImage'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.PublicPreview.getPreview', |
|
410 | 410 | ['x' => 200, 'y' => 200, 'file' => $shareTmpl['directory_path'], 'token' => $shareTmpl['dirToken']]); |
411 | 411 | $ogPreview = $shareTmpl['previewImage']; |
412 | 412 | |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | |
465 | 465 | // OpenGraph Support: http://ogp.me/ |
466 | 466 | \OCP\Util::addHeader('meta', ['property' => "og:title", 'content' => $shareTmpl['filename']]); |
467 | - \OCP\Util::addHeader('meta', ['property' => "og:description", 'content' => $this->defaults->getName() . ($this->defaults->getSlogan() !== '' ? ' - ' . $this->defaults->getSlogan() : '')]); |
|
467 | + \OCP\Util::addHeader('meta', ['property' => "og:description", 'content' => $this->defaults->getName().($this->defaults->getSlogan() !== '' ? ' - '.$this->defaults->getSlogan() : '')]); |
|
468 | 468 | \OCP\Util::addHeader('meta', ['property' => "og:site_name", 'content' => $this->defaults->getName()]); |
469 | 469 | \OCP\Util::addHeader('meta', ['property' => "og:url", 'content' => $shareTmpl['shareUrl']]); |
470 | 470 | \OCP\Util::addHeader('meta', ['property' => "og:type", 'content' => "object"]); |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | |
533 | 533 | $share = $this->shareManager->getShareByToken($token); |
534 | 534 | |
535 | - if(!($share->getPermissions() & \OCP\Constants::PERMISSION_READ)) { |
|
535 | + if (!($share->getPermissions() & \OCP\Constants::PERMISSION_READ)) { |
|
536 | 536 | return new \OCP\AppFramework\Http\DataResponse('Share is read-only'); |
537 | 537 | } |
538 | 538 | |
@@ -615,7 +615,7 @@ discard block |
||
615 | 615 | |
616 | 616 | $this->emitAccessShareHook($share); |
617 | 617 | |
618 | - $server_params = [ 'head' => $this->request->getMethod() === 'HEAD' ]; |
|
618 | + $server_params = ['head' => $this->request->getMethod() === 'HEAD']; |
|
619 | 619 | |
620 | 620 | /** |
621 | 621 | * Http range requests support |
@@ -35,16 +35,16 @@ discard block |
||
35 | 35 | |
36 | 36 | $l = \OC::$server->getL10N('user_ldap'); |
37 | 37 | |
38 | -if(!isset($_POST['action'])) { |
|
38 | +if (!isset($_POST['action'])) { |
|
39 | 39 | \OC_JSON::error(['message' => $l->t('No action specified')]); |
40 | 40 | } |
41 | -$action = (string)$_POST['action']; |
|
41 | +$action = (string) $_POST['action']; |
|
42 | 42 | |
43 | 43 | |
44 | -if(!isset($_POST['ldap_serverconfig_chooser'])) { |
|
44 | +if (!isset($_POST['ldap_serverconfig_chooser'])) { |
|
45 | 45 | \OC_JSON::error(['message' => $l->t('No configuration specified')]); |
46 | 46 | } |
47 | -$prefix = (string)$_POST['ldap_serverconfig_chooser']; |
|
47 | +$prefix = (string) $_POST['ldap_serverconfig_chooser']; |
|
48 | 48 | |
49 | 49 | $ldapWrapper = new \OCA\User_LDAP\LDAP(); |
50 | 50 | $configuration = new \OCA\User_LDAP\Configuration($prefix); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | $wizard = new \OCA\User_LDAP\Wizard($configuration, $ldapWrapper, $access); |
77 | 77 | |
78 | -switch($action) { |
|
78 | +switch ($action) { |
|
79 | 79 | case 'guessPortAndTLS': |
80 | 80 | case 'guessBaseDN': |
81 | 81 | case 'detectEmailAttribute': |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | case 'countInBaseDN': |
95 | 95 | try { |
96 | 96 | $result = $wizard->$action(); |
97 | - if($result !== false) { |
|
97 | + if ($result !== false) { |
|
98 | 98 | \OC_JSON::success($result->getResultArray()); |
99 | 99 | exit; |
100 | 100 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | try { |
111 | 111 | $loginName = $_POST['ldap_test_loginname']; |
112 | 112 | $result = $wizard->$action($loginName); |
113 | - if($result !== false) { |
|
113 | + if ($result !== false) { |
|
114 | 114 | \OC_JSON::success($result->getResultArray()); |
115 | 115 | exit; |
116 | 116 | } |
@@ -126,14 +126,14 @@ discard block |
||
126 | 126 | case 'save': |
127 | 127 | $key = isset($_POST['cfgkey']) ? $_POST['cfgkey'] : false; |
128 | 128 | $val = isset($_POST['cfgval']) ? $_POST['cfgval'] : null; |
129 | - if($key === false || is_null($val)) { |
|
129 | + if ($key === false || is_null($val)) { |
|
130 | 130 | \OC_JSON::error(['message' => $l->t('No data specified')]); |
131 | 131 | exit; |
132 | 132 | } |
133 | 133 | $cfg = [$key => $val]; |
134 | 134 | $setParameters = []; |
135 | 135 | $configuration->setConfiguration($cfg, $setParameters); |
136 | - if(!in_array($key, $setParameters)) { |
|
136 | + if (!in_array($key, $setParameters)) { |
|
137 | 137 | \OC_JSON::error(['message' => $l->t($key. |
138 | 138 | ' Could not set configuration %s', $setParameters[0])]); |
139 | 139 | exit; |
@@ -68,7 +68,7 @@ |
||
68 | 68 | try { |
69 | 69 | $ldapWrapper->read($connection->getConnectionResource(), '', 'objectClass=*', ['dn']); |
70 | 70 | } catch (\Exception $e) { |
71 | - if($e->getCode() === 1) { |
|
71 | + if ($e->getCode() === 1) { |
|
72 | 72 | \OC_JSON::error(['message' => $l->t('Invalid configuration: Anonymous binding is not allowed.')]); |
73 | 73 | exit; |
74 | 74 | } |
@@ -30,15 +30,15 @@ |
||
30 | 30 | \OC_JSON::checkAppEnabled('user_ldap'); |
31 | 31 | \OC_JSON::callCheck(); |
32 | 32 | |
33 | -$prefix = (string)$_POST['ldap_serverconfig_chooser']; |
|
33 | +$prefix = (string) $_POST['ldap_serverconfig_chooser']; |
|
34 | 34 | |
35 | 35 | // Checkboxes are not submitted, when they are unchecked. Set them manually. |
36 | 36 | // only legacy checkboxes (Advanced and Expert tab) need to be handled here, |
37 | 37 | // the Wizard-like tabs handle it on their own |
38 | 38 | $chkboxes = ['ldap_configuration_active', 'ldap_override_main_server', |
39 | 39 | 'ldap_turn_off_cert_check']; |
40 | -foreach($chkboxes as $boxid) { |
|
41 | - if(!isset($_POST[$boxid])) { |
|
40 | +foreach ($chkboxes as $boxid) { |
|
41 | + if (!isset($_POST[$boxid])) { |
|
42 | 42 | $_POST[$boxid] = 0; |
43 | 43 | } |
44 | 44 | } |
@@ -32,13 +32,13 @@ |
||
32 | 32 | $serverConnections = $helper->getServerConfigurationPrefixes(); |
33 | 33 | sort($serverConnections); |
34 | 34 | $lk = array_pop($serverConnections); |
35 | -$ln = (int)str_replace('s', '', $lk); |
|
36 | -$nk = 's'.str_pad($ln+1, 2, '0', STR_PAD_LEFT); |
|
35 | +$ln = (int) str_replace('s', '', $lk); |
|
36 | +$nk = 's'.str_pad($ln + 1, 2, '0', STR_PAD_LEFT); |
|
37 | 37 | |
38 | 38 | $resultData = ['configPrefix' => $nk]; |
39 | 39 | |
40 | 40 | $newConfig = new \OCA\User_LDAP\Configuration($nk, false); |
41 | -if(isset($_POST['copyConfig'])) { |
|
41 | +if (isset($_POST['copyConfig'])) { |
|
42 | 42 | $originalConfig = new \OCA\User_LDAP\Configuration($_POST['copyConfig']); |
43 | 43 | $newConfig->setConfiguration($originalConfig->getConfiguration()); |
44 | 44 | } else { |
@@ -4,23 +4,23 @@ discard block |
||
4 | 4 | <?php |
5 | 5 | $i = 1; |
6 | 6 | $sel = ' selected'; |
7 | - foreach($_['serverConfigurationPrefixes'] as $prefix) { |
|
7 | + foreach ($_['serverConfigurationPrefixes'] as $prefix) { |
|
8 | 8 | ?> |
9 | - <option value="<?php p($prefix); ?>"<?php p($sel); $sel = ''; ?>><?php p($l->t('%s. Server:', [$i++]));?> <?php p(' '.$_['serverConfigurationHosts'][$prefix]); ?></option> |
|
9 | + <option value="<?php p($prefix); ?>"<?php p($sel); $sel = ''; ?>><?php p($l->t('%s. Server:', [$i++])); ?> <?php p(' '.$_['serverConfigurationHosts'][$prefix]); ?></option> |
|
10 | 10 | <?php |
11 | 11 | } |
12 | 12 | ?> |
13 | 13 | </select> |
14 | 14 | <button type="button" id="ldap_action_add_configuration" |
15 | 15 | name="ldap_action_add_configuration" class="icon-add icon-default-style" |
16 | - title="<?php p($l->t('Add a new configuration'));?>"> </button> |
|
16 | + title="<?php p($l->t('Add a new configuration')); ?>"> </button> |
|
17 | 17 | <button type="button" id="ldap_action_copy_configuration" |
18 | 18 | name="ldap_action_copy_configuration" |
19 | 19 | class="ldapIconCopy icon-default-style" |
20 | - title="<?php p($l->t('Copy current configuration into new directory binding'));?>"> </button> |
|
20 | + title="<?php p($l->t('Copy current configuration into new directory binding')); ?>"> </button> |
|
21 | 21 | <button type="button" id="ldap_action_delete_configuration" |
22 | 22 | name="ldap_action_delete_configuration" class="icon-delete icon-default-style" |
23 | - title="<?php p($l->t('Delete the current configuration'));?>"> </button> |
|
23 | + title="<?php p($l->t('Delete the current configuration')); ?>"> </button> |
|
24 | 24 | </p> |
25 | 25 | |
26 | 26 | <div class="hostPortCombinator"> |
@@ -29,14 +29,14 @@ discard block |
||
29 | 29 | <div class="table"> |
30 | 30 | <input type="text" class="host" id="ldap_host" |
31 | 31 | name="ldap_host" |
32 | - placeholder="<?php p($l->t('Host'));?>" |
|
33 | - title="<?php p($l->t('You can omit the protocol, unless you require SSL. If so, start with ldaps://'));?>" |
|
32 | + placeholder="<?php p($l->t('Host')); ?>" |
|
33 | + title="<?php p($l->t('You can omit the protocol, unless you require SSL. If so, start with ldaps://')); ?>" |
|
34 | 34 | /> |
35 | 35 | <span class="hostPortCombinatorSpan"> |
36 | 36 | <input type="number" id="ldap_port" name="ldap_port" |
37 | - placeholder="<?php p($l->t('Port'));?>" /> |
|
37 | + placeholder="<?php p($l->t('Port')); ?>" /> |
|
38 | 38 | <button class="ldapDetectPort" name="ldapDetectPort" type="button"> |
39 | - <?php p($l->t('Detect Port'));?> |
|
39 | + <?php p($l->t('Detect Port')); ?> |
|
40 | 40 | </button> |
41 | 41 | </span> |
42 | 42 | </div> |
@@ -46,19 +46,19 @@ discard block |
||
46 | 46 | <div class="tablerow"> |
47 | 47 | <input type="text" id="ldap_dn" name="ldap_dn" |
48 | 48 | class="tablecell" |
49 | - placeholder="<?php p($l->t('User DN'));?>" autocomplete="off" |
|
50 | - title="<?php p($l->t('The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty.'));?>" |
|
49 | + placeholder="<?php p($l->t('User DN')); ?>" autocomplete="off" |
|
50 | + title="<?php p($l->t('The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty.')); ?>" |
|
51 | 51 | /> |
52 | 52 | </div> |
53 | 53 | |
54 | 54 | <div class="tablerow"> |
55 | 55 | <input type="password" id="ldap_agent_password" |
56 | 56 | class="tablecell" name="ldap_agent_password" |
57 | - placeholder="<?php p($l->t('Password'));?>" autocomplete="off" |
|
58 | - title="<?php p($l->t('For anonymous access, leave DN and Password empty.'));?>" |
|
57 | + placeholder="<?php p($l->t('Password')); ?>" autocomplete="off" |
|
58 | + title="<?php p($l->t('For anonymous access, leave DN and Password empty.')); ?>" |
|
59 | 59 | /> |
60 | 60 | <button class="ldapSaveAgentCredentials" name="ldapSaveAgentCredentials" type="button"> |
61 | - <?php p($l->t('Save Credentials'));?> |
|
61 | + <?php p($l->t('Save Credentials')); ?> |
|
62 | 62 | </button> |
63 | 63 | </div> |
64 | 64 | <div class="tablerow"> </div> |
@@ -66,24 +66,24 @@ discard block |
||
66 | 66 | <div class="tablerow"> |
67 | 67 | <textarea id="ldap_base" name="ldap_base" |
68 | 68 | class="tablecell" |
69 | - placeholder="<?php p($l->t('One Base DN per line'));?>" |
|
70 | - title="<?php p($l->t('You can specify Base DN for users and groups in the Advanced tab'));?>"> |
|
69 | + placeholder="<?php p($l->t('One Base DN per line')); ?>" |
|
70 | + title="<?php p($l->t('You can specify Base DN for users and groups in the Advanced tab')); ?>"> |
|
71 | 71 | </textarea> |
72 | 72 | <button class="ldapDetectBase" name="ldapDetectBase" type="button"> |
73 | - <?php p($l->t('Detect Base DN'));?> |
|
73 | + <?php p($l->t('Detect Base DN')); ?> |
|
74 | 74 | </button> |
75 | 75 | <button class="ldapTestBase" name="ldapTestBase" type="button"> |
76 | - <?php p($l->t('Test Base DN'));?> |
|
76 | + <?php p($l->t('Test Base DN')); ?> |
|
77 | 77 | </button> |
78 | 78 | </div> |
79 | 79 | |
80 | 80 | <div class="tablerow left"> |
81 | 81 | <input type="checkbox" id="ldap_experienced_admin" value="1" |
82 | 82 | name="ldap_experienced_admin" class="tablecell" |
83 | - title="<?php p($l->t('Avoids automatic LDAP requests. Better for bigger setups, but requires some LDAP knowledge.'));?>" |
|
83 | + title="<?php p($l->t('Avoids automatic LDAP requests. Better for bigger setups, but requires some LDAP knowledge.')); ?>" |
|
84 | 84 | /> |
85 | 85 | <label for="ldap_experienced_admin" class="tablecell"> |
86 | - <?php p($l->t('Manually enter LDAP filters (recommended for large directories)'));?> |
|
86 | + <?php p($l->t('Manually enter LDAP filters (recommended for large directories)')); ?> |
|
87 | 87 | </label> |
88 | 88 | </div> |
89 | 89 |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function __construct($serverConfigPrefixes, ILDAPWrapper $ldap, GroupPluginManager $groupPluginManager) { |
41 | 41 | parent::__construct($ldap); |
42 | - foreach($serverConfigPrefixes as $configPrefix) { |
|
42 | + foreach ($serverConfigPrefixes as $configPrefix) { |
|
43 | 43 | $this->backends[$configPrefix] = |
44 | 44 | new \OCA\User_LDAP\Group_LDAP($this->getAccess($configPrefix), $groupPluginManager); |
45 | - if(is_null($this->refBackend)) { |
|
45 | + if (is_null($this->refBackend)) { |
|
46 | 46 | $this->refBackend = &$this->backends[$configPrefix]; |
47 | 47 | } |
48 | 48 | } |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | */ |
58 | 58 | protected function walkBackends($gid, $method, $parameters) { |
59 | 59 | $cacheKey = $this->getGroupCacheKey($gid); |
60 | - foreach($this->backends as $configPrefix => $backend) { |
|
61 | - if($result = call_user_func_array([$backend, $method], $parameters)) { |
|
60 | + foreach ($this->backends as $configPrefix => $backend) { |
|
61 | + if ($result = call_user_func_array([$backend, $method], $parameters)) { |
|
62 | 62 | $this->writeToCache($cacheKey, $configPrefix); |
63 | 63 | return $result; |
64 | 64 | } |
@@ -78,17 +78,17 @@ discard block |
||
78 | 78 | $cacheKey = $this->getGroupCacheKey($gid); |
79 | 79 | $prefix = $this->getFromCache($cacheKey); |
80 | 80 | //in case the uid has been found in the past, try this stored connection first |
81 | - if(!is_null($prefix)) { |
|
82 | - if(isset($this->backends[$prefix])) { |
|
81 | + if (!is_null($prefix)) { |
|
82 | + if (isset($this->backends[$prefix])) { |
|
83 | 83 | $result = call_user_func_array([$this->backends[$prefix], $method], $parameters); |
84 | - if($result === $passOnWhen) { |
|
84 | + if ($result === $passOnWhen) { |
|
85 | 85 | //not found here, reset cache to null if group vanished |
86 | 86 | //because sometimes methods return false with a reason |
87 | 87 | $groupExists = call_user_func_array( |
88 | 88 | [$this->backends[$prefix], 'groupExists'], |
89 | 89 | [$gid] |
90 | 90 | ); |
91 | - if(!$groupExists) { |
|
91 | + if (!$groupExists) { |
|
92 | 92 | $this->writeToCache($cacheKey, null); |
93 | 93 | } |
94 | 94 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | public function getUserGroups($uid) { |
122 | 122 | $groups = []; |
123 | 123 | |
124 | - foreach($this->backends as $backend) { |
|
124 | + foreach ($this->backends as $backend) { |
|
125 | 125 | $backendGroups = $backend->getUserGroups($uid); |
126 | 126 | if (is_array($backendGroups)) { |
127 | 127 | $groups = array_merge($groups, $backendGroups); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { |
139 | 139 | $users = []; |
140 | 140 | |
141 | - foreach($this->backends as $backend) { |
|
141 | + foreach ($this->backends as $backend) { |
|
142 | 142 | $backendUsers = $backend->usersInGroup($gid, $search, $limit, $offset); |
143 | 143 | if (is_array($backendUsers)) { |
144 | 144 | $users = array_merge($users, $backendUsers); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | public function getGroups($search = '', $limit = -1, $offset = 0) { |
224 | 224 | $groups = []; |
225 | 225 | |
226 | - foreach($this->backends as $backend) { |
|
226 | + foreach ($this->backends as $backend) { |
|
227 | 227 | $backendGroups = $backend->getGroups($search, $limit, $offset); |
228 | 228 | if (is_array($backendGroups)) { |
229 | 229 | $groups = array_merge($groups, $backendGroups); |