Verified Commit a2cc0fbf authored by Damien's avatar Damien

FEAT #13608 TIME 0:20 Fix user without entities

parent 2eee87f2
......@@ -1596,12 +1596,15 @@ class UserController
return ['status' => 403, 'error' => 'Service forbidden'];
}
if ($GLOBALS['userId'] != 'superadmin') {
$users = [];
$entities = EntityModel::getAllEntitiesByUserId(['userId' => $GLOBALS['userId']]);
$users = UserEntityModel::getWithUsers([
'select' => ['users.id'],
'where' => ['users_entities.entity_id in (?)', 'status != ?'],
'data' => [$entities, 'DEL']
]);
if (!empty($entities)) {
$users = UserEntityModel::getWithUsers([
'select' => ['users.id'],
'where' => ['users_entities.entity_id in (?)', 'status != ?'],
'data' => [$entities, 'DEL']
]);
}
$usersNoEntities = UserEntityModel::getUsersWithoutEntities(['select' => ['id']]);
$users = array_merge($users, $usersNoEntities);
$allowed = false;
......
Markdown is supported
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