From 888379c40b3c70d44df945cf181a2d9fedbc5d9f Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 15 Sep 2006 07:54:30 +0000 Subject: [PATCH] Added uid to post events. And add uid to class members, if necessary. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4682 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/personal/environment/class_environment.inc | 4 ++-- plugins/personal/generic/class_user.inc | 6 +++--- plugins/personal/nagios/class_nagiosAccount.inc | 13 ++++++++++--- plugins/personal/netatalk/class_netatalk.inc | 14 ++++++++++---- plugins/personal/posix/class_posixAccount.inc | 12 +++++++++--- plugins/personal/samba/class_sambaAccount.inc | 13 ++++++++++--- 6 files changed, 44 insertions(+), 18 deletions(-) diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index 79471d432..6bc6cbd6e 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -836,7 +836,7 @@ class environment extends plugin show_ldap_error($ldap->get_error(), _("Removing environment information failed")); /* Optionally execute a command after we're done */ - $this->handle_post_events("remove"); + $this->handle_post_events("remove",array("uid" => $this->uid)); } @@ -1082,7 +1082,7 @@ class environment extends plugin $this->cleanup(); $ldap->$mode($this->attrs); show_ldap_error($ldap->get_error(), _("Adding environment information failed")); - $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 add19922d..1d758a2f6 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -564,7 +564,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)); } @@ -919,9 +919,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/nagios/class_nagiosAccount.inc b/plugins/personal/nagios/class_nagiosAccount.inc index fc6e04899..a95f64aaf 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); + /* Set uid */ + if(isset($this->attrs['uid'])){ + $this->uid = $this->attrs['uid'][0]; + } + /* Save initial account state */ $this->initially_was_account= $this->is_account; } @@ -149,10 +156,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)); } } @@ -229,7 +236,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 7e66f6ce8..73343859a 100644 --- a/plugins/personal/netatalk/class_netatalk.inc +++ b/plugins/personal/netatalk/class_netatalk.inc @@ -67,7 +67,8 @@ class netatalk extends plugin { /* Checkboxes */ var $is_chk_box = array (); - + + var $uid =""; /* The constructor just saves a copy of the config. You may add what ever you need. */ function netatalk($config, $dn = NULL) { @@ -76,6 +77,11 @@ class netatalk extends plugin { $this->config = $config; plugin :: plugin($config, $dn); + /* set user id */ + if(isset($this->attrs['uid'])){ + $this->uid = $this->attrs['uid'][0]; + } + /* Copy needed attributes */ foreach($this->attributes as $val) { if (isset($this->attrs["$val"][0])) { @@ -258,10 +264,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)); } } @@ -319,7 +325,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 bf803b670..a79ba689c 100644 --- a/plugins/personal/posix/class_posixAccount.inc +++ b/plugins/personal/posix/class_posixAccount.inc @@ -73,6 +73,7 @@ class posixAccount extends plugin "shadowExpire", "gosaDefaultPrinter", "gosaDefaultLanguage", "uid","accessTo","trustModel"); var $objectclasses= array("posixAccount", "shadowAccount"); + var $uid =""; /* constructor, if 'dn' is set, the node loads the given 'dn' from LDAP */ @@ -84,6 +85,11 @@ class posixAccount extends plugin /* Load bases attributes */ plugin::plugin($config, $dn); + /* set user id */ + if(isset($this->attrs['uid'])){ + $this->uid = $this->attrs['uid'][0]; + } + $ldap= $this->config->get_ldap_link(); if ($dn != NULL){ @@ -615,7 +621,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)); } @@ -882,10 +888,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 31721d67b..883005925 100644 --- a/plugins/personal/samba/class_sambaAccount.inc +++ b/plugins/personal/samba/class_sambaAccount.inc @@ -87,6 +87,8 @@ 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) @@ -115,6 +117,11 @@ class sambaAccount extends plugin plugin::plugin ($config, $dn); + /* 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 != ""){ $this->SID= preg_replace ("/-[^-]+$/", "", $this->sambaSID); @@ -627,7 +634,7 @@ class sambaAccount extends plugin 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)); } @@ -976,10 +983,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