Code

Invalid repository settings fixed.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 10 Oct 2005 08:54:18 +0000 (08:54 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 10 Oct 2005 08:54:18 +0000 (08:54 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1542 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 918dab1d892bb07e7dd88ef41fd5cd2ae4684f81..36ce7933c3388032249e7be4653f552b9ffae456 100644 (file)
@@ -117,10 +117,6 @@ class faiPackage extends plugin
         return($display); 
       }
     }
-    $disableRelease   = false;
-    $disableMirror    = false;
-    $disableOptions   = false;
-    $disableSection   = false;
 
     /* Assign variables */
     foreach($this->attributes as $attrs){
@@ -129,6 +125,11 @@ class faiPackage extends plugin
 
     $this->genMirror();
 
+    if((isset($_POST['FAIdebianMirrorS']))&&(!empty($_POST['FAIdebianMirrorS']))){
+      $this->FAIdebianMirror = $_POST['FAIdebianMirrorS'];
+    }
+
+
     /* check servers matching release and section settings */
     $availableServer = array();
     foreach($this->mirrors as $mir){
@@ -144,9 +145,8 @@ class faiPackage extends plugin
         }
       }
     }
-    if($this->list==NULL){
-      $this->list=$this->genPkgs();
-    }
+
+    $this->list=$this->genPkgs();
 
     if(isset($_POST['Addpkg'])){
       $this->dialog = new faiPackageEntry($this->config, $this->dn,$this->list,$this->usedPackages);
@@ -200,6 +200,12 @@ class faiPackage extends plugin
        $strsec .= $sec." ";
     }
 
+    
+    $smarty->assign("OptionsACL","");
+    if(empty($this->FAIdebianMirror)){
+      $smarty->assign("OptionsACL"," disabled ");
+    }
+
     $smarty->assign("mirrors" ,$availableServer);
     $smarty->assign("mirror"  ,$this->FAIdebianMirror);
     $smarty->assign("releases",$this->releases);
@@ -332,6 +338,8 @@ class faiPackage extends plugin
         
         if(!is_file($strID)){
           print_red(sprintf(_("Package file don't exists '%s'."),$strID));
+          $this->FAIdebianMirror="";
+          unset($this->buffer);
           return(array());
         }
         $fp = fopen($strID,"r");
@@ -351,7 +359,7 @@ class faiPackage extends plugin
       ksort($a_ret);
       return($a_ret);
     }else{
-      return $this->buffer[$strID];
+      return $this->buffer;
     }
   }
 
index 45ca89db01546d63ebe7750bf5dc6e6aa29e1e38..bc45bf43bab13e8b145d74a1060e8bae869f8498 100644 (file)
@@ -83,12 +83,19 @@ class faiPackageNew extends plugin
     /* check servers matching release and section settings */
     $availableServer = array();
     foreach($this->mirrors as $mir){
+    
+      /* Check if release and section match */
       if($mir['release'] == $this->FAIdebianRelease){
         $pass = true;
+    
         foreach($this->FAIdebianSection as $sec){
+
+        /* If a mirror match, attach */
           if($sec != $mir['section']){
             $pass = false;
           }
+
+        /* Save all matching */ 
         if($pass){
             $availableServer[$mir['mirror']]=$mir['mirror'];
           }
index 0521f5997b06344f99e63a04d60e23dd138ffb99..6db4f7e696f1151810c82d5328dcf854bb5510b5 100644 (file)
@@ -70,9 +70,9 @@
                                {html_options options=$usedPackages}
                </select>
                        <br>
-                       <input type="submit" name="Addpkg" value="+">
-                       <input type="submit" name="Delpkg" value="-">
-                       <input type="submit" name="Conpkg" value="Configure"
+                       <input type="submit" name="Addpkg" value="+" {$OptionsACL}>
+                       <input type="submit" name="Delpkg" value="-"  {$OptionsACL}>
+                       <input type="submit" name="Conpkg" value="Configure"  {$OptionsACL}>
                </td>
        </tr>
 </table>