Code

Fixed Printer save problem, unknown member uids caused saving problems.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 1 Aug 2006 07:28:55 +0000 (07:28 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 1 Aug 2006 07:28:55 +0000 (07:28 +0000)
Fixed service removement for virus/spam

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4355 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_goSpamServer.inc
plugins/admin/systems/class_goVirusServer.inc
plugins/admin/systems/class_printGeneric.inc

index b0a61d6fa767b712a9ea431aa099eb815f82488c..24884965fc4c74251e9361ed3e29a5c12943dbdc 100644 (file)
@@ -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"));
index 7b334597b420f49bbddb411a4b5b686d183cd898..7a1dde535f0174ca6160849cb0f9c957d28d4406 100644 (file)
@@ -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"));
index 03083da98dbe8b05358f155df8c89d7c74d66fa4..09d5d80eb05befd181d165536295324d02babae6 100644 (file)
@@ -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;
+              }
             }
           }
         }