function tool_graphs_menu_get_list()
{
    global $tool_graph_menu;
    global $nel_user;
    $new_menu = array();
    reset($tool_graph_menu);
    foreach ($tool_graph_menu as $menu_item) {
        if ($menu_item['access'] == '' || tool_admin_applications_check($menu_item['access'])) {
            $new_menu[] = $menu_item;
        }
    }
    return $new_menu;
}
Example #2
0
             }
             break;
     }
     $tool_shard_list = tool_admin_shards_get_list();
     $tool_domain_list = tool_admin_domains_get_list();
     $tpl->assign('tool_shard_list', $tool_shard_list);
     $tpl->assign('tool_domain_list', $tool_domain_list);
     $tpl->assign('tool_language_list', $tool_language_list);
     break;
 case 'restarts':
     /*
      * ###################################################################################################
      *  Restart Admin
      * ###################################################################################################
      */
     if (!tool_admin_applications_check('tool_admin_restart')) {
         nt_common_redirect('index.php');
     }
     $tool_action = null;
     if (isset($_POST['toolaction'])) {
         $tool_action = $_POST['toolaction'];
     } elseif (isset($_GET['toolaction'])) {
         $tool_action = $_GET['toolaction'];
     }
     switch ($tool_action) {
         case 'update':
             /*
              * -------------------------------------------------------------------------------------------
              *  Update an existing Restart Group
              * -------------------------------------------------------------------------------------------
              */
Example #3
0
<?php

require_once 'common.php';
require_once 'functions_tool_notes.php';
if (!tool_admin_applications_check('tool_notes')) {
    nt_common_redirect('index.php');
}
nt_common_add_debug('-- Starting on \'tool_notes.php\'');
$tpl->assign('tool_title', "Notes");
if (tool_admin_applications_check('tool_notes_global')) {
    $tpl->assign('restriction_tool_notes_global', true);
}
if (isset($NELTOOL['GET_VARS']['note_id'])) {
    $note_id = $NELTOOL['GET_VARS']['note_id'];
    $tool_note_data = tool_notes_get_id($nel_user['user_id'], $note_id);
    $tpl->assign('tool_note_edit_data', $tool_note_data);
}
if (isset($NELTOOL['POST_VARS']['toolaction'])) {
    $tool_action = $NELTOOL['POST_VARS']['toolaction'];
    switch ($tool_action) {
        case 'create':
            $note_title = $NELTOOL['POST_VARS']['tool_form_note_title'];
            $note_data = $NELTOOL['POST_VARS']['tool_form_note_data'];
            $note_active = $NELTOOL['POST_VARS']['tool_form_note_active'];
            $note_global = isset($NELTOOL['POST_VARS']['tool_form_note_global']) ? $NELTOOL['POST_VARS']['tool_form_note_global'] : 0;
            $note_mode = $NELTOOL['POST_VARS']['tool_form_note_mode'];
            $note_uri = $NELTOOL['POST_VARS']['tool_form_note_popup_uri'];
            $note_restriction = $NELTOOL['POST_VARS']['tool_form_note_popup_restriction'];
            $tool_error = tool_notes_add($nel_user['user_id'], $note_title, $note_data, $note_active, $note_global, $note_mode, $note_uri, $note_restriction);
            if ($tool_error != "") {
                $tpl->assign('tool_alert_message', $tool_error);
function tool_main_parse_status($status)
{
    $check_graphs = tool_admin_applications_check('tool_main_graphs');
    $_sort_list = array();
    $domainServices = array();
    $sortedServices = array();
    if (is_array($status) && sizeof($status)) {
        reset($status);
        foreach ($status as $sline) {
            $vars = array();
            $vars['_flags_'] = array();
            $sline_vars = explode("\t", $sline);
            reset($sline_vars);
            foreach ($sline_vars as $sline_var) {
                $sline_parts = explode("=", $sline_var);
                if ($sline_parts[0] == 'RunningState') {
                    // this is a small fix to an unknown server bug :)
                    if (trim($sline_parts[1]) == 'topped') {
                        $sline_parts[1] = 'rs_stopped';
                    } elseif (trim($sline_parts[1]) == 'nline') {
                        $sline_parts[1] = 'rs_online';
                    }
                    $vars['_flags_'][$sline_parts[1]] = true;
                    $sline_parts[1] = substr($sline_parts[1], 3);
                } elseif ($sline_parts[0] == 'RunningOrders') {
                    $vars['_flags_'][$sline_parts[1]] = true;
                    $sline_parts[1] = substr($sline_parts[1], 3);
                } elseif ($sline_parts[0] == 'RunningTags') {
                    $_tmp = explode(" ", trim($sline_parts[1]));
                    reset($_tmp);
                    foreach ($_tmp as $_tmp_key => $_tmp_part) {
                        $vars['_flags_'][$_tmp_part] = true;
                        $_tmp_part = str_replace('_', ' ', substr($_tmp_part, 3));
                        $_tmp[$_tmp_key] = $_tmp_part;
                    }
                    $sline_parts[1] = implode(' / ', $_tmp);
                } elseif ($sline_parts[0] == 'NoReportSince') {
                    $_today = time();
                    $_day = date("d", $_today);
                    $_month = date("m", $_today);
                    $_year = date("Y", $_today);
                    $_base_day = mktime(0, 0, 0, $_month, $_day, $_year);
                    if ($sline_parts[1] >= $_base_day) {
                        $sline_parts[1] = 'n/a';
                    } else {
                        $time0 = 0 + $sline_parts[1];
                        // convert to a number ;)
                        if ($time0 > 60) {
                            $vars['_flags_']['alert_red'] = true;
                        } elseif ($time0 > 40) {
                            $vars['_flags_']['alert_orange_dark'] = true;
                        } elseif ($time0 > 25) {
                            $vars['_flags_']['alert_orange_light'] = true;
                        }
                        tool_main_get_elapsed_time_string($sline_parts[1], $sline_parts[1]);
                    }
                } elseif ($sline_parts[0] == 'UpTime') {
                    $_today = time();
                    $_day = date("d", $_today);
                    $_month = date("m", $_today);
                    $_year = date("Y", $_today);
                    $_base_day = mktime(0, 0, 0, $_month, $_day, $_year);
                    if ($sline_parts[1] >= $_base_day) {
                        $sline_parts[1] = 'n/a';
                    } else {
                        tool_main_get_elapsed_time_string($sline_parts[1], $sline_parts[1]);
                    }
                } elseif ($sline_parts[0] == 'State') {
                    if (strtolower($sline_parts[1]) == 'stalled') {
                        $vars['_flags_']['alert_red'] = true;
                    } elseif (strtolower($sline_parts[1]) == 'halted') {
                        $vars['_flags_']['alert_red'] = true;
                    }
                    $vars['_flags_'][$sline_parts[1]] = true;
                } elseif ($sline_parts[0] == 'Hostname') {
                    $sline_parts[1] = substr($sline_parts[1], 0, strpos($sline_parts[1], '.'));
                } elseif ($sline_parts[0] == 'AliasName') {
                    $vars['_flags_']['alias_code'] = '';
                }
                $vars[$sline_parts[0]] = $sline_parts[1];
            }
            // check is service is chain crashing
            if (in_array('rt_chain_crashing', array_keys($vars['_flags_']))) {
                // check is service is online (anything that is not stopped)
                if (!in_array('rs_stopped', array_keys($vars['_flags_']))) {
                    // check the start counts for crashing age
                    $crash_counts = explode(' ', $vars['StartCounter']);
                    if ($crash_counts[0] >= 5) {
                        $vars['_flags_']['alert_red'] = true;
                    } elseif ($crash_counts[1] >= 5) {
                        $vars['_flags_']['alert_orange_dark'] = true;
                    } elseif ($crash_counts[2] >= 5) {
                        $vars['_flags_']['alert_orange_light'] = true;
                    }
                }
            }
            //$vars['_flags_']['has_graphs'] = tool_main_check_rrd_files($vars['AliasName']);
            $_sort_list[] = $vars['AliasName'];
            $domainServices[] = $vars;
        }
        sort($_sort_list);
        reset($_sort_list);
        foreach ($_sort_list as $_sort_name) {
            reset($domainServices);
            foreach ($domainServices as $serviceRow) {
                if ($_sort_name == $serviceRow['AliasName']) {
                    $sortedServices[] = $serviceRow;
                    break;
                }
            }
        }
    }
    return $sortedServices;
}
Example #5
0
 } else {
     // the locator displays a nice output, no need for the raw one
     //$tpl->assign('tool_execute_command', 	$service_command);
 }
 if (sizeof($command_return_data)) {
     $tool_sub_services_gl = null;
     if (isset($NELTOOL['POST_VARS']['subservices_gl'])) {
         $tool_sub_services_gl = $NELTOOL['POST_VARS']['subservices_gl'];
     } elseif (isset($NELTOOL['GET_VARS']['subservices_gl'])) {
         $tool_sub_services_gl = $NELTOOL['GET_VARS']['subservices_gl'];
     }
     $guild_dump_data = tool_gl_parse_dump_guild($command_return_data);
     $tpl->assign('tool_guild_dump_data', $guild_dump_data);
     $tpl->assign('tool_service', $service);
     // view ingame guild forums
     if (tool_admin_applications_check('tool_guild_locator_manage_forums')) {
         if ($tool_sub_services_gl) {
             switch ($tool_sub_services_gl) {
                 case 'viewthread':
                     $view_forum_threadid = $NELTOOL['GET_VARS']['threadid'];
                     $view_forum_recoverable = $NELTOOL['GET_VARS']['recoverable'];
                     $thread_name = ($view_forum_recoverable == 1 ? '_' : '') . 'thread_' . $view_forum_threadid . '.index';
                     $view_thread_data_raw = tool_gl_view_forum($MFS_Web, $guild_shard_id, $guild_dump_data['guild_name'], $thread_name);
                     $view_thread_data = tool_gl_parse_thread_view($view_thread_data_raw);
                     $tpl->assign('tool_guild_thread', $view_thread_data);
                     break;
                 case 'recoverthread':
                     $recover_forum_threadid = $NELTOOL['GET_VARS']['threadid'];
                     $thread_name = '_thread_' . $recover_forum_threadid . '.index';
                     tool_gl_view_forum($MFS_Web, $guild_shard_id, $guild_dump_data['guild_name'], $recover_forum_threadid, true);
                     break;
Example #6
0
<?php

require_once 'common.php';
require_once 'functions_tool_main.php';
require_once 'functions_tool_graphs.php';
require_once "jpgraph/jpgraph.php";
require_once "jpgraph/jpgraph_line.php";
require_once "jpgraph/jpgraph_log.php";
if (!tool_admin_applications_check('tool_graph')) {
    nt_common_redirect('index.php');
}
nt_common_add_debug('-- Starting on \'tool_graphs.php\'');
if (!isset($NELTOOL['GET_VARS']['toolmode'])) {
    $NELTOOL['GET_VARS']['toolmode'] = 'ccu';
    nt_auth_unset_session_var('view_shard_id');
    nt_auth_unset_session_var('view_time_highframe');
    nt_auth_unset_session_var('view_time_lowframe');
}
$tool_menu_item = tool_graphs_menu_get_item_from_key($NELTOOL['GET_VARS']['toolmode']);
$tpl->assign('toolmode', $NELTOOL['GET_VARS']['toolmode']);
$tpl->assign('tool_title', 'Graphs&nbsp;/&nbsp;' . $tool_menu_item['title']);
$tpl->assign('tool_menu', tool_graphs_menu_get_list());
$view_domain_id = nt_auth_get_session_var('view_domain_id');
$view_shard_id = nt_auth_get_session_var('view_shard_id');
$view_time_highframe = nt_auth_get_session_var('view_time_highframe');
$view_time_lowframe = nt_auth_get_session_var('view_time_lowframe');
if (!$view_domain_id) {
    $view_domain_id = $nel_user['group_default_domain_id'];
    $view_shard_id = $nel_user['group_default_shard_id'];
    nt_auth_set_session_var('view_domain_id', $view_domain_id);
    nt_auth_set_session_var('view_shard_id', $view_shard_id);
Example #7
0
<?php

require_once 'common.php';
require_once 'functions_tool_main.php';
nt_common_add_debug('-- Starting on \'tool_actions.php\'');
if (!tool_admin_applications_check('tool_actions')) {
    nt_common_redirect('index.php');
}
$tpl->assign('tool_title', "Actions");
$tpl->display('tool_actions.tpl');
Example #8
0
     $shardRunOrders = tool_main_get_shards_orders($status_orders);
     nt_common_add_debug($shardRunList);
     nt_common_add_debug($shardRunOrders);
     $shardInfos = tool_main_get_shards_info_from_db($AS_Application, $domainServices, $tool_shard_filters, $AS_RingSQL);
     nt_common_add_debug("shard infos :");
     nt_common_add_debug($shardInfos);
     $tpl->assign('tool_services_list', $domainServices);
     $tpl->assign('tool_shard_run_list', $shardRunList);
     $tpl->assign('tool_shard_orders', $shardRunOrders);
     $tpl->assign('tool_shard_su_name', tool_main_get_su_from_status($domainServices));
     $tpl->assign('tool_shard_infos', $shardInfos);
     $tpl->assign('tool_shard_ws_states', array('close', 'dev', 'restricted', 'open'));
     if (isset($shardInfos[$AS_InternalName])) {
         $tpl->assign('tool_restart_ws_state', $shardInfos[$AS_InternalName]['state']);
     }
     if (isset($tool_restart_stop_list) && isset($tool_restart_info) && tool_admin_applications_check('tool_main_easy_restart')) {
         // lets get a list of services for each group
         $tool_restart_start_group_list = tool_main_get_restart_services($AS_InternalName, $domainServices, $tool_restart_start_list);
         $tpl->assign('tool_restart_start_actions', $tool_restart_start_group_list);
         $tool_restart_stop_group_list = tool_main_get_all_restart_services($tool_restart_start_group_list);
         $tpl->assign('tool_restart_stop_actions', $tool_restart_stop_group_list);
         // get the shard id
         $tool_restart_shard_id = tool_main_get_shardid_from_status($domainServices, $AS_InternalName);
         $tpl->assign('tool_restart_shard_id', $tool_restart_shard_id);
         // find the shard egs for broadcasts
         $tool_restart_egs_name = tool_main_get_egs_from_status($domainServices, $AS_InternalName);
         $tpl->assign('tool_restart_egs_name', $tool_restart_egs_name);
     }
 }
 $tool_hd_list = tool_main_get_hd_data_for_domain($view_domain_id);
 nt_common_add_debug($tool_hd_list);
Example #9
0
<?php

require_once 'common.php';
require_once 'functions_tool_preferences.php';
if (!tool_admin_applications_check('tool_preferences')) {
    nt_common_redirect('index.php');
}
$tpl->assign("tool_title", "My Preferences");
$tpl->assign("tool_v_login", $nel_user['user_name']);
$tpl->assign("tool_v_user_id", $nel_user['user_id']);
$tpl->assign("tool_v_menu", $nel_user['user_menu_style']);
$tpl->assign("tool_v_application", isset($nel_user['user_default_application_id']) ? $nel_user['user_default_application_id'] : '');
if (isset($NELTOOL['POST_VARS']['tool_form_user_id'])) {
    $post_user_id = $NELTOOL['POST_VARS']['tool_form_user_id'];
    $tool_action = $NELTOOL['POST_VARS']['toolaction'];
    switch ($tool_action) {
        /*
         * update main preferences
         */
        case 'update':
            $post_old_pwd = $NELTOOL['POST_VARS']['tool_form_password_old'];
            $post_new_pwd = $NELTOOL['POST_VARS']['tool_form_password_new'];
            $post_menu = $NELTOOL['POST_VARS']['tool_form_menu_style'];
            // update menu style
            if ($nel_user['user_menu_style'] != $post_menu) {
                tool_pref_update_menu_style($nel_user, $post_menu);
                $tpl->assign("tool_v_menu", $post_menu);
            }
            // update password
            if ($post_old_pwd != '' && $post_new_pwd != '') {
                if (tool_pref_check_old_password($nel_user, $post_old_pwd)) {
Example #10
0
// SoniX: yop
// SoniX: pour récup les info de view, il faut utiliser la commande getView
// SoniX: par ex, sur un AIS :  "getView (0x0000000001:15:83:83).NamedEntityState" récupère le state de l'entité specifier
// SoniX: "getView *.NamedEntityName" récupère toutes les entité nommé de l'IA sur laquelle tu balance la commande
// SoniX: et pour setter une valuer :
// SoniX: "getView (0x0000000001:15:83:83).NamedEntityState=1" met le truc à 1
// SoniX: En gros, tu récupères les info dans la table variables, et tu vire les 3 premier morceaux (par ex, *.*.AIS.*.NamedEntityName deviens *.NamedEntityName).
// SoniX: Par contre, c'est a toi de faire le dispatch sur chaque AIS si besoin.
// YoGiN: hum, fun fun fun :D
// YoGiN: oki merci beaucoup, je vais voir ca :)
// SoniX: j'ai tester sur linuxshard8, d'jon mark a réactivé un morceau d'époside 2 dessus avec 1 variable
// YoGiN: d'accord
require_once 'common.php';
require_once 'functions_tool_main.php';
require_once 'functions_tool_event_entities.php';
if (!tool_admin_applications_check('tool_event_entities')) {
    nt_common_redirect('index.php');
}
nt_common_add_debug('-- Starting on \'tool_event_entities.php\'');
$tpl->assign('tool_title', "Event Entities");
$view_domain_id = nt_auth_get_session_var('view_domain_id');
$view_shard_id = nt_auth_get_session_var('view_shard_id');
if (!$view_domain_id) {
    $view_domain_id = $nel_user['group_default_domain_id'];
    $view_shard_id = $nel_user['group_default_shard_id'];
    nt_auth_set_session_var('view_domain_id', $view_domain_id);
    nt_auth_set_session_var('view_shard_id', $view_shard_id);
}
if (isset($NELTOOL['GET_VARS']['domain'])) {
    if ($view_domain_id != $NELTOOL['GET_VARS']['domain']) {
        $view_domain_id = $NELTOOL['GET_VARS']['domain'];
Example #11
0
                            }
                        }
                        break;
                }
            }
            if (isset($NELTOOL['GET_VARS']['eid'])) {
                $locate_eid = $NELTOOL['GET_VARS']['eid'];
                // someday i'll do something here :)
            }
            $status = $adminService->getStates();
            nt_common_add_debug($status);
            $domainServices = tool_main_parse_status($status);
            $filteredServices = array();
            reset($domainServices);
            foreach ($domainServices as $aKey => $aService) {
                // we are only interested in EGS
                if ($aService['ShortName'] == 'EGS') {
                    $filteredServices[] = $aService;
                }
            }
            $tpl->assign('tool_services_list', $filteredServices);
            $tpl->assign('shard_su_name', tool_main_get_su_from_status($domainServices));
            // user_id == 0 check system
            if (tool_admin_applications_check('tool_player_locator_userid_check')) {
                $user_check_list = tool_pl_get_character_check_list($AS_Application, $AS_RingSQL);
                $tpl->assign('user_check_list', $user_check_list);
            }
        }
    }
}
$tpl->display('tool_player_locator.tpl');