From: hickert Date: Mon, 8 Aug 2005 07:29:36 +0000 (+0000) Subject: Fixed phonenumber assignment... nu duplicates are allowed in ogroup and phoneaccount X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ad7a06c55ab7d0dfe6b8c18c05e3578678d87d92;p=gosa.git 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 --- 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; } }