From 213a7700aed24ed76757dd076814ec4a50c6770c Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 15 Sep 2006 09:17:01 +0000 Subject: [PATCH] Added uid to class vars. Initialize uid in konstruktor. Set uid for post events git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4688 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../connectivity/class_intranetAccount.inc | 11 +++++++++-- .../personal/connectivity/class_kolabAccount.inc | 13 ++++++++++--- .../personal/connectivity/class_opengwAccount.inc | 7 +++++++ .../connectivity/class_oxchangeAccount.inc | 10 ++++++++-- .../personal/connectivity/class_phpgwAccount.inc | 14 +++++++++++--- .../connectivity/class_phpscheduleitAccount.inc | 6 +++--- .../personal/connectivity/class_pptpAccount.inc | 14 +++++++++++--- .../personal/connectivity/class_proxyAccount.inc | 14 +++++++++++--- .../connectivity/class_pureftpdAccount.inc | 14 +++++++++++--- .../personal/connectivity/class_webdavAccount.inc | 14 +++++++++++--- 10 files changed, 92 insertions(+), 25 deletions(-) diff --git a/plugins/personal/connectivity/class_intranetAccount.inc b/plugins/personal/connectivity/class_intranetAccount.inc index fb7f94020..f3fc0fdf6 100644 --- a/plugins/personal/connectivity/class_intranetAccount.inc +++ b/plugins/personal/connectivity/class_intranetAccount.inc @@ -21,6 +21,8 @@ class intranetAccount extends plugin var $objectclasses= array("gosaIntranetAccount"); var $ReadOnly = false; + var $uid =""; + /*! \brief Konstructor \param $config The Config Object used to initialise plugin @@ -32,6 +34,11 @@ class intranetAccount extends plugin function intranetAccount ($config, $dn= NULL) { plugin::plugin ($config, $dn); + + /* Setting uid to default */ + if(isset($this->attrs['uid'][0])){ + $this->uid = $this->attrs['uid'][0]; + } } /*! @@ -101,7 +108,7 @@ class intranetAccount extends plugin show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/intranet account with dn '%s' failed."),$this->dn)); /* Optionally execute a command after we're done */ - $this->postremove(); + $this->postremove(array("uid"=>$this->uid)); } } @@ -159,7 +166,7 @@ class intranetAccount extends plugin show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/intranet account with dn '%s' failed."),$this->dn)); /* Optionally execute a command after we're done */ - $this->postcreate(); + $this->postcreate(array("uid" = $this->uid)); } diff --git a/plugins/personal/connectivity/class_kolabAccount.inc b/plugins/personal/connectivity/class_kolabAccount.inc index 6ea6d97d7..55fd229c9 100644 --- a/plugins/personal/connectivity/class_kolabAccount.inc +++ b/plugins/personal/connectivity/class_kolabAccount.inc @@ -21,10 +21,17 @@ class kolabAccount extends plugin var $mail_Account = false; var $ReadOnly = false; + var $uid = ""; + function kolabAccount ($config, $dn= NULL) { plugin::plugin ($config, $dn); + /* Setting uid to default */ + if(isset($this->attrs['uid'][0])){ + $this->uid = $this->attrs['uid'][0]; + } + /* Pull arrays */ foreach(array("kolabDelegate", "kolabInvitationPolicy") as $attr){ if (isset($this->attrs["$attr"]["count"])){ @@ -278,7 +285,7 @@ class kolabAccount extends plugin $ldap->cd ($this->dn); $ldap->modify($this->attrs); - $this->handle_post_events('remove'); + $this->handle_post_events('remove',array("uid" => $this->uid)); show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/kolab account with dn '%s' failed."),$this->dn)); } @@ -406,10 +413,10 @@ class kolabAccount 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/connectivity/class_opengwAccount.inc b/plugins/personal/connectivity/class_opengwAccount.inc index c1da16c24..8a07e60f5 100644 --- a/plugins/personal/connectivity/class_opengwAccount.inc +++ b/plugins/personal/connectivity/class_opengwAccount.inc @@ -32,11 +32,18 @@ class opengwAccount extends plugin var $initialy_was_account = false; var $OGWPassword = ""; var $ReadOnly = false; + + var $uid = ""; function opengwAccount ($config, $dn= NULL) { plugin::plugin ($config, $dn); + /* Setting uid to default */ + if(isset($this->attrs['uid'][0])){ + $this->uid = $this->attrs['uid'][0]; + } + $this->info=array(); /* is no account and was no account */ diff --git a/plugins/personal/connectivity/class_oxchangeAccount.inc b/plugins/personal/connectivity/class_oxchangeAccount.inc index 5a89f8dd4..caf7c4a8c 100644 --- a/plugins/personal/connectivity/class_oxchangeAccount.inc +++ b/plugins/personal/connectivity/class_oxchangeAccount.inc @@ -577,6 +577,7 @@ class oxchangeAccount extends plugin ); var $dnmode= ""; + var $uid =""; function oxchangeAccount ($config, $dn= NULL) { @@ -588,6 +589,11 @@ class oxchangeAccount extends plugin } } + /* Setting uid to default */ + if(isset($this->attrs['uid'][0])){ + $this->uid = $this->attrs['uid'][0]; + } + $this->dnmode= $this->config->current['DNMODE']; if(isset($this->attrs[$this->dnmode][0])){ $this->dnModeValue = $this->attrs[$this->dnmode][0]; @@ -736,7 +742,7 @@ class oxchangeAccount extends plugin show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/oxchange addressbook account with dn '%s' failed."),$this->dn)); /* Optionally execute a command after we're done */ - $this->postremove(); + $this->postremove(array("uid" => $this->uid)); /* Finally remove data from postgresql server */ foreach ($sqldeluser as $sqls){ @@ -840,7 +846,7 @@ class oxchangeAccount extends plugin show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/oxchange account with dn '%s' failed."),$this->dn)); /* Optionally execute a command after we're done */ - $this->postcreate(); + $this->postcreate(array("uid" => $this->uid)); if($needupdate){ $ldap->create_missing_trees("ou=addr,".$this->dn); diff --git a/plugins/personal/connectivity/class_phpgwAccount.inc b/plugins/personal/connectivity/class_phpgwAccount.inc index b11ecf4d7..ab17e81ab 100644 --- a/plugins/personal/connectivity/class_phpgwAccount.inc +++ b/plugins/personal/connectivity/class_phpgwAccount.inc @@ -15,9 +15,17 @@ class phpgwAccount extends plugin var $objectclasses= array("phpgwAccount"); var $ReadOnly = false; + var $uid = ""; + function phpgwAccount ($config, $dn= NULL) { plugin::plugin ($config, $dn); + + /* Setting uid to default */ + if(isset($this->attrs['uid'][0])){ + $this->uid = $this->attrs['uid'][0]; + } + } function execute() @@ -71,7 +79,7 @@ class phpgwAccount extends plugin show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/PHPgw 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)); } } @@ -119,10 +127,10 @@ class phpgwAccount 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/connectivity/class_phpscheduleitAccount.inc b/plugins/personal/connectivity/class_phpscheduleitAccount.inc index 1f5b04f65..ecbf26e94 100644 --- a/plugins/personal/connectivity/class_phpscheduleitAccount.inc +++ b/plugins/personal/connectivity/class_phpscheduleitAccount.inc @@ -78,7 +78,7 @@ class phpscheduleitAccount extends plugin show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/PHPscheduleit 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)); } } @@ -126,10 +126,10 @@ class phpscheduleitAccount 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/connectivity/class_pptpAccount.inc b/plugins/personal/connectivity/class_pptpAccount.inc index 626c10035..52baf5ca2 100644 --- a/plugins/personal/connectivity/class_pptpAccount.inc +++ b/plugins/personal/connectivity/class_pptpAccount.inc @@ -32,9 +32,17 @@ class pptpAccount extends plugin var $ReadOnly = false; + var $uid =""; + function pptpAccount ($config, $dn= NULL) { plugin::plugin ($config, $dn); + + /* Setting uid to default */ + if(isset($this->attrs['uid'][0])){ + $this->uid = $this->attrs['uid'][0]; + } + } function execute() @@ -85,7 +93,7 @@ class pptpAccount extends plugin show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/PPTP 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)); } } @@ -134,10 +142,10 @@ class pptpAccount 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/connectivity/class_proxyAccount.inc b/plugins/personal/connectivity/class_proxyAccount.inc index 4f61ac5ee..dbd3869a5 100644 --- a/plugins/personal/connectivity/class_proxyAccount.inc +++ b/plugins/personal/connectivity/class_proxyAccount.inc @@ -19,9 +19,17 @@ class proxyAccount extends plugin var $objectclasses= array("gosaProxyAccount"); var $ReadOnly = false; + var $uid = ""; + function proxyAccount ($config, $dn= NULL) { plugin::plugin ($config, $dn); + + /* Setting uid to default */ + if(isset($this->attrs['uid'][0])){ + $this->uid = $this->attrs['uid'][0]; + } + } function execute() @@ -149,7 +157,7 @@ class proxyAccount extends plugin show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/proxy 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)); } } @@ -266,10 +274,10 @@ class proxyAccount 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/connectivity/class_pureftpdAccount.inc b/plugins/personal/connectivity/class_pureftpdAccount.inc index b9344a733..854797e06 100644 --- a/plugins/personal/connectivity/class_pureftpdAccount.inc +++ b/plugins/personal/connectivity/class_pureftpdAccount.inc @@ -17,6 +17,8 @@ class pureftpdAccount extends plugin var $FTPuid = ""; var $FTPgid = ""; + var $uid = ""; + /* attribute list for save action */ var $attributes= array("FTPQuotaFiles","FTPQuotaMBytes","FTPUploadRatio","FTPDownloadRatio", "FTPUploadBandwidth","FTPDownloadBandwidth","FTPStatus","FTPuid","FTPgid"); @@ -26,6 +28,12 @@ class pureftpdAccount extends plugin function pureftpdAccount ($config, $dn= NULL) { plugin::plugin ($config, $dn); + + /* Setting uid to default */ + if(isset($this->attrs['uid'][0])){ + $this->uid = $this->attrs['uid'][0]; + } + } function execute() @@ -99,7 +107,7 @@ class pureftpdAccount extends plugin show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/pureftpd 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)); } @@ -193,10 +201,10 @@ class pureftpdAccount 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/connectivity/class_webdavAccount.inc b/plugins/personal/connectivity/class_webdavAccount.inc index 7f13e2734..738dda5d3 100644 --- a/plugins/personal/connectivity/class_webdavAccount.inc +++ b/plugins/personal/connectivity/class_webdavAccount.inc @@ -11,9 +11,17 @@ class webdavAccount extends plugin var $objectclasses= array("gosaWebdavAccount"); var $ReadOnly = false; + var $uid =""; + function webdavAccount ($config, $dn= NULL) { plugin::plugin ($config, $dn); + + /* Setting uid to default */ + if(isset($this->attrs['uid'][0])){ + $this->uid = $this->attrs['uid'][0]; + } + } function execute() @@ -68,7 +76,7 @@ class webdavAccount extends plugin show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/webDAV 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)); } } @@ -117,10 +125,10 @@ class webdavAccount 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