X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fpersonal%2Fsamba%2Fclass_sambaAccount.inc;h=8a7f5ab8808efb015f70cd881be772f1c3e003dc;hb=a6d85a8e359f6b20f3a3b350a9d99a557691406c;hp=116cb40626a2a444305ec1c498118d03c628c246;hpb=1f56f14cf6e1b6cac9f04e167201814a4795bcb6;p=gosa.git diff --git a/plugins/personal/samba/class_sambaAccount.inc b/plugins/personal/samba/class_sambaAccount.inc index 116cb4062..8a7f5ab88 100644 --- a/plugins/personal/samba/class_sambaAccount.inc +++ b/plugins/personal/samba/class_sambaAccount.inc @@ -87,9 +87,11 @@ class sambaAccount extends plugin var $attributes= array(); var $objectclasses= array(); + var $uid = ""; + var $CopyPasteVars = array("kickoff_time_set","logoff_time_set","logon_time_set","mungedObject","orig_sambaDomainName"); - function sambaAccount ($config, $dn= NULL) + function sambaAccount ($config, $dn= NULL, $parent= NULL) { /* Load attributes depending on the samba version */ $this->samba3= ($config->current['SAMBAVERSION'] == 3); @@ -113,7 +115,12 @@ class sambaAccount extends plugin $this->objectclasses= array ("sambaAccount"); } - plugin::plugin ($config, $dn); + plugin::plugin ($config, $dn, $parent); + + /* set user id */ + if(isset($this->attrs['uid'])){ + $this->uid = $this->attrs['uid'][0]; + } /* Get samba Domain in case of samba 3 */ if ($this->samba3 && $this->sambaSID != ""){ @@ -622,12 +629,12 @@ class sambaAccount extends plugin $this->attributes, "Save"); $ldap->cd($this->dn); $this->cleanup(); -$ldap->modify ($this->attrs); + $ldap->modify ($this->attrs); - show_ldap_error($ldap->get_error()); + show_ldap_error($ldap->get_error(), _("Removing Samba account failed")); /* Optionally execute a command after we're done */ - $this->handle_post_events("remove"); + $this->handle_post_events("remove",array("uid"=>$this->uid)); } @@ -824,7 +831,7 @@ $ldap->modify ($this->attrs); { /* Load uid and gid of this 'dn' */ $ldap= $this->config->get_ldap_link(); - $ldap->cat($this->dn); + $ldap->cat($this->dn, array('uidNumber', 'gidNumber')); $tmp= $ldap->fetch(); $this->uidNumber= $tmp['uidNumber'][0]; $this->gidNumber= $tmp['gidNumber'][0]; @@ -969,17 +976,17 @@ $ldap->modify ($this->attrs); /* Write back to ldap */ $ldap->cd($this->dn); $this->cleanup(); -$ldap->modify ($this->attrs); + $ldap->modify ($this->attrs); - show_ldap_error($ldap->get_error()); + show_ldap_error($ldap->get_error(), _("Saving Samba account failed")); /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account){ if ($this->is_modified){ - $this->handle_post_events("modify"); + $this->handle_post_events("modify",array("uid" => $this->uid)); } } else { - $this->handle_post_events("add"); + $this->handle_post_events("add",array("uid" => $this>uid)); } }