fixed a prob with the url matching code
[glcas.git] / plugins / admin.php
index 845d857..b746ebb 100644 (file)
@@ -4,6 +4,8 @@ error_log("admin loaded");
 
 global $URL_HANDLERS;
 $URL_HANDLERS["admin.*"] = "GLCASAdmin";
+global $CRON_CLASSES;
+$CRON_CLASSES["GLCASAdmin"] = "GLCASAdmin";
 
 class GLCASAdmin {
        function __construct($config)
@@ -46,6 +48,12 @@ class GLCASAdmin {
                GLCASpageBuilder($this, "body");
        }
        
+       function cron()
+       {
+               echo "ADMIN CRON: nothing to see here<br>";
+               // TODO: touch cronstamp file here
+       }
+       
        function body($url)
        {
                // for the main admin body, we hae the following components
@@ -111,7 +119,8 @@ class GLCASAdmin {
                        echo "<tr><td>Other (OS, Updates, etc)</td><td><input type=\"text\" name=\"other\" value=\"$other\"></td></tr>";
                        echo "<tr><td>Short URL</td><td><input type=\"text\" name=\"shorturl\"></td></tr>";
                        echo "<tr><td>URL Prefix (blank for none)</td><td><input type=\"text\" name=\"prefix\"></td></tr>";
-                       echo "<tr><td>Do Initial Update (can take a while)</td><td><input type=\"checkbox\" name=\"initial\" checked></td></tr>";
+                       echo "<tr><td>Do Initial Update (can take a while, but done in background)</td><td><input type=\"checkbox\" name=\"initial\" checked></td></tr>";
+                       echo "<tr><td>Expire time for Meta Data</td><td><input type=\"text\" name=\"expiretime\"> days</td></tr>";
                        echo "<tr><td><input type=\"submit\" name=\"Add\" value=\"Add\"></td></tr>";
                        echo "</table>";
                        echo "</form>";
@@ -132,12 +141,13 @@ class GLCASAdmin {
                $shorturl = $_REQUEST["shorturl"];
                $prefix = $_REQUEST["prefix"];
                $repurl = $_REQUEST["repourl"];
+               $expiretime = $REQUEST["expiretime"];
                $init = false;
                if(isset($_REQUEST["initial"])) $init = true;
                
                
                
-               $repo->addRepo($desc, $OS, $version, $arch, $other, $shorturl, $prefix, $repurl, "YUM", $init);
+               $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/");