From ad7a06c55ab7d0dfe6b8c18c05e3578678d87d92 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 8 Aug 2005 07:29:36 +0000 Subject: [PATCH] Fixed phonenumber assignment... nu duplicates are allowed in ogroup and phoneaccount git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1072 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/ogroups/class_phonequeue.inc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/admin/ogroups/class_phonequeue.inc b/plugins/admin/ogroups/class_phonequeue.inc index 1e7c6cdd3..c2cc8216c 100644 --- a/plugins/admin/ogroups/class_phonequeue.inc +++ b/plugins/admin/ogroups/class_phonequeue.inc @@ -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; } } -- 2.30.2