@@ -43,9 +43,9 @@ |
||
43 | 43 | |
44 | 44 | public function process(\ArrayAccess $credentials): void |
45 | 45 | { |
46 | - $name = $credentials->offsetExists(static::INPUT_NAME) ? strval($credentials->offsetGet(static::INPUT_NAME)) : '' ; |
|
47 | - $name = $credentials->offsetExists(static::INPUT_NAME2) ? strval($credentials->offsetGet(static::INPUT_NAME2)) : $name ; |
|
48 | - $stamp = $credentials->offsetExists(static::INPUT_STAMP) ? intval(strval($credentials->offsetGet(static::INPUT_STAMP))) : 0 ; |
|
46 | + $name = $credentials->offsetExists(static::INPUT_NAME) ? strval($credentials->offsetGet(static::INPUT_NAME)) : ''; |
|
47 | + $name = $credentials->offsetExists(static::INPUT_NAME2) ? strval($credentials->offsetGet(static::INPUT_NAME2)) : $name; |
|
48 | + $stamp = $credentials->offsetExists(static::INPUT_STAMP) ? intval(strval($credentials->offsetGet(static::INPUT_STAMP))) : 0; |
|
49 | 49 | |
50 | 50 | $wantedUser = $this->authenticator->getCertData(strval($name)); |
51 | 51 | if ($wantedUser && !empty($stamp) && $this->checkStamp($stamp)) { |
@@ -93,7 +93,7 @@ |
||
93 | 93 | preg_match_all('@(' . $keys . ')=(?:([\'"])([^\2]*?)\2|([^\s,]+))@', $txt, $matches, PREG_SET_ORDER); |
94 | 94 | |
95 | 95 | foreach ($matches as $m) { |
96 | - $data[strval($m[1])] = strval($m[3] ?: ( $m[4] ?? '' )); |
|
96 | + $data[strval($m[1])] = strval($m[3] ?: ($m[4] ?? '')); |
|
97 | 97 | unset($needed_parts[$m[1]]); |
98 | 98 | } |
99 | 99 |
@@ -53,9 +53,9 @@ |
||
53 | 53 | |
54 | 54 | public function process(\ArrayAccess $credentials): void |
55 | 55 | { |
56 | - $name = $credentials->offsetExists(static::INPUT_NAME) ? strval($credentials->offsetGet(static::INPUT_NAME)) : '' ; |
|
57 | - $name = $credentials->offsetExists(static::INPUT_NAME2) ? strval($credentials->offsetGet(static::INPUT_NAME2) ): $name ; |
|
58 | - $stamp = $credentials->offsetExists(static::INPUT_STAMP) ? intval(strval($credentials->offsetGet(static::INPUT_STAMP))) : 0 ; |
|
56 | + $name = $credentials->offsetExists(static::INPUT_NAME) ? strval($credentials->offsetGet(static::INPUT_NAME)) : ''; |
|
57 | + $name = $credentials->offsetExists(static::INPUT_NAME2) ? strval($credentials->offsetGet(static::INPUT_NAME2)) : $name; |
|
58 | + $stamp = $credentials->offsetExists(static::INPUT_STAMP) ? intval(strval($credentials->offsetGet(static::INPUT_STAMP))) : 0; |
|
59 | 59 | |
60 | 60 | $wantedUser = $this->authenticator->getCertData(strval($name)); |
61 | 61 | if ($wantedUser && !empty($stamp) && $this->checkStamp($stamp)) { |
@@ -42,8 +42,8 @@ |
||
42 | 42 | |
43 | 43 | public function process(\ArrayAccess $credentials): void |
44 | 44 | { |
45 | - $name = $this->server->offsetExists(static::INPUT_NAME) ? strval($this->server->offsetGet(static::INPUT_NAME)) : '' ; |
|
46 | - $digest = $this->server->offsetExists(static::INPUT_PASS) ? strval($this->server->offsetGet(static::INPUT_PASS)) : '' ; |
|
45 | + $name = $this->server->offsetExists(static::INPUT_NAME) ? strval($this->server->offsetGet(static::INPUT_NAME)) : ''; |
|
46 | + $digest = $this->server->offsetExists(static::INPUT_PASS) ? strval($this->server->offsetGet(static::INPUT_PASS)) : ''; |
|
47 | 47 | $wantedUser = $this->authenticator->getCertData(strval($name)); |
48 | 48 | if ($wantedUser && $digest) { |
49 | 49 | // now we have public key and salt from our storage, so it's time to check it |
@@ -33,7 +33,7 @@ |
||
33 | 33 | public function setExpirationNotice($class, int $nextChange): void |
34 | 34 | { |
35 | 35 | if ($class && is_object($class) && $class instanceof IExpire) { |
36 | - $class->setExpireNotice( $this->shallExpire($nextChange)); |
|
36 | + $class->setExpireNotice($this->shallExpire($nextChange)); |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 |
@@ -36,8 +36,8 @@ |
||
36 | 36 | |
37 | 37 | public function process(ArrayAccess $credentials): void |
38 | 38 | { |
39 | - $name = $this->server->offsetExists(static::INPUT_NAME) ? strval($this->server->offsetGet(static::INPUT_NAME)) : '' ; |
|
40 | - $pass = $this->server->offsetExists(static::INPUT_PASS) ? strval($this->server->offsetGet(static::INPUT_PASS)) : '' ; |
|
39 | + $name = $this->server->offsetExists(static::INPUT_NAME) ? strval($this->server->offsetGet(static::INPUT_NAME)) : ''; |
|
40 | + $pass = $this->server->offsetExists(static::INPUT_PASS) ? strval($this->server->offsetGet(static::INPUT_PASS)) : ''; |
|
41 | 41 | |
42 | 42 | if (!empty($name) && !empty($pass)) { |
43 | 43 | /** @scrutinizer ignore-call */ |
@@ -58,10 +58,10 @@ |
||
58 | 58 | /** @scrutinizer ignore-call */ |
59 | 59 | $this->loggedUser = $this->authenticator->getDataOnly($this->nameFromSess()); |
60 | 60 | } else { |
61 | - $name = $credentials->offsetExists(static::INPUT_NAME) ? strval($credentials->offsetGet(static::INPUT_NAME)) : '' ; |
|
62 | - $name = $credentials->offsetExists(static::INPUT_NAME2) ? strval($credentials->offsetGet(static::INPUT_NAME2)) : $name ; |
|
63 | - $pass = $credentials->offsetExists(static::INPUT_PASS) ? strval($credentials->offsetGet(static::INPUT_PASS)) : '' ; |
|
64 | - $pass = $credentials->offsetExists(static::INPUT_PASS2) ? strval($credentials->offsetGet(static::INPUT_PASS2)) : $pass ; |
|
61 | + $name = $credentials->offsetExists(static::INPUT_NAME) ? strval($credentials->offsetGet(static::INPUT_NAME)) : ''; |
|
62 | + $name = $credentials->offsetExists(static::INPUT_NAME2) ? strval($credentials->offsetGet(static::INPUT_NAME2)) : $name; |
|
63 | + $pass = $credentials->offsetExists(static::INPUT_PASS) ? strval($credentials->offsetGet(static::INPUT_PASS)) : ''; |
|
64 | + $pass = $credentials->offsetExists(static::INPUT_PASS2) ? strval($credentials->offsetGet(static::INPUT_PASS2)) : $pass; |
|
65 | 65 | if (!empty($name) && !empty($pass)) { |
66 | 66 | /** @scrutinizer ignore-call */ |
67 | 67 | $this->loggedUser = $this->authenticator->authenticate($name, ['password' => $pass]); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | 'password' => $params['password'] ?: '' |
37 | 37 | ])) |
38 | 38 | ? $this->getDataOnly($userName) |
39 | - : null ; |
|
39 | + : null; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | public function getDataOnly(string $userName): ?IUser |
@@ -44,6 +44,6 @@ discard block |
||
44 | 44 | $record = new Ldap\LdapRecord(); |
45 | 45 | $record->name = $userName; |
46 | 46 | $record->load(); |
47 | - return (empty($record->getAuthId())) ? null : $record ; |
|
47 | + return (empty($record->getAuthId())) ? null : $record; |
|
48 | 48 | } |
49 | 49 | } |
@@ -261,8 +261,8 @@ discard block |
||
261 | 261 | $newUserPass = [ |
262 | 262 | static::PW_NAME => $userName, |
263 | 263 | static::PW_ID => $uid, |
264 | - static::PW_GROUP => empty($user->getGroup()) ? $uid : $user->getGroup() , |
|
265 | - static::PW_CLASS => empty($user->getClass()) ? Interfaces\IAccessClasses::CLASS_USER : $user->getClass() , |
|
264 | + static::PW_GROUP => empty($user->getGroup()) ? $uid : $user->getGroup(), |
|
265 | + static::PW_CLASS => empty($user->getClass()) ? Interfaces\IAccessClasses::CLASS_USER : $user->getClass(), |
|
266 | 266 | static::PW_STATUS => $this->transformFromIntToString($user->getStatus()), |
267 | 267 | static::PW_DISPLAY => empty($displayName) ? $userName : $displayName, |
268 | 268 | static::PW_DIR => $directory, |
@@ -353,11 +353,11 @@ discard block |
||
353 | 353 | $oldName = $line[static::PW_NAME]; |
354 | 354 | $line[static::PW_NAME] = $userName; |
355 | 355 | } |
356 | - $line[static::PW_GROUP] = !empty($user->getGroup()) ? $user->getGroup() : $line[static::PW_GROUP] ; |
|
357 | - $line[static::PW_CLASS] = !empty($user->getClass()) ? $user->getClass() : $line[static::PW_CLASS] ; |
|
356 | + $line[static::PW_GROUP] = !empty($user->getGroup()) ? $user->getGroup() : $line[static::PW_GROUP]; |
|
357 | + $line[static::PW_CLASS] = !empty($user->getClass()) ? $user->getClass() : $line[static::PW_CLASS]; |
|
358 | 358 | $line[static::PW_STATUS] = $this->transformFromIntToString($user->getStatus()); |
359 | - $line[static::PW_DISPLAY] = !empty($displayName) ? $displayName : $line[static::PW_DISPLAY] ; |
|
360 | - $line[static::PW_DIR] = !empty($directory) ? $directory : $line[static::PW_DIR] ; |
|
359 | + $line[static::PW_DISPLAY] = !empty($displayName) ? $displayName : $line[static::PW_DISPLAY]; |
|
360 | + $line[static::PW_DIR] = !empty($directory) ? $directory : $line[static::PW_DIR]; |
|
361 | 361 | } |
362 | 362 | } |
363 | 363 |