Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 520 Rev 536
Line 45... Line 45...
45
		$this->analyserCookies();
45
		$this->analyserCookies();
46
		return $this->identifie;
46
		return $this->identifie;
47
	}
47
	}
Line 48... Line 48...
48
 
48
 
49
	public function connecter($courriel, $mdp, $persistance = false) {
49
	public function connecter($courriel, $mdp, $persistance = false) {
50
		$url = sprintf($this->urlWsAnnuaire, 'Utilisateur');
50
		$url = sprintf($this->urlWsAnnuaire, 'utilisateur');
51
		$donnees['methode'] = 'connexion';
51
		$donnees['methode'] = 'connexion';
52
		$donnees['courriel'] = $courriel;
52
		$donnees['courriel'] = $courriel;
53
		$donnees['mdp'] = $mdp;
53
		$donnees['mdp'] = $mdp;
Line 54... Line 54...
54
		$donnees['persistance'] = $persistance;
54
		$donnees['persistance'] = $persistance;
55
 
55
 
56
		$json = $this->restClient->ajouter($url, $donnees);
56
		$json = $this->restClient->ajouter($url, $donnees);
57
		$forceTableauAssociatif = true;
-
 
58
		$resultat = json_decode($json, $forceTableauAssociatif);
57
		$forceTableauAssociatif = true;
59
		Debug::printr($resultat);
58
		$resultat = json_decode($json, $forceTableauAssociatif);
Line 60... Line 59...
60
		return $resultat['identifie'];
59
		return $resultat['identifie'];
61
	}
60
	}
Line 67... Line 66...
67
 
66
 
68
	private function analyserCookiesIdentite() {
67
	private function analyserCookiesIdentite() {
69
		if ($this->identifie == false) {
68
		if ($this->identifie == false) {
70
			if (isset($_COOKIE[$this->nomCookieUtilisateurPersistant])) {
69
			if (isset($_COOKIE[$this->nomCookieUtilisateurPersistant])) {
71
				$idTela = $_COOKIE[$this->nomCookieUtilisateurPersistant];
-
 
72
				$this->md5Mdp = substr($idTela, 0, 32);
70
				$idTela = $_COOKIE[$this->nomCookieUtilisateurPersistant];
73
				$this->courriel = substr($idTela, 32);
-
 
74
				$this->identifie = true;
71
				$this->extraireMdpEtCourriel($idTela);
75
			} else if (isset($_COOKIE[$this->nomCookieUtilisateur])) {
72
			} else if (isset($_COOKIE[$this->nomCookieUtilisateur])) {
76
				$this->courriel = $_COOKIE[$this->nomCookieUtilisateur];
73
				$idTela = $_COOKIE[$this->nomCookieUtilisateur];
77
				$this->identifie = true;
74
				$this->extraireMdpEtCourriel($idTela);
78
			}
75
			}
79
		}
76
		}
Line -... Line 77...
-
 
77
	}
-
 
78
 
-
 
79
	private function extraireMdpEtCourriel($idTela) {
-
 
80
		$this->md5Mdp = substr($idTela, 0, 32);
-
 
81
		$this->courriel = substr($idTela, 32);
-
 
82
		$this->identifie = true;
80
	}
83
	}
81
 
84
 
82
	private function analyserCookiesNiveau() {
85
	private function analyserCookiesNiveau() {
83
		$this->niveau = $this->niveauDefaut;
86
		$this->niveau = $this->niveauDefaut;
84
		if (isset($_COOKIE[$this->nomCookieNiveau])) {
87
		if (isset($_COOKIE[$this->nomCookieNiveau])) {