Code

Updated group to do smb sid updates for copy'n paste
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 12 Feb 2010 14:12:14 +0000 (14:12 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 12 Feb 2010 14:12:14 +0000 (14:12 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15620 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/Changelog
gosa-core/plugins/admin/groups/class_group.inc

index 5d42c86719dcfcfd1c3bb98865bd0b8093702efd..f4afd6059b0702e51457adc75a12681a86bed56d 100644 (file)
@@ -5,6 +5,9 @@ GOsa2 changelog
   - Base selector displays descriptions and icons now
   - Base selector autocomplete
   - Fixed gosa.conf system generation
+  - Added wildcard ACLs
+  - Improved ACL handling for new lists
+  - Fixed phone filters
 
 * gosa 2.6.7
   - Added more information to DHCP service dialog (thanks to Mathieu)
index fa2e63cdb9b24a9208b40c3ec36965470d395a73..72eec6a9ee6eb08cbcb0e50737aa6315739db931 100644 (file)
@@ -906,16 +906,7 @@ class group extends plugin
       if ($this->groupType == 0){
 
         if ($this->sambaSID == "" || $this->oldgroupType != $this->groupType){
-          $gidNumber= $this->gidNumber;
-          while(TRUE){
-            $sid= $this->SID."-".($gidNumber*2 + $this->ridBase+1);
-            $ldap->cd($this->config->current['BASE']);
-            $ldap->search("(sambaSID=$sid)",array("sambaSID"));
-            if ($ldap->count() == 0){
-              break;
-            }
-            $gidNumber++;
-          }
+          $sid = $this->getSambaSID();
           $this->attrs['sambaSID']= $sid;
           $this->sambaSID= $sid;
         }
@@ -1336,6 +1327,10 @@ class group extends plugin
   {
     plugin::PrepareForCopyPaste($source);
 
+    if ($this->smbgroup) { 
+      $this->sambaSID = $this->getSambaSID(); 
+    } 
+
     $this->memberUid = array();
     if(isset($source['memberUid'])){
       for($i = 0 ; $i < $source['memberUid']['count']; $i ++){
@@ -1370,6 +1365,26 @@ class group extends plugin
     plugin::set_multi_edit_values($attrs);
     $this->memberUid = $users;
   }
+
+
+  /*! \brief Get a new SambaSID for a group */ 
+  function getSambaSID() 
+  { 
+    $ldap = $this->config->get_ldap_link(); 
+    $gidNumber= $this->gidNumber; 
+    while(TRUE){ 
+      $sid= $this->SID."-".($gidNumber*2 + $this->ridBase+1); 
+      $ldap->cd($this->config->current['BASE']); 
+      $ldap->search("(sambaSID=$sid)",array("sambaSID")); 
+      if ($ldap->count() == 0){ 
+        break; 
+      } 
+      $gidNumber++; 
+    } 
+  
+    return $sid; 
+  } 
+
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>