Subversion Repositories Applications.annuaire

Rev

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

Rev 395 Rev 401
Line 52... Line 52...
52
 
52
 
53
	public function setUtilisateur($nom_utilisateur) {
53
	public function setUtilisateur($nom_utilisateur) {
54
		$this->objet_identification = Config::get('objet_identification');
54
		$this->objet_identification = Config::get('objet_identification');
55
		$this->objet_identification->setAuth($nom_utilisateur);
55
		$this->objet_identification->setAuth($nom_utilisateur);
-
 
56
		$pass = $this->objet_identification->password;
56
		$pass = $this->objet_identification->password;
57
 
57
		$this->creerCookie($nom_utilisateur, $pass, true);
58
		$this->creerCookie($nom_utilisateur, $pass, true);
Line 58... Line 59...
58
	}
59
	}
59
 
60
 
Line 63... Line 64...
63
		// Expiration si l'utilisateur ne referme pas son navigateur
64
		// Expiration si l'utilisateur ne referme pas son navigateur
64
		$this->objet_identification->setExpire(0);
65
		$this->objet_identification->setExpire(0);
65
		$this->objet_identification->setIdle(0);
66
		$this->objet_identification->setIdle(0);
Line 66... Line 67...
66
 
67
 
67
		// Création d'un cookie pour rendre permanente l'identification de Papyrus
-
 
68
		if (!$pass_deja_crypte) {
68
		// Création d'un cookie pour rendre permanente l'identification de Papyrus
69
			$pass_crypt = md5($pass);
-
 
70
		} else {
-
 
71
			$pass_crypt = $pass;
-
 
72
		}
69
		$pass_crypt = (!$pass_deja_crypte) ? md5($pass) : $pass;
73
		$cookie_val = $pass_crypt.$utilisateur;
70
		$cookie_val = $pass_crypt.$utilisateur;
74
		setcookie(session_name().'-memo', $cookie_val, 0, '/');
71
		setcookie(session_name().'-memo', $cookie_val, 0, '/');
Line 75... Line 72...
75
	}
72
	}