Subversion Repositories eFlore/Applications.cel

Rev

Rev 1724 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1724 Rev 1727
Line 42... Line 42...
42
			$this->envoyerJson($stats);
42
			$this->envoyerJson($stats);
43
		}
43
		}
44
	}
44
	}
Line 45... Line 45...
45
	
45
	
46
	private function analyserParametresUrl() {
46
	private function analyserParametresUrl() {
47
		$this->parametres['utilisateur'] = isset($_GET['utilisateur']) ? $this->bdd->quote($this->verifierSecuriteParametreUrl($_GET['utilisateur'])) : null;
47
		$this->parametres['utilisateur'] = isset($_GET['utilisateur']) ? Cel::db()->quote($this->verifierSecuriteParametreUrl($_GET['utilisateur'])) : null;
48
		$this->parametres['num_taxon'] = isset($_GET['num_taxon']) ? $this->bdd->quote($this->verifierSecuriteParametreUrl($_GET['num_taxon'])) : null;
48
		$this->parametres['num_taxon'] = isset($_GET['num_taxon']) ? Cel::db()->quote($this->verifierSecuriteParametreUrl($_GET['num_taxon'])) : null;
49
		$this->parametres['taxon'] = isset($_GET['taxon']) ? $this->bdd->quote($this->verifierSecuriteParametreUrl($_GET['taxon'].'%')) : null;
49
		$this->parametres['taxon'] = isset($_GET['taxon']) ? Cel::db()->quote($this->verifierSecuriteParametreUrl($_GET['taxon'].'%')) : null;
50
		$this->parametres['tag'] = isset($_GET['tag']) ? $this->verifierSecuriteParametreUrl($_GET['tag']) : null;
50
		$this->parametres['tag'] = isset($_GET['tag']) ? $this->verifierSecuriteParametreUrl($_GET['tag']) : null;
51
		$this->parametres['start'] = isset($_GET['start']) ? $this->verifierSecuriteParametreUrl($_GET['start']) : null;
51
		$this->parametres['start'] = isset($_GET['start']) ? $this->verifierSecuriteParametreUrl($_GET['start']) : null;
52
		$this->parametres['limit'] = isset($_GET['limit']) ? $this->verifierSecuriteParametreUrl($_GET['limit']) : null;
52
		$this->parametres['limit'] = isset($_GET['limit']) ? $this->verifierSecuriteParametreUrl($_GET['limit']) : null;
Line 120... Line 120...
120
	
120
	
121
	private function construireWhereTags() {
121
	private function construireWhereTags() {
122
		$where = null;
122
		$where = null;
123
		if (isset($this->parametres['tag'])) {
123
		if (isset($this->parametres['tag'])) {
124
			$tag = $this->parametres['tag'];
124
			$tag = $this->parametres['tag'];
Line 125... Line 125...
125
			$tag_encode = $this->bdd->quote($this->encoderMotCle(trim($tag)));
125
			$tag_encode = Cel::db()->quote($this->encoderMotCle(trim($tag)));
126
 
126
 
127
			// Construction de la requête
127
			// Construction de la requête
128
			$requete = 	'SELECT cmc_id_mot_cle_utilisateur, cmc_id_proprietaire '.
128
			$requete = 	'SELECT cmc_id_mot_cle_utilisateur, cmc_id_proprietaire '.
Line 133... Line 133...
133
			if ($elements != false && count($elements) > 0) {
133
			if ($elements != false && count($elements) > 0) {
134
				// Pré-construction du where de la requête
134
				// Pré-construction du where de la requête
135
				$tpl_where = '(ci_meta_mots_cles LIKE "%%%s%%" AND ci_ce_utilisateur = %s )';
135
				$tpl_where = '(ci_meta_mots_cles LIKE "%%%s%%" AND ci_ce_utilisateur = %s )';
136
				$requete_where = array();
136
				$requete_where = array();
137
				foreach ($elements as $occurence) {
137
				foreach ($elements as $occurence) {
138
					$requete_where[] = sprintf($tpl_where, $occurence['cmc_id_mot_cle_utilisateur'], $this->bdd->quote($occurence['cmc_id_proprietaire']));
138
					$requete_where[] = sprintf($tpl_where, $occurence['cmc_id_mot_cle_utilisateur'], Cel::db()->quote($occurence['cmc_id_proprietaire']));
139
				}
139
				}
140
				$where = ' ('.implode(" \nOR ", $requete_where).') ';
140
				$where = ' ('.implode(" \nOR ", $requete_where).') ';
141
			} else {
141
			} else {
142
				$this->debug[] = "Aucune image ne correspond à ce mot clé.";
142
				$this->debug[] = "Aucune image ne correspond à ce mot clé.";
143
			}
143
			}