From 09f9a2fadced3b2bb568bc1f17907b05be3ff60b Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 15 Sep 2006 09:26:00 +0000 Subject: [PATCH] Added iud to post events. Added uid to class members git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4689 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/personal/environment/class_environment.inc | 9 +++++++-- plugins/personal/generic/class_user.inc | 6 +++--- plugins/personal/mail/class_mailAccount.inc | 9 +++++---- plugins/personal/nagios/class_nagiosAccount.inc | 13 ++++++++++--- plugins/personal/netatalk/class_netatalk.inc | 13 +++++++++---- plugins/personal/posix/class_posixAccount.inc | 12 +++++++++--- plugins/personal/samba/class_sambaAccount.inc | 13 ++++++++++--- 7 files changed, 53 insertions(+), 22 deletions(-) diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index 5e15d269b..51cda502c 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -81,6 +81,11 @@ class environment extends plugin { plugin::plugin ($config, $dn); + /* Setting uid to default */ + if(isset($this->attrs['uid'][0])){ + $this->uid = $this->attrs['uid'][0]; + } + /* Check : Are we currently editing a group or user dialog */ if((isset($this->attrs['cn'][0]))&&(!isset($this->attrs['uid'][0]))){ $suffix="Group"; @@ -906,7 +911,7 @@ class environment extends plugin show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/environment account with dn '%s' failed."),$this->dn)); /* Optionally execute a command after we're done */ - $this->handle_post_events("remove"); + $this->handle_post_events("remove",array("uid" => $this->uid)); } @@ -1157,7 +1162,7 @@ class environment extends plugin $this->cleanup(); $ldap->$mode($this->attrs); show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/environment account with dn '%s' failed."),$this->dn)); - $this->handle_post_events($mode); + $this->handle_post_events($mode,array("uid"=>$this->uid)); } /* Generate ListBox frindly output for the defined shares diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index 3b4e20374..b995a384c 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -580,7 +580,7 @@ class user extends plugin } /* Optionally execute a command after we're done */ - $this->handle_post_events("remove"); + $this->handle_post_events("remove",array("uid" => $this->uid)); } @@ -960,9 +960,9 @@ class user extends plugin /* Optionally execute a command after we're done */ if ($mode == "add"){ - $this->handle_post_events("add"); + $this->handle_post_events("add", array("uid" => $this->uid)); } elseif ($this->is_modified){ - $this->handle_post_events("modify"); + $this->handle_post_events("modify", array("uid" => $this->uid)); } /* Fix tagging if needed */ diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc index 541a31d4d..1161d9173 100644 --- a/plugins/personal/mail/class_mailAccount.inc +++ b/plugins/personal/mail/class_mailAccount.inc @@ -61,7 +61,7 @@ class mailAccount extends plugin "gosaMailDeliveryMode", "gosaSpamSortLevel", "gosaSpamMailbox","gosaMailAlternateAddress", "gosaVacationMessage", "gosaMailAlternateAddress", "gosaMailForwardingAddress"); var $objectclasses= array("gosaMailAccount"); - + var $uid; /* constructor, if 'dn' is set, the node loads the given 'dn' from LDAP */ @@ -70,6 +70,7 @@ class mailAccount extends plugin /* Load bases attributes */ plugin::plugin($config, $dn); + /* Set uid */ if(isset($this->attrs['uid'])){ $this->uid = $this->attrs['uid'][0]; } @@ -609,7 +610,7 @@ class mailAccount extends plugin } /* Optionally execute a command after we're done */ - $this->handle_post_events("remove"); + $this->handle_post_events("remove",array("uid" => $this->uid)); } @@ -754,10 +755,10 @@ class mailAccount extends plugin /* 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)); } } diff --git a/plugins/personal/nagios/class_nagiosAccount.inc b/plugins/personal/nagios/class_nagiosAccount.inc index 51a522cb2..9c679f6e9 100644 --- a/plugins/personal/nagios/class_nagiosAccount.inc +++ b/plugins/personal/nagios/class_nagiosAccount.inc @@ -59,6 +59,8 @@ class nagiosAccount extends plugin var $objectclasses= array("nagiosContact","nagiosAuth"); + var $uid = ""; + /* constructor, if 'dn' is set, the node loads the given 'dn' from LDAP */ function nagiosAccount ($config, $dn= NULL) @@ -68,6 +70,11 @@ class nagiosAccount extends plugin plugin::plugin ($config, $dn); + /* Setting uid to default */ + if(isset($this->attrs['uid'][0])){ + $this->uid = $this->attrs['uid'][0]; + } + /* Save initial account state */ $this->initially_was_account= $this->is_account; } @@ -159,10 +166,10 @@ class nagiosAccount extends plugin /* 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)); } } @@ -241,7 +248,7 @@ class nagiosAccount extends plugin unset ($this->attrs['uid']); /* Optionally execute a command after we're done */ - $this->handle_post_events('remove'); + $this->handle_post_events('remove',array("uid" => $this->uid)); } diff --git a/plugins/personal/netatalk/class_netatalk.inc b/plugins/personal/netatalk/class_netatalk.inc index 5d82f6e99..78451c543 100644 --- a/plugins/personal/netatalk/class_netatalk.inc +++ b/plugins/personal/netatalk/class_netatalk.inc @@ -70,7 +70,7 @@ class netatalk extends plugin { /* Checkboxes */ var $is_chk_box = array (); - + var $uid = ""; function get_shares() { $this->shares_loaded= TRUE; @@ -118,6 +118,11 @@ class netatalk extends plugin { $this->config = $config; plugin :: plugin($config, $dn); + /* Setting uid to default */ + if(isset($this->attrs['uid'][0])){ + $this->uid = $this->attrs['uid'][0]; + } + /* Copy needed attributes */ foreach($this->use_save_attributes as $val) { if (isset($this->attrs["$val"][0])) { @@ -265,10 +270,10 @@ class netatalk extends plugin { /* 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)); } } @@ -326,7 +331,7 @@ class netatalk extends plugin { unset ($this->attrs['uid']); /* Optionally execute a command after we're done */ - $this->handle_post_events('remove'); + $this->handle_post_events('remove',array("uid" => $this->uid)); } diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc index 4ed5ee14c..b7b03c299 100644 --- a/plugins/personal/posix/class_posixAccount.inc +++ b/plugins/personal/posix/class_posixAccount.inc @@ -77,6 +77,7 @@ class posixAccount extends plugin var $objectclasses= array("posixAccount", "shadowAccount"); + var $uid= ""; /* constructor, if 'dn' is set, the node loads the given 'dn' from LDAP */ @@ -88,6 +89,11 @@ class posixAccount extends plugin /* Load bases attributes */ plugin::plugin($config, $dn); + /* Setting uid to default */ + if(isset($this->attrs['uid'][0])){ + $this->uid = $this->attrs['uid'][0]; + } + $ldap= $this->config->get_ldap_link(); if ($dn != NULL){ @@ -628,7 +634,7 @@ class posixAccount extends plugin } /* Optionally execute a command after we're done */ - $this->handle_post_events("remove"); + $this->handle_post_events("remove",array("uid" => $this->uid)); } @@ -896,10 +902,10 @@ class posixAccount extends plugin /* 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)); } } diff --git a/plugins/personal/samba/class_sambaAccount.inc b/plugins/personal/samba/class_sambaAccount.inc index c9c48a1ee..017e4d758 100644 --- a/plugins/personal/samba/class_sambaAccount.inc +++ b/plugins/personal/samba/class_sambaAccount.inc @@ -86,6 +86,8 @@ class sambaAccount extends plugin var $ctxattributes= array(); var $attributes= array(); var $objectclasses= array(); + + var $uid= ""; var $CopyPasteVars = array("kickoff_time_set","logoff_time_set","logon_time_set","mungedObject","orig_sambaDomainName"); @@ -115,6 +117,11 @@ class sambaAccount extends plugin plugin::plugin ($config, $dn); + /* Setting uid to default */ + if(isset($this->attrs['uid'][0])){ + $this->uid = $this->attrs['uid'][0]; + } + /* Get samba Domain in case of samba 3 */ if ($this->samba3 && $this->sambaSID != ""){ $this->SID= preg_replace ("/-[^-]+$/", "", $this->sambaSID); @@ -614,7 +621,7 @@ class sambaAccount extends plugin show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/samba account with dn '%s' failed."),$this->dn)); /* Optionally execute a command after we're done */ - $this->handle_post_events("remove"); + $this->handle_post_events("remove", array("uid" => $this->uid)); } @@ -964,10 +971,10 @@ class sambaAccount extends plugin /* 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)); } } -- 2.30.2