278,24 → 278,26 |
return $identifie; |
} |
|
protected function creerCookiePersistant($id = null, $mdp = null) { |
protected function creerCookiePersistant($duree = null, $id = null, $mdp = null) { |
$id = is_null($id) ? $_SERVER['PHP_AUTH_USER'] : $id; |
$mdp = is_null($mdp) ? $_SERVER['PHP_AUTH_PW'] : $mdp; |
$duree = (int) is_null($duree) ? time()+3600*24*30 : $duree; |
|
$nomCookie = $this->config['database_ident']['nom_cookie_persistant']; |
$valeurCookie = md5($mdp).$id; |
$dureeCookie = (int) time()+3600*24*30;// 1 mois à partir de l'appel |
setcookie($nomCookie, $valeurCookie, $dureeCookie, '/'); |
|
setcookie($nomCookie, $valeurCookie, $duree, '/'); |
} |
|
protected function verifierIdentification() { |
$identifie = false; |
$nomCookie = $this->config['database_ident']['nom_cookie_persistant']; |
if (isset($_COOKIE[$nomCookie])) { |
$identifie = true; |
protected function creerCookieUtilisateur($duree = null, $id = null) { |
$id = is_null($id) ? $_SERVER['PHP_AUTH_USER'] : $id; |
$duree = (int) is_null($duree) ? 0 : $duree; |
|
$nomCookie = $this->config['database_ident']['nom_cookie_utilisateur']; |
$valeurCookie = $id; |
|
setcookie($nomCookie, $valeurCookie, $duree, '/'); |
} |
return $identifie; |
} |
|
protected function estAutoriseMessagerie($adresse) { |
$utilisateurs_messagerie = explode(',', $this->config['messagerie']['utilisateurs_autorises']); |