From d8047f3b99f3f40badd6c4bd973abeac34dcc5d1 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 7 Jun 2010 12:28:28 +0000 Subject: [PATCH] Updated copy & paste for groups. -Samba SID wasn't set correctly git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@18853 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../plugins/admin/groups/class_group.inc | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/gosa-core/plugins/admin/groups/class_group.inc b/gosa-core/plugins/admin/groups/class_group.inc index a2c5ee12a..90405849d 100644 --- a/gosa-core/plugins/admin/groups/class_group.inc +++ b/gosa-core/plugins/admin/groups/class_group.inc @@ -1327,6 +1327,47 @@ class group extends plugin { plugin::PrepareForCopyPaste($source); + /* Get samba Domain in case of samba 3 */ + if ($this->sambaSID != ""){ + $this->SID= preg_replace ("/-[^-]+$/", "", $this->sambaSID); + $ldap= $this->config->get_ldap_link(); + $ldap->cd($this->config->current['BASE']); + $ldap->search ("(&(objectClass=sambaDomain)(sambaSID=$this->SID))",array("sambaAlgorithmicRidBase")); + if ($ldap->count() != 0){ + $attrs= $ldap->fetch(); + if(isset($attrs['sambaAlgorithmicRidBase'])){ + $this->ridBase= $attrs['sambaAlgorithmicRidBase'][0]; + } else { + $this->ridBase= $this->config->get_cfg_value("sambaRidBase"); + } + + /* Get domain name for SID */ + $this->sambaDomainName= "DEFAULT"; + foreach ($this->config->data['SERVERS']['SAMBA'] as $key => $val){ + if ($val['SID'] == $this->SID){ + $this->sambaDomainName= $key; + break; + } + } + } else { + if ($this->config->get_cfg_value("sambaRidBase") != ""){ + $this->sambaDomainName= "DEFAULT"; + $this->ridBase= $this->config->get_cfg_value("sambaRidBase"); + $this->SID= $this->config->get_cfg_value("sid"); + } else { + msg_dialog::display(_("Configuration error"), _("Cannot find group SID in your configuration!"), ERROR_DIALOG); + } + } + + /* Get group type */ + $this->groupType= (int)substr(strrchr($this->sambaSID, "-"), 1); + if ($this->groupType < 500 || $this->groupType > 553){ + $this->groupType= 0; + } + $this->oldgroupType= $this->groupType; + } + + // Detect samba groups and adapt its values. $this->smbgroup = in_array('sambaGroupMapping', $source['objectClass']); if ($this->smbgroup) { -- 2.30.2