diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2020-04-28 20:18:17 +0200 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2020-04-28 20:24:52 +0200 |
commit | 9090550d241f9f7b3246b24bfd323bd988add749 (patch) | |
tree | 2c2de66510533da53848dd876a9ab392471b38b8 /app/class/User.php | |
parent | 98514a4e0037aa0879e45bbad660aeda8837c624 (diff) | |
download | wcms-9090550d241f9f7b3246b24bfd323bd988add749.tar.gz wcms-9090550d241f9f7b3246b24bfd323bd988add749.zip |
listen to brother Stan and clean some things
Diffstat (limited to 'app/class/User.php')
-rw-r--r-- | app/class/User.php | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/app/class/User.php b/app/class/User.php index 417b5f3..b2b6193 100644 --- a/app/class/User.php +++ b/app/class/User.php @@ -39,13 +39,9 @@ class User extends Item return $this->level; } - public function password($type = 'string') + public function password() { - if ($type === 'int') { - return strlen($this->password); - } elseif ($type = 'string') { - return $this->password; - } + return $this->password; } public function signature() @@ -117,12 +113,11 @@ class User extends Item public function setid($id): bool { if (is_string($id)) { - try { - $this->id = idclean($id, Model::MAX_ID_LENGTH, 1); - } catch (\Throwable $th) { - return false; + $id = idclean($id); + if (!empty($id)) { + $this->id = $id; + return true; } - return true; } return false; } |