some more on adhoc
authorpaulr <me@pjr.cc>
Sat, 6 Aug 2011 18:35:59 +0000 (04:35 +1000)
committerpaulr <me@pjr.cc>
Sat, 6 Aug 2011 18:35:59 +0000 (04:35 +1000)
plugins/adhoc.php

index 6b7d4c1..cfffa2e 100644 (file)
@@ -91,6 +91,7 @@ class GLCASAdhoc {
                
                echo "Would add package as $n";
                
+               $pkgs[$n]["name"] = $_REQUEST["pkgname"];
                $pkgs[$n]["arch"] = $_REQUEST["arch"];
                $pkgs[$n]["type"] = $_REQUEST["type"];
                $pkgs[$n]["fileurl"] = $ultfileurl;
@@ -101,6 +102,7 @@ class GLCASAdhoc {
                        file_put_contents("$repostore/adhoc/$n", $fetfile);
                }
                
+               $this->config->setConfigVar("adhocpackages", serialize($pkgs));
                $this->config->saveConfig();
                
                echo "Done";
@@ -123,6 +125,13 @@ class GLCASAdhoc {
                
                echo "<hr>";
                echo "<h3>Add a Package</h3><br>";
+               $pkgs = unserialize($this->config->getConfigVar("adhocpackages"));
+               foreach($pkgs as $key => $var) {
+                       $name = $var["pkgname"];
+                       $arch = $var["arch"];
+                       $type = $var["type"];
+                       echo "$key: $name $arch, $type<br>";
+               }
                echo "<form enctype=\"multipart/form-data\" method=\"post\" action=\"?action=addpackage\">";
                echo "Name <input type=\"text\" name=\"pkgname\"><br>";
                echo "Arch <select name=\"arch\">";