X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_config.inc;h=762c6e0f91510fe01dc74e672eddb143d97d8df6;hb=0d96e184dc6107bff6f32f24b4cda64ddd01c35a;hp=b72146e2281eee96385d9f51fd28d9ac6614cc2d;hpb=60e570e4a9732e74f1e49deea51dc69ce65f92ad;p=gosa.git diff --git a/include/class_config.inc b/include/class_config.inc index b72146e22..762c6e0f9 100644 --- a/include/class_config.inc +++ b/include/class_config.inc @@ -241,6 +241,10 @@ class config { if (!isset($this->current['GROUPS'])){ $this->current['GROUPS']= "ou=groups"; } + + if (isset($this->current['INITIAL_BASE'])){ + $_SESSION['CurrentMainBase']= $this->current['INITIAL_BASE']; + } /* Remove possibly added ',' from end of group and people ou */ $this->current['GROUPS'] = preg_replace("/,*$/","",$this->current['GROUPS']); @@ -363,24 +367,46 @@ class config { 'PASSWORD' => $attrs['goFaxPassword'][0]); } + /* Get asterisk servers */ $ldap->cd ($this->current['BASE']); $ldap->search ("(objectClass=goFonServer)"); + $this->data['SERVERS']['FON']= array(); if ($ldap->count()){ - $attrs= $ldap->fetch(); - $this->data['SERVERS']['FON']= array( - 'SERVER' => $attrs['cn'][0], - 'LOGIN' => $attrs['goFonAdmin'][0], - 'PASSWORD' => $attrs['goFonPassword'][0], - 'DB' => "gophone", - 'SIP_TABLE' => "sip_users", - 'EXT_TABLE' => "extensions", - 'VOICE_TABLE' => "voicemail_users", - 'QUEUE_TABLE' => "queues", - 'QUEUE_MEMBER_TABLE' => "queue_members"); + while ($attrs= $ldap->fetch()){ + + /* Add 0 entry for development */ + if(count($this->data['SERVERS']['FON']) == 0){ + $this->data['SERVERS']['FON'][0]= array( + 'DN' => $attrs['dn'], + 'SERVER' => $attrs['cn'][0], + 'LOGIN' => $attrs['goFonAdmin'][0], + 'PASSWORD' => $attrs['goFonPassword'][0], + 'DB' => "gophone", + 'SIP_TABLE' => "sip_users", + 'EXT_TABLE' => "extensions", + 'VOICE_TABLE' => "voicemail_users", + 'QUEUE_TABLE' => "queues", + 'QUEUE_MEMBER_TABLE' => "queue_members"); + } + + /* Add entry with 'dn' as index */ + $this->data['SERVERS']['FON'][$attrs['dn']]= array( + 'DN' => $attrs['dn'], + 'SERVER' => $attrs['cn'][0], + 'LOGIN' => $attrs['goFonAdmin'][0], + 'PASSWORD' => $attrs['goFonPassword'][0], + 'DB' => "gophone", + 'SIP_TABLE' => "sip_users", + 'EXT_TABLE' => "extensions", + 'VOICE_TABLE' => "voicemail_users", + 'QUEUE_TABLE' => "queues", + 'QUEUE_MEMBER_TABLE' => "queue_members"); + } } - /* Get asterisk servers */ + + /* Get glpi server */ $ldap->cd ($this->current['BASE']); $ldap->search ("(&(objectClass=goGlpiServer)(cn=*)(goGlpiAdmin=*)(goGlpiDatabase=*))",array("cn","goGlpiPassword","goGlpiAdmin","goGlpiDatabase")); if ($ldap->count()){