X-Git-Url: http://git.pjr.cc/?a=blobdiff_plain;f=plugins%2Fadmin.php;h=56d86ddb8aae653e9126cfd85ec49d4f63c54dec;hb=c9cd2c7a60256b5d5d82610424c48706695bad5d;hp=13121c321fc066ec32e8807c3ac4a5ec0b063f2a;hpb=45b1b37dd9688baba31184815cc110f0f1839c1e;p=glcas.git diff --git a/plugins/admin.php b/plugins/admin.php index 13121c3..56d86dd 100644 --- a/plugins/admin.php +++ b/plugins/admin.php @@ -44,6 +44,10 @@ class GLCASAdmin { error_log("call setstorage"); GLCASpageBuilder($this, "setStorage"); return; + case "freezerepo": + error_log("call freezerepo"); + GLCASpageBuilder($this, "freezeRepo"); + return; case "scanrepo": break; } @@ -93,6 +97,22 @@ class GLCASAdmin { $this->mainBody($url); } + function freezeRepo($url) + { + $repo = $_REQUEST["repo"]; + + + $myRep = new GLCASRepo($this->config); + + + error_log("called freeze repo on $repo"); + $myRep->freezeRepo($repo); + + global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL; + header("Location: $BASE_URL/admin/"); + + } + function doRemoveRepo($url) { $repo = $_REQUEST["repo"]; @@ -162,19 +182,22 @@ class GLCASAdmin { $version = $glt["versions"]; $archs = $glt["arch"]; - echo "
";
-			print_r($glt);
-			echo "
"; + //echo "
";
+			//print_r($glt);
+			//echo "
"; + echo "The joy of apt is that there could be a million distro's under the root of an apt mirror"; + echo "if it doesn't list here, but you know its there, its still usable for glcas"; echo "
"; echo ""; echo ""; + echo ""; echo ""; echo ""; echo ""; - // TODO change this "provides" bit with a bit that allows us to choose which versions - // of ubuntu will be made available from the ones we found - echo ""; @@ -236,9 +259,26 @@ class GLCASAdmin { $init = false; if(isset($_REQUEST["initial"])) $init = true; + $blocklist = null; + $bn = 0; + foreach($_REQUEST as $key => $val) { + if(preg_match("/^blocked-*/", $key)) { + $blocked = preg_replace("/^blocked-/", "", $key); + //echo "
got block for $blocked
"; + $blocklist[$bn] = "dists\/$blocked.*"; + $bn++; + } + } + + //echo "
";
+		//print_r($_REQUEST);
+		//echo "
"; + //exit(0); - $repo->addRepo($desc, $OS, $version, $arch, "-", $shorturl, $prefix, $repurl, "APT", $init, $expiretime); + $repo->addRepo($desc, $OS, $version, $arch, "-", $shorturl, $prefix, $repurl, "APT", $init, $expiretime, $blocklist); + + // next we need to deal with that "blocked" bit global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL; header("Location: $BASE_URL/admin/"); @@ -271,6 +311,8 @@ class GLCASAdmin { function doUpdateRepo($url) { $rkey = $_REQUEST["repo"]; + + error_log("would update for repo"); $repo = new GLCASRepo($this->config); @@ -301,9 +343,18 @@ class GLCASAdmin { $repotype = $rval["repotype"]; $prefix = $rval["prefix"]; $shorturl = $rval["shorturl"]; + if(isset($rval["frozen"])) $frozen = $rval["frozen"]; + else $frozen = false; if($prefix == "") $prefix = "-"; if($shorturl == "") $shorturl = "-"; - echo ""; + if($frozen) { + $bgcol = "bgcolor=\"#bbbbff\""; + $frotext = "Unfreeze"; + } else { + $frotext = "Freeze"; + $bgcol = ""; + } + echo ""; // get url $browseurl = "$BASE_URL/repo/$rkey"; @@ -318,9 +369,9 @@ class GLCASAdmin { // Edit echo "Edit "; // update - echo "Update "; + if(!$frozen) echo "Update "; // freeze - echo "Freeze "; + echo "$frotext "; // deactivate echo "Disable "; // clean @@ -338,13 +389,12 @@ class GLCASAdmin { //echo ""; // wrap all this in a table - echo "
Description
Provides (tick those you wish to BLOCK)"; + + // TODO: deal with block bit + echo "
Provides (tick those you wish to BLOCK - not implemented)"; foreach($glt["knownrepo"] as $key => $val) { $reponame = $kos["apt"][$val["name"]]; $a = ""; @@ -183,7 +206,7 @@ class GLCASAdmin { if($glt["knownrepo"][$key]["amd64"]) $b = "x86_64"; if($a != "" && $b != "") $archs = "$a/$b"; else $archs = "$a$b"; - echo " $reponame ($archs)
"; + echo " $reponame ($archs)
"; } echo "
$desc$repotype$os$version$arch$other$prefix$shorturl
$desc$repotype$os$version$arch$other$prefix$shorturl
"; + echo "
"; // now, add a repo echo "

Add A Repo

"; echo ""; echo "Type
"; echo "URL
"; @@ -359,19 +409,37 @@ class GLCASAdmin { echo "Hint
"; echo "URL
"; echo "
"; echo ""; - echo "

"; + echo "
"; + + // now for mirror lists + echo "

Via Mirrolist - not implemented

"; + echo "
"; + echo "Distro
"; + echo "Architecture
"; + echo "Version
"; + echo "Get updates too
"; + echo "
"; + echo "
"; + + + echo "
"; // repo storage location echo "

Storage


"; echo "
"; $storloc = $this->config->getConfigVar("storagelocation"); - echo ""; + echo ""; echo ""; echo "
"; }