From 36e33b32154c1e803b2a00cc9533822fbcf52a09 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 26 Aug 2020 15:17:23 +0200 Subject: [PATCH] Removed old check Removal of last admin has been fixed with 3568a570. --- src/psm/Module/User/Controller/UserController.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/psm/Module/User/Controller/UserController.php b/src/psm/Module/User/Controller/UserController.php index 0704cc39..cd667a29 100644 --- a/src/psm/Module/User/Controller/UserController.php +++ b/src/psm/Module/User/Controller/UserController.php @@ -289,15 +289,6 @@ class UserController extends AbstractController $clean['level'] = PSM_USER_USER; } - // Won't allow removing the last admin - if ( - count($this->db->select(PSM_DB_PREFIX . 'users', array('level' => PSM_USER_ADMIN))) == 1 && - $this->getUser()->getUserLevel() == PSM_USER_ADMIN - ) { - $this->addMessage(psm_get_lang('users', 'error_user_admin_cant_be_deleted'), 'warning'); - $clean['level'] = PSM_USER_ADMIN; - } - // always validate password for new users, // but only validate it for existing users when they change it. if ($user_id == 0 || ($user_id > 0 && $clean['password'] != '')) {