Esempio n. 1
0
 function enregistrer()
 {
     //Declaration des variables :
     global $adresserepertoiresite;
     global $adressehttpsite;
     //chargement des regles pour la creation de compte :
     require_once $adresserepertoiresite . '/scripts/php/class.regle.php';
     $activation_par_mail = new regle(0, "Activation_par_mail");
     $testcreation = false;
     if (!isset($this->identifiant)) {
         $testcreation = true;
     }
     $id = objet::enregistrer();
     if ($this->message == "" && $testcreation) {
         $this->message = _LA_CREATION_DU_COMPTE_C_EST_BIEN_DEROULEE;
         if ($activation_par_mail->valeur == 1) {
             $destinataire = $this->email;
             $sujet = _SUJET_MAIL_CREATION_COMPTE;
             $from = "From: QCM@{$SERVER_NAME}\n";
             $from .= "X-Mailer: PHP/" . phpversion();
             $from .= "MIME-version: 1.0\n";
             $from .= "Content-type: text/html; charset= utf-8\n";
             $message = _MESSAGE_MAIL_CREATION_COMPTE;
             $message .= " <a href=\"" . $adressehttpsite . "compte.php?I=" . $id . "&act=" . MD5($this->datecreation) . "\">" . _LIEN_ACTIVATION_COMPTE_UTILISATEUR . "</a>";
             mail($destinataire, $sujet, $message, $from);
             $this->message .= _UN_MAIL_DE_CONFIRMATION_VOUS_A_ETE_ENVOYE;
             $this->message .= _L_ACTIVATION_S_EFFECTUE_GRACE_AU_MAIL_DE_CONFIRMATION;
         } else {
             $sql_activation = "UPDATE {$this->table} SET activation='1',  datederniereconnection='" . time() . "' WHERE " . $this->champ_identifiant . "='" . $id . "';";
             $sql_resultat = requete_sql($sql_activation);
         }
     }
     if ($this->message == "" && !$testcreation) {
         $this->message = _LA_MODIFICATION_DU_COMPTE_C_EST_BIEN_DEROULEE;
     }
 }
Esempio n. 2
0
 function enregistrer()
 {
     //Recalcul du niveau :
     if ($this->idtheme_rel <= 0) {
         $this->niveau = 1;
     } else {
         $vtemp = new theme($this->idtheme_rel);
         $niveaupere = $vtemp->niveau;
         $this->niveau = $niveaupere + 1;
     }
     // Heritage:
     parent::enregistrer();
 }