public static function deleteUserId($user_id) { $userProfile = new UserProfile(); return $userProfile->Delete('user_id', $user_id); }
public function act_delete_user() { //$this->set_event(); if (isset($_POST['no'])) { set_redirect_header('admin', 'user_management'); return; } if (!isset($_POST['users'])) { shnMessageQueue::addInformation(_t('PLEASE_SELECT_A_USER_TO_DELETE')); set_redirect_header('admin', 'user_management'); exit; } $this->del_confirm = true; if (isset($_POST['yes'])) { if (isset($_POST['user'])) { array_push($_POST['users'], $_POST['user']); } //if multiplt users are selected if (is_array($_POST['users'])) { foreach ($_POST['users'] as $user) { if ($user == 'admin') { shnMessageQueue::addInformation(_t('YOU_CANNOT_DELETE_THE_ADMINISTRATOR_ACCOUNT_')); continue; } if ($user == $_SESSION['username']) { shnMessageQueue::addInformation(_t('YOU_CANNOT_DELETE_YOURSELF_FROM_THE_LIST_OF_USERS_')); continue; } if (key(acl_get_user_roles($user)) == 'admin' && $_SESSION['username'] != 'admin') { shnMessageQueue::addInformation(_t('YOU_CANNOT_DELETE_OTHER_ADMIN_USERS_')); continue; } $u = new User(); $up = new UserProfile(); $up->Delete('username', $user); $u->Delete('username', $user); acl_delete_user($user); } } set_redirect_header('admin', 'user_management'); return; } //if there are multiple evets show table $this->users = Browse::getUserListArray($_POST['users']); }