@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | header('X-Accel-Buffering: no'); |
61 | 61 | $this->fallback = isset($_GET['fallback']) and $_GET['fallback'] == 'true'; |
62 | 62 | if ($this->fallback) { |
63 | - $this->fallBackId = (int)$_GET['fallback_id']; |
|
63 | + $this->fallBackId = (int) $_GET['fallback_id']; |
|
64 | 64 | /** |
65 | 65 | * FIXME: The default content-security-policy of ownCloud forbids inline |
66 | 66 | * JavaScript for security reasons. IE starting on Windows 10 will |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | header("Content-Security-Policy: default-src 'none'; script-src 'unsafe-inline'"); |
75 | 75 | header("Content-Type: text/html"); |
76 | - echo str_repeat('<span></span>' . PHP_EOL, 10); //dummy data to keep IE happy |
|
76 | + echo str_repeat('<span></span>'.PHP_EOL, 10); //dummy data to keep IE happy |
|
77 | 77 | } else { |
78 | 78 | header("Content-Type: text/event-stream"); |
79 | 79 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public function send($type, $data = null) { |
103 | 103 | if ($data and !preg_match('/^[A-Za-z0-9_]+$/', $type)) { |
104 | - throw new BadMethodCallException('Type needs to be alphanumeric ('. $type .')'); |
|
104 | + throw new BadMethodCallException('Type needs to be alphanumeric ('.$type.')'); |
|
105 | 105 | } |
106 | 106 | $this->init(); |
107 | 107 | if (is_null($data)) { |
@@ -110,13 +110,13 @@ discard block |
||
110 | 110 | } |
111 | 111 | if ($this->fallback) { |
112 | 112 | $response = '<script type="text/javascript">window.parent.OC.EventSource.fallBackCallBack(' |
113 | - . $this->fallBackId . ',"' . $type . '",' . OC_JSON::encode($data) . ')</script>' . PHP_EOL; |
|
113 | + . $this->fallBackId.',"'.$type.'",'.OC_JSON::encode($data).')</script>'.PHP_EOL; |
|
114 | 114 | echo $response; |
115 | 115 | } else { |
116 | 116 | if ($type) { |
117 | - echo 'event: ' . $type . PHP_EOL; |
|
117 | + echo 'event: '.$type.PHP_EOL; |
|
118 | 118 | } |
119 | - echo 'data: ' . OC_JSON::encode($data) . PHP_EOL; |
|
119 | + echo 'data: '.OC_JSON::encode($data).PHP_EOL; |
|
120 | 120 | } |
121 | 121 | echo PHP_EOL; |
122 | 122 | flush(); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | public static function checkAppEnabled($app) { |
45 | 45 | if (!\OC::$server->getAppManager()->isEnabledForUser($app)) { |
46 | 46 | $l = \OC::$server->getL10N('lib'); |
47 | - self::error([ 'data' => [ 'message' => $l->t('Application is not enabled'), 'error' => 'application_not_enabled' ]]); |
|
47 | + self::error(['data' => ['message' => $l->t('Application is not enabled'), 'error' => 'application_not_enabled']]); |
|
48 | 48 | exit(); |
49 | 49 | } |
50 | 50 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | || $twoFactorAuthManger->needsSecondFactor(\OC::$server->getUserSession()->getUser())) { |
61 | 61 | $l = \OC::$server->getL10N('lib'); |
62 | 62 | http_response_code(\OCP\AppFramework\Http::STATUS_UNAUTHORIZED); |
63 | - self::error([ 'data' => [ 'message' => $l->t('Authentication error'), 'error' => 'authentication_error' ]]); |
|
63 | + self::error(['data' => ['message' => $l->t('Authentication error'), 'error' => 'authentication_error']]); |
|
64 | 64 | exit(); |
65 | 65 | } |
66 | 66 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | if (!\OC::$server->getRequest()->passesCSRFCheck()) { |
80 | 80 | $l = \OC::$server->getL10N('lib'); |
81 | - self::error([ 'data' => [ 'message' => $l->t('Token expired. Please reload page.'), 'error' => 'token_expired' ]]); |
|
81 | + self::error(['data' => ['message' => $l->t('Token expired. Please reload page.'), 'error' => 'token_expired']]); |
|
82 | 82 | exit(); |
83 | 83 | } |
84 | 84 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | public static function checkAdminUser() { |
92 | 92 | if (!OC_User::isAdminUser(OC_User::getUser())) { |
93 | 93 | $l = \OC::$server->getL10N('lib'); |
94 | - self::error([ 'data' => [ 'message' => $l->t('Authentication error'), 'error' => 'authentication_error' ]]); |
|
94 | + self::error(['data' => ['message' => $l->t('Authentication error'), 'error' => 'authentication_error']]); |
|
95 | 95 | exit(); |
96 | 96 | } |
97 | 97 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | protected static function to_string(&$value) { |
125 | 125 | if ($value instanceof \OC\L10N\L10NString) { |
126 | - $value = (string)$value; |
|
126 | + $value = (string) $value; |
|
127 | 127 | } |
128 | 128 | } |
129 | 129 |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $this->respondToActions |= $respondToActions; |
55 | 55 | |
56 | 56 | foreach ($this->which as $action => $v) { |
57 | - if ((bool)($respondToActions & $action)) { |
|
57 | + if ((bool) ($respondToActions & $action)) { |
|
58 | 58 | $this->which[$action] = $plugin; |
59 | 59 | \OC::$server->getLogger()->debug("Registered action ".$action." to plugin ".get_class($plugin), ['app' => 'user_ldap']); |
60 | 60 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $plugin = $this->which[GroupInterface::COUNT_USERS]; |
148 | 148 | |
149 | 149 | if ($plugin) { |
150 | - return $plugin->countUsersInGroup($gid,$search); |
|
150 | + return $plugin->countUsersInGroup($gid, $search); |
|
151 | 151 | } |
152 | 152 | throw new \Exception('No plugin implements countUsersInGroup in this LDAP Backend.'); |
153 | 153 | } |
@@ -114,7 +114,7 @@ |
||
114 | 114 | return; |
115 | 115 | } |
116 | 116 | $this->config->setUserValue($ocName, 'user_ldap', 'isDeleted', '1'); |
117 | - $this->config->setUserValue($ocName, 'user_ldap', 'foundDeleted', (string)time()); |
|
117 | + $this->config->setUserValue($ocName, 'user_ldap', 'foundDeleted', (string) time()); |
|
118 | 118 | $this->deletedUsers = null; |
119 | 119 | } |
120 | 120 | } |
@@ -292,7 +292,7 @@ |
||
292 | 292 | |
293 | 293 | $config = new Configuration($configID); |
294 | 294 | $data = $config->getConfiguration(); |
295 | - if (!(int)$showPassword) { |
|
295 | + if (!(int) $showPassword) { |
|
296 | 296 | $data['ldapAgentPassword'] = '***'; |
297 | 297 | } |
298 | 298 | foreach ($data as $key => $value) { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | protected function getMinPagingSize() { |
105 | 105 | $configKeys = $this->config->getAppKeys('user_ldap'); |
106 | - $configKeys = array_filter($configKeys, function ($key) { |
|
106 | + $configKeys = array_filter($configKeys, function($key) { |
|
107 | 107 | return strpos($key, 'ldap_paging_size') !== false; |
108 | 108 | }); |
109 | 109 | $minPagingSize = null; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $pagingSize = $this->config->getAppValue('user_ldap', $configKey, $minPagingSize); |
112 | 112 | $minPagingSize = $minPagingSize === null ? $pagingSize : min($minPagingSize, $pagingSize); |
113 | 113 | } |
114 | - return (int)$minPagingSize; |
|
114 | + return (int) $minPagingSize; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | |
165 | 165 | $filter = $access->combineFilterWithAnd([ |
166 | 166 | $access->connection->ldapUserFilter, |
167 | - $access->connection->ldapUserDisplayName . '=*', |
|
167 | + $access->connection->ldapUserDisplayName.'=*', |
|
168 | 168 | $access->getFilterPartForUserSearch('') |
169 | 169 | ]); |
170 | 170 | $results = $access->fetchListOfUsers( |
@@ -175,10 +175,10 @@ discard block |
||
175 | 175 | true |
176 | 176 | ); |
177 | 177 | |
178 | - if ((int)$connection->ldapPagingSize === 0) { |
|
178 | + if ((int) $connection->ldapPagingSize === 0) { |
|
179 | 179 | return false; |
180 | 180 | } |
181 | - return count($results) >= (int)$connection->ldapPagingSize; |
|
181 | + return count($results) >= (int) $connection->ldapPagingSize; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | /** |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | |
196 | 196 | $cycleData = [ |
197 | 197 | 'prefix' => $this->config->getAppValue('user_ldap', 'background_sync_prefix', null), |
198 | - 'offset' => (int)$this->config->getAppValue('user_ldap', 'background_sync_offset', 0), |
|
198 | + 'offset' => (int) $this->config->getAppValue('user_ldap', 'background_sync_offset', 0), |
|
199 | 199 | ]; |
200 | 200 | |
201 | 201 | if ( |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | * @return bool |
253 | 253 | */ |
254 | 254 | public function qualifiesToRun($cycleData) { |
255 | - $lastChange = $this->config->getAppValue('user_ldap', $cycleData['prefix'] . '_lastChange', 0); |
|
255 | + $lastChange = $this->config->getAppValue('user_ldap', $cycleData['prefix'].'_lastChange', 0); |
|
256 | 256 | if ((time() - $lastChange) > 60 * 30) { |
257 | 257 | return true; |
258 | 258 | } |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | */ |
267 | 267 | protected function increaseOffset($cycleData) { |
268 | 268 | $ldapConfig = new Configuration($cycleData['prefix']); |
269 | - $cycleData['offset'] += (int)$ldapConfig->ldapPagingSize; |
|
269 | + $cycleData['offset'] += (int) $ldapConfig->ldapPagingSize; |
|
270 | 270 | $this->setCycle($cycleData); |
271 | 271 | } |
272 | 272 |
@@ -91,7 +91,7 @@ |
||
91 | 91 | $offset += $batchSize; |
92 | 92 | } catch (\InvalidArgumentException $e) { |
93 | 93 | if (strpos($e->getMessage(), 'Background job arguments can\'t exceed 4000') !== false) { |
94 | - $batchSize = (int)floor(count($records) * 0.8); |
|
94 | + $batchSize = (int) floor(count($records) * 0.8); |
|
95 | 95 | $retry = true; |
96 | 96 | } |
97 | 97 | } |
@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | $this->respondToActions |= $respondToActions; |
61 | 61 | |
62 | 62 | foreach ($this->which as $action => $v) { |
63 | - if (is_int($action) && (bool)($respondToActions & $action)) { |
|
63 | + if (is_int($action) && (bool) ($respondToActions & $action)) { |
|
64 | 64 | $this->which[$action] = $plugin; |
65 | 65 | \OC::$server->getLogger()->debug("Registered action ".$action." to plugin ".get_class($plugin), ['app' => 'user_ldap']); |
66 | 66 | } |
67 | 67 | } |
68 | - if (method_exists($plugin,'deleteUser')) { |
|
68 | + if (method_exists($plugin, 'deleteUser')) { |
|
69 | 69 | $this->which['deleteUser'] = $plugin; |
70 | 70 | \OC::$server->getLogger()->debug("Registered action deleteUser to plugin ".get_class($plugin), ['app' => 'user_ldap']); |
71 | 71 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $plugin = $this->which[Backend::CREATE_USER]; |
93 | 93 | |
94 | 94 | if ($plugin) { |
95 | - return $plugin->createUser($username,$password); |
|
95 | + return $plugin->createUser($username, $password); |
|
96 | 96 | } |
97 | 97 | throw new \Exception('No plugin implements createUser in this LDAP Backend.'); |
98 | 98 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $plugin = $this->which[Backend::SET_PASSWORD]; |
109 | 109 | |
110 | 110 | if ($plugin) { |
111 | - return $plugin->setPassword($uid,$password); |
|
111 | + return $plugin->setPassword($uid, $password); |
|
112 | 112 | } |
113 | 113 | throw new \Exception('No plugin implements setPassword in this LDAP Backend.'); |
114 | 114 | } |
@@ -24,14 +24,14 @@ discard block |
||
24 | 24 | <?php endif; ?> |
25 | 25 | <div id="message" class="hidden"> |
26 | 26 | <img class="float-spinner" alt="" |
27 | - src="<?php p(image_path('core', 'loading-dark.gif'));?>"> |
|
27 | + src="<?php p(image_path('core', 'loading-dark.gif')); ?>"> |
|
28 | 28 | <span id="messageText"></span> |
29 | 29 | <!-- the following div ensures that the spinner is always inside the #message div --> |
30 | 30 | <div style="clear: both;"></div> |
31 | 31 | </div> |
32 | 32 | <p class="grouptop"> |
33 | 33 | <input type="password" id="oldPassword" name="oldPassword" |
34 | - placeholder="<?php echo $l->t('Current password');?>" |
|
34 | + placeholder="<?php echo $l->t('Current password'); ?>" |
|
35 | 35 | autofocus autocomplete="off" autocapitalize="off" autocorrect="off" required/> |
36 | 36 | <label for="oldPassword" class="infield"><?php p($l->t('Current password')); ?></label> |
37 | 37 | </p> |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | <input type="checkbox" id="personal-show" name="show" class="hidden-visually" /><label for="personal-show"></label> |
41 | 41 | <label id="newPassword-label" for="newPassword" class="infield"><?php p($l->t('New password')); ?></label> |
42 | 42 | <input type="password" id="newPassword" name="newPassword" |
43 | - placeholder="<?php echo $l->t('New password');?>" |
|
43 | + placeholder="<?php echo $l->t('New password'); ?>" |
|
44 | 44 | data-typetoggle="#personal-show" autofocus autocomplete="off" autocapitalize="off" autocorrect="off" required/> |
45 | 45 | </p> |
46 | 46 |