Subversion Repositories Applications.annuaire

Compare Revisions

Regard whitespace Rev 394 → Rev 395

/trunk/controleurs/IdentificationControleur.php
18,18 → 18,7
private $fonction_cryptage_mdp_cookie = 'md5';
private $objet_identification = null;
/*public function IdentificationControleur() {
 
Controleur::__construct();
$this->cookie_persistant_nom = session_name().'-memo';
$this->cookie_persistant_nom = 'pap-admin_papyrus_-memo';
$this->duree_identification = time()+Config::get('duree_session_identification');
$this->fonction_cryptage_mdp_cookie = Config::get('fonction_cryptage_mdp_cookie');
}*/
 
public function afficherFormulaireIdentification($id_annuaire, $donnees = array()) {
 
$this->chargerModele('AnnuaireModele');
$annuaire = $this->AnnuaireModele->chargerAnnuaire($id_annuaire);
 
43,13 → 32,11
}
public function loggerUtilisateur($utilisateur, $pass) {
$this->objet_identification = Config::get('objet_identification');
// on cree le cookie
$this->creerCookie($utilisateur, $pass);
// On loggue l'utilisateur
// Loguer l'utilisateur
$this->objet_identification->username = $utilisateur;
$this->objet_identification->password = $pass;
$this->objet_identification->login();
58,10 → 45,8
}
public function deLoggerUtilisateur() {
$this->objet_identification = Config::get('objet_identification');
$this->objet_identification->logout();
return true;
}
73,12 → 58,12
}
public function creerCookie($utilisateur, $pass, $pass_deja_crypte = false) {
$this->objet_identification = Config::get('objet_identification');
// Expiration si l'utilisateur ne referme pas son navigateur
$this->objet_identification->setExpire(0);
$this->objet_identification->setIdle(0);
 
// Création d'un cookie pour rendre permanente l'identification de Papyrus
if(!$pass_deja_crypte) {
$pass_crypt = md5($pass);
90,7 → 75,6
}
public function obtenirLoginUtilisateurParCookie() {
 
$nom_session = Config::get('nom_session');
if(isset($_COOKIE[$nom_session])) {
100,7 → 84,6
} else {
return false;
}
}
}
?>