@@ -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 | |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | |
| 82 | 82 | public function process(\ArrayAccess $credentials): void |
| 83 | 83 | { |
| 84 | - $name = $credentials->offsetExists(static::INPUT_NAME) ? strval($credentials->offsetGet(static::INPUT_NAME)) : '' ; |
|
| 84 | + $name = $credentials->offsetExists(static::INPUT_NAME) ? strval($credentials->offsetGet(static::INPUT_NAME)) : ''; |
|
| 85 | 85 | $ip = strval($this->server->offsetGet(static::SERVER_REMOTE)); |
| 86 | 86 | if ($this->libBan->has( |
| 87 | 87 | strval(preg_replace(static::PREG_IP4, '', $ip)), |
@@ -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 | |
@@ -51,14 +51,14 @@ |
||
| 51 | 51 | { |
| 52 | 52 | $ln = strlen($input); |
| 53 | 53 | # pass is too long and salt too short |
| 54 | - $salt = (strlen($this->salt) < ($ln*5)) |
|
| 54 | + $salt = (strlen($this->salt) < ($ln * 5)) |
|
| 55 | 55 | ? str_repeat($this->salt, 5) |
| 56 | - : $this->salt ; |
|
| 56 | + : $this->salt; |
|
| 57 | 57 | return substr($salt, $ln, $ln) |
| 58 | - . substr($input,0, (int) ($ln/2)) |
|
| 59 | - . substr($salt,$ln*2, $ln) |
|
| 60 | - . substr($input, (int) ($ln/2)) |
|
| 61 | - . substr($salt,$ln*3, $ln); |
|
| 58 | + . substr($input, 0, (int) ($ln / 2)) |
|
| 59 | + . substr($salt, $ln * 2, $ln) |
|
| 60 | + . substr($input, (int) ($ln / 2)) |
|
| 61 | + . substr($salt, $ln * 3, $ln); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
@@ -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]); |