@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | } |
216 | 216 | |
217 | 217 | if (false !== $this->ldap->getDn($login)) { |
218 | - $this->activeServer = (int) $key; |
|
218 | + $this->activeServer = (int)$key; |
|
219 | 219 | break; |
220 | 220 | } |
221 | 221 | } |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | } |
289 | 289 | |
290 | 290 | if (false !== $this->ldap->getDn($login)) { |
291 | - $this->activeServer = (int) $key; |
|
291 | + $this->activeServer = (int)$key; |
|
292 | 292 | break; |
293 | 293 | } |
294 | 294 | } |
@@ -102,10 +102,10 @@ discard block |
||
102 | 102 | private function setConnectionOptions($user, $passwd, $database) |
103 | 103 | { |
104 | 104 | $this->connectionOptions = array( |
105 | - 'UID' => $user, |
|
106 | - 'PWD' => $passwd, |
|
107 | - 'Database' => $database, |
|
108 | - 'CharacterSet' => 'UTF-8', ); |
|
105 | + 'UID' => $user, |
|
106 | + 'PWD' => $passwd, |
|
107 | + 'Database' => $database, |
|
108 | + 'CharacterSet' => 'UTF-8', ); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -262,8 +262,8 @@ discard block |
||
262 | 262 | max(%s) as current_id |
263 | 263 | FROM |
264 | 264 | %s', |
265 | - $id, |
|
266 | - $table); |
|
265 | + $id, |
|
266 | + $table); |
|
267 | 267 | |
268 | 268 | $result = $this->query($select); |
269 | 269 | sqlsrv_fetch($result); |
@@ -105,7 +105,7 @@ |
||
105 | 105 | 'UID' => $user, |
106 | 106 | 'PWD' => $passwd, |
107 | 107 | 'Database' => $database, |
108 | - 'CharacterSet' => 'UTF-8', ); |
|
108 | + 'CharacterSet' => 'UTF-8',); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -248,8 +248,8 @@ |
||
248 | 248 | MAX(%s) AS current_id |
249 | 249 | FROM |
250 | 250 | %s', |
251 | - $id, |
|
252 | - $table); |
|
251 | + $id, |
|
252 | + $table); |
|
253 | 253 | |
254 | 254 | $result = $this->query($select); |
255 | 255 |
@@ -94,10 +94,10 @@ |
||
94 | 94 | $result = $this->_config->getDb()->query($query); |
95 | 95 | while ($row = $this->_config->getDb()->fetchObject($result)) { |
96 | 96 | $data[$row->id] = array( |
97 | - 'time' => $row->time, |
|
98 | - 'usr' => $row->usr, |
|
99 | - 'text' => $row->text, |
|
100 | - 'ip' => $row->ip, |
|
97 | + 'time' => $row->time, |
|
98 | + 'usr' => $row->usr, |
|
99 | + 'text' => $row->text, |
|
100 | + 'ip' => $row->ip, |
|
101 | 101 | ); |
102 | 102 | } |
103 | 103 |
@@ -149,7 +149,7 @@ |
||
149 | 149 | WHERE |
150 | 150 | time < %d', |
151 | 151 | Db::getTablePrefix(), |
152 | - $_SERVER['REQUEST_TIME'] - 30 * 86400 |
|
152 | + $_SERVER['REQUEST_TIME'] - 30*86400 |
|
153 | 153 | ); |
154 | 154 | |
155 | 155 | if ($this->_config->getDb()->query($query)) { |
@@ -166,9 +166,9 @@ |
||
166 | 166 | |
167 | 167 | foreach ($news as $item) { |
168 | 168 | $url = sprintf('%s?action=news&newsid=%d&newslang=%s', |
169 | - Link::getSystemRelativeUri(), |
|
170 | - $item['id'], |
|
171 | - $item['lang']); |
|
169 | + Link::getSystemRelativeUri(), |
|
170 | + $item['id'], |
|
171 | + $item['lang']); |
|
172 | 172 | $oLink = new Link($url, $this->_config); |
173 | 173 | |
174 | 174 | if (isset($item['header'])) { |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | if ($this->_config->get('records.numberOfShownNewsEntries') > 0 && $this->_config->getDb()->numRows($result) > 0) { |
113 | 113 | while (($row = $this->_config->getDb()->fetchObject($result))) { |
114 | 114 | ++$counter; |
115 | - if (($showArchive && ($counter > $this->_config->get('records.numberOfShownNewsEntries'))) || |
|
115 | + if (($showArchive && ($counter > $this->_config->get('records.numberOfShownNewsEntries'))) || |
|
116 | 116 | ((!$showArchive) && (!$forceConfLimit) && |
117 | 117 | ($counter <= $this->_config->get('records.numberOfShownNewsEntries'))) || |
118 | 118 | ((!$showArchive) && $forceConfLimit)) { |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | 'allowComments' => $allowComments, |
303 | 303 | 'link' => $row->link, |
304 | 304 | 'linkTitle' => $row->linktitel, |
305 | - 'target' => $row->target, ); |
|
305 | + 'target' => $row->target,); |
|
306 | 306 | } |
307 | 307 | } |
308 | 308 |
@@ -215,7 +215,7 @@ |
||
215 | 215 | 'category_id' => $faq['category_id'] |
216 | 216 | ]; |
217 | 217 | |
218 | - if ($i % 1000 == 0) { |
|
218 | + if ($i%1000 == 0) { |
|
219 | 219 | $responses = $this->client->bulk($params); |
220 | 220 | $params = ['body' => []]; |
221 | 221 | unset($responses); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | public function getUserId() |
252 | 252 | { |
253 | 253 | if (isset($this->userId) && is_int($this->userId)) { |
254 | - return (int) $this->userId; |
|
254 | + return (int)$this->userId; |
|
255 | 255 | } |
256 | 256 | $this->userId = -1; |
257 | 257 | $this->errors[] = self::ERROR_USER_NO_USERID; |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | WHERE |
282 | 282 | user_id = %d '.($allowBlockedUsers ? '' : "AND account_status != 'blocked'"), |
283 | 283 | Db::getTablePrefix(), |
284 | - (int) $userId |
|
284 | + (int)$userId |
|
285 | 285 | ); |
286 | 286 | |
287 | 287 | $res = $this->config->getDb()->query($select); |
@@ -291,10 +291,10 @@ discard block |
||
291 | 291 | return false; |
292 | 292 | } |
293 | 293 | $user = $this->config->getDb()->fetchArray($res); |
294 | - $this->userId = (int) $user['user_id']; |
|
295 | - $this->login = (string) $user['login']; |
|
296 | - $this->status = (string) $user['account_status']; |
|
297 | - $this->isSuperAdmin = (bool) $user['is_superadmin']; |
|
294 | + $this->userId = (int)$user['user_id']; |
|
295 | + $this->login = (string)$user['login']; |
|
296 | + $this->status = (string)$user['account_status']; |
|
297 | + $this->isSuperAdmin = (bool)$user['is_superadmin']; |
|
298 | 298 | |
299 | 299 | // get encrypted password |
300 | 300 | // @todo: Add a getEncPassword method to the Auth* classes for the (local and remote) Auth Sources. |
@@ -359,9 +359,9 @@ discard block |
||
359 | 359 | return false; |
360 | 360 | } |
361 | 361 | $user = $this->config->getDb()->fetchArray($res); |
362 | - $this->userId = (int) $user['user_id']; |
|
363 | - $this->login = (string) $user['login']; |
|
364 | - $this->status = (string) $user['account_status']; |
|
362 | + $this->userId = (int)$user['user_id']; |
|
363 | + $this->login = (string)$user['login']; |
|
364 | + $this->status = (string)$user['account_status']; |
|
365 | 365 | |
366 | 366 | // get user-data |
367 | 367 | if (!$this->userdata instanceof UserData) { |
@@ -408,9 +408,9 @@ discard block |
||
408 | 408 | return false; |
409 | 409 | } |
410 | 410 | |
411 | - $this->userId = (int) $user['user_id']; |
|
412 | - $this->login = (string) $user['login']; |
|
413 | - $this->status = (string) $user['account_status']; |
|
411 | + $this->userId = (int)$user['user_id']; |
|
412 | + $this->login = (string)$user['login']; |
|
413 | + $this->status = (string)$user['account_status']; |
|
414 | 414 | |
415 | 415 | // get user-data |
416 | 416 | if (!$this->userdata instanceof UserData) { |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | } |
516 | 516 | |
517 | 517 | // is $login valid? |
518 | - $login = (string) $login; |
|
518 | + $login = (string)$login; |
|
519 | 519 | if (!$this->isValidLogin($login)) { |
520 | 520 | $this->errors[] = self::ERROR_USER_LOGINNAME_TOO_SHORT; |
521 | 521 | |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | |
532 | 532 | // set user-ID |
533 | 533 | if (0 == $userId) { |
534 | - $this->userId = (int) $this->config->getDb()->nextId(Db::getTablePrefix().'faquser', 'user_id'); |
|
534 | + $this->userId = (int)$this->config->getDb()->nextId(Db::getTablePrefix().'faquser', 'user_id'); |
|
535 | 535 | } else { |
536 | 536 | $this->userId = $userId; |
537 | 537 | } |
@@ -788,7 +788,7 @@ discard block |
||
788 | 788 | */ |
789 | 789 | public function isValidLogin($login) |
790 | 790 | { |
791 | - $login = (string) $login; |
|
791 | + $login = (string)$login; |
|
792 | 792 | |
793 | 793 | if (strlen($login) < $this->loginMinLength || !preg_match($this->validUsername, $login)) { |
794 | 794 | $this->errors[] = self::ERROR_USER_LOGIN_INVALID; |
@@ -1070,8 +1070,8 @@ discard block |
||
1070 | 1070 | // To make passwords harder to get wrong, a few letters & numbers have been omitted. |
1071 | 1071 | // This will ensure safety with browsers using fonts with confusable letters. |
1072 | 1072 | // Removed: o,O,0,1,l,L |
1073 | - $consonants = ['b','c','d','f','g','h','j','k','m','n','p','r','s','t','v','w','x','y','z']; |
|
1074 | - $vowels = ['a','e','i','u']; |
|
1073 | + $consonants = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'm', 'n', 'p', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z']; |
|
1074 | + $vowels = ['a', 'e', 'i', 'u']; |
|
1075 | 1075 | $newPassword = ''; |
1076 | 1076 | $skipped = false; |
1077 | 1077 | |
@@ -1083,9 +1083,7 @@ discard block |
||
1083 | 1083 | } |
1084 | 1084 | |
1085 | 1085 | switch (Utils::createRandomNumber(0, $skipped ? 3 : ($allowUnderscore ? 5 : 4))) { |
1086 | - case 0: |
|
1087 | - case 1: |
|
1088 | - $nextChar = $caseFunc($consonants[rand(0, 18)]); |
|
1086 | + case 0 : case 1 : $nextChar = $caseFunc($consonants[rand(0, 18)]); |
|
1089 | 1087 | break; |
1090 | 1088 | case 2: |
1091 | 1089 | case 3: |
@@ -1189,7 +1187,7 @@ discard block |
||
1189 | 1187 | WHERE |
1190 | 1188 | user_id = %d", |
1191 | 1189 | Db::getTablePrefix(), |
1192 | - (int) $this->isSuperAdmin, |
|
1190 | + (int)$this->isSuperAdmin, |
|
1193 | 1191 | $this->userId |
1194 | 1192 | ); |
1195 | 1193 |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $message = ''; |
125 | 125 | |
126 | 126 | if (!is_array($this->errors)) { |
127 | - $this->errors = array((string) $this->errors); |
|
127 | + $this->errors = array((string)$this->errors); |
|
128 | 128 | } |
129 | 129 | foreach ($this->errors as $error) { |
130 | 130 | $message .= $error."\n"; |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | } |
186 | 186 | |
187 | 187 | $oldReadOnly = $this->readOnly; |
188 | - $this->readOnly = (bool) $readOnly; |
|
188 | + $this->readOnly = (bool)$readOnly; |
|
189 | 189 | |
190 | 190 | return $oldReadOnly; |
191 | 191 | } |
@@ -124,7 +124,7 @@ |
||
124 | 124 | foreach ($attributes[0] as $attribute) { |
125 | 125 | $attributeName = stristr($attribute, '=', true); |
126 | 126 | if (!in_array($attributeName, $keep)) { |
127 | - $html = str_replace(' ' . $attribute, '', $html); |
|
127 | + $html = str_replace(' '.$attribute, '', $html); |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 |