Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 779 → Rev 780

/web/acc/admin/lib/alcasar/freeradius/ldapconfig.php
88,13 → 88,13
$this->_items['host'] = $tmp[1];
} else {
$this->_items['protocol'] = 'ldap';
$this->_items['host'] = $tmp[1];
$this->_items['host'] = $tmp[0];
}
$this->_items['server'] = $this->_items['protocol'].'://'.$this->_items['host'];
break;
case "uid":
$this->_items['uid'] = $value;
$this->_items['filter'] = "($this->_items['uid']=%{Stripped-User-Name:-%{User-Name}})";
$this->_items['filter'] = "(".$this->_items['uid']."=%{Stripped-User-Name:-%{User-Name}})";
break;
case "filter":
// extract uid
115,9 → 115,7
public function load($confFile){
// use here the parsing class
require_once("configreader.php");
$r = new configReader($confFile);
/*
loading only if the file containt only one ldap instance.
If more instance are found, we use the default values instead.
125,15 → 123,21
if (is_object($r->ldap)){
$this->instanceName = $r->ldap->getInstanceName();
$items = $r->ldap->getpair();
foreach ($this->_items as $key => $value){
if (array_key_exists($key, $items))
$this->_items[$key] = $items[$key];
 
foreach ($items as $pair){
$pairName = $pair->getName();
$pairValue = $pair->getPair($pairName);
if (array_key_exists($pairName , $this->_items))
$this->$pairName = $pairValue; // we use __set() function to have all exceptions!
}
if (is_object($r->ldap->tls)){
$tls = $r->ldap->tls->getpair();
foreach ($this->_tls as $key => $value){
if (array_key_exists($key, $tls))
$this->_tls[$key] = $tls[$key];
foreach ($tls as $pair){
$tlsPairName = $pair->getName();
$tlsPairValue = $pair->getPair($tlsPairName);
if (array_key_exists($tlsPairName , $this->_tls))
$this->$tlsPairName = $pairValue; // we use __set() function to have all exceptions!
}
}
}