From 595ed7aab183758e11c5667c3f5af666fa624784 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 6 Oct 2005 11:31:32 +0000 Subject: [PATCH] Added some functionalty git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1507 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiPackage.inc | 30 +++++++++++++++++++++----- plugins/admin/fai/faiPackage.tpl | 6 +++--- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/plugins/admin/fai/class_faiPackage.inc b/plugins/admin/fai/class_faiPackage.inc index 7be3e011b..dc22f0a0f 100644 --- a/plugins/admin/fai/class_faiPackage.inc +++ b/plugins/admin/fai/class_faiPackage.inc @@ -42,6 +42,8 @@ class faiPackage extends plugin var $sections = array(); // All possible sections var $releases = array(); // All release types + var $disableRepository = false; + var $mirrors = array(); // The combination of server/section/release var $confDir = ""; var $usedPackages = array(); @@ -59,6 +61,10 @@ class faiPackage extends plugin $this->dn =$dn; } + if(isset($this->attrs['FAIdebianRelease'])){ + $this->disableRepository=true; + } + unset($this->attrs['FAIpackage']['count']); foreach($this->attrs['FAIpackage'] as $pkg){ $this->usedPackages[$pkg] = $pkg; @@ -91,7 +97,11 @@ class faiPackage extends plugin $this->dialog = new faiPackageEntry($this->config, $this->dn,$this->confDir.$this->mirror."/".$this->section."/".$this->release,$this->usedPackages); $this->is_dialog =true; } - + + if(isset($_POST['Delpkg'])){ + unset($this->usedPackages[$_POST['usedPackages']]); + } + if(isset($_POST['CancelSubObject'])){ $this->dialog = false; $this->is_dialog=false; @@ -108,6 +118,7 @@ class faiPackage extends plugin $this->usedPackages = $use; $this->dialog = false; $this->is_dialog=false; + $this->disableRepository =true; } } @@ -115,7 +126,15 @@ class faiPackage extends plugin return $this->dialog->execute(); } - + if($this->disableRepository == true){ + $smarty->assign("mirrorACL" ," disabled "); + $smarty->assign("sectionACL" ," disabled "); + $smarty->assign("releaseACL" ," disabled "); + }else{ + $smarty->assign("mirrorACL" ,""); + $smarty->assign("sectionACL" ,""); + $smarty->assign("releaseACL" ,""); + } $smarty->assign("mirrors" ,$availableServer); $smarty->assign("mirror" ,$this->FAIdebianMirror); $smarty->assign("sections",$this->sections); @@ -215,10 +234,11 @@ class faiPackage extends plugin function check() { $message= array(); - $str = utf8_encode("üöä"); - if((preg_match("/[^a-z0-9".$str."\.,;:\-_\? ]/i",$this->description))){ - $message[]=_("Please enter a valid description."); + + if((empty($this->FAIdebianSection))||(empty($this->FAIdebianRelease))||(empty($this->FAIdebianMirror))){ + $message[]=_("Please choose a valid combination for your repository setup."); } + return ($message); } diff --git a/plugins/admin/fai/faiPackage.tpl b/plugins/admin/fai/faiPackage.tpl index cb6482034..66f38f0ad 100644 --- a/plugins/admin/fai/faiPackage.tpl +++ b/plugins/admin/fai/faiPackage.tpl @@ -35,7 +35,7 @@ - {html_options options=$sections selected=$section} @@ -48,7 +48,7 @@ - {html_options options=$releases selected=$release} @@ -61,7 +61,7 @@ - {html_options options=$mirrors selected=$mirror} -- 2.30.2