/** * Standard modular run function for OcCLE hooks. * * @param array The options with which the command was called * @param array The parameters with which the command was called * @param array A reference to the OcCLE filesystem object * @return array Array of stdcommand, stdhtml, stdout, and stderr responses */ function run($options, $parameters, &$occle_fs) { if (array_key_exists('h', $options) || array_key_exists('help', $options)) { return array('', do_command_help('ban_ip', array('h', 'u'), array(true)), '', ''); } else { if (!array_key_exists(0, $parameters)) { return array('', '', '', do_lang('MISSING_PARAM', '1', 'ban_ip')); } require_code('submit'); if (array_key_exists('u', $options) || array_key_exists('unban', $options)) { unban_ip($parameters[0]); } else { ban_ip($parameters[0], array_key_exists(1, $parameters) ? $parameters[1] : ''); } return array('', '', do_lang('SUCCESS'), ''); } }
hesk_session_start(); hesk_dbConnect(); hesk_isLoggedIn(); /* Check permissions for this feature */ hesk_checkPermission('can_ban_ips'); $can_unban = hesk_checkPermission('can_unban_ips', 0); // Define required constants define('LOAD_TABS', 1); // What should we do? if ($action = hesk_REQUEST('a')) { if (defined('HESK_DEMO')) { hesk_process_messages($hesklang['ddemo'], 'banned_ips.php', 'NOTICE'); } elseif ($action == 'ban') { ban_ip(); } elseif ($action == 'unban' && $can_unban) { unban_ip(); } elseif ($action == 'unbantemp' && $can_unban) { unban_temp_ip(); } } /* Print header */ require_once HESK_PATH . 'inc/header.inc.php'; /* Print main manage users page */ require_once HESK_PATH . 'inc/show_admin_nav.inc.php'; ?> </td> </tr> <tr> <td>