Code

Added some functionalty
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 6 Oct 2005 11:31:32 +0000 (11:31 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 6 Oct 2005 11:31:32 +0000 (11:31 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1507 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiPackage.inc
plugins/admin/fai/faiPackage.tpl

index 7be3e011b819b63c557feae83e7dfc4549f13c29..dc22f0a0fdbab5db7fa7f644e93b530140894608 100644 (file)
@@ -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);
   }
 
index cb64820349ebe2dbe4207c7454fb09364a4b4323..66f38f0adf64368a7c76bc454c00325aa13449d2 100644 (file)
@@ -35,7 +35,7 @@
                                                        </LABEL>
                                                </td>
                                                <td>
-                                                       <select name="FAIdebianSection" title="{t}section{/t}">
+                                                       <select name="FAIdebianSection" title="{t}section{/t}" {$sectionACL}>
                                                                {html_options options=$sections selected=$section}
                                                        </select>
                                                        <input type="submit" value="{t}refresh{/t}" name="refresh1">
@@ -48,7 +48,7 @@
                                                        </LABEL>
                                                </td>
                                                <td>
-                                                       <select name="FAIdebianRelease" title="{t}release{/t}">
+                                                       <select name="FAIdebianRelease" title="{t}release{/t}" {$releaseACL}>
                                                                {html_options options=$releases selected=$release}
                                                        </select>
                                                        <input type="submit" value="{t}refresh{/t}" name="refresh2">
@@ -61,7 +61,7 @@
                                                        </LABEL>
                                                </td>
                                                <td>
-                                                       <select name="FAIdebianMirror" title="{t}mirror{/t}">
+                                                       <select name="FAIdebianMirror" title="{t}mirror{/t}" {$mirrorACL}>
                                                                {html_options options=$mirrors selected=$mirror}
                                                        </select>
                                                        <input type="submit" value="{t}refresh{/t}" name="refresh3">