Commit e0f9c153 authored by Quentin Ribac's avatar Quentin Ribac
Browse files

FEAT #17436 TIME 0:45 users can be created with no groups

parent 6a67b2ce
......@@ -103,6 +103,6 @@ class PrivilegeController
}
}
return true;
return false;
}
}
......@@ -135,11 +135,11 @@ class UserController
return $response->withStatus(400)->withJson(['errors' => 'Body email is empty or not a valid email']);
} elseif (!empty($body['x509Fingerprint']) && !Validator::stringType()->validate($body['x509Fingerprint'])) {
return $response->withStatus(400)->withJson(['errors' => 'Body x509Fingerprint is not a string']);
} elseif (!Validator::arrayType()->notEmpty()->validate($body['groups'])) {
return $response->withStatus(400)->withJson(['errors' => 'Body groups is empty or not an array']);
} elseif (!empty($body['groups']) && !Validator::arrayType()->validate($body['groups'])) {
return $response->withStatus(400)->withJson(['errors' => 'Body groups is not an array']);
}
$body['groups'] = array_column($body['groups'], 'id');
$body['groups'] = !empty($body['groups']) ? array_column($body['groups'], 'id') : [];
$body['login'] = strtolower($body['login']);
$existingUser = UserModel::getByLogin(['login' => $body['login'], 'select' => [1]]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment