Example #1
0
 /**
  * Ajoute un email dans la base
  *
  * @param  int      $id         Identifiant du forum
  * @param  string   $champs     Champs à renvoyer
  * @access public
  * @return array
  */
 function AjouterEmail($email, $blacklist = false)
 {
     $blacklist_sql = $blacklist ? '1' : '0';
     $email = $this->_bdd->echapper($email);
     $requete = "REPLACE INTO afup_email (`email` ,`blacklist`) ";
     $requete .= "VALUES ({$email}, {$blacklist_sql});";
     return $this->_bdd->executer($requete);
 }
Example #2
0
 function ajouter($id_forum, $texte)
 {
     $requete = 'INSERT INTO ';
     $requete .= '  afup_forum_coupon (id, id_forum, texte) ';
     $requete .= 'VALUES (null,';
     $requete .= (int) $id_forum . ',';
     $requete .= $this->_bdd->echapper(strtoupper($texte)) . ')';
     return $this->_bdd->executer($requete);
 }
 public function getUserByEmail($email)
 {
     $requete = ' SELECT * ';
     $requete .= ' FROM afup_personnes_physiques ';
     $requete .= ' WHERE email = ' . $this->_bdd->echapper($email);
     return $this->_bdd->obtenirEnregistrement($requete);
 }
Example #4
0
 function estDejaReglee($cmd)
 {
     $requete = 'SELECT';
     $requete .= '  1 ';
     $requete .= 'FROM';
     $requete .= '  afup_cotisations ';
     $requete .= 'WHERE';
     $requete .= '  informations_reglement=' . $this->_bdd->echapper($cmd);
     return $this->_bdd->obtenirUn($requete);
 }
Example #5
0
 function ajouterRappel($email, $id_forum = null)
 {
     if ($id_forum == null) {
         require_once dirname(__FILE__) . '/AFUP_Forum.php';
         $forum = new AFUP_Forum($this->_bdd);
         $id_forum = $forum->obtenirDernier();
     }
     $requete = 'INSERT INTO afup_inscriptions_rappels (email, date, id_forum) VALUES (' . $this->_bdd->echapper($email) . ', ' . time() . ', ' . $id_forum . ')';
     return $this->_bdd->executer($requete);
 }
Example #6
0
 /**
  * Changement de la date de réglement d'une facture
  * @param integer $reference
  * @param integer $date_reglement
  */
 public function changerDateReglement($reference, $date_reglement)
 {
     $requete = 'UPDATE ';
     $requete .= '  afup_facturation_forum ';
     $requete .= 'SET ';
     $requete .= '  date_reglement = ' . intval($date_reglement) . ' ';
     $requete .= 'WHERE';
     $requete .= '  reference=' . $this->_bdd->echapper($reference);
     return $this->_bdd->executer($requete);
 }
Example #7
0
 function modifier($id, $id_forum, $id_niveau_partenariat, $ranking, $nom, $presentation, $site, $logo)
 {
     $requete = 'UPDATE ';
     $requete .= '  afup_forum_partenaires ';
     $requete .= 'SET';
     $requete .= '  id_forum=' . (int) $id_forum . ',';
     $requete .= '  id_niveau_partenariat=' . (int) $id_niveau_partenariat . ',';
     $requete .= '  ranking=' . (int) $ranking . ',';
     $requete .= '  nom=' . $this->_bdd->echapper($nom) . ',';
     $requete .= '  presentation=' . $this->_bdd->echapper($presentation) . ',';
     $requete .= '  site=' . $this->_bdd->echapper($site) . ',';
     $requete .= '  logo=' . $this->_bdd->echapper($logo) . ' ';
     $requete .= 'WHERE';
     $requete .= '  id=' . $id;
     return $this->_bdd->executer($requete);
 }
Example #8
0
 function enregistrer($source, $id_source, $tag, $id_personne_physique, $date, $id)
 {
     if ($id > 0) {
         $requete = ' UPDATE afup_tags ';
     } else {
         $requete = ' INSERT INTO afup_tags ';
     }
     $requete .= ' SET ';
     $requete .= ' source = ' . $this->_bdd->echapper($source) . ',';
     $requete .= ' id_source = ' . $this->_bdd->echapper($id_source) . ',';
     $requete .= ' tag = ' . $this->_bdd->echapper($tag, true) . ',';
     $requete .= ' id_personne_physique = ' . $this->_bdd->echapper($id_personne_physique) . ',';
     $requete .= ' date = ' . $this->_bdd->echapper($date);
     if ($id > 0) {
         $requete .= ' WHERE id = ' . $id;
     }
     return $this->_bdd->executer($requete);
 }
Example #9
0
 /**
  * Essaie de connecter l'utilisateur
  *
  * @param string $login Login de l'utilisateur
  * @param string $mot_de_passe Mot de passe de l'utilisateur
  * @param string $encoder Faut-il encoder le mot de passe ?
  *                                     Le mot de passe est déjà encodé s'il vient du cookie mais il ne l'est pas
  *                                     si il vient de l'écran de connexion.
  * @access public
  * @return bool Succès de la connection
  */
 public function seConnecter($login, $mot_de_passe, $encoder = true)
 {
     if ($encoder) {
         $mot_de_passe = md5($mot_de_passe);
     }
     $requete = '
         SELECT
             id, niveau, niveau_modules, nom, prenom, email,
             CONCAT(id, \'_\', email, \'_\', login) as hash
         FROM
             afup_personnes_physiques
         WHERE
             (
               login=' . $this->_bdd->echapper($login) . '
               OR email=' . $this->_bdd->echapper($login) . '
             )
             AND mot_de_passe=' . $this->_bdd->echapper($mot_de_passe) . '
             AND etat=' . AFUP_DROITS_ETAT_ACTIF;
     $resultat = $this->_bdd->obtenirEnregistrement($requete);
     if ($resultat !== false) {
         $this->_identifiant = $resultat['id'];
         $this->_hash = md5($resultat['hash']);
         $this->_niveau = $resultat['niveau'];
         $this->_niveau_modules = $resultat['niveau_modules'];
         $this->_email = $resultat['email'];
         $this->_nom = $resultat['nom'];
         $this->_prenom = $resultat['prenom'];
     }
     $this->_est_connecte = $resultat !== false;
     $this->_echec_connexion = !$this->_est_connecte;
     if ($this->_est_connecte) {
         $_SESSION['afup_login'] = $login;
         $_SESSION['afup_mot_de_passe'] = $mot_de_passe;
         // Envoi la demande de connection aux listeners
         $event = $resultat;
         foreach ($this->_listeners as $el) {
             $el->seConnecter($event);
         }
     }
     return $this->_est_connecte;
 }
Example #10
0
 /**
  * Modifie une personne morale
  *
  * @param  int      $id                 Identifiant de la personne morale à modifier
  * @param  string   $raison_sociale     Raison sociale de la personne morale
  * @param  string   $adresse            Adresse de la personne morale
  * @param  string   $code_postal        Code postal de la personne morale
  * @param  string   $ville              Ville de la personne morale
  * @param  int      $id_pays            Identifiant du pays de la personne morale
  * @param  int      $etat               Etat de la personne morale
  * @access public
  * @return bool     Succès de l'ajout
  */
 function modifier($id, $civilite, $nom, $prenom, $email, $raison_sociale, $siret, $adresse, $code_postal, $ville, $id_pays, $telephone_fixe, $telephone_portable, $etat)
 {
     $requete = 'UPDATE ';
     $requete .= '  afup_personnes_morales ';
     $requete .= 'SET';
     $requete .= '  civilite=' . $civilite . ',';
     $requete .= '  nom=' . $this->_bdd->echapper($nom) . ',';
     $requete .= '  prenom=' . $this->_bdd->echapper($prenom) . ',';
     $requete .= '  email=' . $this->_bdd->echapper($email) . ',';
     $requete .= '  raison_sociale=' . $this->_bdd->echapper($raison_sociale) . ',';
     $requete .= '  siret=' . $this->_bdd->echapper($siret) . ',';
     $requete .= '  adresse=' . $this->_bdd->echapper($adresse) . ',';
     $requete .= '  code_postal=' . $this->_bdd->echapper($code_postal) . ',';
     $requete .= '  ville=' . $this->_bdd->echapper($ville) . ',';
     $requete .= '  id_pays=' . $this->_bdd->echapper($id_pays) . ',';
     $requete .= '  telephone_fixe=' . $this->_bdd->echapper($telephone_fixe) . ',';
     $requete .= '  telephone_portable=' . $this->_bdd->echapper($telephone_portable) . ',';
     $requete .= '  etat=' . $this->_bdd->echapper($etat) . ' ';
     $requete .= 'WHERE';
     $requete .= '  id=' . $id;
     return $this->_bdd->executer($requete);
 }
 function modifier($id, $titre_revue, $civilite, $nom, $prenom, $carte_presse, $adresse, $code_postal, $ville, $id_pays, $telephone, $email, $commentaires, $id_forum, $valide)
 {
     $requete = 'UPDATE ';
     $requete .= '  afup_accreditation_presse ';
     $requete .= 'SET';
     $requete .= '  titre_revue=' . $this->_bdd->echapper($titre_revue) . ',';
     $requete .= '  civilite=' . $this->_bdd->echapper($civilite) . ',';
     $requete .= '  nom=' . $this->_bdd->echapper($nom) . ',';
     $requete .= '  prenom=' . $this->_bdd->echapper($prenom) . ',';
     $requete .= '  carte_presse=' . $this->_bdd->echapper($carte_presse) . ',';
     $requete .= '  adresse=' . $this->_bdd->echapper($adresse) . ',';
     $requete .= '  code_postal=' . $this->_bdd->echapper($code_postal) . ',';
     $requete .= '  ville=' . $this->_bdd->echapper($ville) . ',';
     $requete .= '  id_pays=' . $this->_bdd->echapper($id_pays) . ',';
     $requete .= '  telephone=' . $this->_bdd->echapper($telephone) . ',';
     $requete .= '  email=' . $this->_bdd->echapper($email) . ',';
     $requete .= '  commentaires=' . $this->_bdd->echapper($commentaires) . ',';
     $requete .= '  id_forum=' . $this->_bdd->echapper($id_forum) . ',';
     $requete .= '  valide=' . $this->_bdd->echapper($valide) . ' ';
     $requete .= 'WHERE';
     $requete .= '  id=' . $id;
     return $this->_bdd->executer($requete);
 }
Example #12
0
 function nbVoteSession($id_session)
 {
     $requete = 'select count(*) from afup_sessions_vote
     where id_session=' . $this->_bdd->echapper($id_session);
     return (int) $this->_bdd->obtenirUn($requete);
 }
Example #13
0
 function supprimer($id_forum)
 {
     $id_forum = $this->_bdd->echapper($id_forum);
     $requete = 'DELETE FROM afup_forum WHERE id = ' . $id_forum;
     return $this->_bdd->executer($requete);
 }
Example #14
0
 /**
  * Renvoit le nom du pays à partir du code ISO
  * 
  * @param  string   $id         Identifiant ISO 2a du pays
  * @param  string   $champs     Champs à renvoyer
  * @return string
  */
 function obtenirNom($id)
 {
     $requete = 'SELECT nom FROM afup_pays WHERE id =' . $this->_bdd->echapper($id);
     return $this->_bdd->obtenirUn($requete);
 }