http range request ass bandits from redhat for their installer and
[glcas.git] / plugins / webbase.php
index 6fa5943..fea2f2f 100644 (file)
@@ -19,7 +19,44 @@ class GLCASWebBase {
        
        function body($url)
        {
-               echo "i am disturbing, $url";
+               global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
+               
+               // first, list available repos
+               echo "<h3>Repositories</h3>";
+               echo "<br><table border=\"1\">";
+               echo "<tr><th>Name</th><th>Type</th><th>OS</th><th>Version</th><th>Architecture</th><th>Other</th><th>Prefix</th><th>Short URL</th><th>Browse</th></tr>";
+               
+               // now iterate thru the repos and print them
+               $repo = new GLCASRepo($this->config);
+               $repos = $repo->getRepos();
+               
+               foreach($repos as $rkey => $rval) {
+                       $desc = $rval["desc"];
+                       $os = $rval["os"];
+                       $version = $rval["version"];
+                       $arch = $rval["arch"];
+                       $other = $rval["other"];
+                       $repotype = $rval["repotype"];
+                       $prefix = $rval["prefix"];
+                       $shorturl = $rval["shorturl"];
+                       if($prefix == "") $prefix = "-";
+                       if($shorturl == "") $shorturl = "-";
+                       echo "<tr><td>$desc</td><td>$repotype</td><td>$os</td><td>$version</td><td>$arch</td><td>$other</td><td>$prefix</td><td>$shorturl</td>";
+                       
+                       // get url
+                       $browseurl = "$BASE_URL/repo/$rkey";
+                       if($shorturl!="-") {
+                               $brurl = $shorturl;
+                               if($prefix != "-") $brurl = "$prefix/$shorturl";
+                               $browseurl = "$BASE_URL/$brurl/";
+                       }
+                       echo "<td><a href=\"$browseurl\">Browse</td><td>";
+                       echo "</td>";
+                       echo "</tr>";
+               }
+               
+               echo "</table><br><hr>";
+                       
        }
        
        private $config;