Subversion Repositories Sites.obs-saisons.fr

Rev

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

Rev 281 Rev 282
Line 3... Line 3...
3
// GESTION DE L'IDENTIFICATION
3
// GESTION DE L'IDENTIFICATION
4
Class ControleUtilisateur extends JRestService {
4
Class ControleUtilisateur extends JRestService {
Line 5... Line 5...
5
	
5
	
6
	private function envoyerAuth($message_accueil, $message_echec) {
6
	private function envoyerAuth($message_accueil, $message_echec) {
7
		header('HTTP/1.0 401 Unauthorized');
7
		header('HTTP/1.0 401 Unauthorized');
8
		header('WWW-Authenticate: Basic realm="UTF-8"');
8
		header('WWW-Authenticate: Basic realm="www.obs-saisons.fr"');
9
		header('Content-type: text/plain; charset=UTF-8');
9
		header('Content-type: text/plain; charset=UTF-8');
10
		print $message_echec;
10
		print $message_echec;
11
		exit(0);
11
		exit(0);
Line 60... Line 60...
60
	
60
	
61
	public function etreAdminAutorise() {
61
	public function etreAdminAutorise() {
62
		$identifiant = $this->getAuthIdentifiant();
62
		$identifiant = $this->getAuthIdentifiant();
Line 63... Line 63...
63
		$mdp = md5($this->getAuthMotDePasse());
63
		$mdp = md5($this->getAuthMotDePasse());
64
		
64
		
65
		$requete = 'SELECT COUNT(*) as existe FROM ods_redesign.drupal_users du '.
65
		$requete = 'SELECT COUNT(*) as existe FROM drupal_users du '.
66
		           'INNER JOIN ods_redesign.drupal_users_roles dur '.
66
		           'INNER JOIN drupal_users_roles dur '.
67
		           'ON du.uid = dur.uid '.
67
		           'ON du.uid = dur.uid '.
68
		           'WHERE name = '.$this->proteger($identifiant).' '.
68
		           'WHERE name = '.$this->proteger($identifiant).' '.
69
		           	'AND pass = '.$this->proteger($mdp).' '.
69
		           	'AND pass = '.$this->proteger($mdp).' '.