Subversion Repositories Applications.annuaire

Rev

Rev 120 | Rev 170 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 120 Rev 143
Line 43... Line 43...
43
	}
43
	}
Line 44... Line 44...
44
 
44
 
Line 45... Line 45...
45
	public function loggerUtilisateur($utilisateur, $pass) {
45
	public function loggerUtilisateur($utilisateur, $pass) {
46
		
46
		
47
		$this->objet_identification = Config::get('objet_identification');
47
		$this->objet_identification = Config::get('objet_identification');
48
 
48
		
49
		// Expiration si l'utilisateur ne referme pas son navigateur
-
 
50
		$this->objet_identification->setExpire(0);
-
 
51
		// Création d'un cookie pour rendre permanente l'identification de Papyrus
-
 
Line 52... Line 49...
52
		$cookie_val = md5($pass).$utilisateur;
49
		// on cree le cookie
53
		setcookie(session_name().'-memo', $cookie_val, 0, '/');
50
		$this->creerCookie($utilisateur, $pass);
54
		
51
		
55
		// On loggue l'utilisateur
52
		// On loggue l'utilisateur
Line 66... Line 63...
66
		$this->objet_identification->logout();
63
		$this->objet_identification->logout();
Line 67... Line 64...
67
		
64
		
68
		return true;
65
		return true;
Line 69... Line 66...
69
	}
66
	}
-
 
67
	
-
 
68
	public function setUtilisateur($nom_utilisateur) {
-
 
69
		$this->objet_identification = Config::get('objet_identification');
-
 
70
		$this->objet_identification->setAuth($nom_utilisateur);
-
 
71
		$pass = $this->objet_identification->password;
-
 
72
		$this->creerCookie($nom_utilisateur, $pass, true);
-
 
73
	}
-
 
74
	
-
 
75
	public function creerCookie($utilisateur, $pass, $pass_deja_crypte = false) {
Line -... Line 76...
-
 
76
		
-
 
77
		$this->objet_identification = Config::get('objet_identification');
-
 
78
		
-
 
79
		// Expiration si l'utilisateur ne referme pas son navigateur
-
 
80
		$this->objet_identification->setExpire(0);
-
 
81
		// Création d'un cookie pour rendre permanente l'identification de Papyrus
-
 
82
		if(!$pass_deja_crypte) {
-
 
83
			$pass_crypt = md5($pass); 
-
 
84
		} else {
-
 
85
			$pass_crypt = $pass;
70
	
86
		}
71
	public function creerCookieOpenId($utilisateur) {
87
		$cookie_val = $pass_crypt.$utilisateur;
72
		
88
		setcookie(session_name().'-memo', $cookie_val, 0, '/');