From 2304649c2c57b79131339b8bd6fa6359a87de877 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 10 Feb 2006 14:28:43 +0000 Subject: [PATCH] Added \$this->cleanup before all calls of $ldap->modify It is still missing for $ldap->$mode ( ... ) ; git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2660 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../applications/class_applicationGeneric.inc | 4 +++- .../applications/class_applicationParameters.inc | 8 ++++++-- .../departments/class_departmentGeneric.inc | 4 +++- plugins/admin/fai/class_faiHook.inc | 8 ++++++-- plugins/admin/fai/class_faiPackage.inc | 8 ++++++-- plugins/admin/fai/class_faiPartitionTable.inc | 12 +++++++++--- plugins/admin/fai/class_faiProfile.inc | 4 +++- plugins/admin/fai/class_faiScript.inc | 8 ++++++-- plugins/admin/fai/class_faiTemplate.inc | 8 ++++++-- plugins/admin/fai/class_faiVariable.inc | 8 ++++++-- plugins/admin/groups/class_groupAcl.inc | 8 ++++++-- plugins/admin/groups/class_groupApplication.inc | 8 ++++++-- plugins/admin/groups/class_groupMail.inc | 16 ++++++++++++---- plugins/admin/ogroups/class_mailogroup.inc | 8 ++++++-- plugins/admin/ogroups/class_phonequeue.inc | 8 ++++++-- plugins/admin/systems/class_componentGeneric.inc | 4 +++- plugins/admin/systems/class_phoneGeneric.inc | 4 +++- plugins/admin/systems/class_printGeneric.inc | 4 +++- plugins/admin/systems/class_servDB.inc | 4 +++- plugins/admin/systems/class_servDNS.inc | 4 +++- plugins/admin/systems/class_servGeneric.inc | 4 +++- plugins/admin/systems/class_servKolab.inc | 4 +++- plugins/admin/systems/class_servRepository.inc | 8 ++++++-- plugins/admin/systems/class_servService.inc | 4 +++- plugins/admin/systems/class_termDNS.inc | 8 ++++++-- plugins/admin/systems/class_terminalGeneric.inc | 4 +++- plugins/admin/systems/class_terminalService.inc | 4 +++- plugins/admin/systems/class_terminalStartup.inc | 4 +++- plugins/admin/systems/class_winGeneric.inc | 4 +++- .../admin/systems/class_workstationGeneric.inc | 4 +++- .../admin/systems/class_workstationService.inc | 4 +++- .../admin/systems/class_workstationStartup.inc | 4 +++- plugins/gofax/faxaccount/class_gofaxAccount.inc | 8 ++++++-- .../conference/class_phoneConferenceGeneric.inc | 4 +++- plugins/gofon/macro/class_gofonMacro.inc | 4 +++- .../gofon/macro/class_gofonMacroParameters.inc | 4 +++- .../gofon/phoneaccount/class_phoneAccount.inc | 8 ++++++-- .../connectivity/class_intranetAccount.inc | 8 ++++++-- .../personal/connectivity/class_kolabAccount.inc | 4 +++- .../connectivity/class_oxchangeAccount.inc | 8 ++++++-- .../personal/connectivity/class_phpgwAccount.inc | 8 ++++++-- .../connectivity/class_phpscheduleitAccount.inc | 8 ++++++-- .../personal/connectivity/class_pptpAccount.inc | 8 ++++++-- .../personal/connectivity/class_proxyAccount.inc | 8 ++++++-- .../connectivity/class_pureftpdAccount.inc | 8 ++++++-- .../connectivity/class_webdavAccount.inc | 8 ++++++-- .../personal/environment/class_environment.inc | 12 +++++++++--- plugins/personal/mail/class_mailAccount.inc | 8 ++++++-- plugins/personal/nagios/class_nagiosAccount.inc | 8 ++++++-- plugins/personal/posix/class_posixAccount.inc | 8 ++++++-- plugins/personal/samba/class_sambaAccount.inc | 8 ++++++-- 51 files changed, 252 insertions(+), 84 deletions(-) diff --git a/plugins/admin/applications/class_applicationGeneric.inc b/plugins/admin/applications/class_applicationGeneric.inc index be7001e95..a61e7994b 100644 --- a/plugins/admin/applications/class_applicationGeneric.inc +++ b/plugins/admin/applications/class_applicationGeneric.inc @@ -333,7 +333,9 @@ class application extends plugin $a= $ldap->fetch(); if (count($a)){ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + $this->handle_post_events("modify"); } else { $ldap->cd($this->config->current['BASE']); diff --git a/plugins/admin/applications/class_applicationParameters.inc b/plugins/admin/applications/class_applicationParameters.inc index da2bc67cc..69ccc8f03 100644 --- a/plugins/admin/applications/class_applicationParameters.inc +++ b/plugins/admin/applications/class_applicationParameters.inc @@ -120,7 +120,9 @@ class applicationParameters extends plugin $ldap->cd($this->dn); @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->attributes, "Save"); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ @@ -179,7 +181,9 @@ class applicationParameters extends plugin $ldap->cd($this->dn); @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->attributes, "Save"); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc index 5dbb830c8..62ceff126 100644 --- a/plugins/admin/departments/class_departmentGeneric.inc +++ b/plugins/admin/departments/class_departmentGeneric.inc @@ -197,7 +197,9 @@ class department extends plugin $a= $ldap->fetch(); $ldap->cd($this->dn); if (count($a)){ - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + $this->handle_post_events('modify'); } else { $ldap->add($this->attrs); diff --git a/plugins/admin/fai/class_faiHook.inc b/plugins/admin/fai/class_faiHook.inc index aaf7f74e0..4dbff3b89 100644 --- a/plugins/admin/fai/class_faiHook.inc +++ b/plugins/admin/fai/class_faiHook.inc @@ -273,7 +273,9 @@ class faiHook extends plugin if($ldap->count()!=0){ /* Write FAIscript to ldap*/ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + }else{ /* Write FAIscript to ldap*/ $ldap->cd($this->config->current['BASE']); @@ -335,7 +337,9 @@ class faiHook extends plugin $this->handle_post_events("remove"); }elseif($obj['status'] == "edited"){ $ldap->cd($sub_dn); - $ldap->modify($tmp); + $this->cleanup(); +$ldap->modify ($tmp); + $this->handle_post_events("modify"); }elseif($obj['status']=="new"){ if($tmp['description']==array()){ diff --git a/plugins/admin/fai/class_faiPackage.inc b/plugins/admin/fai/class_faiPackage.inc index e98f721e4..1540bb748 100644 --- a/plugins/admin/fai/class_faiPackage.inc +++ b/plugins/admin/fai/class_faiPackage.inc @@ -386,7 +386,9 @@ class faiPackage extends plugin if($ldap->count()!=0){ /* Write FAIscript to ldap*/ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + }else{ /* Write FAIscript to ldap*/ $ldap->cd($this->config->current['BASE']); @@ -416,7 +418,9 @@ class faiPackage extends plugin $ldap->cat($pkgdn); if($ldap->count()!=0){ $ldap->cd($pkgdn); - $ldap->modify($pkgattrs); + $this->cleanup(); +$ldap->modify ($pkgattrs); + }else{ $ldap->cd($this->config->current['BASE']); $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $pkgdn)); diff --git a/plugins/admin/fai/class_faiPartitionTable.inc b/plugins/admin/fai/class_faiPartitionTable.inc index f6adfeb34..77b2e76e8 100644 --- a/plugins/admin/fai/class_faiPartitionTable.inc +++ b/plugins/admin/fai/class_faiPartitionTable.inc @@ -303,7 +303,9 @@ class faiPartitionTable extends plugin /* Add partition table to ldap */ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); } @@ -343,7 +345,9 @@ class faiPartitionTable extends plugin $disk_attrs['description']=array(); } $ldap->cd($disk_dn); - $ldap->modify($disk_attrs); + $this->cleanup(); +$ldap->modify ($disk_attrs); + }elseif($disk['status']== "new"){ if(empty($disk_attrs['description'])){ unset($disk_attrs['description']); @@ -404,7 +408,9 @@ class faiPartitionTable extends plugin $partition_attrs['description']=array(); } $ldap->cd($partition_dn); - $ldap->modify($partition_attrs); + $this->cleanup(); +$ldap->modify ($partition_attrs); + } show_ldap_error($ldap->get_error()); } diff --git a/plugins/admin/fai/class_faiProfile.inc b/plugins/admin/fai/class_faiProfile.inc index 8e56ddfb6..d416b0602 100644 --- a/plugins/admin/fai/class_faiProfile.inc +++ b/plugins/admin/fai/class_faiProfile.inc @@ -385,7 +385,9 @@ class faiProfile extends plugin if($ldap->count()!=0){ /* Write FAIscript to ldap*/ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + }else{ /* Write FAIscript to ldap*/ $ldap->cd($this->config->current['BASE']); diff --git a/plugins/admin/fai/class_faiScript.inc b/plugins/admin/fai/class_faiScript.inc index b7e122058..51b674c38 100644 --- a/plugins/admin/fai/class_faiScript.inc +++ b/plugins/admin/fai/class_faiScript.inc @@ -252,7 +252,9 @@ class faiScript extends plugin if($ldap->count()!=0){ /* Write FAIscript to ldap*/ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + }else{ /* Write FAIscript to ldap*/ $ldap->cd($this->config->current['BASE']); @@ -318,7 +320,9 @@ class faiScript extends plugin $this->handle_post_events("remove"); }elseif($obj['status'] == "edited"){ $ldap->cd($sub_dn); - $ldap->modify($tmp); + $this->cleanup(); +$ldap->modify ($tmp); + $this->handle_post_events("modify"); }elseif($obj['status']=="new"){ if($tmp['description']==array()){ diff --git a/plugins/admin/fai/class_faiTemplate.inc b/plugins/admin/fai/class_faiTemplate.inc index cfe0f41e8..10f81c719 100644 --- a/plugins/admin/fai/class_faiTemplate.inc +++ b/plugins/admin/fai/class_faiTemplate.inc @@ -253,7 +253,9 @@ class faiTemplate extends plugin if($ldap->count()!=0){ /* Write FAIscript to ldap*/ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + }else{ /* Write FAIscript to ldap*/ $ldap->cd($this->config->current['BASE']); @@ -310,7 +312,9 @@ class faiTemplate extends plugin $this->handle_post_events("remove"); }elseif($obj['status'] == "edited"){ $ldap->cd($sub_dn); - $ldap->modify($tmp); + $this->cleanup(); +$ldap->modify ($tmp); + $this->handle_post_events("modify"); }elseif($obj['status']=="new"){ diff --git a/plugins/admin/fai/class_faiVariable.inc b/plugins/admin/fai/class_faiVariable.inc index 2d2e581bf..f6c4a5562 100644 --- a/plugins/admin/fai/class_faiVariable.inc +++ b/plugins/admin/fai/class_faiVariable.inc @@ -256,7 +256,9 @@ class faiVariable extends plugin if($ldap->count()!=0){ /* Write FAIscript to ldap*/ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + }else{ /* Write FAIscript to ldap*/ $ldap->cd(preg_replace('/^[^,]+,[^,]+,/', '', $this->dn)); @@ -314,7 +316,9 @@ class faiVariable extends plugin $this->handle_post_events("remove"); }elseif($obj['status'] == "edited"){ $ldap->cd($sub_dn); - $ldap->modify($tmp); + $this->cleanup(); +$ldap->modify ($tmp); + $this->handle_post_events("modify"); }elseif($obj['status']=="new"){ diff --git a/plugins/admin/groups/class_groupAcl.inc b/plugins/admin/groups/class_groupAcl.inc index 706edc95a..79c28d043 100644 --- a/plugins/admin/groups/class_groupAcl.inc +++ b/plugins/admin/groups/class_groupAcl.inc @@ -94,7 +94,9 @@ class acl extends plugin $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); } @@ -189,7 +191,9 @@ class acl extends plugin /* Modify class */ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); } diff --git a/plugins/admin/groups/class_groupApplication.inc b/plugins/admin/groups/class_groupApplication.inc index 05c1160e4..8cee62bab 100644 --- a/plugins/admin/groups/class_groupApplication.inc +++ b/plugins/admin/groups/class_groupApplication.inc @@ -630,7 +630,9 @@ class appgroup extends plugin $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ @@ -673,7 +675,9 @@ class appgroup extends plugin /* Write back to LDAP */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ diff --git a/plugins/admin/groups/class_groupMail.inc b/plugins/admin/groups/class_groupMail.inc index f759f7435..383b51361 100644 --- a/plugins/admin/groups/class_groupMail.inc +++ b/plugins/admin/groups/class_groupMail.inc @@ -543,7 +543,9 @@ class mailgroup extends plugin /* Keep uid */ unset ($this->attrs['uid']); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Connect to IMAP server for account deletion */ @@ -630,7 +632,9 @@ class mailgroup extends plugin /* Backup for function save - Änderungen : fixAttributesOnStore($this) wurde erst nach dem ldap->modify + Änderungen : fixAttributesOnStore($this) wurde erst nach dem this->cleanup(); +$ldap->modify + Ausgeführt, deshalb wurden die gemappten Attribute auch nicht gespeichert. @@ -665,7 +669,9 @@ class mailgroup extends plugin /* Save data to LDAP * / $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Only do IMAP actions if we are not a template * / @@ -785,7 +791,9 @@ class mailgroup extends plugin /* Save data to LDAP */ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ diff --git a/plugins/admin/ogroups/class_mailogroup.inc b/plugins/admin/ogroups/class_mailogroup.inc index 74a290218..b99206146 100644 --- a/plugins/admin/ogroups/class_mailogroup.inc +++ b/plugins/admin/ogroups/class_mailogroup.inc @@ -91,7 +91,9 @@ class mailogroup extends plugin /* Save data to LDAP */ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ @@ -122,7 +124,9 @@ class mailogroup extends plugin @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->attributes, "Save"); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); } diff --git a/plugins/admin/ogroups/class_phonequeue.inc b/plugins/admin/ogroups/class_phonequeue.inc index e5861b8a7..c0e669b03 100644 --- a/plugins/admin/ogroups/class_phonequeue.inc +++ b/plugins/admin/ogroups/class_phonequeue.inc @@ -579,7 +579,9 @@ class phonequeue extends plugin /* Save data to LDAP */ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); @@ -675,7 +677,9 @@ class phonequeue extends plugin @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->attributes, "Save"); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); } diff --git a/plugins/admin/systems/class_componentGeneric.inc b/plugins/admin/systems/class_componentGeneric.inc index 9650956cb..250261b2c 100644 --- a/plugins/admin/systems/class_componentGeneric.inc +++ b/plugins/admin/systems/class_componentGeneric.inc @@ -169,7 +169,9 @@ class componentGeneric extends plugin } $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + $this->handle_post_events("modify"); } diff --git a/plugins/admin/systems/class_phoneGeneric.inc b/plugins/admin/systems/class_phoneGeneric.inc index 86696b0b9..ee1916c58 100644 --- a/plugins/admin/systems/class_phoneGeneric.inc +++ b/plugins/admin/systems/class_phoneGeneric.inc @@ -353,7 +353,9 @@ class phoneGeneric extends plugin } $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + // $user_phone_reload $ldap->cd ($this->config->current['BASE']); $user_phone_assignment = $ldap->fetch($ldap->search("(&(objectClass=goFonAccount)(goFonHardware=".$this->cn."))",array("uid"))); diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index b06b878c2..bc7324386 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -615,7 +615,9 @@ class printgeneric extends plugin } $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + $this->handle_post_events("modify"); } show_ldap_error($ldap->get_error()); diff --git a/plugins/admin/systems/class_servDB.inc b/plugins/admin/systems/class_servDB.inc index de6214635..65e0f9df5 100644 --- a/plugins/admin/systems/class_servDB.inc +++ b/plugins/admin/systems/class_servDB.inc @@ -238,7 +238,9 @@ class servdb extends plugin /* Write to LDAP */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ diff --git a/plugins/admin/systems/class_servDNS.inc b/plugins/admin/systems/class_servDNS.inc index 13c295600..aa3403071 100644 --- a/plugins/admin/systems/class_servDNS.inc +++ b/plugins/admin/systems/class_servDNS.inc @@ -388,7 +388,9 @@ class servdns extends plugin /* Update existing entries */ foreach($actions['update'] as $dn => $attrs){ $ldap->cd($dn); - $ldap->modify($attrs); + $this->cleanup(); +$ldap->modify ($attrs); + } show_ldap_error($ldap->get_error()); } diff --git a/plugins/admin/systems/class_servGeneric.inc b/plugins/admin/systems/class_servGeneric.inc index 883c3989d..9252d16a9 100644 --- a/plugins/admin/systems/class_servGeneric.inc +++ b/plugins/admin/systems/class_servGeneric.inc @@ -234,7 +234,9 @@ class servgeneric extends plugin } $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + $mode= "modify"; } $this->netConfigDNS->cn = $this->cn; diff --git a/plugins/admin/systems/class_servKolab.inc b/plugins/admin/systems/class_servKolab.inc index f3bd4ef46..87c65e765 100644 --- a/plugins/admin/systems/class_servKolab.inc +++ b/plugins/admin/systems/class_servKolab.inc @@ -185,7 +185,9 @@ class servkolab extends plugin { } $attrs= array('kolabHost' => $hosts); $ldap->cd($this->dn); - $ldap->modify($attrs); + $this->cleanup(); +$ldap->modify ($attrs); + show_ldap_error($ldap->get_error()); } diff --git a/plugins/admin/systems/class_servRepository.inc b/plugins/admin/systems/class_servRepository.inc index 6f75496ac..0d4453468 100644 --- a/plugins/admin/systems/class_servRepository.inc +++ b/plugins/admin/systems/class_servRepository.inc @@ -237,7 +237,9 @@ class servrepository extends plugin if($ldap->count()){ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + $this->handle_post_events("modify"); } } @@ -289,7 +291,9 @@ class servrepository extends plugin if($ldap->count()){ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + $this->handle_post_events("modify"); }else{ $ldap->cd ($this->config->current['BASE']); diff --git a/plugins/admin/systems/class_servService.inc b/plugins/admin/systems/class_servService.inc index 627cb5a95..281fd7897 100644 --- a/plugins/admin/systems/class_servService.inc +++ b/plugins/admin/systems/class_servService.inc @@ -312,7 +312,9 @@ class servservice extends plugin /* Write to LDAP */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc index d7d254fbd..b525f7b9d 100644 --- a/plugins/admin/systems/class_termDNS.inc +++ b/plugins/admin/systems/class_termDNS.inc @@ -316,7 +316,9 @@ class termDNS extends plugin /* Write back to ldap */ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + /****************/ /* DNS HANDLING */ @@ -360,7 +362,9 @@ class termDNS extends plugin if(count($ldap->fetch())){ $ldap->cd($dn); - $ldap->modify($attrs); + $this->cleanup(); +$ldap->modify ($attrs); + }else{ $ldap->cd($dn); $ldap->add($attrs); diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc index bfa881a31..75556b63d 100644 --- a/plugins/admin/systems/class_terminalGeneric.inc +++ b/plugins/admin/systems/class_terminalGeneric.inc @@ -315,7 +315,9 @@ class termgeneric extends plugin $this->move($this->orig_dn, $this->dn); } $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + $this->handle_post_events("modify"); } $this->netConfigDNS->cn = $this->cn; diff --git a/plugins/admin/systems/class_terminalService.inc b/plugins/admin/systems/class_terminalService.inc index 6cce41a47..a09473e3a 100644 --- a/plugins/admin/systems/class_terminalService.inc +++ b/plugins/admin/systems/class_terminalService.inc @@ -293,7 +293,9 @@ class termservice extends plugin /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); $this->handle_post_events("modify"); } diff --git a/plugins/admin/systems/class_terminalStartup.inc b/plugins/admin/systems/class_terminalStartup.inc index 6a80c0de5..f1bf0d3dd 100644 --- a/plugins/admin/systems/class_terminalStartup.inc +++ b/plugins/admin/systems/class_terminalStartup.inc @@ -297,7 +297,9 @@ class termstartup extends plugin /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); $this->handle_post_events("modify"); } diff --git a/plugins/admin/systems/class_winGeneric.inc b/plugins/admin/systems/class_winGeneric.inc index b2002b79e..089c096ac 100644 --- a/plugins/admin/systems/class_winGeneric.inc +++ b/plugins/admin/systems/class_winGeneric.inc @@ -186,7 +186,9 @@ class wingeneric extends plugin } $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + $this->handle_post_events("modify"); } diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc index 1c81a6c1f..f34e55a8c 100644 --- a/plugins/admin/systems/class_workstationGeneric.inc +++ b/plugins/admin/systems/class_workstationGeneric.inc @@ -276,7 +276,9 @@ class workgeneric extends plugin $this->move($this->orig_dn, $this->dn); } $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + if(!$this->didAction){ $this->handle_post_events("modify"); } diff --git a/plugins/admin/systems/class_workstationService.inc b/plugins/admin/systems/class_workstationService.inc index c80b799fb..f8cd526a7 100644 --- a/plugins/admin/systems/class_workstationService.inc +++ b/plugins/admin/systems/class_workstationService.inc @@ -290,7 +290,9 @@ class workservice extends plugin /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); $this->handle_post_events("modify"); } diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc index 07a925b61..0eeb89220 100644 --- a/plugins/admin/systems/class_workstationStartup.inc +++ b/plugins/admin/systems/class_workstationStartup.inc @@ -633,7 +633,9 @@ class workstartup extends plugin $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); $this->handle_post_events("modify"); } diff --git a/plugins/gofax/faxaccount/class_gofaxAccount.inc b/plugins/gofax/faxaccount/class_gofaxAccount.inc index 8e29d57cb..a8658b2ed 100644 --- a/plugins/gofax/faxaccount/class_gofaxAccount.inc +++ b/plugins/gofax/faxaccount/class_gofaxAccount.inc @@ -618,7 +618,9 @@ class gofaxAccount extends plugin $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ @@ -735,7 +737,9 @@ class gofaxAccount extends plugin /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ diff --git a/plugins/gofon/conference/class_phoneConferenceGeneric.inc b/plugins/gofon/conference/class_phoneConferenceGeneric.inc index f56e30a1a..fea75e73d 100644 --- a/plugins/gofon/conference/class_phoneConferenceGeneric.inc +++ b/plugins/gofon/conference/class_phoneConferenceGeneric.inc @@ -472,7 +472,9 @@ class conference extends plugin $a= $ldap->fetch(); $ldap->cd($this->dn); if (count($a)){ - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + $this->handle_post_events('modify'); } else { $ldap->add($this->attrs); diff --git a/plugins/gofon/macro/class_gofonMacro.inc b/plugins/gofon/macro/class_gofonMacro.inc index d33f8a605..d358ef900 100755 --- a/plugins/gofon/macro/class_gofonMacro.inc +++ b/plugins/gofon/macro/class_gofonMacro.inc @@ -411,7 +411,9 @@ class macro extends plugin if($this->generate_mysql_entension_entries()){ if (count($a)){ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + $this->handle_post_events("modify"); } else { $ldap->cd($this->config->current['BASE']); diff --git a/plugins/gofon/macro/class_gofonMacroParameters.inc b/plugins/gofon/macro/class_gofonMacroParameters.inc index e7e7b0d0a..451462083 100755 --- a/plugins/gofon/macro/class_gofonMacroParameters.inc +++ b/plugins/gofon/macro/class_gofonMacroParameters.inc @@ -378,7 +378,9 @@ class macroParameter extends plugin if (count($a)){ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + $this->handle_post_events("modify"); } else { if(count($this->attrs['goFonMacroParameter']==0)){ diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc index db1c304c2..d2016b629 100644 --- a/plugins/gofon/phoneaccount/class_phoneAccount.inc +++ b/plugins/gofon/phoneaccount/class_phoneAccount.inc @@ -956,7 +956,9 @@ class phoneAccount extends plugin /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ @@ -1109,7 +1111,9 @@ class phoneAccount extends plugin } } $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ diff --git a/plugins/personal/connectivity/class_intranetAccount.inc b/plugins/personal/connectivity/class_intranetAccount.inc index 067b3ed07..6b0638ace 100644 --- a/plugins/personal/connectivity/class_intranetAccount.inc +++ b/plugins/personal/connectivity/class_intranetAccount.inc @@ -96,7 +96,9 @@ class intranetAccount extends plugin $ldap->cd($this->dn); @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->attributes, "Save"); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ @@ -149,7 +151,9 @@ class intranetAccount extends plugin /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ diff --git a/plugins/personal/connectivity/class_kolabAccount.inc b/plugins/personal/connectivity/class_kolabAccount.inc index 7596ec118..3f9e952d6 100644 --- a/plugins/personal/connectivity/class_kolabAccount.inc +++ b/plugins/personal/connectivity/class_kolabAccount.inc @@ -318,7 +318,9 @@ class kolabAccount extends plugin /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ diff --git a/plugins/personal/connectivity/class_oxchangeAccount.inc b/plugins/personal/connectivity/class_oxchangeAccount.inc index e88ac8fd8..317506027 100644 --- a/plugins/personal/connectivity/class_oxchangeAccount.inc +++ b/plugins/personal/connectivity/class_oxchangeAccount.inc @@ -719,7 +719,9 @@ class oxchangeAccount extends plugin $ldap->cd($this->dn); @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->attributes, "Save"); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ $this->postremove(); @@ -804,7 +806,9 @@ class oxchangeAccount extends plugin /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ diff --git a/plugins/personal/connectivity/class_phpgwAccount.inc b/plugins/personal/connectivity/class_phpgwAccount.inc index 4e79a2f12..2bc1a0c67 100644 --- a/plugins/personal/connectivity/class_phpgwAccount.inc +++ b/plugins/personal/connectivity/class_phpgwAccount.inc @@ -66,7 +66,9 @@ class phpgwAccount extends plugin $ldap->cd($this->dn); @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->attributes, "Save"); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ @@ -107,7 +109,9 @@ class phpgwAccount extends plugin /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ diff --git a/plugins/personal/connectivity/class_phpscheduleitAccount.inc b/plugins/personal/connectivity/class_phpscheduleitAccount.inc index 775773261..5f1e60ffb 100644 --- a/plugins/personal/connectivity/class_phpscheduleitAccount.inc +++ b/plugins/personal/connectivity/class_phpscheduleitAccount.inc @@ -78,7 +78,9 @@ class phpscheduleitAccount extends plugin $ldap->cd($this->dn); @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->attributes, "Save"); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ @@ -117,7 +119,9 @@ class phpscheduleitAccount extends plugin /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ diff --git a/plugins/personal/connectivity/class_pptpAccount.inc b/plugins/personal/connectivity/class_pptpAccount.inc index 6e1076dac..c7ed311e8 100644 --- a/plugins/personal/connectivity/class_pptpAccount.inc +++ b/plugins/personal/connectivity/class_pptpAccount.inc @@ -78,7 +78,9 @@ class pptpAccount extends plugin $ldap->cd($this->dn); @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->attributes, "Save"); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ @@ -119,7 +121,9 @@ class pptpAccount extends plugin /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ diff --git a/plugins/personal/connectivity/class_proxyAccount.inc b/plugins/personal/connectivity/class_proxyAccount.inc index bc50bb78e..1c2596582 100644 --- a/plugins/personal/connectivity/class_proxyAccount.inc +++ b/plugins/personal/connectivity/class_proxyAccount.inc @@ -150,7 +150,9 @@ class proxyAccount extends plugin @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->attributes, "Save"); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ @@ -253,7 +255,9 @@ class proxyAccount extends plugin /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); diff --git a/plugins/personal/connectivity/class_pureftpdAccount.inc b/plugins/personal/connectivity/class_pureftpdAccount.inc index bd996fbf9..733428ac7 100644 --- a/plugins/personal/connectivity/class_pureftpdAccount.inc +++ b/plugins/personal/connectivity/class_pureftpdAccount.inc @@ -90,7 +90,9 @@ class pureftpdAccount extends plugin $ldap->cd($this->dn); @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->attributes, "Save"); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ @@ -166,7 +168,9 @@ class pureftpdAccount extends plugin /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ diff --git a/plugins/personal/connectivity/class_webdavAccount.inc b/plugins/personal/connectivity/class_webdavAccount.inc index c917e2bd6..7ea80d965 100644 --- a/plugins/personal/connectivity/class_webdavAccount.inc +++ b/plugins/personal/connectivity/class_webdavAccount.inc @@ -62,7 +62,9 @@ class webdavAccount extends plugin $ldap->cd($this->dn); @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->attributes, "Save"); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ @@ -103,7 +105,9 @@ class webdavAccount extends plugin /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index 059b35c20..3c97e19a6 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -686,7 +686,9 @@ class environment extends plugin @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,$this->attributes, "Save"); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); @@ -875,7 +877,9 @@ class environment extends plugin /* Save changes */ $ldap->cd($attr['dn']); unset($attr['dn']); - $ldap->modify($attr); + $this->cleanup(); +$ldap->modify ($attr); + if($ldap->get_error()!="Success"){ print_red(_("Error while writing printer")." : ".$ldap->get_error()); } @@ -945,7 +949,9 @@ class environment extends plugin $ldap->cd($attrs['dn']); unset($attrs['dn']); - $ldap->modify($attrs); + $this->cleanup(); +$ldap->modify ($attrs); + if($ldap->get_error()!="Success"){ print_red(_("Error while writing printer settings")." : ".$ldap->get_error()); } diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc index 1f02e8c1e..25e866bc9 100644 --- a/plugins/personal/mail/class_mailAccount.inc +++ b/plugins/personal/mail/class_mailAccount.inc @@ -555,7 +555,9 @@ class mailAccount extends plugin @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->attributes, "Save"); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Connect to IMAP server for account deletion */ @@ -654,7 +656,9 @@ class mailAccount extends plugin /* Save data to LDAP */ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Only do IMAP actions if we are not a template */ diff --git a/plugins/personal/nagios/class_nagiosAccount.inc b/plugins/personal/nagios/class_nagiosAccount.inc index 9465e97e7..ba64598dc 100644 --- a/plugins/personal/nagios/class_nagiosAccount.inc +++ b/plugins/personal/nagios/class_nagiosAccount.inc @@ -141,7 +141,9 @@ class nagiosAccount extends plugin /* Write back to ldap */ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ @@ -216,7 +218,9 @@ class nagiosAccount extends plugin @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->attributes, "Save"); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* remove the entry from LDAP */ diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc index ca2dcb5e4..5ae6f0ddd 100644 --- a/plugins/personal/posix/class_posixAccount.inc +++ b/plugins/personal/posix/class_posixAccount.inc @@ -595,7 +595,9 @@ class posixAccount extends plugin @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->attributes, "Save"); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Delete group only if cn is uid and there are no other @@ -807,7 +809,9 @@ class posixAccount extends plugin /* Save data to LDAP */ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Remove lock needed for unique id generation */ diff --git a/plugins/personal/samba/class_sambaAccount.inc b/plugins/personal/samba/class_sambaAccount.inc index 5a8cab055..d0032add2 100644 --- a/plugins/personal/samba/class_sambaAccount.inc +++ b/plugins/personal/samba/class_sambaAccount.inc @@ -619,7 +619,9 @@ class sambaAccount extends plugin @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->attributes, "Save"); $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ @@ -963,7 +965,9 @@ class sambaAccount extends plugin /* Write back to ldap */ $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + show_ldap_error($ldap->get_error()); /* Optionally execute a command after we're done */ -- 2.30.2