3 error_log("admin loaded");
6 $URL_HANDLERS["admin.*"] = "GLCASAdmin";
9 function __construct($config)
11 $this->config = $config;
12 error_log("constructor for GLCASAdmin");
18 error_log("repo:go called");
20 if(isset($_REQUEST["action"])) {
21 switch($_REQUEST["action"]) {
23 GLCASpageBuilder($this,"doAddRepo");
30 GLCASpageBuilder($this, "body");
35 // for the main admin body, we hae the following components
37 // 1. list of currently available repos and stuff
39 // 2. way to add a repo direct
41 // 3. way to scan for a repo given a url
43 // so first, lets do the main body
44 $this->mainBody($url);
47 function doAddRepo($url)
49 $myRep = new GLCASRepo($this->config);
51 $glt = $myRep->getRepoDetailsYum($_REQUEST["repourl"]);
53 echo "<pre>$glt</pre>";
56 function mainBody($url)
58 // first, list available repos
59 echo "<h3>Repositories</h3><br><table>";
60 echo "<tr><th>Name</th><th>Type</th><th>Version</th><th>Browse</th><th>Control</th></tr>";
61 echo "</table><br><hr>";
63 // wrap all this in a table
64 echo "<table><tr><td valign=\"top\">";
66 echo "<h3>Add A Repo</h3>";
67 echo "<form method=\"post\" action=\"?action=addrepo\">";
68 echo "Type <select name=\"repotype\">";
69 echo "<option value=\"yumbase\">YUM (Base URL)</option>";
70 echo "<option value=\"yummirrorlist\">YUM (Mirror List)</option>";
71 echo "<option value=\"apt\">APT</option>";
73 echo "URL <input type=\"text\" name=\"repourl\"><br>";
74 echo "<input type=\"submit\" name=\"Add\" value=\"Add\"><br>";
77 echo "</td><td valign=\"top\">";
79 // now scan for a repo
80 echo "<h3>Scan For Repos</h3>";
81 echo "<form method=\"post\" action=\"?action=scanrepo\">";
82 echo "Hint <select name=\"repohint\">";
83 echo "<option value=\"fedora\">Fedora</option>";
84 echo "<option value=\"centos\">Centos</option>";
85 echo "<option value=\"ubuntu\">Ubuntu</option>";
87 echo "URL <input type=\"text\" name=\"repourl\"><br>";
88 echo "<input type=\"submit\" name=\"Scan\" value=\"Scan\"><br>";
91 echo "</td></tr></table>";