Code

Fixed phonenumber assignment... nu duplicates are allowed in ogroup and phoneaccount
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 8 Aug 2005 07:29:36 +0000 (07:29 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 8 Aug 2005 07:29:36 +0000 (07:29 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1072 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/ogroups/class_phonequeue.inc

index 1e7c6cdd3f648a8bb4023db4917da80947bcdddc..c2cc8216c1e2b46a7539281d1c8ee5204d8a93dd 100644 (file)
@@ -399,14 +399,19 @@ class phonequeue extends plugin
   }
 
 
+
+ /* This function checks if the given phonenumbers are available or already in use*/
+
   function is_number_used()
   {
     $ldap= $this->config->get_ldap_link();
-    $ldap->search("(objectClass=goFonAccount)", array("telephoneNumber","uid","cn"));
+    $ldap->cd($this->config->current['BASE']);
+    $ldap->search("(|(objectClass=goFonAccount)(objectClass=goFonQueue))", array("telephoneNumber","cn","uid"));
     while($attrs = $ldap->fetch()) {
       unset($attrs['telephoneNumber']['count']);
-      $usednumber[$attrs['uid'][0]]= $attrs['telephoneNumber'];
       foreach($attrs['telephoneNumber'] as $tele){
+        if(!isset($attrs['cn'][0])) $attrs['cn'][0]=$attrs['dn'];
+        if(!isset($attrs['uid'][0])) $attrs['uid'][0]=$attrs['dn'];
         $numbers[$tele]=$attrs;
       }
     }