1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
$ntlm = new NTLM();
$this->login = $ntlm->getInfosFromNTLM();
$this->group_authorize = ad::getGroupAuthorized();
$ad = new adLDAP(sfConfig::get('app_ad_options'));
$user = $this->getUser();
if(!$user->isAuthenticated()){
if($this->login!=""){
if(!$user->hasLogin()){
$this->msg = "Authentification en cours pour ".$this->login." ...";
$user->setLogin();
unset($ntlm);
$this->redirect('@vjGuardADAuthLoginNtlm');
}else{
$this->msg = "Authentification accomplie !";
if($ad->user_ingroup($this->login,$this->group_authorize)){
$this->msg .= "<br />Connexion en cours";
$user->loginOrMessage($this->login, __('Access denied!', array(), 'vjGuardAD'));
unset($ntlm);
$this->redirect('@homepage');
}else{
$user->logoutMessage("error",__('Access denied!', array(), 'vjGuardAD'));
unset($ntlm);
$this->redirect('@vjGuardADAuthLogin');
}
}
}
}else{
unset($ntlm);
$this->redirect('@homepage');
} |
Partager