index 516195d7b43468767e91ee34c0ffe0ab00072cc2..7ef00cb6c44ed0147f48022ff48ab5fd674ce3c4 100644 (file)
--- a/include/class_config.inc
+++ b/include/class_config.inc
if (!isset($this->current['GROUPS'])){
$this->current['GROUPS']= "ou=groups";
}
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']);
/* Remove possibly added ',' from end of group and people ou */
$this->current['GROUPS'] = preg_replace("/,*$/","",$this->current['GROUPS']);
'PASSWORD' => $attrs['goFaxPassword'][0]);
}
'PASSWORD' => $attrs['goFaxPassword'][0]);
}
+
/* Get asterisk servers */
$ldap->cd ($this->current['BASE']);
$ldap->search ("(objectClass=goFonServer)");
/* Get asterisk servers */
$ldap->cd ($this->current['BASE']);
$ldap->search ("(objectClass=goFonServer)");
- $this->data['SERVERS']['FON']= array();
+ $this->data['SERVERS']['FON']= array();
if ($ldap->count()){
while ($attrs= $ldap->fetch()){
if ($ldap->count()){
while ($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");
+
+ /* 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()){
$ldap->cd ($this->current['BASE']);
$ldap->search ("(&(objectClass=goGlpiServer)(cn=*)(goGlpiAdmin=*)(goGlpiDatabase=*))",array("cn","goGlpiPassword","goGlpiAdmin","goGlpiDatabase"));
if ($ldap->count()){
'PASSWORD' => $attrs['goGlpiPassword'][0],
'DB' => $attrs['goGlpiDatabase'][0]);
}
'PASSWORD' => $attrs['goGlpiPassword'][0],
'DB' => $attrs['goGlpiDatabase'][0]);
}
+
/* Get logdb server */
$ldap->cd ($this->current['BASE']);
/* 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();
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 */
}
/* Get NFS server lists */