/** * 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) { require_code('lookup'); if (array_key_exists('h', $options) || array_key_exists('help', $options)) { return array('', do_command_help('whois', array('h', 's', 'm', 'f', 'o'), array(true)), '', ''); } else { if (!array_key_exists(0, $parameters)) { return array('', '', '', do_lang('MISSING_PARAM', '1', 'whois')); } $start = array_key_exists('s', $options) ? intval($options['s']) : 0; $start = array_key_exists('start', $options) ? intval($options['start']) : 0; $max = array_key_exists('m', $options) ? intval($options['m']) : 50; $max = array_key_exists('max', $options) ? intval($options['max']) : 50; $sortable = array_key_exists('f', $options) ? $options['f'] : 'date_and_time'; $sortable = array_key_exists('field', $options) ? $options['field'] : 'date_and_time'; $sort_order = array_key_exists('o', $options) ? $options['o'] : 'DESC'; $sort_order = array_key_exists('order', $options) ? $options['order'] : 'DESC'; $name = mixed(); $id = mixed(); $ip = mixed(); $rows = lookup_member_page($parameters[0], $name, $id, $ip); if (is_null($name)) { $name = do_lang('UNKNOWN'); } if (is_null($id)) { $id = $GLOBALS['FORUM_DRIVER']->get_guest_id(); } if (is_null($ip)) { $ip = ''; } $ip_list = new ocp_tempcode(); foreach ($rows as $row) { $ip_list->attach(do_template('LOOKUP_IP_LIST_ENTRY', array('IP' => $row['ip']))); } $stats = get_stats_track($id, $ip, $start, $max, $sortable, $sort_order); return array('', occle_make_normal_html_visible(do_template('OCCLE_WHOIS', array('_GUID' => 'f315a705e9a2a2fb50b78ae3a8fc6a05', 'STATS' => $stats, 'IP_LIST' => $ip_list, 'ID' => strval($id), 'IP' => $ip, 'NAME' => $name))), '', ''); } }
/** * 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) { require_code('xhtml'); if (array_key_exists('h', $options) || array_key_exists('help', $options)) { return array('', do_command_help('fix_perms', array('h'), array(true, true, true)), '', ''); } else { if (!array_key_exists(0, $parameters)) { return array('', '', '', do_lang('MISSING_PARAM', '1', 'fix_perms')); } if (!array_key_exists(1, $parameters)) { return array('', '', '', do_lang('MISSING_PARAM', '2', 'fix_perms')); } if (!array_key_exists(2, $parameters)) { return array('', '', '', do_lang('MISSING_PARAM', '3', 'fix_perms')); } $return = http_download_file(get_base_url() . '/upgrader.php?check_perms=1&user='******'&pass='******'&root=' . $parameters[2], NULL, false); if (is_null($return)) { return array('', '', '', do_lang('HTTP_DOWNLOAD_NO_SERVER', get_base_url() . '/upgrader.php?check_perms=1')); } else { return array('', occle_make_normal_html_visible(extract_html_body($return)), '', ''); } } }
/** * 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('find_function', array('h'), array(true)), '', ''); } else { if (!array_key_exists(0, $parameters)) { return array('', '', '', do_lang('MISSING_PARAM', '1', 'find_function')); } require_code('php'); require_lang('phpdoc'); $tpl = new ocp_tempcode(); $contents = file_get_contents(get_custom_file_base() . '/data_custom/functions.dat', FILE_TEXT); if ($contents == '') { make_functions_dat(); $contents = file_get_contents(get_custom_file_base() . '/data_custom/functions.dat', FILE_TEXT); } $_classes = unserialize($contents); foreach ($_classes as $class) { foreach ($class['functions'] as $function) { if (strpos($function['name'], $parameters[0]) !== false) { $ret = render_php_function($function, $class, true); $tpl->attach($ret[0]); } } } return array('', occle_make_normal_html_visible($tpl), '', ''); } }