From: hickert Date: Tue, 1 Aug 2006 07:28:55 +0000 (+0000) Subject: Fixed Printer save problem, unknown member uids caused saving problems. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bd70b83e5a71883143c94b9247083a4997689be0;p=gosa.git Fixed Printer save problem, unknown member uids caused saving problems. Fixed service removement for virus/spam git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4355 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_goSpamServer.inc b/plugins/admin/systems/class_goSpamServer.inc index b0a61d6fa..24884965f 100644 --- a/plugins/admin/systems/class_goSpamServer.inc +++ b/plugins/admin/systems/class_goSpamServer.inc @@ -246,9 +246,17 @@ class gospamserver extends plugin{ /* remove this extension */ function remove_from_parent() { + if(!$this->is_account && $this->initially_was_account){ + plugin::remove_from_parent(); + /* Remove status flag, it is not a memeber of + this->attributes, so ensure that it is deleted too */ + if(!empty($this->StatusFlag)){ + $this->attrs[$this->StatusFlag] = array(); + } + /* Check if this is a new entry ... add/modify */ $ldap = $this->config->get_ldap_link(); $ldap->cat($this->dn,array("objectClass")); diff --git a/plugins/admin/systems/class_goVirusServer.inc b/plugins/admin/systems/class_goVirusServer.inc index 7b334597b..7a1dde535 100644 --- a/plugins/admin/systems/class_goVirusServer.inc +++ b/plugins/admin/systems/class_goVirusServer.inc @@ -123,8 +123,15 @@ class govirusserver extends plugin{ function remove_from_parent() { if(!$this->is_account && $this->initially_was_account){ + plugin::remove_from_parent(); + /* Remove status flag, it is not a memeber of + this->attributes, so ensure that it is deleted too */ + if(!empty($this->StatusFlag)){ + $this->attrs[$this->StatusFlag] = array(); + } + /* Check if this is a new entry ... add/modify */ $ldap = $this->config->get_ldap_link(); $ldap->cat($this->dn,array("objectClass")); diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index 03083da98..09d5d80eb 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -132,13 +132,19 @@ class printgeneric extends plugin foreach($this->attrs[$attr] as $mem){ if(preg_match("/Group/",$type)){ $ldap->search("(&(objectClass=posixGroup)(cn=".$mem."))",array("cn","description")); - $entry = $ldap->fetch(); - $this->member[$type][$entry['cn'][0]]=$entry; + if($ldap->count()){ + $entry = $ldap->fetch(); + if(isset($entry['cn'])){ + $this->member[$type][$entry['cn'][0]]=$entry; + } + } }else{ $ldap->search("(&(objectClass=person)(objectClass=inetOrgPerson)(uid=".$mem."))",array("cn","uid")); - $entry = $ldap->fetch(); - if(isset($entry['uid'])){ - $this->member[$type][$entry['uid'][0]]=$entry; + if($ldap->count()){ + $entry = $ldap->fetch(); + if(isset($entry['uid'])){ + $this->member[$type][$entry['uid'][0]]=$entry; + } } } }