summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 646652b)
raw | patch | inline | side by side (parent: 646652b)
author | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 11 Feb 2010 12:34:19 +0000 (12:34 +0000) | ||
committer | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 11 Feb 2010 12:34:19 +0000 (12:34 +0000) |
- Add a new function getSambaSID() to groupGeneric which calculates
a samba SID with the algorithm which is used for new groups as
well.
- Remove the SID calculation code from the save function and just
use getSambaSID
- In PrepareForCopyPaste determine a new SID for the new group
object.
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@15611 594d385d-05f5-0310-b6e9-bd551577e9d8
a samba SID with the algorithm which is used for new groups as
well.
- Remove the SID calculation code from the save function and just
use getSambaSID
- In PrepareForCopyPaste determine a new SID for the new group
object.
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@15611 594d385d-05f5-0310-b6e9-bd551577e9d8
trunk/gosa-core/plugins/admin/groups/class_groupGeneric.inc | patch | blob | history |
diff --git a/trunk/gosa-core/plugins/admin/groups/class_groupGeneric.inc b/trunk/gosa-core/plugins/admin/groups/class_groupGeneric.inc
index ce905299c035c620f612daa78c25b0e7602d3274..3956d560c270bf919cec075162dd251110c32d02 100644 (file)
}
+ /*! \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;
+ }
/* Save to LDAP */
function save()
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;
}
$this->$var = $source_o->$var;
}
+ if ($this->smbgroup) {
+ $this->sambaSID = $this->getSambaSID();
+ }
+
$this->memberUid = array();
if(isset($source['memberUid'])){
for($i = 0 ; $i < $source['memberUid']['count']; $i ++){