Code

Fixed some error msgs
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Jan 2007 08:12:59 +0000 (08:12 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Jan 2007 08:12:59 +0000 (08:12 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5508 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofon/phoneaccount/class_phoneAccount.inc

index 7b1d6517b72f08a98e9c50af434c5b90fcfbe167..edd033610f3dbf47f2f203c1f5f44265f34cf382 100644 (file)
@@ -66,6 +66,13 @@ class phoneAccount extends plugin
       }
     }
 
+    /* Set uid */
+    if((isset($this->parent->by_object['user']->uid))&&(!empty($this->parent->by_object['user']->uid))){
+      $this->uid = $this->parent->by_object['user']->uid;
+    }
+    if((isset($this->parent->by_object['user']->cn))&&(!empty($this->parent->by_object['user']->cn))){
+      $this->cn  = $this->parent->by_object['user']->cn;
+    }
 
     /* Check server configurations 
      * Load all server configuration in $this->goFonHomeServers if available
@@ -1320,14 +1327,14 @@ class phoneAccount extends plugin
 
     $ldap= $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
-    $ldap->search("(objectClass=goFonQueue)", array("member"));
+    $ldap->search("(&(objectClass=goFonQueue)(member=*))", array("member"));
     while($attr = $ldap->fetch()){
       if(in_array($this->dn,$attr['member'])){
         $new =new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'],$attr['dn']);
         unset($new->by_object['ogroup']->memberList[$this->dn]);
         unset($new->by_object['ogroup']->member[$this->dn]);
         $new->save();
-        print_red(sprintf(_("Removed user '%s' from phone queue '%s'."),$this->uid,$new->by_object['ogroup']->attrs['cn']));
+        print_red(sprintf(_("Removed user '%s' from phone queue '%s'."),$this->uid,$new->by_object['ogroup']->cn));
       }
     }
     $ldap->cd($this->dn);