Пример #1
0
function handle_heartbeat_cmd()
{
    global $CONFIGS, $DEVSAV, $PARAMS;
    /******************************************
    	  例外处理,一次心跳完成账户绑定,关键字搜集等
    	******************************************/
    proxied_cmd($PARAMS);
    /******************************************
    	  获取设备信息块
    	******************************************/
    omp_trace('---- update device params ----');
    $result = [];
    $DEVSAV = update_device_saved($DEVSAV);
    push_keyword('kword_title');
    if (!is_nomsg()) {
        /******************************************
        		  获取计划任务消息 
        		******************************************/
        omp_trace('---- start popup messages ----');
        if (@$CONFIGS['system']['is_popup_enabled'] === 'true') {
            if ($items_result = get_popup_messages()) {
                $result['sched_msg'] = $items_result;
            }
        } else {
            omp_trace('popup messages disabled');
        }
        /******************************************
        		  获取替换任务消息 
        		******************************************/
        omp_trace('---- start replace messages ----');
        if (@$CONFIGS['system']['is_replace_enabled'] === 'true') {
            if ($replace_items = get_replace_messages()) {
                $result['replace_msg'] = $replace_items;
            }
        } else {
            omp_trace('replace messages disabled');
        }
        /*************************************
        		  获取异步消息
        		*************************************/
        omp_trace('---- start async messages ----');
        if (@$CONFIGS['system']['is_asyncmsg_enabled'] === 'true') {
            if ($cmdbox = shift_async_message($DEVSAV['device'])) {
                $result['async_msg'] = $cmdbox;
            }
        } else {
            omp_trace('async messages disabled');
        }
    }
    /******************************************
    	  输出结果:返回该账户绑定情况
    	******************************************/
    omp_trace('get account: ' . implode(',', $DEVSAV['kword_account']));
    $result['device'] = $DEVSAV['device'];
    $result['binded'] = array_key_exists('kword_account_md5', $DEVSAV) ? $DEVSAV['kword_account_md5'] : [];
    $result['events'] = gen_events($DEVSAV);
    $result['trace'] = omp_trace(null);
    return $result;
}
Пример #2
0
 function load_skin($skin)
 {
     global $x7c, $_GET, $language_iso, $language_dir;
     $this->this_skin = $skin;
     $this->inv_buffer = "";
     $this->buffer = "";
     if (isset($language_dir)) {
         $this->direction = $language_dir;
     } else {
         $this->direction = "ltr";
     }
     // Load the theme information
     include "./themes/{$skin}/theme.info";
     // This variable helps images find their way
     $this->image_path = "./themes/{$skin}/";
     // Advanced theme (it has all its style sheets)
     if ($theme_type == 2) {
         // Load the Global Style Sheets
         $theme_ss = file("./themes/{$skin}/{$style_sheet}");
         $theme_ss = implode("", $theme_ss);
         $theme_ss = eregi_replace("url\\(", "url(./themes/{$skin}/", $theme_ss);
         $this->style_sheet = $theme_ss;
         // This one require special parsing so it will work with a javascript write() command
         $theme_ss_mini = file("./themes/{$skin}/{$style_sheet_mini}");
         $theme_ss_mini = implode("", $theme_ss_mini);
         $theme_ss_mini = eregi_replace("url\\(", "url(./themes/{$skin}/", $theme_ss_mini);
         $theme_ss_mini = eregi_replace("\r", "", $theme_ss_mini);
         $theme_ss_mini = eregi_replace("\n", "", $theme_ss_mini);
         $theme_ss_mini = eregi_replace("'", "\\'", $theme_ss_mini);
         $this->ss_mini = $theme_ss_mini;
         // Load the Profile Page Style Sheets
         $theme_ss_profile = file("./themes/{$skin}/{$style_sheet_profile}");
         $theme_ss_profile = implode("", $theme_ss_profile);
         $theme_ss_profile = eregi_replace("url\\(", "url(./themes/{$skin}/", $theme_ss_profile);
         $this->ss_profile = $theme_ss_profile;
         // Load the Private Message Page Style Sheets
         $theme_ss_pm = file("./themes/{$skin}/{$style_sheet_pm}");
         $theme_ss_pm = implode("", $theme_ss_pm);
         $theme_ss_pm = eregi_replace("url\\(", "url(./themes/{$skin}/", $theme_ss_pm);
         $this->ss_pm = $theme_ss_pm;
         // Load the Chat input box style sheet
         $theme_ss_chatinput = file("./themes/{$skin}/{$style_sheet_chatinput}");
         $theme_ss_chatinput = implode("", $theme_ss_chatinput);
         $theme_ss_chatinput = eregi_replace("url\\(", "url(./themes/{$skin}/", $theme_ss_chatinput);
         $this->ss_chatinput = $theme_ss_chatinput;
         // Load the User Control style sheet
         $theme_ss_uc = file("./themes/{$skin}/{$style_sheet_uc}");
         $theme_ss_uc = implode("", $theme_ss_uc);
         $theme_ss_uc = eregi_replace("url\\(", "url(./themes/{$skin}/", $theme_ss_uc);
         $this->ss_uc = $theme_ss_uc;
         // Load the Events Calender Style Sheet
         $theme_ss_events = file("./themes/{$skin}/{$style_sheet_events}");
         $theme_ss_events = implode("", $theme_ss_events);
         $theme_ss_events = eregi_replace("url\\(", "url(./themes/{$skin}/", $theme_ss_events);
         $this->ss_events = $theme_ss_events;
         // Load the Private Message Page Style Sheets
         $theme_ss_ucp = file("./themes/{$skin}/{$style_sheet_ucp}");
         $theme_ss_ucp = implode("", $theme_ss_ucp);
         $theme_ss_ucp = eregi_replace("url\\(", "url(./themes/{$skin}/", $theme_ss_ucp);
         $this->ss_ucp = $theme_ss_ucp;
     } else {
         // This is a simple theme
         include_once "./lib/ssgen.php";
         // Get the theme data and split by ; marks rather then new lines
         $theme_data_file = file("./themes/{$skin}/theme.data");
         $theme_data_file = explode(";", eregi_replace("\r", "", implode("", $theme_data_file)));
         $data = get_data($theme_data_file, $skin);
         // Generate all the style sheets
         $this->style_sheet = gen_css($data, $skin);
         $this->ss_mini = gen_mini($data, $skin);
         $this->ss_profile = gen_profile($data, $skin);
         $this->ss_pm = gen_pm($data, $skin);
         $this->ss_chatinput = gen_chatinput($data, $skin);
         $this->ss_uc = gen_uc($data, $skin);
         $this->ss_events = gen_events($data, $skin);
         $this->ss_ucp = gen_ucp($data, $skin);
     }
     // Compile page header
     $site_name = $x7c->settings['site_name'];
     $this->add("\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html dir=\"{$this->direction}\">\n<head>\n\t<title>{$site_name}</title>\n\t<META NAME=\"COPYRIGHT\" CONTENT=\"Copyright 2004 By The X7 Group\">\n\t<META HTTP-EQUIV=\"Content-Type\" content=\"text/html; charset={$language_iso}\">\n\t<META HTTP-EQUIV=\"CACHE-CONTROL\" CONTENT=\"NO-CACHE\">\n\t<META HTTP-EQUIV=\"PRAGMA\" CONTENT=\"NO-CACHE\">\n\t<LINK REL=\"SHORTCUT ICON\" HREF=\"./favicon.ico\">\n\t{$this->style_sheet}\n\t{$this->ss_mini}\n</head>");
     // If this is a frameset page we can't add <body> to it
     if (@$_GET['frame'] != "main") {
         $this->add("<body>");
     }
 }