1
0
mirror of https://github.com/typemill/typemill.git synced 2025-07-30 19:00:32 +02:00

Version 1.4.3: Validate inactive user, add raw userdata

This commit is contained in:
trendschau
2021-01-05 21:17:22 +01:00
parent 1f063a6778
commit 1df78a636d
3 changed files with 14 additions and 4 deletions

View File

@@ -58,8 +58,9 @@ class Validation
# checks if username is free when create new user
Validator::addRule('userAvailable', function($field, $value, array $params, array $fields) use ($user)
{
$userdata = $user->getUser($value);
if($userdata){ return false; }
$activeUser = $user->getUser($value);
$inactiveUser = $user->getUser("_" . $value);
if($activeUser OR $inactiveUser){ return false; }
return true;
}, 'taken');