X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_config.inc;h=7ef00cb6c44ed0147f48022ff48ab5fd674ce3c4;hb=393402bd6f7875b422726b00aad7c69bdaca55e7;hp=b72146e2281eee96385d9f51fd28d9ac6614cc2d;hpb=60e570e4a9732e74f1e49deea51dc69ce65f92ad;p=gosa.git diff --git a/include/class_config.inc b/include/class_config.inc index b72146e22..7ef00cb6c 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()){ @@ -394,14 +420,16 @@ class config { 'PASSWORD' => $attrs['goGlpiPassword'][0], 'DB' => $attrs['goGlpiDatabase'][0]); } + /* Get logdb server */ $ldap->cd ($this->current['BASE']); - $ldap->search ("(objectClass=goLogDBServer)"); + $ldap->search ("(objectClass=goLogDBServer)",array("cn","goLogDBServerUser","goLogDBServerPassword","goLogDB")); if ($ldap->count()){ $attrs= $ldap->fetch(); - $this->data['SERVERS']['LOG']= array( 'SERVER' => $attrs['cn'][0], - 'LOGIN' => $attrs['goLogAdmin'][0], - 'PASSWORD' => $attrs['goLogPassword'][0]); + $this->data['SERVERS']['LOGGING'][$attrs['cn'][0]]= + array('USER' => $attrs['goLogDBServerUser'][0], + 'PWD' => $attrs['goLogDBServerPassword'][0], + 'DB' => $attrs['goLogDB'][0]); } /* Get NFS server lists */