Code

Added repository functions
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 6 Oct 2005 11:08:54 +0000 (11:08 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 6 Oct 2005 11:08:54 +0000 (11:08 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1506 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 1688637e148cf0adb3d448ea50d77c022855a2e0..7be3e011b819b63c557feae83e7dfc4549f13c29 100644 (file)
@@ -11,10 +11,10 @@ class faiPackage extends plugin
   var $ignore_account   = TRUE;
 
   /* Attributes for this Object */
-  var $attributes       = array("cn","description","FAIpackage","section","mirror","release");
+  var $attributes       = array("cn","description","FAIpackage","FAIdebianSection","FAIdebianRelease","FAIdebianMirror");
 
   /* ObjectClasses for this Object*/
-  var $objectclasses    = array("top","FAIclass","FAIpackageList");
+  var $objectclasses    = array("top","FAIclass","FAIpackageList","FAIrepository");
 
   /* Class name of the Ldap ObjectClass for the Sub Object */
   var $subClass         = "";
@@ -34,9 +34,9 @@ class faiPackage extends plugin
   var $dialog           = NULL;     // a dialog, e.g. new disk dialog
   var $SubObjects       = array();  // All leafobjects of this object
 
-  var $section          = ""; // The selected section
-  var $release          = ""; // selected release
-  var $mirror           = ""; // selected mirror
+  var $FAIdebianSection          = ""; // The selected section
+  var $FAIdebianRelease          = ""; // selected release
+  var $FAIdebianMirror           = ""; // selected mirror
 
   var $servers          = array();  // All available servers
   var $sections         = array();  // All possible sections 
@@ -61,10 +61,10 @@ class faiPackage extends plugin
 
     unset($this->attrs['FAIpackage']['count']);
     foreach($this->attrs['FAIpackage'] as $pkg){
-      $this->usedPackages[] = $pkg;
+      $this->usedPackages[$pkg] = $pkg;
     }
     $this->confDir = CONFIG_DIR."/fai/";
-    $this->FAIpackage = "test";
+    $this->FAIpackage = array();
   }
 
   function execute()
@@ -82,7 +82,7 @@ class faiPackage extends plugin
 
     $availableServer = array();
     foreach($this->mirrors as $mir){
-      if(($mir['section'] == $this->section)&&($mir['release']==$this->release)){
+      if(($mir['section'] == $this->FAIdebianSection)&&($mir['release']==$this->FAIdebianRelease)){
         $availableServer[$mir['mirror']]=$mir['mirror'];
       }
     }
@@ -117,11 +117,11 @@ class faiPackage extends plugin
     
 
     $smarty->assign("mirrors" ,$availableServer);
-    $smarty->assign("mirror"  ,$this->mirror);
+    $smarty->assign("mirror"  ,$this->FAIdebianMirror);
     $smarty->assign("sections",$this->sections);
-    $smarty->assign("section" ,$this->section);
+    $smarty->assign("section" ,$this->FAIdebianSection);
     $smarty->assign("releases",$this->releases);
-    $smarty->assign("release" ,$this->release);
+    $smarty->assign("release" ,$this->FAIdebianRelease);
     $smarty->assign("usedPackages",$this->printUsedPackages());
     $display.= $smarty->fetch(get_template_path('faiPackage.tpl', TRUE));
     return($display);
@@ -244,10 +244,6 @@ class faiPackage extends plugin
       $this->attrs['FAIpackage'][] = $pkg;
     } 
 
-    unset($this->attrs['section']);
-    unset($this->attrs['mirror']);
-    unset($this->attrs['release']);
-
     $ldap->cat($this->dn);
     if($ldap->count()!=0){
       /* Write FAIscript to ldap*/
index 885690152e7cf59c622e0c5e64dbe00b9ceb9ea3..cb64820349ebe2dbe4207c7454fb09364a4b4323 100644 (file)
@@ -35,7 +35,7 @@
                                                        </LABEL>
                                                </td>
                                                <td>
-                                                       <select name="section" title="{t}section{/t}">
+                                                       <select name="FAIdebianSection" title="{t}section{/t}">
                                                                {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="release" title="{t}release{/t}">
+                                                       <select name="FAIdebianRelease" title="{t}release{/t}">
                                                                {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="mirror" title="{t}mirror{/t}">
+                                                       <select name="FAIdebianMirror" title="{t}mirror{/t}">
                                                                {html_options options=$mirrors selected=$mirror}
                                                        </select>
                                                        <input type="submit" value="{t}refresh{/t}" name="refresh3">