@@ -129,8 +129,8 @@ discard block |
||
| 129 | 129 | static::PW_ID => $uid, |
| 130 | 130 | static::PW_NAME => $userName, |
| 131 | 131 | static::PW_PASS => $this->mode->hash($password), |
| 132 | - static::PW_GROUP => empty($user->getGroup()) ? $uid : $user->getClass() , |
|
| 133 | - static::PW_CLASS => empty($user->getClass()) ? IAccessClasses::CLASS_USER : $user->getClass() , |
|
| 132 | + static::PW_GROUP => empty($user->getGroup()) ? $uid : $user->getClass(), |
|
| 133 | + static::PW_CLASS => empty($user->getClass()) ? IAccessClasses::CLASS_USER : $user->getClass(), |
|
| 134 | 134 | static::PW_DISPLAY => empty($displayName) ? $userName : $displayName, |
| 135 | 135 | static::PW_DIR => $directory, |
| 136 | 136 | static::PW_FEED => '', |
@@ -175,10 +175,10 @@ discard block |
||
| 175 | 175 | foreach ($passwordLines as &$line) { |
| 176 | 176 | if ($line[static::PW_NAME] == $userName) { |
| 177 | 177 | // REFILL |
| 178 | - $line[static::PW_GROUP] = !empty($user->getGroup()) ? $user->getGroup() : $line[static::PW_GROUP] ; |
|
| 179 | - $line[static::PW_CLASS] = !empty($user->getClass()) ? $user->getClass() : $line[static::PW_CLASS] ; |
|
| 180 | - $line[static::PW_DISPLAY] = !empty($displayName) ? $displayName : $line[static::PW_DISPLAY] ; |
|
| 181 | - $line[static::PW_DIR] = !empty($directory) ? $directory : $line[static::PW_DIR] ; |
|
| 178 | + $line[static::PW_GROUP] = !empty($user->getGroup()) ? $user->getGroup() : $line[static::PW_GROUP]; |
|
| 179 | + $line[static::PW_CLASS] = !empty($user->getClass()) ? $user->getClass() : $line[static::PW_CLASS]; |
|
| 180 | + $line[static::PW_DISPLAY] = !empty($displayName) ? $displayName : $line[static::PW_DISPLAY]; |
|
| 181 | + $line[static::PW_DIR] = !empty($directory) ? $directory : $line[static::PW_DIR]; |
|
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | 184 | |
@@ -212,8 +212,8 @@ discard block |
||
| 212 | 212 | $newUserPass = [ |
| 213 | 213 | static::PW_NAME => $userName, |
| 214 | 214 | static::PW_ID => $uid, |
| 215 | - static::PW_GROUP => empty($user->getGroup()) ? $uid : $user->getGroup() , |
|
| 216 | - static::PW_CLASS => empty($user->getClass()) ? IAccessClasses::CLASS_USER : $user->getClass() , |
|
| 215 | + static::PW_GROUP => empty($user->getGroup()) ? $uid : $user->getGroup(), |
|
| 216 | + static::PW_CLASS => empty($user->getClass()) ? IAccessClasses::CLASS_USER : $user->getClass(), |
|
| 217 | 217 | static::PW_DISPLAY => empty($displayName) ? $userName : $displayName, |
| 218 | 218 | static::PW_DIR => $directory, |
| 219 | 219 | static::PW_FEED => '', |
@@ -292,10 +292,10 @@ discard block |
||
| 292 | 292 | $oldName = $line[static::PW_NAME]; |
| 293 | 293 | $line[static::PW_NAME] = $userName; |
| 294 | 294 | } |
| 295 | - $line[static::PW_GROUP] = !empty($user->getGroup()) ? $user->getGroup() : $line[static::PW_GROUP] ; |
|
| 296 | - $line[static::PW_CLASS] = !empty($user->getClass()) ? $user->getClass() : $line[static::PW_CLASS] ; |
|
| 297 | - $line[static::PW_DISPLAY] = !empty($displayName) ? $displayName : $line[static::PW_DISPLAY] ; |
|
| 298 | - $line[static::PW_DIR] = !empty($directory) ? $directory : $line[static::PW_DIR] ; |
|
| 295 | + $line[static::PW_GROUP] = !empty($user->getGroup()) ? $user->getGroup() : $line[static::PW_GROUP]; |
|
| 296 | + $line[static::PW_CLASS] = !empty($user->getClass()) ? $user->getClass() : $line[static::PW_CLASS]; |
|
| 297 | + $line[static::PW_DISPLAY] = !empty($displayName) ? $displayName : $line[static::PW_DISPLAY]; |
|
| 298 | + $line[static::PW_DIR] = !empty($directory) ? $directory : $line[static::PW_DIR]; |
|
| 299 | 299 | } |
| 300 | 300 | } |
| 301 | 301 | |
@@ -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]); |