Ejemplo n.º 1
0
function collect_traffic()
{
    $flfile = "__path_program_etc/last_sisinfoc";
    $ret = lfile_get_unserialize($flfile);
    $ret['time'] = time();
    lfile_put_serialize($flfile, $ret);
}
Ejemplo n.º 2
0
 function dbactionUpdate($subaction)
 {
     if_demo_throw_exception('lxguard');
     $rmt = new Remote();
     $rmt->data['disablehit'] = $this->main->disablehit;
     lfile_put_serialize("__path_home_root/lxguard/config.info", $rmt);
     lxshell_return("__path_php_path", "../bin/common/lxguard.php");
 }
 function updateWht()
 {
     $res = $this->main->__var_whitelist;
     $res = merge_array_object_not_deleted($res, $this->main);
     $list = get_namelist_from_arraylist($res, 'ipaddress');
     $rmt = new Remote();
     $rmt->data = $list;
     lfile_put_serialize("__path_home_root/lxguard/whitelist.info", $rmt);
     lxshell_return("__path_php_path", "../bin/common/lxguard.php");
 }
Ejemplo n.º 4
0
 function dbactionAdd()
 {
     global $gbl, $sgbl, $login;
     if (if_demo()) {
         return;
     }
     $_filepath = "__path_home_root/lxguard/hostdeny.info";
     $result = $this->main->__var_hostlist;
     $result = merge_array_object_not_deleted($result, $this->main);
     $list = get_namelist_from_arraylist($result, 'hostname', 'hostname');
     dprintr($list);
     lfile_put_serialize($_filepath, $list);
     lxshell_return("__path_php_path", "../bin/common/lxguard.php");
 }
Ejemplo n.º 5
0
function collect_traffic()
{
    $flfile = "__path_program_etc/last_sisinfoc";
    $ret = lfile_get_unserialize($flfile);
    $interval = 20 * 60;
    //$interval = 2;
    if (time() - $ret['time'] < $interval) {
        //return;
    }
    $oldtime = $ret['time'];
    //if (!$oldtime) { $oldtime = time() - 20 * 60 ; }
    if (!$oldtime) {
        $oldtime = time() - 5 * 60;
    }
    $newtime = time();
    $ret['time'] = time();
    lfile_put_serialize($flfile, $ret);
    //mailtraffic:generateGraph($oldtime, $newtime);
    //webtraffic::generateGraph($oldtime, $newtime);
}
Ejemplo n.º 6
0
<?php

include_once "htmllib/lib/include.php";
if (!isset($argv[1])) {
    print "Need file name\n";
    exit;
}
$sq = new Sqlite(null, "vps");
$list = $sq->getTable(array("vpsid", "nname", "contactemail", "password", "rootpassword"));
foreach ($list as $l) {
    $nlist[$l['vpsid']] = $l;
}
lfile_put_serialize($argv[1], $nlist);
dprintr($nlist);
Ejemplo n.º 7
0
 static function createSession($ar)
 {
     $tsess['name'] = $ar['session'];
     $tsess['ip_address'] = $ar['ip_address'];
     lfile_put_serialize("/home/kloxo/httpd/script/sess_{$tsess['name']}", $tsess);
 }
Ejemplo n.º 8
0
function save_slave_name($o)
{
    if (!lxfile_exists("__path_slave_db")) {
        return;
    }
    $rmt = lfile_get_unserialize("__path_slave_db");
    if ($o->machine && $rmt->myname !== $o->machine || $o->master_c && $rmt->master_c !== $o->master_c) {
        dprint("Saving slave info..\n");
        $rmt->myname = $o->machine;
        $rmt->master_c = $o->master_c;
        lfile_put_serialize("__path_slave_db", $rmt);
    }
}
Ejemplo n.º 9
0
function lxguard_save_hitlist($hl)
{
    include_once "htmllib/lib/lxguardincludelib.php";
    lxfile_mkdir("__path_home_root/lxguard");
    $lxgpath = "__path_home_root/lxguard";
    $rmt = new Remote();
    $rmt->hl = $hl;
    $rmt->ddate = time();
    lfile_put_serialize("{$lxgpath}/hitlist.info", $rmt);
    lxguard_main();
}
Ejemplo n.º 10
0
 function saveVpsData()
 {
     lxfile_mkdir("/home/hypervm/data/");
     lfile_put_serialize("/home/hypervm/data/complete", $this->main->__var_vpsdata);
 }