From fc92a9c0c140e0eadca23c353f7f6f613f5b6f83 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 7 Jun 2010 12:30:29 +0000 Subject: [PATCH] Updated copy & paste for groups. -Samba SID wasn't set correctly git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18854 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../plugins/admin/groups/class_group.inc | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/gosa-core/plugins/admin/groups/class_group.inc b/gosa-core/plugins/admin/groups/class_group.inc index c5daaf909..9dbc14f09 100644 --- a/gosa-core/plugins/admin/groups/class_group.inc +++ b/gosa-core/plugins/admin/groups/class_group.inc @@ -1189,6 +1189,46 @@ class group extends plugin $this->trustModeDialog->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("core","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("core","sambaRidBase") != ""){ + $this->sambaDomainName= "DEFAULT"; + $this->ridBase= $this->config->get_cfg_value("core","sambaRidBase"); + $this->SID= $this->config->get_cfg_value("core","sambaSID"); + } 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