function ShowTeamspeakPage() { global $CONF, $LNG; if ($_POST) { if (isset($_POST['ts_on']) && $_POST['ts_on'] == 'on') { $CONF['ts_modon'] = 1; } else { $CONF['ts_modon'] = 0; } $CONF['ts_server'] = request_var('ts_ip', ''); $CONF['ts_tcpport'] = request_var('ts_tcp', 0); $CONF['ts_udpport'] = request_var('ts_udp', 0); $CONF['ts_timeout'] = request_var('ts_to', 0); $CONF['ts_version'] = request_var('ts_v', 0); update_config('ts_timeout', $CONF['ts_timeout']); update_config('ts_modon', $CONF['ts_modon']); update_config('ts_server', $CONF['ts_server']); update_config('ts_tcpport', $CONF['ts_tcpport']); update_config('ts_udpport', $CONF['ts_udpport']); update_config('ts_version', $CONF['ts_version']); } $template = new template(); $template->page_header(); $template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'ts_tcpport' => $LNG['ts_tcpport'], 'ts_serverip' => $LNG['ts_serverip'], 'ts_version' => $LNG['ts_version'], 'ts_active' => $LNG['ts_active'], 'ts_settings' => $LNG['ts_settings'], 'ts_udpport' => $LNG['ts_udpport'], 'ts_timeout' => $LNG['ts_timeout'], 'ts_server_query' => $LNG['ts_server_query'], 'ts_server_id' => $LNG['ts_server_id'], 'ts_to' => $CONF['ts_timeout'], 'ts_on' => $CONF['ts_modon'], 'ts_ip' => $CONF['ts_server'], 'ts_tcp' => $CONF['ts_tcpport'], 'ts_udp' => $CONF['ts_udpport'], 'ts_v' => $CONF['ts_version'])); $template->show('adm/TeamspeakPage.tpl'); }
/** _ \_/ |\ | /¯¯\ \ / /\ |¯¯) |_¯ \ / /¯¯\ | | |´¯|¯` | /¯¯\ |\ |5 ¯ /¯\ | \| \__/ \/ /--\ |¯¯\ |__ \/ \__/ |__ \_/ | | \__/ | \|Core. * @author: Copyright (C) 2011 by Brayan Narvaez (Prinick) developer of xNova Revolution * @link: http://www.xnovarevolution.con.ar * @package 2Moons * @author Slaver <*****@*****.**> * @copyright 2009 Lucky <*****@*****.**> (XGProyecto) * @copyright 2011 Slaver <*****@*****.**> (Fork/2Moons) * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License * @version 1.3 (2011-01-21) * @link http://code.google.com/p/2moons/ * Please do not remove the credits */ function DeleteSelectedUser($UserID) { global $db, $CONF; $TheUser = $db->uniquequery("SELECT universe, ally_id FROM " . USERS . " WHERE `id` = '" . $UserID . "';"); $SQL = ""; if ($TheUser['ally_id'] != 0) { $TheAlly = $db->uniquequery("SELECT ally_members FROM " . ALLIANCE . " WHERE `id` = '" . $TheUser['ally_id'] . "';"); $TheAlly['ally_members'] -= 1; if ($TheAlly['ally_members'] > 0) { $SQL .= "UPDATE " . ALLIANCE . " SET `ally_members` = '" . $TheAlly['ally_members'] . "' WHERE `id` = '" . $TheUser['ally_id'] . "';"; } else { $SQL .= "DELETE FROM " . ALLIANCE . " WHERE `id` = '" . $TheUser['ally_id'] . "';"; $SQL .= "DELETE FROM " . STATPOINTS . " WHERE `stat_type` = '2' AND `id_owner` = '" . $TheUser['ally_id'] . "';"; } } $SQL .= "DELETE FROM " . BUDDY . " WHERE `owner` = '" . $UserID . "' OR `sender` = '" . $UserID . "';"; $SQL .= "DELETE FROM " . FLEETS . " WHERE `fleet_owner` = '" . $UserID . "';"; $SQL .= "DELETE FROM " . MESSAGES . " WHERE `message_owner` = '" . $UserID . "' OR `message_sender` = '" . $UserID . "';"; $SQL .= "DELETE FROM " . NOTES . " WHERE `owner` = '" . $UserID . "';"; $SQL .= "DELETE FROM " . PLANETS . " WHERE `id_owner` = '" . $UserID . "';"; $SQL .= "DELETE FROM " . USERS . " WHERE `id` = '" . $UserID . "';"; $SQL .= "DELETE FROM " . STATPOINTS . " WHERE `stat_type` = '1' AND `id_owner` = '" . $UserID . "';"; $db->multi_query($SQL); $SQL = $db->query("SELECT fleet_id FROM " . FLEETS . " WHERE `fleet_target_owner` = '" . $UserID . "';"); while ($FleetID = $db->fetch_array($SQL)) { SendFleetBack($UserID, $FleetID); } update_config(array('users_amount' => $CONF['users_amount'] - 1), $TheUser['universe']); }
function ShowConfigPage() { global $CONF, $LNG, $USER, $LANG; if (!empty($_POST)) { $CONF['game_disable'] = isset($_POST['closed']) && $_POST['closed'] == 'on' ? 1 : 0; $CONF['noobprotection'] = isset($_POST['noobprotection']) && $_POST['noobprotection'] == 'on' ? 1 : 0; $CONF['debug'] = isset($_POST['debug']) && $_POST['debug'] == 'on' ? 1 : 0; $CONF['adm_attack'] = isset($_POST['adm_attack']) && $_POST['adm_attack'] == 'on' ? 1 : 0; $CONF['OverviewNewsFrame'] = isset($_POST['newsframe']) && $_POST['newsframe'] == 'on' ? 1 : 0; $CONF['capaktiv'] = isset($_POST['capaktiv']) && $_POST['capaktiv'] == 'on' ? 1 : 0; $CONF['reg_closed'] = isset($_POST['reg_closed']) && $_POST['reg_closed'] == 'on' ? 1 : 0; $CONF['user_valid'] = isset($_POST['user_valid']) && $_POST['user_valid'] == 'on' ? 1 : 0; $CONF['ga_active'] = isset($_POST['ga_active']) && $_POST['ga_active'] == 'on' ? 1 : 0; $CONF['bgm_active'] = isset($_POST['bgm_active']) && $_POST['bgm_active'] == 'on' ? 1 : 0; $CONF['mail_active'] = isset($_POST['mail_active']) && $_POST['mail_active'] == 'on' ? 1 : 0; $CONF['OverviewNewsText'] = $_POST['NewsText']; $CONF['close_reason'] = request_var('close_reason', '', true); $CONF['game_name'] = request_var('game_name', '', true); $CONF['forum_url'] = request_var('forum_url', '', true); $CONF['game_speed'] = 2500 * request_var('game_speed', 0.0); $CONF['fleet_speed'] = 2500 * request_var('fleet_speed', 0.0); $CONF['resource_multiplier'] = request_var('resource_multiplier', 0.0); $CONF['halt_speed'] = request_var('halt_speed', 0.0); $CONF['initial_fields'] = request_var('initial_fields', 0); $CONF['metal_basic_income'] = request_var('metal_basic_income', 0); $CONF['crystal_basic_income'] = request_var('crystal_basic_income', 0); $CONF['deuterium_basic_income'] = request_var('deuterium_basic_income', 0); $CONF['norio_basic_income'] = request_var('norio_basic_income', 0); $CONF['lang'] = request_var('lang', ''); $CONF['Defs_Cdr'] = request_var('Defs_Cdr', 0); $CONF['Fleet_Cdr'] = request_var('Fleet_Cdr', 0); $CONF['noobprotectiontime'] = request_var('noobprotectiontime', 0); $CONF['noobprotectionmulti'] = request_var('noobprotectionmulti', 0); $CONF['capprivate'] = request_var('capprivate', ''); $CONF['cappublic'] = request_var('cappublic', ''); $CONF['min_build_time'] = request_var('min_build_time', 0); $CONF['ga_key'] = request_var('ga_key', '', true); $CONF['bgm_file'] = request_var('bgm_file', '', true); $CONF['mail_use'] = request_var('mail_use', 0); $CONF['smail_path'] = request_var('smail_path', ''); $CONF['smtp_host'] = request_var('smtp_host', '', true); $CONF['smtp_port'] = request_var('smtp_port', 0); $CONF['smtp_user'] = request_var('smtp_user', '', true); $CONF['smtp_sendmail'] = request_var('smtp_sendmail', '', true); $CONF['smtp_pass'] = request_var('smtp_pass', '', true); $CONF['smtp_ssl'] = request_var('smtp_ssl', ''); $CONF['ftp_server'] = request_var('ftp_server', '', true); $CONF['ftp_user_name'] = request_var('ftp_user_name', '', true); $CONF['ftp_root_path'] = request_var('ftp_root_path', '', true); $CONF['trade_allowed_ships'] = request_var('trade_allowed_ships', ''); $CONF['trade_charge'] = request_var('trade_charge', 0.0); $CONF['ftp_root_path'] = request_var('ftp_root_path', '', true); update_config(array('noobprotectiontime' => $CONF['noobprotectiontime'], 'noobprotectionmulti' => $CONF['noobprotectionmulti'], 'noobprotection' => $CONF['noobprotection'], 'Defs_Cdr' => $CONF['Defs_Cdr'], 'Fleet_Cdr' => $CONF['Fleet_Cdr'], 'game_disable' => $CONF['game_disable'], 'close_reason' => $CONF['close_reason'], 'OverviewNewsFrame' => $CONF['OverviewNewsFrame'], 'reg_closed' => $CONF['reg_closed'], 'OverviewNewsText' => $CONF['OverviewNewsText'], 'game_name' => $CONF['game_name'], 'forum_url' => $CONF['forum_url'], 'game_speed' => $CONF['game_speed'], 'fleet_speed' => $CONF['fleet_speed'], 'resource_multiplier' => $CONF['resource_multiplier'], 'halt_speed' => $CONF['halt_speed'], 'initial_fields' => $CONF['initial_fields'], 'metal_basic_income' => $CONF['metal_basic_income'], 'crystal_basic_income' => $CONF['crystal_basic_income'], 'deuterium_basic_income' => $CONF['deuterium_basic_income'], 'norio_basic_income' => $CONF['norio_basic_income'], 'debug' => $CONF['debug'], 'adm_attack' => $CONF['adm_attack'], 'lang' => $CONF['lang'], 'min_build_time' => $CONF['min_build_time'], 'user_valid' => $CONF['user_valid'], 'trade_charge' => $CONF['trade_charge'], 'trade_allowed_ships' => $CONF['trade_allowed_ships']), false, $_SESSION['adminuni']); update_config(array('mail_active' => $CONF['mail_active'], 'mail_use' => $CONF['mail_use'], 'smail_path' => $CONF['smail_path'], 'smtp_host' => $CONF['smtp_host'], 'smtp_port' => $CONF['smtp_port'], 'smtp_user' => $CONF['smtp_user'], 'smtp_pass' => $CONF['smtp_pass'], 'smtp_ssl' => $CONF['smtp_ssl'], 'smtp_sendmail' => $CONF['smtp_sendmail'], 'ftp_server' => $CONF['ftp_server'], 'ftp_user_name' => $CONF['ftp_user_name'], 'ftp_root_path' => $CONF['ftp_root_path'], 'ga_active' => $CONF['ga_active'], 'ga_key' => $CONF['ga_key'], 'bgm_active' => $CONF['bgm_active'], 'bgm_file' => $CONF['bgm_file'], 'capaktiv' => $CONF['capaktiv'], 'capprivate' => $CONF['capprivate'], 'cappublic' => $CONF['cappublic'], 'min_js' => $CONF['min_js']), true); } $template = new template(); $template->assign_vars(array('se_server_parameters' => $LNG['se_server_parameters'], 'se_name' => $LNG['se_name'], 'se_cookie_advert' => $LNG['se_cookie_advert'], 'se_lang' => $LNG['se_lang'], 'se_general_speed' => $LNG['se_general_speed'], 'se_fleet_speed' => $LNG['se_fleet_speed'], 'se_halt_speed' => $LNG['se_halt_speed'], 'se_normal_speed' => $LNG['se_normal_speed'], 'se_normal_speed_fleet' => $LNG['se_normal_speed_fleet'], 'se_resources_producion_speed' => $LNG['se_resources_producion_speed'], 'se_normal_speed_resoruces' => $LNG['se_normal_speed_resoruces'], 'se_normal_speed_halt' => $LNG['se_normal_speed_halt'], 'se_forum_link' => $LNG['se_forum_link'], 'se_server_op_close' => $LNG['se_server_op_close'], 'se_server_status_message' => $LNG['se_server_status_message'], 'se_server_planet_parameters' => $LNG['se_server_planet_parameters'], 'se_initial_fields' => $LNG['se_initial_fields'], 'se_metal_production' => $LNG['se_metal_production'], 'se_admin_protection' => $LNG['se_admin_protection'], 'se_crystal_production' => $LNG['se_crystal_production'], 'se_deuterium_production' => $LNG['se_deuterium_production'], 'se_norio_production' => $LNG['se_norio_production'], 'se_several_parameters' => $LNG['se_several_parameters'], 'se_min_build_time' => $LNG['se_min_build_time'], 'se_reg_closed' => $LNG['se_reg_closed'], 'se_verfiy_mail' => $LNG['se_verfiy_mail'], 'se_min_build_time_info' => $LNG['se_min_build_time_info'], 'se_verfiy_mail_info' => $LNG['se_verfiy_mail_info'], 'se_fields' => $LNG['se_fields'], 'se_per_hour' => $LNG['se_per_hour'], 'se_debug_mode' => $LNG['se_debug_mode'], 'se_title_admins_protection' => $LNG['se_title_admins_protection'], 'se_debug_message' => $LNG['se_debug_message'], 'se_ships_cdr_message' => $LNG['se_ships_cdr_message'], 'se_def_cdr_message' => $LNG['se_def_cdr_message'], 'se_ships_cdr' => $LNG['se_ships_cdr'], 'se_def_cdr' => $LNG['se_def_cdr'], 'se_noob_protect' => $LNG['se_noob_protect'], 'se_noob_protect3' => $LNG['se_noob_protect3'], 'se_noob_protect2' => $LNG['se_noob_protect2'], 'se_noob_protect_e2' => $LNG['se_noob_protect_e2'], 'se_noob_protect_e3' => $LNG['se_noob_protect_e3'], 'se_trader_head' => $LNG['se_trader_head'], 'se_trader_ships' => $LNG['se_trader_ships'], 'se_trader_charge' => $LNG['se_trader_charge'], 'se_news_head' => $LNG['se_news_head'], 'se_news_active' => $LNG['se_news_active'], 'se_news_info' => $LNG['se_news_info'], 'se_news' => $LNG['se_news'], 'se_news_limit' => $LNG['se_news_limit'], 'se_recaptcha_head' => $LNG['se_recaptcha_head'], 'se_recaptcha_active' => $LNG['se_recaptcha_active'], 'se_recaptcha_desc' => $LNG['se_recaptcha_desc'], 'se_recaptcha_public' => $LNG['se_recaptcha_public'], 'se_recaptcha_private' => $LNG['se_recaptcha_private'], 'se_smtp' => $LNG['se_smtp'], 'se_mail_active' => $LNG['se_mail_active'], 'se_mail_use' => $LNG['se_mail_use'], 'se_smail_path' => $LNG['se_smail_path'], 'se_smtp_info' => $LNG['se_smtp_info'], 'se_smtp_host' => $LNG['se_smtp_host'], 'se_smtp_host_info' => $LNG['se_smtp_host_info'], 'se_smtp_ssl' => $LNG['se_smtp_ssl'], 'se_smtp_ssl_info' => $LNG['se_smtp_ssl_info'], 'se_smtp_port' => $LNG['se_smtp_port'], 'se_smtp_port_info' => $LNG['se_smtp_port_info'], 'se_smtp_user' => $LNG['se_smtp_user'], 'se_smtp_pass' => $LNG['se_smtp_pass'], 'se_smtp_sendmail' => $LNG['se_smtp_sendmail'], 'se_smtp_sendmail_info' => $LNG['se_smtp_sendmail_info'], 'se_ftp' => $LNG['se_ftp'], 'se_ftp_info' => $LNG['se_ftp_info'], 'se_ftp_host' => $LNG['se_ftp_host'], 'se_ftp_user' => $LNG['se_ftp_user'], 'se_ftp_dir' => $LNG['se_ftp_dir'], 'se_ftp_dir_info' => $LNG['se_ftp_dir_info'], 'se_google' => $LNG['se_google'], 'se_google_active' => $LNG['se_google_active'], 'se_google_info' => $LNG['se_google_info'], 'se_google_key' => $LNG['se_google_key'], 'se_google_key_info' => $LNG['se_google_key_info'], 'se_bgm_login' => $LNG['se_bgm_login'], 'se_bgm_active' => $LNG['se_bgm_active'], 'se_bgm_info' => $LNG['se_bgm_info'], 'se_bgm_file' => $LNG['se_bgm_file'], 'se_bgm_file_info' => $LNG['se_bgm_file_info'], 'se_google_key_info' => $LNG['se_google_key_info'], 'se_save_parameters' => $LNG['se_save_parameters'], 'game_name' => $CONF['game_name'], 'game_speed' => $CONF['game_speed'] / 2500, 'fleet_speed' => $CONF['fleet_speed'] / 2500, 'resource_multiplier' => $CONF['resource_multiplier'], 'halt_speed' => $CONF['halt_speed'], 'forum_url' => $CONF['forum_url'], 'initial_fields' => $CONF['initial_fields'], 'metal_basic_income' => $CONF['metal_basic_income'], 'crystal_basic_income' => $CONF['crystal_basic_income'], 'deuterium_basic_income' => $CONF['deuterium_basic_income'], 'norio_basic_income' => $CONF['norio_basic_income'], 'game_disable' => $CONF['game_disable'], 'close_reason' => $CONF['close_reason'], 'debug' => $CONF['debug'], 'adm_attack' => $CONF['adm_attack'], 'defenses' => $CONF['Defs_Cdr'], 'shiips' => $CONF['Fleet_Cdr'], 'noobprot' => $CONF['noobprotection'], 'noobprot2' => $CONF['noobprotectiontime'], 'noobprot3' => $CONF['noobprotectionmulti'], 'mail_active' => $CONF['mail_active'], 'mail_use' => $CONF['mail_use'], 'smail_path' => $CONF['smail_path'], 'smtp_host' => $CONF['smtp_host'], 'smtp_port' => $CONF['smtp_port'], 'smtp_user' => $CONF['smtp_user'], 'smtp_pass' => $CONF['smtp_pass'], 'smtp_sendmail' => $CONF['smtp_sendmail'], 'smtp_ssl' => $CONF['smtp_ssl'], 'user_valid' => $CONF['user_valid'], 'newsframe' => $CONF['OverviewNewsFrame'], 'reg_closed' => $CONF['reg_closed'], 'NewsTextVal' => $CONF['OverviewNewsText'], 'capprivate' => $CONF['capprivate'], 'cappublic' => $CONF['cappublic'], 'capaktiv' => $CONF['capaktiv'], 'min_build_time' => $CONF['min_build_time'], 'ftp_server' => $CONF['ftp_server'], 'ftp_user_name' => $CONF['ftp_user_name'], 'ftp_user_pass' => str_pad('', strlen($CONF['ftp_user_pass']), 'x'), 'ftp_root_path' => $CONF['ftp_root_path'], 'ga_active' => $CONF['ga_active'], 'ga_key' => $CONF['ga_key'], 'bgm_active' => $CONF['bgm_active'], 'bgm_file' => $CONF['bgm_file'], 'trade_allowed_ships' => $CONF['trade_allowed_ships'], 'trade_charge' => $CONF['trade_charge'], 'Selector' => array('langs' => $LANG->getAllowedLangs(false), 'mail' => $LNG['se_mail_sel'], 'encry' => array('' => $LNG['se_smtp_ssl_1'], 'ssl' => $LNG['se_smtp_ssl_2'], 'tls' => $LNG['se_smtp_ssl_3'])), 'lang' => $CONF['lang'])); $template->show('adm/ConfigBody.tpl'); }
function save_f_method($method) { global $dbprefix, $SQL, $config; if (!get_config('upg_f_method')) { return add_config('upg_f_method', $method); } else { return update_config('upg_f_method', $method); } }
function ShowFacebookPage() { global $CONF, $LNG; if ($_POST) { $CONF['fb_on'] = isset($_POST['fb_on']) && $_POST['fb_on'] == 'on' && !empty($_POST['fb_skey']) && !empty($_POST['fb_apikey']) ? 1 : 0; $CONF['fb_apikey'] = request_var('fb_apikey', ''); $CONF['fb_skey'] = request_var('fb_skey', ''); update_config(array('fb_on' => $CONF['fb_on'], 'fb_apikey' => $CONF['fb_apikey'], 'fb_skey' => $CONF['fb_skey']), true); } $template = new template(); $template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'fb_info' => $LNG['fb_info'], 'fb_secrectkey' => $LNG['fb_secrectkey'], 'fb_api_key' => $LNG['fb_api_key'], 'fb_active' => $LNG['fb_active'], 'fb_settings' => $LNG['fb_settings'], 'fb_on' => $CONF['fb_on'], 'fb_apikey' => $CONF['fb_apikey'], 'fb_skey' => $CONF['fb_skey'], 'fb_curl' => function_exists('curl_init') ? 1 : 0, 'fb_curl_info' => function_exists('curl_init') ? $LNG['fb_curl_yes'] : $LNG['fb_curl_no'])); $template->show('adm/FacebookPage.tpl'); }
function ShowStatsPage() { global $LNG, $CONF; if ($_POST) { $CONF['stat_settings'] = request_var('stat_settings', 0); $CONF['stat'] = request_var('stat', 0); $CONF['stat_update_time'] = request_var('stat_update_time', 0); $CONF['stat_level'] = request_var('stat_level', 0); update_config(array('stat_settings' => $CONF['stat_settings'], 'stat' => $CONF['stat'], 'stat_update_time' => $CONF['stat_update_time'], 'stat_level' => $CONF['stat_level']), true); } $template = new template(); $template->assign_vars(array('stat_level' => $CONF['stat_level'], 'stat_update_time' => $CONF['stat_update_time'], 'stat' => $CONF['stat'], 'stat_settings' => $CONF['stat_settings'], 'timeact' => date('d. M y H:i:s T', $CONF['stat_last_update']), 'cs_timeact_1' => $LNG['cs_timeact_1'], 'cs_access_lvl' => $LNG['cs_access_lvl'], 'cs_points_to_zero' => $LNG['cs_points_to_zero'], 'cs_time_between_updates' => $LNG['cs_time_between_updates'], 'cs_point_per_resources_used' => $LNG['cs_point_per_resources_used'], 'cs_title' => $LNG['cs_title'], 'cs_banner_time_between_updates' => $LNG['cs_banner_time_between_updates'], 'cs_banner_title' => $LNG['cs_banner_title'], 'cs_resources' => $LNG['cs_resources'], 'cs_minutes' => $LNG['cs_minutes'], 'cs_save_changes' => $LNG['cs_save_changes'], 'Selector' => array(1 => $LNG['cs_yes'], 2 => $LNG['cs_no_view'], 0 => $LNG['cs_no']))); $template->show('adm/StatsPage.tpl'); }
function ShowStatUpdatePage() { global $LNG; require_once ROOT_PATH . 'includes/classes/class.statbuilder.php'; $stat = new statbuilder(); $result = $stat->MakeStats(); $memory_p = str_replace(array("%p", "%m"), $result['memory_peak'], $LNG['sb_top_memory']); $memory_e = str_replace(array("%e", "%m"), $result['end_memory'], $LNG['sb_final_memory']); $memory_i = str_replace(array("%i", "%m"), $result['initial_memory'], $LNG['sb_start_memory']); $stats_end_time = sprintf($LNG['sb_stats_update'], $result['totaltime']); $stats_sql = sprintf($LNG['sb_sql_counts'], $result['sql_count']); update_config(array('stat_last_update' => $result['stats_time']), true); $template = new template(); $template->message($LNG['sb_stats_updated'] . $stats_end_time . $memory_i . $memory_e . $memory_p . $stats_sql, false, 0, true); }
function ShowModulePage() { global $CONF, $LNG; if ($_GET['mode']) { $CONF['moduls'][request_var('id', 0)] = $_GET['mode'] == 'aktiv' ? 1 : 0; update_config('moduls', implode(";", $CONF['moduls'])); $CONF['moduls'] = explode(";", $CONF['moduls']); } foreach ($LNG['modul'] as $ID => $Name) { $Modules[$ID] = array('name' => $Name, 'state' => $CONF['moduls'][$ID]); } $template = new template(); $template->page_header(); $template->assign_vars(array('Modules' => $Modules, 'mod_module' => $LNG['mod_module'], 'mod_info' => $LNG['mod_info'], 'mod_active' => $LNG['mod_active'], 'mod_deactive' => $LNG['mod_deactive'], 'mod_change_active' => $LNG['mod_change_active'], 'mod_change_deactive' => $LNG['mod_change_deactive'])); $template->show('adm/ModulePage.tpl'); }
function ShowModulePage() { global $CONF, $LNG; if ($_GET['mode']) { $CONF['moduls'][request_var('id', 0)] = $_GET['mode'] == 'aktiv' ? 1 : 0; update_config(array('moduls' => implode(";", $CONF['moduls']), false, $_SESSION['adminuni'])); $CONF['moduls'] = explode(";", $CONF['moduls']); } $IDs = range(0, 40); foreach ($IDs as $ID => $Name) { $Modules[$ID] = array('name' => $LNG['modul'][$ID], 'state' => isset($CONF['moduls'][$ID]) ? $CONF['moduls'][$ID] : 1); } $template = new template(); $template->assign_vars(array('Modules' => $Modules, 'mod_module' => $LNG['mod_module'], 'mod_info' => $LNG['mod_info'], 'mod_active' => $LNG['mod_active'], 'mod_deactive' => $LNG['mod_deactive'], 'mod_change_active' => $LNG['mod_change_active'], 'mod_change_deactive' => $LNG['mod_change_deactive'])); $template->show('adm/ModulePage.tpl'); }
function ShowConfigstatAdmin($user) { global $lang, $db, $displays; if ($user['authlevel'] < 3) { die($displays->message($lang['not_enough_permissions'])); } if ($_POST['save'] == $lang['cs_save_changes']) { if (isset($_POST['stat']) && $_POST['stat'] != $db->game_config['stat']) { update_config('stat', $_POST['stat']); $db->game_config['stat'] = $_POST['stat']; } if (isset($_POST['stat_level']) && is_numeric($_POST['stat_level']) && $_POST['stat_level'] != $db->game_config['stat_level']) { update_config('stat_level', $_POST['stat_level']); $db->game_config['stat_level'] = $_POST['stat_level']; } if (isset($_POST['stat_flying']) && $_POST['stat_flying'] != $db->game_config['stat_flying']) { update_config('stat_flying', $_POST['stat_flying']); $db->game_config['stat_flying'] = $_POST['stat_flying']; } if (isset($_POST['stat_settings']) && is_numeric($_POST['stat_settings']) && $_POST['stat_settings'] != $db->game_config['stat_settings']) { update_config('stat_settings', $_POST['stat_settings']); $db->game_config['stat_settings'] = $_POST['stat_settings']; } if (isset($_POST['stat_amount']) && is_numeric($_POST['stat_amount']) && $_POST['stat_amount'] != $db->game_config['stat_amount'] && $_POST['stat_amount'] >= 10) { update_config('stat_amount', $_POST['stat_amount']); $db->game_config['stat_amount'] = $_POST['stat_amount']; } if (isset($_POST['stat_update_time']) && is_numeric($_POST['stat_update_time']) && $_POST['stat_update_time'] != $db->game_config['stat_update_time']) { update_config('stat_update_time', $_POST['stat_update_time']); $db->game_config['stat_update_time'] = $_POST['stat_update_time']; } $displays->message("Configuaracion de estadisticas Guardadas", "admin.php?page=configstat"); } else { $selected = "selected=\"selected\""; $stat = $db->game_config['stat'] == 1 ? 'sel_sta1' : 'sel_sta0'; $lang[$stat] = $selected; $stat_fly = $db->game_config['stat_flying'] == 1 ? 'sel_sf1' : 'sel_sf0'; $lang[$stat_fly] = $selected; $lang['stat_level'] = $db->game_config['stat_level']; $lang['stat_settings'] = $db->game_config['stat_settings']; $lang['stat_amount'] = $db->game_config['stat_amount']; $lang['stat_update_time'] = $db->game_config['stat_update_time']; $displays->assignContent('adm/configstats_body'); $displays->display(); } }
function ShowStatbuilderAdmin($user) { global $lang, $svn_root, $db, $phpEx, $displays; include $svn_root . 'includes/pages/admin/statfunctions.' . $phpEx; if ($user['authlevel'] < 2) { die($displays->message($lang['not_enough_permissions'])); } $stats = new statfunction(); $result = $stats->MakeStats(); $memory_p = str_replace(array("%p", "%m"), $result['memory_peak'], $lang['sb_top_memory']); $memory_e = str_replace(array("%e", "%m"), $result['end_memory'], $lang['sb_final_memory']); $memory_i = str_replace(array("%i", "%m"), $result['initial_memory'], $lang['sb_start_memory']); $stats_end_time = str_replace("%t", $result['totaltime'], $lang['sb_stats_update']); $stats_block = str_replace("%n", $result['amount_per_block'], $lang['sb_users_per_block']); update_config('stat_last_update', $result['stats_time']); $using_flying = $game_config['stat_flying'] == 1 ? $lang['sb_using_fleet_array'] : $lang['sb_using_fleet_query']; $displays->message($lang['sb_stats_updated'] . $stats_end_time . $memory_i . $memory_e . $memory_p . $stats_block . $using_flying); }
function ShowOverviewAdmin($user) { global $lang, $db, $svn_root, $displays; if ($user['authlevel'] < 1) { die($displays->message($lang['not_enough_permissions'])); } if (file_exists($svn_root . 'install/') && defined('IN_ADMIN')) { $Message .= "<font color=\"red\">" . $lang['ow_install_file_detected'] . "</font><br/><br/>"; $error++; } if (@fopen($svn_root . "config.php", "a")) { $Message .= "<font color=\"red\">" . $lang['ow_config_file_writable'] . "</font><br/><br/>"; $error++; } $Errors = $db->query("SELECT COUNT(*) AS `errors` FROM {{table}};", 'errors', true); if ($Errors['errors'] != 0) { $Message .= "<font color=\"red\">" . $lang['ow_database_errors'] . "</font><br/><br/>"; $error++; } update_config("update_version", time()); include $svn_root . 'includes/functions/CheckVersion.php'; $time_ini = microtime(true); $updates = new Update_version(); $updates->check_ult_modificacion(); $updates->check_version(); $time_fin = microtime(true); //$versionerror=Checkversion(); if ($updates->errors > 0) { if ($updates->versioncreditos) { $error++; $Message .= "<font color=\"red\">" . $updates->versioncreditos . "</font><br/><br/>"; } elseif ($updates->mensajeversion) { $Message .= "<font color=\"red\">" . $updates->mensajeversion . "</font><br/><br/>"; $error++; } } if ($error != 0) { $lang['error_message'] = $Message; } else { $lang['error_message'] = $lang['ow_none']; } $displays->assignContent('adm/overview_body', $topnav = true, $menu = true, $admin = true); $displays->display(); }
function ShowTeamspeakPage() { global $CONF, $LNG; if ($_POST) { $CONF['ts_modon'] = isset($_POST['ts_on']) && $_POST['ts_on'] == 'on' ? 1 : 0; $CONF['ts_server'] = request_var('ts_ip', ''); $CONF['ts_tcpport'] = request_var('ts_tcp', 0); $CONF['ts_udpport'] = request_var('ts_udp', 0); $CONF['ts_timeout'] = request_var('ts_to', 0); $CONF['ts_version'] = request_var('ts_v', 0); $CONF['ts_login'] = request_var('ts_login', ''); $CONF['ts_password'] = request_var('ts_password', '', true); $CONF['ts_cron_interval'] = request_var('ts_cron', 0); update_config(array('ts_timeout' => $CONF['ts_timeout'], 'ts_modon' => $CONF['ts_modon'], 'ts_server' => $CONF['ts_server'], 'ts_tcpport' => $CONF['ts_tcpport'], 'ts_udpport' => $CONF['ts_udpport'], 'ts_version' => $CONF['ts_version'], 'ts_login' => $CONF['ts_login'], 'ts_password' => $CONF['ts_password'], 'ts_cron_interval' => $CONF['ts_cron_interval']), true); } $template = new template(); $template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'ts_tcpport' => $LNG['ts_tcpport'], 'ts_serverip' => $LNG['ts_serverip'], 'ts_version' => $LNG['ts_version'], 'ts_active' => $LNG['ts_active'], 'ts_settings' => $LNG['ts_settings'], 'ts_udpport' => $LNG['ts_udpport'], 'ts_timeout' => $LNG['ts_timeout'], 'ts_server_query' => $LNG['ts_server_query'], 'ts_sq_login' => $LNG['ts_login'], 'ts_sq_pass' => $LNG['ts_pass'], 'ts_lng_cron' => $LNG['ts_cron'], 'ts_to' => $CONF['ts_timeout'], 'ts_on' => $CONF['ts_modon'], 'ts_ip' => $CONF['ts_server'], 'ts_tcp' => $CONF['ts_tcpport'], 'ts_udp' => $CONF['ts_udpport'], 'ts_v' => $CONF['ts_version'], 'ts_login' => $CONF['ts_login'], 'ts_password' => $CONF['ts_password'], 'ts_cron' => $CONF['ts_cron_interval'])); $template->show('adm/TeamspeakPage.tpl'); }
function ShowFacebookPage() { global $CONF, $LNG; if ($_POST) { if (isset($_POST['fb_on']) && $_POST['fb_on'] == 'on' && !empty($_POST['fb_skey']) && !empty($_POST['fb_apikey'])) { $CONF['fb_on'] = 1; } else { $CONF['fb_on'] = 0; } $CONF['fb_apikey'] = request_var('fb_apikey', ''); $CONF['fb_skey'] = request_var('fb_skey', ''); update_config('fb_on', $CONF['fb_on']); update_config('fb_apikey', $CONF['fb_apikey']); update_config('fb_skey', $CONF['fb_skey']); } $template = new template(); $template->page_header(); $template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'fb_info' => $LNG['fb_info'], 'fb_secrectkey' => $LNG['fb_secrectkey'], 'fb_api_key' => $LNG['fb_api_key'], 'fb_active' => $LNG['fb_active'], 'fb_settings' => $LNG['fb_settings'], 'fb_on' => $CONF['fb_on'], 'fb_apikey' => $CONF['fb_apikey'], 'fb_skey' => $CONF['fb_skey'])); $template->show('adm/FacebookPage.tpl'); }
** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(__FILE__) . '/include/config.inc.php'; $page['title'] = _('Configuration of trigger displaying options'); $page['file'] = 'adm.triggerdisplayoptions.php'; $page['hist_arg'] = array(); require_once dirname(__FILE__) . '/include/page_header.php'; $fields = array('problem_unack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'problem_ack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'ok_unack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'ok_ack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'problem_unack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'problem_ack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'ok_unack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'ok_ack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'ok_period' => array(T_ZBX_INT, O_OPT, null, null, 'isset({save})'), 'blink_period' => array(T_ZBX_INT, O_OPT, null, null, 'isset({save})'), 'save' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'form' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form_refresh' => array(T_ZBX_INT, O_OPT, null, null, null)); check_fields($fields); if (isset($_REQUEST['save'])) { $configs = array('ok_period' => get_request('ok_period'), 'blink_period' => get_request('blink_period'), 'problem_unack_color' => get_request('problem_unack_color'), 'problem_ack_color' => get_request('problem_ack_color'), 'ok_unack_color' => get_request('ok_unack_color'), 'ok_ack_color' => get_request('ok_ack_color'), 'problem_unack_style' => get_request('problem_unack_style', 0), 'problem_ack_style' => get_request('problem_ack_style', 0), 'ok_unack_style' => get_request('ok_unack_style', 0), 'ok_ack_style' => get_request('ok_ack_style', 0)); $result = update_config($configs); show_messages($result, _('Configuration updated'), _('Cannot update configuration')); } $form = new CForm(); $form->cleanItems(); $cmbConf = new CComboBox('configDropDown', 'adm.triggerdisplayoptions.php', 'redirect(this.options[this.selectedIndex].value);'); $cmbConf->addItems(array('adm.gui.php' => _('GUI'), 'adm.housekeeper.php' => _('Housekeeping'), 'adm.images.php' => _('Images'), 'adm.iconmapping.php' => _('Icon mapping'), 'adm.regexps.php' => _('Regular expressions'), 'adm.macros.php' => _('Macros'), 'adm.valuemapping.php' => _('Value mapping'), 'adm.workingtime.php' => _('Working time'), 'adm.triggerseverities.php' => _('Trigger severities'), 'adm.triggerdisplayoptions.php' => _('Trigger displaying options'), 'adm.other.php' => _('Other'))); $form->addItem($cmbConf); $cnf_wdgt = new CWidget(); $cnf_wdgt->addPageHeader(_('CONFIGURATION OF ZABBIX'), $form); $data = array(); $data['form_refresh'] = get_request('form_refresh', 0); // form has been submitted if ($data['form_refresh']) { $data['ok_period'] = get_request('ok_period'); $data['blink_period'] = get_request('blink_period');
break; } } if ($flag == 1) { //用户已经存在 echo "a"; //header("Location:http://127.0.0.1/project4/log_in.php?username=$username&password=$password"); die; } else { $usernames[$user_num + 1] = $username; file_put_contents('./user/username.json', json_encode($usernames)); $passwords[$user_num + 1] = $password; file_put_contents('./user/password.json', json_encode($passwords)); $extensions[$user_num + 1] = "welcome to nsc!"; file_put_contents('./user/extension.json', json_encode($extensions)); update_config('./user/user_config.php', 'user_num', $user_num + 1); echo "c"; die; //header("Location:http://127.0.0.1/project4/log_in.php"); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="./css/bootstrap.css" rel="stylesheet">
** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(__FILE__) . '/include/config.inc.php'; $page['title'] = _('Configuration of trigger displaying options'); $page['file'] = 'adm.triggerdisplayoptions.php'; require_once dirname(__FILE__) . '/include/page_header.php'; $fields = ['problem_unack_color' => [T_ZBX_CLR, O_OPT, null, null, 'isset({update})', _('Unacknowledged PROBLEM events')], 'problem_ack_color' => [T_ZBX_CLR, O_OPT, null, null, 'isset({update})', _('Acknowledged PROBLEM events')], 'ok_unack_color' => [T_ZBX_CLR, O_OPT, null, null, 'isset({update})', _('Unacknowledged OK events')], 'ok_ack_color' => [T_ZBX_CLR, O_OPT, null, null, 'isset({update})', _('Acknowledged OK events')], 'problem_unack_style' => [T_ZBX_INT, O_OPT, null, IN('1'), null, _('Blinking')], 'problem_ack_style' => [T_ZBX_INT, O_OPT, null, IN('1'), null, _('Blinking')], 'ok_unack_style' => [T_ZBX_INT, O_OPT, null, IN('1'), null, _('Blinking')], 'ok_ack_style' => [T_ZBX_INT, O_OPT, null, IN('1'), null, _('Blinking')], 'ok_period' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 999999), 'isset({update})', _('Display OK triggers for')], 'blink_period' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 999999), 'isset({update})', _('On status change triggers blink for')], 'update' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'form_refresh' => [T_ZBX_INT, O_OPT, null, null, null]]; check_fields($fields); /* * Actions */ if (hasRequest('update')) { DBstart(); $result = update_config(['problem_unack_color' => getRequest('problem_unack_color'), 'problem_ack_color' => getRequest('problem_ack_color'), 'ok_unack_color' => getRequest('ok_unack_color'), 'ok_ack_color' => getRequest('ok_ack_color'), 'problem_unack_style' => getRequest('problem_unack_style', 0), 'problem_ack_style' => getRequest('problem_ack_style', 0), 'ok_unack_style' => getRequest('ok_unack_style', 0), 'ok_ack_style' => getRequest('ok_ack_style', 0), 'ok_period' => getRequest('ok_period'), 'blink_period' => getRequest('blink_period')]); $result = DBend($result); show_messages($result, _('Configuration updated'), _('Cannot update configuration')); } /* * Display */ $config = select_config(); // form has been submitted if (hasRequest('form_refresh')) { $data = ['problem_unack_color' => getRequest('problem_unack_color', $config['problem_unack_color']), 'problem_ack_color' => getRequest('problem_ack_color', $config['problem_ack_color']), 'ok_unack_color' => getRequest('ok_unack_color', $config['ok_unack_color']), 'ok_ack_color' => getRequest('ok_ack_color', $config['ok_ack_color']), 'problem_unack_style' => getRequest('problem_unack_style', 0), 'problem_ack_style' => getRequest('problem_ack_style', 0), 'ok_unack_style' => getRequest('ok_unack_style', 0), 'ok_ack_style' => getRequest('ok_ack_style', 0), 'ok_period' => getRequest('ok_period', $config['ok_period']), 'blink_period' => getRequest('blink_period', $config['blink_period'])]; } else { $data = ['problem_unack_color' => $config['problem_unack_color'], 'problem_ack_color' => $config['problem_ack_color'], 'ok_unack_color' => $config['ok_unack_color'], 'ok_ack_color' => $config['ok_ack_color'], 'problem_unack_style' => $config['problem_unack_style'], 'problem_ack_style' => $config['problem_ack_style'], 'ok_unack_style' => $config['ok_unack_style'], 'ok_ack_style' => $config['ok_ack_style'], 'ok_period' => $config['ok_period'], 'blink_period' => $config['blink_period']]; } $view = new CView('administration.general.trigger.options.edit', $data); $view->render();
} elseif (preg_match('!:del_[a-z0-9]{0,3}reports:!i', $config['queue'])) { $table = 'reports'; $for = strpos($config['queue'], ':del_allreports:') !== false ? 'all' : 30; } $days = intval(time() - 3600 * 24 * intval($for)); $query = array('SELECT' => 'f.id, f.time', 'FROM' => "`{$dbprefix}" . $table . "` f", 'ORDER BY' => 'f.id ASC', 'LIMIT' => '20'); if ($for != 'all') { $query['WHERE'] = "f.time < {$days}"; } ($hook = $plugin->run_hook('qr_select_klj_clean_old_queue')) ? eval($hook) : null; //run hook $result = $SQL->build($query); $num_to_delete = $SQL->num_rows($result); if ($num_to_delete == 0) { $t = $table == 'call' ? 'calls' : $table; update_config('queue', preg_match('!:del_' . $for . $t . ':!i', '', $config['queue'])); $SQL->freeresult($result); return; } $ids = array(); $num = 0; while ($row = $SQL->fetch_array($result)) { $ids[] = $row['id']; $num++; } $SQL->freeresult($result); $query_del = array('DELETE' => "`" . $dbprefix . $table . "`", 'WHERE' => "id IN (" . implode(',', $ids) . ")"); ($hook = $plugin->run_hook('qr_del_delf_old_table')) ? eval($hook) : null; //run hook $SQL->build($query_del); #end
$harga = $row['branch_menu_price']; } }else{ $harga = $row['branch_menu_price']; }*/ $harga = $row['branch_menu_price']; $total = $jumlah * $harga; $check_history = check_history($i_table_id, $row['menu_id']); if ($check_history > 0) { $data_history = get_data_history($i_table_id, $row['menu_id']); $row_history = mysql_fetch_array($data_history); //$new_qty = $row_history['transaction_detail_qty'] + $jumlah; $new_qty = $jumlah; $new_total = $new_qty * $harga; $data_detail = "transaction_detail_qty = '{$new_qty}', \n\t\t\t\t\t\t\t\t\t\ttransaction_detail_total = '{$new_total}',\n\t\t\t\t\t\t\t\t\t\ttransaction_detail_compliment_status = '{$get_compliment_status}'\n\t\t\t\t\t\t\t\t\t"; update_config("transaction_tmp_details", $data_detail, "transaction_detail_id", $row_history['transaction_detail_id']); } else { $data_detail = "'',\n\t\t\t\t\t\t\t\t\t'{$transaction_id}',\n\t\t\t\t\t\t\t\t\t'" . $row['menu_id'] . "',\n\t\t\t\t\t\t\t\t\t'" . $row['menu_original_price'] . "',\n\t\t\t\t\t\t\t\t\t'" . $row['menu_margin_price'] . "',\n\t\t\t\t\t\t\t\t\t'" . $harga . "',\n\t\t\t\t\t\t\t\t\t'0',\n\t\t\t\t\t\t\t\t\t'" . $harga . "',\n\t\t\t\t\t\t\t\t\t'{$jumlah}',\n\t\t\t\t\t\t\t\t\t'{$total}',\n\t\t\t\t\t\t\t\t\t'0',\n\t\t\t\t\t\t\t\t\t'{$get_compliment_status}'\n\t\t\t\t\t\t\t\t\t"; create_config("transaction_tmp_details", $data_detail); } } } /*if($i_tot_id == 1){ header("Location: order.php"); }else{ header("Location: payment.php?table_id=0"); }*/ header("Location: payment.php?page=list&table_id={$i_table_id}&building_id={$building_id}"); } else { header("Location: transaction.php?page=list&err=1&table_id={$i_table_id}&building_id={$building_id}"); }
if ($iphone_audio_sampling == '') { $errors[] = 'Sound sampling rate for converted videos cannot be left blank!'; } elseif (!is_numeric($iphone_audio_sampling)) { $errors[] = 'Sound sampling rate for converted videos must have a numeric value!'; } $config['iphone_convert'] = $iphone_convert; if ($config['flv_convert'] == 0 && $config['iphone_convert'] == 0) { $errors[] = 'You can\'t disable both FLV and Mobile Conversion!'; } // No Errors if (!$errors) { // Update encoding profile in db $sql = "UPDATE encoding_avs SET" . " ovc_profile = '" . $iphone_ovc_profile . "'" . ", resize_base = '" . $iphone_resize_base . "'" . ", resize_width = '" . $iphone_resize_width . "'" . ", resize_height = '" . $iphone_resize_height . "'" . ", ref_bitrate = '" . $iphone_ref_bitrate . "'" . ", ref_type = '" . $iphone_ref_type . "'" . ", encodepass = '******'" . ", blackbars = '" . $iphone_blackbars . "'" . ", audio_sampling = '" . $iphone_audio_sampling . "'" . ", audio_bitrate = '" . $iphone_audio_bitrate . "'" . " WHERE action = 'encode_ipod'" . ""; $conn->execute($sql); // Update $config update_config($config); update_smarty(); $messages[] = 'Conversion settings updated successfully!'; } } // Get db Values $sql = "SELECT ovc_profile, resize_base, resize_width, resize_height, ref_bitrate," . " ref_type, encodepass, blackbars, audio_sampling, audio_bitrate" . " FROM encoding_avs" . " WHERE video_type = 'normal'" . " AND action = 'encode_ipod'" . ""; $rs = $conn->execute($sql); $ovc_profile = $rs->fields['ovc_profile']; $resize_base = $rs->fields['resize_base']; $resize_width = $rs->fields['resize_width']; $resize_height = $rs->fields['resize_height']; $ref_bitrate = $rs->fields['ref_bitrate']; $ref_type = $rs->fields['ref_type']; $encodepass = $rs->fields['encodepass']; $blackbars = $rs->fields['blackbars'];
while ($row = $SQL->fetch_array($result)) { if (in_array($row['plg_name'], $plugins_required)) { unset($plugins_required[$row['plg_name']]); } } } $SQL->freeresult($result); $plugins_required = array_flip($plugins_required); if (sizeof($plugins_required)) { kleeja_admin_err(sprintf($lang['PLUGINS_REQ_NO_STYLE_ERR'], implode(', ', $plugins_required))); } } } //make it as default update_config('style', $style_id); update_config('style_depend_on', isset($style_info['depend_on']) ? $style_info['depend_on'] : ''); //delete all cache to get new style delete_cache('', true); //show msg kleeja_admin_info(sprintf($lang['STYLE_NOW_IS_DEFAULT'], htmlspecialchars($style_id)), true, '', true, basename(ADMIN_PATH) . '?cp=' . (isset($_REQUEST['home']) ? 'start' : basename(__FILE__, '.php'))); break; } } break; case 'style_orders': //style id .. $style_id = str_replace('..', '', htmlspecialchars($_GET['style_id'])); $redirect_to = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&style_choose=' . $style_id . '&method=1'; if (empty($_GET['tpl_choose'])) { #redirect($redirect_to); }
font-family:Arial, Helvetica, sans-serif; font-size:12px; padding:0px 0px 0px 0px; } </style> <h2>Install Finished </h2><br /> <font size="2">You may now set up your site configuration</font><br /><br /> <a href="../core.php"><font size="3" color="#ff0000">HERE</font></a></td> </tr> </table> <?php die; exit; } if (isset($_POST['install'])) { if ($_POST['install'] || $_GET['install']) { update_config(); basic_query(); insert_coder(); finale(); ?> <form method="post" type="hidden" action="../admincp.php"> <?php } } else { step_1(); }
<option>Yes</option> <option>No</option> </select><br /> </div> <input type="submit" value="Update" name="conf[submit]" class="submit" /> </form> <?php } elseif ($page == 'lang') { ?> <?php if (isset($_POST['lang'])) { update_config($_POST['lang'], $lang); } include 'lang.inc.php'; ?> <h2>Language settings</h2> <form method="post"> Month names (separated with comma): <br /> <input type="text" name="lang[months]" value="<?php print $lang['months']; ?> " class="text" /><br /> Year: <br /> <input type="text" name="lang[year]" value="<?php print $lang['year']; ?>
case 'payment': $id = get_isset($_GET['id']); payment($id); header('Location: purchase.php?page=list&did=4'); break; case 'add_menu': $item_id = get_isset($_GET['item_id']); $data = "'',\n\t\t\t\t\t'0',\n\t\t\t\t\t'{$item_id}',\n\t\t\t\t\t'0', \n\t\t\t\t\t'0',\n\t\t\t\t\t'" . $_SESSION['user_id'] . "'\n\t\t\t\t\t\n\t\t\t"; create_config("purchase_details", $data); header("Location: purchase.php?page=form"); break; case 'edit_price': $id = get_isset($_GET['id']); $qty = get_isset($_GET['qty']); $price = get_isset($_GET['price']); $data = "purchase_detail_qty = '{$qty}',\n\t\t\t\tpurchase_detail_price = '{$price}'\n\t\t\t\t\n\t\t"; update_config("purchase_details", $data, "purchase_detail_id", $id); break; case 'edit_qty': $id = get_isset($_GET['id']); $qty = get_isset($_GET['qty']); $price = get_isset($_GET['price']); $data = "purchase_detail_qty = '{$qty}',\n\t\t\t\tpurchase_detail_price = '{$price}'\n\t\t\t\t\n\t\t"; update_config("purchase_details", $data, "purchase_detail_id", $id); break; case 'delete_item': $id = get_isset($_GET['id']); delete_item($id); header("Location: purchase.php?page=form"); break; }
$H_FORM_KEYS = kleeja_add_form_key('adm_reports'); $there_queue = preg_match('!:del_[a-z0-9]{0,3}reports:!i', $config['queue']); // // Check form key // if (isset($_POST['submit'])) { if (!kleeja_check_form_key('adm_reports')) { kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1); } } #add delete process to the queue if ($current_smt == 'del_d30' || $current_smt == 'del_all') { if (strpos($config['queue'], ':' . $current_smt . 'reports:') !== false) { kleeja_admin_err($lang['DELETE_PROCESS_IN_WORK'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php'), 1); } else { update_config('queue', $config['queue'] . ':' . $current_smt . 'reports:'); kleeja_admin_info($lang['DELETE_PROCESS_QUEUED'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php')); } } $query = array('SELECT' => '*', 'FROM' => "{$dbprefix}reports r", 'ORDER BY' => 'r.id DESC'); if ($current_smt == 'show_h24') { $query['WHERE'] = 'r.time > ' . intval(time() - 3600 * 24); } $result = $SQL->build($query); //pagination $nums_rows = $SQL->num_rows($result); $currentPage = isset($_GET['page']) ? intval($_GET['page']) : 1; $Pager = new SimplePager($perpage, $nums_rows, $currentPage); $start = $Pager->getStartRow(); $no_results = false; $del_nums = array();
($hook = $plugin->run_hook('while_qr_select_online_index_page')) ? eval($hook) : null; //run hook $usersnum++; $online_names[$row['name']] = $row['name']; } #while $SQL->freeresult($result); //check & update most ever users and vistors was online if (empty($config['most_user_online_ever']) || trim($config['most_user_online_ever']) == '') { $most_online = $usersnum; $on_muoe = time(); } else { list($most_online, $on_muoe) = @explode($config['most_user_online_ever']); } if ((int) $most_online < $allnumbers || (empty($config['most_user_online_ever']) || trim($config['most_user_online_ever']) == '')) { update_config('most_user_online_ever', $usersnum . ':' . time()); } $on_muoe = date('d-m-Y h:i a', $on_muoe); if (!$usersnum) { $show_online = false; } ($hook = $plugin->run_hook('if_online_index_page')) ? eval($hook) : null; //run hook } #allow_online ($hook = $plugin->run_hook('end_index_page')) ? eval($hook) : null; //run hook #header kleeja_header(); #index template include get_template_path($current_template);
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(__FILE__) . '/include/config.inc.php'; $page['title'] = _('Configuration of working time'); $page['file'] = 'adm.workingtime.php'; $page['hist_arg'] = array(); require_once dirname(__FILE__) . '/include/page_header.php'; // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION $fields = array('work_period' => array(T_ZBX_STR, O_NO, null, null, 'isset({save})'), 'save' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'form_refresh' => array(T_ZBX_INT, O_OPT, null, null, null)); check_fields($fields); /* * Actions */ if (isset($_REQUEST['save'])) { DBstart(); $result = update_config(array('work_period' => get_request('work_period'))); show_messages($result, _('Configuration updated'), _('Cannot update configuration')); if ($result) { add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_ZABBIX_CONFIG, _s('Working time "%1$s".', get_request('work_period'))); } DBend($result); } /* * Display */ $form = new CForm(); $form->cleanItems(); $cmbConf = new CComboBox('configDropDown', 'adm.workingtime.php', 'redirect(this.options[this.selectedIndex].value);'); $cmbConf->addItems(array('adm.gui.php' => _('GUI'), 'adm.housekeeper.php' => _('Housekeeping'), 'adm.images.php' => _('Images'), 'adm.iconmapping.php' => _('Icon mapping'), 'adm.regexps.php' => _('Regular expressions'), 'adm.macros.php' => _('Macros'), 'adm.valuemapping.php' => _('Value mapping'), 'adm.workingtime.php' => _('Working time'), 'adm.triggerseverities.php' => _('Trigger severities'), 'adm.triggerdisplayoptions.php' => _('Trigger displaying options'), 'adm.other.php' => _('Other'))); $form->addItem($cmbConf); $cnf_wdgt = new CWidget();
function UpdateBots() { $now = time(); if (read_config('bots') > 0 && read_config('bots_last_update') < $now - 60) { include_once XN_ROOT . 'includes/functions/CheckPlanetBuildingQueue.php'; include_once XN_ROOT . 'includes/functions/GetBuildingPrice.php'; include_once XN_ROOT . 'includes/functions/IsElementBuyable.php'; include_once XN_ROOT . 'includes/functions/SetNextQueueElementOnTop.php'; include_once XN_ROOT . 'includes/functions/UpdatePlanetBatimentQueueList.php'; include_once XN_ROOT . 'includes/functions/IsTechnologieAccessible.php'; include_once XN_ROOT . 'includes/functions/GetElementPrice.php'; include_once XN_ROOT . 'includes/functions/HandleTechnologieBuild.php'; include_once XN_ROOT . 'includes/functions/CheckPlanetUsedFields.php'; if (read_config('log_bots')) { $BotLog = "\n\n------------------------------------------\n"; } $allbots = doquery("SELECT * FROM {{table}} WHERE `next_time`<" . $now, 'bots'); $update_bots = array(); $update_users = array(); while ($bot = $allbots->fetch_array()) { $user = doquery("SELECT * FROM {{table}} WHERE `id` = '" . $bot['user'] . "'", 'users', true); $thebot = new Bot($user, $bot); $thebot->Play(); if (isset($BotLog)) { $BotLog .= $thebot->log; } /** * Para calcular la próxima actividad, se genera una función que decrece de * probabilidad casi totalmente en 15 minutos. Luego se calcula la próxima * actividad un poco aleatóriamente, teniendo en cuenta la noche, las horas * de sueño y según los minutos que está conectado. **/ if (date('H', $now) < 8) { $max_time = 28800 / (($bot['minutes_per_day'] < 975 ? 15 : $bot['minutes_per_day'] - 960) / 15); } elseif ($bot['minutes_per_day'] >= 960) { $max_time = 60; } else { $max_time = 57600 / ($bot['minutes_per_day'] / 15); } if ($max_time / 60 > 15) { $random = mt_rand(1, 100); if ($random <= 30) { $next_time = $now + mt_rand(1, 120); } elseif ($random <= 45) { $next_time = $now + mt_rand(61, 180); } elseif ($random <= 55) { $next_time = $now + mt_rand(121, 240); } elseif ($random <= 62) { $next_time = $now + mt_rand(181, 300); } elseif ($random <= 68) { $next_time = $now + mt_rand(241, 360); } elseif ($random <= 73) { $next_time = $now + mt_rand(301, 420); } elseif ($random <= 81) { $next_time = $now + mt_rand(361, 540); } elseif ($random <= 90) { $next_time = $now + mt_rand(421, 660); } else { $next_time = $now + mt_rand(541, 960); } } if (mt_rand(0, 1) or $max_time / 60 <= 15) { $next_time = $now + mt_rand($max_time > 120 ? $max_time - 60 : 60, $max_time + 60); } if (date('H', $next_time) < 8 && $bot['minutes_per_day'] < 960) { $next_time = mktime(8); } $update_bots[$bot['id']] = array('last_time' => $now, 'next_time' => $next_time, 'minutes_per_day' => !mt_rand(0, 999) ? mt_rand(1, 1440) : $bot['minutes_per_day'], 'last_planet' => $thebot->end_planet); $update_users[$bot['user']] = array('onlinetime' => $now, 'user_lastip' => 'BOT', 'user_agent' => 'BOT'); unset($thebot); } if (isset($BotLog)) { $st = fopen(XN_ROOT . "adm/Log/BotLog.php", "a"); $BotLog .= 'Bots actualizados a las ' . date('H:i:s - j/n/Y', $now) . "\n"; $BotLog .= "------------------------------------------"; fwrite($st, $BotLog); fclose($st); } unset($bot); unset($allbots); if (!empty($update_bots)) { $query = 'UPDATE {{table}}'; $bot_ids = array(); $user_ids = array(); foreach ($update_bots as $id => $values) { foreach ($values as $field => $value) { if (!isset($fields[$field])) { $fields[$field] = ' SET `' . $field . '` = CASE'; } $fields[$field] .= ' WHEN `id` = \'' . $id . '\' THEN \'' . $value . '\''; } $bot_ids[] = $id; } foreach ($fields as $field => $text) { $query_bots = $query . $text . ' ELSE `' . $field . '` END,'; } $query_bots = substr($query_bots, 0, -1) . ' WHERE `id` IN (' . implode(',', $bot_ids) . ')'; foreach ($update_users as $id => $values) { foreach ($values as $field => $value) { if (!isset($fields[$field])) { $fields[$field] = ' SET `' . $field . '` = CASE'; } $fields[$field] .= ' WHEN `id` = \'' . $id . '\' THEN \'' . $value . '\''; } $user_ids[] = $id; } foreach ($fields as $field => $text) { $query_users = $query . $text . ' ELSE `' . $field . '` END,'; } $query_users = substr($query_users, 0, -1) . ' WHERE `id` IN (' . implode(',', $user_ids) . ')'; doquery($query_bots, 'bots'); doquery($query_users, 'users'); } update_config('bots_last_update', $now); } }
//some variables must be destroyed here unset($online_names, $timeout, $timeout2); /** * Wanna increase your onlines counter ..you can from next line * but you must know this is illegal ... */ $allnumbers = $usersnum + $visitornum; //check & update most ever users and vistors was online if (empty($config['most_user_online_ever']) || trim($config['most_user_online_ever']) == '') { $most_online = $allnumbers; $on_muoe = time(); } else { list($most_online, $on_muoe) = @explode($config['most_user_online_ever']); } if ((int) $most_online < $allnumbers || (empty($config['most_user_online_ever']) || trim($config['most_user_online_ever']) == '')) { update_config('most_user_online_ever', $allnumbers . ':' . time()); } $on_muoe = date('d-m-Y h:i a', $on_muoe); ($hook = kleeja_run_hook('if_online_index_page')) ? eval($hook) : null; //run hook } #allow_online ($hook = kleeja_run_hook('end_index_page')) ? eval($hook) : null; //run hook //header Saaheader(); //index echo $tpl->display("index_body"); //footer Saafooter(); //<-- EOF
} else { show_error_message($isAuthenticationTypeChanged ? _('Cannot change authentication method to LDAP') : _('Cannot change authentication')); } } } elseif (isset($_REQUEST['test'])) { show_messages($login, _('LDAP login successful'), _('LDAP login was not successful')); } } } elseif ($config['authentication_type'] == ZBX_AUTH_HTTP) { if (isset($_REQUEST['save'])) { // get groups wich use this authentication method $result = DBfetch(DBselect('SELECT COUNT(g.usrgrpid) AS cnt_usrgrp FROM usrgrp g WHERE g.gui_access=' . GROUP_GUI_ACCESS_INTERNAL)); if ($result['cnt_usrgrp'] > 0) { info(_n('There is "%1$d" group with Internal GUI access.', 'There are "%1$d" groups with Internal GUI access.', $result['cnt_usrgrp'])); } if (update_config($config)) { // reset all sessions if ($isAuthenticationTypeChanged) { DBexecute('UPDATE sessions SET status=' . ZBX_SESSION_PASSIVE . ' WHERE sessionid<>' . zbx_dbstr($USER_DETAILS['sessionid'])); } $isAuthenticationTypeChanged = false; add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_ZABBIX_CONFIG, _('Authentication method changed to HTTP')); show_message(_('Authentication method changed to HTTP')); } else { show_error_message(_('Cannot change authentication method to HTTP')); } } } show_messages(); /* * Display