Example #1
0
if (isset($_GET['period'])) {
    $period = $_GET['period'] * 3600;
} else {
    $period = 86400;
}


try {
    $req = new SOURCERequest();
} catch (ADEIException $e) {
    $req = new REQUEST();
    $nodata = 1;
}


$list = $req->GetSources(REQUEST::LIST_ALL);
?><div class="header"><?
foreach ($list as $sreq) {
    ?><a href="download.php?<?echo GetQueryString($sreq);?>"><?echo $sreq->props['db_server'];?>.<?echo $sreq->props['db_name'];?></a> <?
}
?><a href="csvmerge.php">Merge Groups</a></div><?
if ($nodata) exit;


?><h3>Server: <?echo $req->props['db_server'];?>, DataBase: <?echo $req->props['db_name'];?></h3><?


//$props = array("db_server"=>"katrin", "db_name"=>"HS");
$reader = $req->CreateReader();
$groups = $reader->GetGroupList(REQUEST::NEED_INFO);
Example #2
0
            }
            if ($syslocked) {
                $syslock->UnLock();
            }
            if ($e->getCode() != ADEIException::DISABLED) {
                $e->logInfo(translate("Failed to update CACHE"), $cache ? $cache : $greq);
                if ($verbose) {
                    echo " failed\n";
                }
                return $greq->GetLocationString() . ", Error: " . $e->getInfo();
            }
        }
        if ($verbose) {
            echo " done\n";
        }
    }
    return 0;
}
$list = $user_req->GetSources($list_flags);
foreach ($list as $sreq) {
    if (isset($user_req->props['db_server']) && $user_req->props['db_server'] != $sreq->props['db_server']) {
        continue;
    }
    if (isset($user_req->props['db_name']) && $user_req->props['db_name'] != $sreq->props['db_name']) {
        continue;
    }
    $err = DoCache($sreq);
    if ($err) {
        echo "{$err}\n\n\n";
    }
}
Example #3
0
            }
            if ($syslocked) {
                $syslock->UnLock();
            }
            if ($e->getCode() != ADEIException::DISABLED) {
                $e->logInfo(translate("Failed to update CACHE"), $cache ? $cache : $greq);
                if ($verbose) {
                    echo " failed\n";
                }
                return $greq->GetLocationString() . ", Error: " . $e->getInfo();
            }
        }
        if ($verbose) {
            echo " done\n";
        }
    }
    return 0;
}
$list = $user_req->GetSources();
foreach ($list as $sreq) {
    if (isset($user_req->props['db_server']) && $user_req->props['db_server'] != $sreq->props['db_server']) {
        continue;
    }
    if (isset($user_req->props['db_name']) && $user_req->props['db_name'] != $sreq->props['db_name']) {
        continue;
    }
    $err = DoCache($sreq);
    if ($err) {
        echo "{$err}\n\n\n";
    }
}
Example #4
0
        
        	}
        */
        /*	
        	$cprops = $props;
        	foreach (array_keys($groups) as $group) {
        	    $cprops['db_group'] = $group;
        	    $lg = new LOGGROUP($cprops);
        	    $zlg = new ZEUSLogGroup($lg);
        	    
        	    $cache = new CACHE($cprops, $zeus);
        	    $cache->Update();
        	}*/
    } catch (ADEIException $e) {
        $e->logInfo("Backup is failed", $reader ? $reader : $req);
        $error = $e->getInfo();
    }
    return $error ? $error : 0;
}
$req = new REQUEST($config);
$list = $req->GetSources();
foreach ($list as $sreq) {
    $opts =& $sreq->GetOptions();
    $backup = $opts->Get('backup');
    if ($backup) {
        $err = DoBackup($sreq, $backup);
        if ($err) {
            echo $sreq->GetLocationString() . ", Error: {$err}\n";
        }
    }
}
Example #5
0
function adeiGroupList($props)
{
    $tmp = preg_split("/&(amp;)?/", $props);
    $p = array();
    foreach ($tmp as $pair) {
        $res = explode("=", $pair);
        if (sizeof($res) == 2) {
            $p[$res[0]] = $res[1];
        }
    }
    $res = "";
    $req = new REQUEST($tmp = array());
    $sources = $req->GetSources(REQUEST::SKIP_UNCACHED | REQUEST::LIST_ALL);
    foreach ($sources as $sreq) {
        if (isset($p["db_server"]) && strcmp($p["db_server"], $sreq->props["db_server"])) {
            continue;
        }
        if (isset($p["db_name"]) && strcmp($p["db_name"], $sreq->props["db_name"])) {
            continue;
        }
        $title = $sreq->GetSourceTitle();
        $groupinfo = $sreq->GetGroupList();
        $groups = $sreq->GetGroups(NULL, REQUEST::SKIP_UNCACHED);
        foreach ($groups as $gid => $greq) {
            if (isset($p["db_group"]) && strcmp($p["db_group"], $gid)) {
                continue;
            }
            $res .= "!!" . xml_escape($title . " -- " . $groupinfo[$gid]["name"]) . "[br]\n";
            $res .= "[preview(" . $greq->GetGroupQueryString($props) . "), link]";
            $res .= "[br][br][br]\n";
        }
    }
    return $res;
}
Example #6
0
 function GetList($search_data, $module, $opts)
 {
     $res = array();
     $req = new REQUEST($tmp = array());
     if ($module == "control" || $module == "control_group" || $module == "control_item") {
         $sources = $req->GetSources();
         $flags = REQUEST::CONTROL;
     } else {
         $sources = $req->GetSources(REQUEST::SKIP_UNCACHED | REQUEST::LIST_ALL);
         $flags = REQUEST::SKIP_UNCACHED;
     }
     foreach ($sources as $sreq) {
         $title = $sreq->GetSourceTitle();
         $groupinfo = $sreq->GetGroupList();
         $groups = $sreq->GetGroups(NULL, $flags);
         foreach ($groups as $gid => $greq) {
             $gtitle = $title . " -- " . $groupinfo[$gid]["name"];
             $props = $greq->GetProps();
             if ($module == "group" || $module == "control_group") {
                 array_push($res, array('title' => $gtitle, 'props' => $props, 'description' => false, 'name' => $groupinfo[$gid]["name"]));
             } elseif ($module == "mask") {
                 $list = $greq->GetMaskList(REQUEST::NEED_INFO);
                 foreach ($list as $mid => &$mask) {
                     $mtitle = $mask["name"] . " (Group: {$gtitle})";
                     $props['db_mask'] = $mask['mask'];
                     array_push($res, array('title' => $mtitle, 'props' => $props, 'description' => false, 'name' => $mask['name']));
                 }
             } else {
                 $list = $greq->GetItemList($flags);
                 foreach ($list as $iid => &$item) {
                     $ititle = $item["name"] . " (Group: {$gtitle})";
                     $props['db_mask'] = $item['id'];
                     array_push($res, array('title' => $ititle, 'props' => $props, 'description' => false, 'name' => $item['name'], 'uid' => $item['uid']));
                 }
             }
         }
     }
     return $res;
 }
Example #7
0
<?php

require "../../adei.php";
$req = new REQUEST($tmp = array());
$slist = $req->GetSources(REQUEST::SKIP_UNCACHED | REQUEST::LIST_ALL);
foreach ($slist as $sreq) {
    $groups = $sreq->GetGroups(NULL, REQUEST::SKIP_UNCACHED);
    $groupinfo = $sreq->GetGroupList();
    print_r($groupinfo);
    foreach ($groups as $gid => $greq) {
        $gquery = $greq->GetGroupQueryString($props);
    }
}