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"){ |