From: hickert Date: Tue, 16 Aug 2005 11:51:26 +0000 (+0000) Subject: Added number check X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=db67294680b63561fefab69f87bd107a229407e0;p=gosa.git Added number check git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1152 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/ogroups/class_phonequeue.inc b/plugins/admin/ogroups/class_phonequeue.inc index 52bc8949d..506984d55 100644 --- a/plugins/admin/ogroups/class_phonequeue.inc +++ b/plugins/admin/ogroups/class_phonequeue.inc @@ -471,7 +471,7 @@ class phonequeue extends plugin { $ldap= $this->config->get_ldap_link(); $ldap->cd($this->config->current['BASE']); - $ldap->search("(|(objectClass=goFonAccount)(objectClass=goFonQueue))", array("telephoneNumber","cn","uid")); + $ldap->search("(|(objectClass=goFonAccount)(objectClass=goFonQueue)(goFonConference))", array("telephoneNumber","cn","uid")); while($attrs = $ldap->fetch()) { unset($attrs['telephoneNumber']['count']); foreach($attrs['telephoneNumber'] as $tele){ diff --git a/plugins/gofon/conference/class_phoneConferenceGeneric.inc b/plugins/gofon/conference/class_phoneConferenceGeneric.inc index b2880643e..b277a3b41 100644 --- a/plugins/gofon/conference/class_phoneConferenceGeneric.inc +++ b/plugins/gofon/conference/class_phoneConferenceGeneric.inc @@ -100,7 +100,7 @@ class conference extends plugin $smarty= get_smarty(); $smarty->assign("goFonConferenceOptions", array("P"=>"Conference ",""=>"Conference without PIN")); - $smarty->assign("goFonConferenceOptionFormats", array("wav"=>"Wave","gsm"=>"GSM","wav49"=>"Wave49")); + $smarty->assign("goFonConferenceOptionFormats", array("WAV"=>"Wave","GSM"=>"GSM","WAV49"=>"Wave49")); $smarty->assign("goFonConferenceOption", $this->goFonConferenceOption_P); foreach ($this->attributes as $val){ @@ -243,7 +243,14 @@ class conference extends plugin $EXT[$i]['priority']=$i; $EXT[$i]['app'] ="MeetMe"; $EXT[$i]['appdata'] =$this->goFonConferenceOptionNumber."|".$parameter."|".$this->goFonPIN; - + $i++; + + // Start Conference + $EXT[$i]['exten'] =$this->cn; + $EXT[$i]['context'] =$context; + $EXT[$i]['priority']=1; + $EXT[$i]['app'] ="Goto"; + $EXT[$i]['appdata'] =$this->goFonConferenceOptionNumber."|1"; $SQL=array(); foreach($EXT as $keytop => $valtop){ @@ -305,6 +312,40 @@ class conference 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->cd($this->config->current['BASE']); + $ldap->search("(|(objectClass=goFonAccount)(objectClass=goFonQueue)(objectClass=goFonConference))", array("telephoneNumber","cn","uid")); + while($attrs = $ldap->fetch()) { + unset($attrs['telephoneNumber']['count']); + 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; + } + } + + foreach($this->phoneNumbers as $num){ + if(!isset($this->cn)) $this->cn = ""; + + if((isset($numbers[$num]))&&(($numbers[$num]['uid'][0]!=$this->uid))){ + if(isset($numbers[$num]['uid'][0])){ + return sprintf(_("The specified telephonenumber '%s' is already assigned to '%s'."),$num,$numbers[$num]['uid'][0]); + }else{ + return sprintf(_("The specified telephonenumber '%s' is already assigned to '%s'."),$num,$numbers[$num]['cn'][0]); + } + } + } + } + + + + + + /* Save to LDAP */ function save() { diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc index 03f69db13..5ab022af6 100644 --- a/plugins/gofon/phoneaccount/class_phoneAccount.inc +++ b/plugins/gofon/phoneaccount/class_phoneAccount.inc @@ -973,7 +973,7 @@ class phoneAccount extends plugin { $ldap= $this->config->get_ldap_link(); $ldap->cd($this->config->current['BASE']); - $ldap->search("(|(objectClass=goFonAccount)(objectClass=goFonQueue))", array("telephoneNumber","cn","uid")); + $ldap->search("(|(objectClass=goFonAccount)(objectClass=goFonQueue)(objectClass=goFonConference))", array("telephoneNumber","cn","uid")); while($attrs = $ldap->fetch()) { unset($attrs['telephoneNumber']['count']); foreach($attrs['telephoneNumber'] as $tele){