Code

Added release patch from glg.
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 20 Feb 2006 13:06:32 +0000 (13:06 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 20 Feb 2006 13:06:32 +0000 (13:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2705 594d385d-05f5-0310-b6e9-bd551577e9d8

debian/gosa.conffiles
plugins/admin/groups/class_groupAcl.inc
plugins/admin/systems/class_workstationStartup.inc
plugins/admin/systems/workstationStartup.tpl

index e70f8de40f70599467578756e33ee8e12bb1078e..54d090bdd7b943c4fa758aee4894470b81c45ef6 100644 (file)
@@ -1,2 +1,3 @@
 /etc/gosa/gosa.conf
 /etc/gosa/apache.conf
+/etc/gosa/encodings
index 5ce1d53908dc7830f93de6b7cb4eaa9efbc02de1..bfbb2a51992aef510ea373ba884a4a1ee437d913 100644 (file)
@@ -20,7 +20,7 @@ class acl extends plugin
   var $current_acl= "";
   var $selfflag= FALSE;
 
-       var $gosaSubtreeACL;
+  var $gosaSubtreeACL;
 
   /* attribute list for save action */
   var $attributes= array("gosaSubtreeACL");
@@ -96,7 +96,7 @@ class acl extends plugin
        $ldap= $this->config->get_ldap_link();
        $ldap->cd($this->dn);
        $this->cleanup();
-$ldap->modify ($this->attrs); 
+       $ldap->modify ($this->attrs); 
 
        show_ldap_error($ldap->get_error());
   }
@@ -115,7 +115,7 @@ $ldap->modify ($this->attrs);
        if ($this->object == "all"){
                $this->current_acl= preg_replace ( "/[,]?all[,]?/", "", $this->current_acl);
        }
-       $this->current_acl= preg_replace ( "/[^a-z0-9A-Z]$this->object#[^,]*[,]?/", "", $this->current_acl);
+       $this->current_acl= preg_replace ( "/(^|[^a-z0-9A-Z])$this->object#[^,]*[,]?/", "", $this->current_acl);
 
        /* assemble new attributes */
        $attrs= "";
@@ -136,13 +136,13 @@ $ldap->modify ($this->attrs);
        }
 
        /* append information */
-       if ($this->current_acl != "" && $attrs != ""){
-               $this->current_acl.= ",";
-       }
        if ($attrs != ""){
                $tmp= $this->object;
                $attrs= $tmp.$attrs;
        }
+       if ($this->current_acl != "" && $attrs != ""){
+               $this->current_acl.= ",";
+       }
        $this->current_acl.= $attrs;
        if (preg_match("/all#all/", $this->current_acl)){
                $this->current_acl= "all";
@@ -160,7 +160,6 @@ $ldap->modify ($this->attrs);
        } else {
                $this->selfflag= FALSE;
        }
-
   }
 
 
@@ -193,7 +192,7 @@ $ldap->modify ($this->attrs);
        /* Modify class */
        $ldap->cd($this->dn);
        $this->cleanup();
-$ldap->modify ($this->attrs); 
+       $ldap->modify ($this->attrs); 
 
        show_ldap_error($ldap->get_error());
   }
index afb5e9e7c60cf2693f2089fee2370e3de93e8433..29246952eca5626ea393fbc1e207f553407ae543 100644 (file)
@@ -24,7 +24,7 @@ class workstartup extends plugin
 
 
   /* attribute list for save action */
-  var $attributes     = array("gotoLdapServer", "gotoBootKernel", "gotoKernelParameters", "FAIclass", "FAIstatus", "gotoShare","FAIdebianMirror");
+  var $attributes     = array("gotoLdapServer", "gotoBootKernel", "gotoKernelParameters", "FAIclass", "FAIstatus", "gotoShare","FAIdebianMirror", "FAIrelease");
   var $objectclasses  = array("GOhard", "FAIobject");
 
   /* Share */
@@ -38,6 +38,8 @@ class workstartup extends plugin
   var $orig_dn            = "";
   var $ignore_account     = TRUE;
   var $FAIdebianMirrors   = array();
+  var $FAIrelease         = "";
+  var $FAIreleases        = array();
 
   function workstartup ($config, $dn= NULL)
   {
@@ -47,12 +49,15 @@ class workstartup extends plugin
      * none will not be saved to ldap.
      */
     $this->FAIdebianMirrors   = array();
+    $this->FAIreleases        = array();
+
     $ldap   = $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
     $ldap->search("(objectClass=FAIrepositoryServer)",array("FAIrepository"));
     
     /* attach all attributes with "index => cn" to avoid multiple entries */
     $ret = array();
+    $rels = array();
     while($attr = $ldap->fetch()){
       if(isset($attr['FAIrepository'])){
         
@@ -65,12 +70,20 @@ class workstartup extends plugin
             $sections = split(",",$tmp[3]);
             $str = $tmp[0];
             $ret[$str]=$sections;
+            if( array_key_exists( $str, $rels ) ) {
+              if( "" == $this->FAIrelease )
+                $this->FAIrelease = $tmp[2];
+              array_push( $rels[$str], $tmp[2] );
+            }
+            else $rels[$str] = array( $tmp[2] );
           }
         }
       }
     }
     ksort($ret);
+    ksort($rels);
     $this->FAIdebianMirrors = $ret;
+    $this->FAIreleases = $rels;
 
     /* Get arrays */
     foreach (array("gotoModules", "gotoAutoFs", "gotoFilesystem") as $val){
@@ -179,7 +192,11 @@ class workstartup extends plugin
       $tmp2 =array();  
     
       foreach($tmp as $class){
-        $tmp2[$class] = $class;
+        if( ":" == $class[0] ) {
+          $this->FAIrelease = substr( $class, 1 );
+        }
+        else
+          $tmp2[$class] = $class;
       }
       $this->FAIclass = $tmp2;
     }
@@ -220,8 +237,8 @@ class workstartup extends plugin
 
   function execute()
   {
-       /* Call parent execute */
-       plugin::execute();
+       /* Call parent execute */
+       plugin::execute();
 
     /* Do we need to flip is_account state? */
     if (isset($_POST['modify_state'])){
@@ -331,7 +348,6 @@ class workstartup extends plugin
         $this->FAIclass = $tmp2; 
       }
   
-
       if(preg_match("/fai_remove/i",$name)){
         $value = base64_decode(preg_replace("/_.*$/i","",preg_replace("/fai_remove_/i","",$name)));
         unset($this->FAIclass[$value]);
@@ -390,7 +406,7 @@ class workstartup extends plugin
     }
 
     /* Values */
-    foreach(array("gotoBootKernel", "customParameters", "gotoShare","FAIclasses","FAIclass","FAIdebianMirror") as $val){
+    foreach(array("gotoBootKernel", "customParameters", "gotoShare","FAIclasses","FAIclass","FAIdebianMirror","FAIrelease") as $val){
       $smarty->assign($val, $this->$val);
       $smarty->assign($val."ACL", chkacl($this->acl, $val));
     }
@@ -417,13 +433,15 @@ class workstartup extends plugin
       $i ++ ; 
     
       $div->AddEntry(array(
-                            array("string"=>$class),
-                            array("string"=>preg_replace("/\%s/",base64_encode($class),$str),"attach"=>"style='width:50px;border-right:none;'")
-                          ));
+                       array("string"=>$class),
+                       array("string"=>preg_replace("/\%s/",base64_encode($class),$str),"attach"=>"style='width:50px;border-right:none;'")
+                    ));
     }  
 
     $smarty->assign("FAIScriptlist",$div->DrawList()); 
     $smarty->assign("FAIdebianMirrors",$this->getFAIdebianMirrors());
+    $smarty->assign("FAIreleases",$this->getFAIreleases());
+    $smarty->assign("FAIrelease",$this->FAIrelease);
     $smarty->assign("FAIclasses",$this->selectFriendlyClasses());
     $smarty->assign("FAIclassesKeys",array_flip($this->selectFriendlyClasses()));
     $smarty->assign("FAIclassKeys",$this->FAIclass);
@@ -495,6 +513,21 @@ class workstartup extends plugin
     return($ret);
   }
 
+  function getFAIreleases() 
+  {
+    $ret = array();
+    if(is_array($this->FAIreleases)) {
+      foreach($this->FAIreleases as $mirr=>$releases){
+        if( $this->FAIdebianMirror == $mirr ) {
+          foreach ($releases as $release) 
+            $ret[$release] = $release;
+          return($ret);
+        }
+      }
+    }
+    return($ret);
+  }
+
   /* Save data to object */
   function save_object()
   {
@@ -580,11 +613,14 @@ class workstartup extends plugin
     }
 
     plugin::save();
+
+    unset( $this->attrs['FAIrelease'] );
     
     $str = "";
     foreach($this->FAIclass as $class){
       $str .= $class." ";
     }
+    $str .= ":" . $this->FAIrelease;
     $this->attrs['FAIclass']= "";
     $this->attrs['FAIclass']= trim($str);
 
index 6556a926ff261b3dfb8c64601fa77324c97ef85e..3f2ebecb5696acd8e677cb8508133798381896d6 100644 (file)
   </td>
   
   <td style="vertical-align:top;">
-       <h2><img class="center" alt="" align="middle" src="images/fai_profile.png">&nbsp;{t}FAI server{/t}</h2>
+     <table><tr>
+     <td>
+       <h2><img class="center" alt="" align="middle" src="images/fai_profile.png">&nbsp;{t}FAI server{/t}</h2></td>
+     <td>
+       <h2><img class="center" alt="" align="middle" src="images/fai_profile.png">&nbsp;{t}Release{/t}</h2></td>
+     </tr><tr>
+     <td>
                <!--<select name="FAIdebianMirror" {$FAIdebianMirrorACL} onchange="document.mainform.submit();">-->
-               <select name="FAIdebianMirror" {$FAIdebianMirrorACL}>
+               <select name="FAIdebianMirror" {$FAIdebianMirrorACL} onchange='document.mainform.submit()'>
         {html_options options=$FAIdebianMirrors output=$FAIdebianMirrors selected=$FAIdebianMirror}
         <option disabled>&nbsp;</option>
                </select>
                <!--<input type="submit" value="{t}set{/t}" name="refresh">-->
+     </td><td>
+           <select name="FAIrelease" >
+               {html_options options=$FAIreleases output=$FAIreleases selected=$FAIrelease}
+               </select>
+       </td>
+     </tr></table>
        <h2><img class="center" alt="" align="middle" src="images/fai_profile.png">&nbsp;{t}Assigned FAI classes{/t}</h2>
                {$FAIScriptlist}