Subversion Repositories Applications.annuaire

Rev

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

Rev 394 Rev 396
Line 276... Line 276...
276
			$identifie = true;
276
			$identifie = true;
277
		}
277
		}
278
		return $identifie;
278
		return $identifie;
279
	}
279
	}
Line 280... Line 280...
280
 
280
 
281
	protected function creerCookiePersistant($id = null, $mdp = null) {
281
	protected function creerCookiePersistant($duree = null, $id = null, $mdp = null) {
282
		$id = is_null($id) ? $_SERVER['PHP_AUTH_USER'] : $id;
282
		$id = is_null($id) ? $_SERVER['PHP_AUTH_USER'] : $id;
-
 
283
		$mdp = is_null($mdp) ? $_SERVER['PHP_AUTH_PW'] : $mdp;
Line 283... Line 284...
283
		$mdp = is_null($mdp) ? $_SERVER['PHP_AUTH_PW'] : $mdp;
284
		$duree = (int) is_null($duree) ? time()+3600*24*30 : $duree;
284
 
285
 
285
		$nomCookie = $this->config['database_ident']['nom_cookie_persistant'];
-
 
-
 
286
		$nomCookie = $this->config['database_ident']['nom_cookie_persistant'];
286
		$valeurCookie = md5($mdp).$id;
287
		$valeurCookie = md5($mdp).$id;
287
		$dureeCookie = (int) time()+3600*24*30;// 1 mois à partir de l'appel
288
 
Line 288... Line 289...
288
		setcookie($nomCookie, $valeurCookie, $dureeCookie, '/');
289
		setcookie($nomCookie, $valeurCookie, $duree, '/');
-
 
290
	}
289
	}
291
 
-
 
292
	protected function creerCookieUtilisateur($duree = null, $id = null) {
290
 
293
		$id = is_null($id) ? $_SERVER['PHP_AUTH_USER'] : $id;
291
	protected function verifierIdentification() {
-
 
292
		$identifie = false;
294
		$duree = (int) is_null($duree) ? 0 : $duree;
293
		$nomCookie = $this->config['database_ident']['nom_cookie_persistant'];
295
 
294
		if (isset($_COOKIE[$nomCookie])) {
296
		$nomCookie = $this->config['database_ident']['nom_cookie_utilisateur'];
295
			$identifie = true;
297
		$valeurCookie = $id;
Line 296... Line 298...
296
		}
298
 
297
		return $identifie;
299
		setcookie($nomCookie, $valeurCookie, $duree, '/');
298
	}
300
	}