Added a hosts bit
[glcas.git] / plugins / hosts.php
diff --git a/plugins/hosts.php b/plugins/hosts.php
new file mode 100644 (file)
index 0000000..a5709a5
--- /dev/null
@@ -0,0 +1,47 @@
+<?php 
+
+error_log("hosts loaded");
+
+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";
+
+class GLCASHosts {
+       function __construct($config)
+       {
+               $this->config = $config;
+               error_log("constructor for GLCASHosts");
+               
+       }
+       
+       function go($url)
+       {
+               if(isset($_REQUEST["action"])) {
+                       switch($_REQUEST["action"]) {
+                               case "addpackage":
+                                       error_log("in updaterepo");
+                                       GLCASpageBuilder($this,"addPackage");
+                                       return;
+                               case "deletepkg":
+                                       error_log("in delete pkg");
+                                       GLCASpageBuilder($this, "delPackage");
+                                       return;
+                       }
+               }
+               
+               GLCASpageBuilder($this,"mainBody");
+               return;
+               
+       }
+       
+       function mainBody($url)
+       {
+               echo "I am a hosts thingy";
+       }
+       
+       private $config;
+}
+
+?>
\ No newline at end of file