mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fix logical issues with panel handler
This commit is contained in:
parent
6b82170d6f
commit
02b6c3b545
@ -254,7 +254,7 @@ class UsersController:
|
|||||||
def remove_user(self, user_id):
|
def remove_user(self, user_id):
|
||||||
for user in self.get_managed_users(user_id):
|
for user in self.get_managed_users(user_id):
|
||||||
self.update_user(user.user_id, {"manager": None})
|
self.update_user(user.user_id, {"manager": None})
|
||||||
for role in HelperRoles.get_managed_roles(user_id):
|
for role in HelperUsers.get_managed_roles(user_id):
|
||||||
HelperRoles.update_role(role.role_id, {"manager": None})
|
HelperRoles.update_role(role.role_id, {"manager": None})
|
||||||
return self.users_helper.remove_user(user_id)
|
return self.users_helper.remove_user(user_id)
|
||||||
|
|
||||||
|
@ -1313,7 +1313,7 @@ class PanelHandler(BaseHandler):
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
EnumPermissionsCrafty.ROLES_CONFIG not in exec_user_crafty_permissions
|
EnumPermissionsCrafty.ROLES_CONFIG not in exec_user_crafty_permissions
|
||||||
and exec_user["user_id"] != role["manager"]
|
or exec_user["user_id"] != role["manager"]
|
||||||
and not exec_user["superuser"]
|
and not exec_user["superuser"]
|
||||||
):
|
):
|
||||||
self.redirect(
|
self.redirect(
|
||||||
@ -2042,7 +2042,10 @@ class PanelHandler(BaseHandler):
|
|||||||
else:
|
else:
|
||||||
manager = user["manager"]
|
manager = user["manager"]
|
||||||
|
|
||||||
if not exec_user["superuser"] and exec_user["user_id"] != user["user_id"]:
|
if (
|
||||||
|
not exec_user["superuser"]
|
||||||
|
and int(exec_user["user_id"]) != user["manager"]
|
||||||
|
):
|
||||||
if username is None or username == "":
|
if username is None or username == "":
|
||||||
self.redirect("/panel/error?error=Invalid username")
|
self.redirect("/panel/error?error=Invalid username")
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user