Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 776 → Rev 777

/web/acc/admin/lib/alcasar/freeradius/configreader.php
381,6 → 381,26
return false;
}
}
public function deleteSection($sectionName, $instanceName=null){
$t = false;
foreach ($this->_items as $key => $item){
if ($item->getType() !== 'section'){
continue;
}
if ($item->getName() === $sectionName){
if ($instanceName!==null){
if ($item->getInstanceName() === $instanceName){
unset($this->_items[$key]);
$t = true;
}
} else {
unset($this->_items[$key]);
$t = true;
}
}
}
return $t;
}
public function setSection($sectionName, sectionItem $sectionItem){
$t = false;
foreach ($this->_items as $key => $item){
/web/acc/admin/update_ldap.php
58,30 → 58,43
$site = new siteConfig();
$site->load(ALCASAR_RADIUS_SITE);
if ($auth_enable == "1"){ //test $auth_enable
# ldap {
# fail=1
# }
if ($site->authorize->ldap !== false){
/*
ON ACTIVE LE LDAP
*/
/*
Configure autorize section with:
ldap {
fail=1
}
*/
if ($site->authorize->ldap === false){ // always test before update
$site->authorize->addSection('ldap');
$site->authorize->ldap->addPair('fail','1');
}else{
if ($site->authorize->ldap->fail === false){
if ($site->authorize->ldap->fail === false){ // always test before update
$site->authorize->ldap->addPair('fail','1');
}
}
# Auth-Type LDAP {
# ldap
# }
if ($site->authenticate->getSectionInstance('Auth-Type','LDAP')===false){
/*
Configure authenticate section with
Auth-Type LDAP {
ldap
}
*/
if ($site->authenticate->getSectionInstance('Auth-Type','LDAP')===false){ // always test before update
$site->authenticate->addSection('Auth-Type', 'LDAP');
$site->authenticate->getSectionInstance('Auth-Type','LDAP')->addSection('ldap');
}
} else {
/*
DESACTIVE LE LDAP
*/
/*
ON DESACTIVE LE LDAP
*/
if ($site->authorize->ldap !== false){ // always test before update
$site->authorize->deleteSection("ldap");
}
if ($site->authenticate->getSectionInstance('Auth-Type','LDAP')!==false){ // always test before update
$site->authenticate->deleteSection('Auth-Type','LDAP');
}
}
//Sauvegarde du /etc/raddb/sites-available/alcasar
$site->save(ALCASAR_RADIUS_SITE);
106,7 → 119,7
} //test $auth_enable
 
/****************************************************************
* Redémarage des service *
* Redémarage des service *
*****************************************************************/
 
if ($auth_enable == "1"){