From fdd0bb369d17cf667057142113badbc0a59bb151 Mon Sep 17 00:00:00 2001 From: cajus Date: Fri, 12 Feb 2010 14:12:14 +0000 Subject: [PATCH] Updated group to do smb sid updates for copy'n paste git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15620 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/Changelog | 3 ++ .../plugins/admin/groups/class_group.inc | 35 +++++++++++++------ 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/gosa-core/Changelog b/gosa-core/Changelog index 5d42c8671..f4afd6059 100644 --- a/gosa-core/Changelog +++ b/gosa-core/Changelog @@ -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) diff --git a/gosa-core/plugins/admin/groups/class_group.inc b/gosa-core/plugins/admin/groups/class_group.inc index fa2e63cdb..72eec6a9e 100644 --- a/gosa-core/plugins/admin/groups/class_group.inc +++ b/gosa-core/plugins/admin/groups/class_group.inc @@ -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: ?> -- 2.30.2