escape($disallowed_user) . "')"; $result = DB()->sql_query($sql); if (!$result) { bb_die('Could not add disallowed user'); } $message = $lang['DISALLOW_SUCCESSFUL']; } $message .= '

' . sprintf($lang['CLICK_RETURN_DISALLOWADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); bb_die($message); } elseif (isset($_POST['delete_name'])) { $disallowed_id = isset($_POST['disallowed_id']) ? (int)$_POST['disallowed_id'] : (int)$_GET['disallowed_id']; if (!empty($disallowed_id)) { $sql = 'DELETE FROM ' . BB_DISALLOW . " WHERE disallow_id = $disallowed_id"; $result = DB()->sql_query($sql); if (!$result) { bb_die('Could not removed disallowed user'); } $message .= $lang['DISALLOWED_DELETED'] . '

' . sprintf($lang['CLICK_RETURN_DISALLOWADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); bb_die($message); } } /** * Grab the current list of disallowed usernames */ $sql = 'SELECT * FROM ' . BB_DISALLOW; $result = DB()->sql_query($sql); if (!$result) { bb_die('Could not get disallowed users'); } $disallowed = DB()->sql_fetchrowset($result); /** * Now generate the info for the template, which will be put out no matter what mode we are in */ $disallow_select = ''; $template->assign_vars([ 'S_DISALLOW_SELECT' => $disallow_select, 'S_FORM_ACTION' => 'admin_disallow.php', ]); print_page('admin_disallow.tpl', 'admin');