error_log("admin loaded");
global $BASE_URL, $MENU_ITEMS;
-$MENU_ITEMS["10admin"]["name"] = "Admin";
-$MENU_ITEMS["10admin"]["link"] = "$BASE_URL/admin";
+$MENU_ITEMS["30admin"]["name"] = "Repo Admin";
+$MENU_ITEMS["30admin"]["link"] = "$BASE_URL/repoadmin";
global $URL_HANDLERS;
-$URL_HANDLERS["admin.*"] = "GLCASAdmin";
+$URL_HANDLERS["repoadmin.*"] = "GLCASRepoAdmin";
global $CRON_CLASSES;
-$CRON_CLASSES["GLCASAdmin"] = "GLCASAdmin";
+$CRON_CLASSES["GLCASAdmin"] = "GLCASRepoAdmin";
-class GLCASAdmin {
+class GLCASRepoAdmin {
function __construct($config)
{
$this->config = $config;
- error_log("constructor for GLCASAdmin");
+ error_log("constructor for GLCASRepoAdmin");
}
function cron()
{
- echo "ADMIN CRON: nothing to see here<br>";
+ echo "REPOADMIN CRON: nothing to see here<br>";
// TODO: touch cronstamp file here
// make a backup of the config.. but.. errr. how to tell if theres an old backup?
// backups will occur... weekly and be called $configpath.DDMMYYYY
$configpath = glcas_getWebConfigPath();
$basepath = dirname($configpath);
- echo "ADMIN CRON: backing up config, $configpath, $basepath<br>";
+ echo "REPOADMIN CRON: backing up config, $configpath, $basepath<br>";
$nowtime = time();
$oneday = 3600 * 24; // 1 hour in seconds, by 24 hours
for($i = 0; $i < 7; $i ++) {
$nowdatestr = strftime("%d-%h-%Y");
$backupfile = "$configpath.$nowdatestr";
copy($configpath, $backupfile);
- echo "ADMIN CRON: createing backup of config as $backupfile<br>";
+ echo "REPOADMIN CRON: createing backup of config as $backupfile<br>";
}
function body($url)
$myRep->freezeRepo($repo);
global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
- header("Location: $BASE_URL/admin/");
+ header("Location: $BASE_URL/repoadmin/");
}
$myRep->deleteRepo($repo);
global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
- header("Location: $BASE_URL/admin/");
+ header("Location: $BASE_URL/repoadmin/");
}
// next we need to deal with that "blocked" bit
global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
- header("Location: $BASE_URL/admin/");
+ header("Location: $BASE_URL/repoadmin/");
}
function doAddRepoYum($url)
$repo->addRepo($desc, $OS, $version, $arch, $other, $shorturl, $prefix, $repurl, "YUM", $init, $expiretime);
global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
- header("Location: $BASE_URL/admin/");
+ header("Location: $BASE_URL/repoadmin/");
}
function doUpdateRepo($url)
$repo->updateRepo($rkey);
global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
- header("Location: $BASE_URL/admin/");
+ header("Location: $BASE_URL/repoadmin/");
}
function mainBody($url)
global $URL_HANDLERS;
$URL_HANDLERS["hosts.*"] = "GLCASHosts";
global $BASE_URL, $MENU_ITEMS;
-$MENU_ITEMS["30hosts"]["name"] = "Known Machines";
-$MENU_ITEMS["30hosts"]["link"] = "$BASE_URL/hosts";
+$MENU_ITEMS["10hosts"]["name"] = "Known Machines";
+$MENU_ITEMS["10hosts"]["link"] = "$BASE_URL/hosts";
class GLCASHosts {
function __construct($config)
error_log("in add group");
GLCASpageBuilder($this, "addGroup");
return;
- case "deletehost":
- error_log("in add group");
- GLCASpageBuilder($this, "deleteHost");
- return;
case "scanrange":
GLCASpageBuilder($this, "scanIPRange");
return;
GLCASpageBuilder($this, "deleteGroup");
return;
case "dooperation":
+ error_log("in do operation");
GLCASpageBuilder($this, "doOperation");
return;
}
$hip = $val["name"];
$hg = $val["val"];
- echo "<br>Checking $hname, $hip, $hg<br>";
+ //echo "<br>Checking $hname, $hip, $hg<br>";
// check if no group is on
if($nogroup && $hg == "") {
}
- function deleteHost($url)
- {
- $hostname = $_REQUEST["hostname"];
- $this->config->delData("hosts", "$hostname");
- global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
- header("Location: $BASE_URL/hosts");
- }
-
function addHost($url)
{
$hg = $_REQUEST["hostgroup"];
echo "<tr valign=\"top\">";
echo "<td>";
echo "<h3>Ungrouped Hosts</h3><br>";
- echo "<table border=\"1\"><tr><th><input type=\"checkbox\" name=\"nonegroup-selected\"></th><th>Host</th><th>IP</th><th>Last Seen</th><th>Last Ping</th><th>Control</th></tr>";
+ echo "<table border=\"1\"><tr><th><input type=\"checkbox\" name=\"nonegroup-selected\"></th><th>Host</th><th>IP</th><th>Last Seen</th><th>Last Ping</th></tr>";
foreach($hosts as $key => $val) {
$hname = $val["category"];
$hip = $val["name"];
echo "<td>";
$grpname = $val["category"];
echo "<h3>Host Group: $grpname <a href=\"?action=delgroup&grpname=$grpname\">Delete</a></h3><br>";
- echo "<table border=\"1\"><tr><th><input type=\"checkbox\" name=\"$grpname-selectgroup\"></th><th>Host</th><th>IP</th><th>Last Seen</th><th>Last Ping</th><th>Control</th></tr>";
+ echo "<table border=\"1\"><tr><th><input type=\"checkbox\" name=\"$grpname-selectgroup\"></th><th>Host</th><th>IP</th><th>Last Seen</th><th>Last Ping</th></tr>";
if($hosts != false) foreach($hosts as $key => $val) {
$hname = $val["category"];
$hip = $val["name"];