58,11 → 58,30 |
$site = new siteConfig(); |
$site->load(ALCASAR_RADIUS_SITE); |
if ($auth_enable == "1"){ //test $auth_enable |
$site->authorize->ldap = 'ldap'; |
$site->authenticate->ldap = 'ldap'; |
# ldap { |
# fail=1 |
# } |
if ($site->authorize->ldap !== false){ |
$site->authorize->addSection('ldap'); |
$site->authorize->ldap->addPair('fail','1'); |
}else{ |
if ($site->authorize->ldap->fail === false){ |
$site->authorize->ldap->addPair('fail','1'); |
} |
} |
# Auth-Type LDAP { |
# ldap |
# } |
if ($site->authenticate->getSectionInstance('Auth-Type','LDAP')===false){ |
$site->authenticate->addSection('Auth-Type', 'LDAP'); |
$site->authenticate->getSectionInstance('Auth-Type','LDAP')->addSection('ldap'); |
} |
} else { |
$site->authorize->ldap = false; |
$site->authenticate->ldap = false; |
/* |
DESACTIVE LE LDAP |
|
|
*/ |
} |
//Sauvegarde du /etc/raddb/sites-available/alcasar |
$site->save(ALCASAR_RADIUS_SITE); |