Esempio n. 1
0
require_once INC_GSESSION;
require_once PATH_METIER . 'mJoueur.php';
$login = GContexte::LireVariablePost($nomContexte, 'login');
$motDePasse = GContexte::LireVariablePost($nomContexte, 'motDePasse');
$mJoueur = new MJoueur(NULL, $login, $motDePasse);
$formulaireValide = true;
// On vérifie qu'un compte existe pour cette adresse email.
$mJoueur->ChargerFromLoginEtMotDePasse();
if ($mJoueur->Id() === NULL || $mJoueur->Supprime() === true) {
    GLog::LeverException(EXF_0020, GSession::Libelle(LIB_CON_COMPTENONEXISTANT), true, false);
    $formulaireValide = false;
} else {
    if ($mJoueur->Banni() === true) {
        GLog::LeverException(EXF_0021, GSession::Libelle(LIB_CON_COMPTEBANNI), true, false);
        $formulaireValide = false;
    }
}
if ($formulaireValide === true) {
    GSession::Joueur(COL_ID, $mJoueur->Id());
    GSession::Joueur(COL_PSEUDO, $mJoueur->Pseudo());
    GSession::Joueur(COL_SUPERADMIN, $mJoueur->SuperAdmin());
    // On vérifie si le compte a été activé ou non.
    if ($mJoueur->Actif() === false) {
        GContexte::SetContexte(CONT_ACTIVATION);
    } else {
        GContexte::SetContexte(CONT_ADMINISTRATION, false);
    }
} else {
    GContexte::SupprimerContexte(CONT_CONNEXION);
}
$pasDeRechargement = true;
Esempio n. 2
0
    $formulaireValide = false;
}
if ($mJoueur->Pseudo() == NULL) {
    GLog::LeverException(EXF_0003, GSession::Libelle(LIB_CON_PSEUDOERREUR), true);
    $formulaireValide = false;
}
if ($formulaireValide === true) {
    // Si un joueur existait et était supprimé on le met à jour, sinon on crée un nouveau joueur.
    if ($mJoueurExistant->Id() != NULL) {
        $mJoueurExistant->Modifier();
        unset($mJoueur);
        $mJoueur = $mJoueurExistant;
    } else {
        $mJoueur->Ajouter();
    }
}
// Si le joueur a bien été créé, on lui envoie un mail avec son pseudo, son mot de passe et son code d'activation.
if ($mJoueur->Id() !== NULL) {
    $headers = 'From: "Admin"<*****@*****.**>' . "\n";
    $headers .= 'Content-Type: text/plain; charset="utf8"' . "\n";
    $headers .= 'Content-Transfer-Encoding: 8bit';
    ini_set('SMTP', SMTP);
    $message = GSession::Libelle(LIBTEXT_CON_MAILMESSAGE, false, true) . "\r\n\r\n" . GSession::Libelle(LIB_CON_PSEUDO, false, true) . ' ' . $mJoueur->Pseudo() . "\r\n" . GSession::Libelle(LIB_CON_MOTDEPASSE, false, true) . ' ' . $mJoueur->MotDePasse() . "\r\n" . GSession::Libelle(LIB_CON_CODEACTIVATION, false, true) . ' ' . $mJoueur->CodeActivation();
    mail($mJoueur->Login(), GSession::Libelle(LIB_CON_MAILTITRE, false, true), $message, $headers);
    GSession::Joueur(COL_ID, $mJoueur->Id());
    GSession::Joueur(COL_PSEUDO, $mJoueur->Pseudo());
    GContexte::SetContexte(CONT_ACTIVATION);
} else {
    GLog::LeverException(EXF_0004, GSession::Libelle(LIB_CON_CREATCOMPTEERREUR), true, $formulaireValide);
}
$pasDeRechargement = true;
require_once 'cst.php';
require_once INC_GSESSION;
$groupe = GSession::Groupe(COL_ID);
if ($groupe !== NULL && GDroit::ADroitPopErreur(FONC_PRS_CREERMODIFIER) === true) {
    $nouvPres = GSession::LirePost('nouvPres');
    // Cas de la création d'une présentation.
    if ($nouvPres != NULL && $nouvPres !== '') {
        require_once PATH_METIER . 'mListePresentations.php';
        require_once PATH_METIER . 'mVersion.php';
        require_once PATH_METIER . 'mJoueur.php';
        require_once PATH_METIER . 'mGroupe.php';
        $formulaire = true;
        $mPresentation = new MPresentation();
        $mPresentation->Nom(GContexte::LirePost(COL_NOM));
        $mPresentation->CreateurJoueur(GSession::Joueur(COL_ID));
        $mPresentation->CreateurGroupe($groupe);
        if ($mPresentation->Nom() === NULL) {
            GLog::LeverException(EXF_0040, GSession::Libelle(LIB_PRS_NOMINVALIDE), true, false);
            $formulaire = false;
        }
        $retour = true;
        if ($formulaire === true) {
            $mPresentation->AjouterJointure(COL_VERSION, COL_ID, 0, NULL, SQL_RIGHT_JOIN);
            $mPresentation->AjouterColInsertionMaxExt(1, COL_VERSION, COL_ID);
            $retour = $mPresentation->Ajouter();
        }
        if ($formulaire === false || $retour === false) {
            GLog::LeverException(EXF_0041, GSession::Libelle(LIB_PRS_PRESNONCREEE), true, false);
        } else {
            GSession::PresentationModif($mPresentation->Id());
Esempio n. 4
0
    $creerJoueurForm->AjouterInputText(1, 1, GSession::Libelle(LIB_CON_EMAIL), '', true, GContexte::FormaterVariable(CONT_CONNEXION, 'login'), '', 1, 70, 70, false, '', GSession::Libelle(LIB_CON_EMAILINFO), GSession::Libelle(LIB_CON_EMAILERREUR), INPUTTEXT_REGEXP_EMAIL_FV);
    $creerJoueurForm->AjouterInputText(2, 1, GSession::Libelle(LIB_CON_MOTDEPASSE), INPUTTEXT_TYPE_PASSWORD, true, GContexte::FormaterVariable(CONT_CONNEXION, 'motDePasse'), '', 5, 20, 20, false, '', GSession::Libelle(LIB_CON_MOTDEPASSEINFO), GSession::Libelle(LIB_CON_MOTDEPASSEERREUR));
    $creerJoueurForm->AjouterInputText(3, 1, GSession::Libelle(LIB_CON_PSEUDO), '', true, GContexte::FormaterVariable(CONT_CONNEXION, 'pseudo'), '', 1, 30, 30, false, '', GSession::Libelle(LIB_CON_PSEUDOINFO), GSession::Libelle(LIB_CON_PSEUDOERREUR));
    $label = $creerJoueurForm->AjouterInputLabel(6, 1, GSession::Libelle(LIB_CON_DATENAISSANCE));
    $label->AjouterInputText(GSession::Libelle(LIB_CON_ANNEE), '', false, GContexte::FormaterVariable(CONT_CONNEXION, 'annee'), '', 1, 4, 4, false, '', '', '', INPUTTEXT_REGEXP_DECIMAL_FV, 1900, intval(date('Y')));
    $label->AjouterInputText(GSession::Libelle(LIB_CON_MOIS), '', false, GContexte::FormaterVariable(CONT_CONNEXION, 'mois'), '', 1, 2, 2, false, '', '', '', INPUTTEXT_REGEXP_DECIMAL_FV, 1, 12);
    $label->AjouterInputText(GSession::Libelle(LIB_CON_JOUR), '', false, GContexte::FormaterVariable(CONT_CONNEXION, 'jour'), '', 1, 2, 2, false, '', '', '', INPUTTEXT_REGEXP_DECIMAL_FV, 1, 31);
    $creerJoueurForm->SetCadreBoutons(2, 1, 1, 2);
    $creerJoueurForm->AjouterInputButtonValiderAjaxContexte(1, 1, CONT_CONNEXION, 'CreerJoueur');
    $creerJoueurForm->AjouterInputButtonAnnuler(1, 2);
    $connexionForm = new SForm('connexion', 1, 2);
    $connexionForm->SetCadreInputs(1, 1, 1, 2);
    $select = $connexionForm->AjouterInputNewText(1, 1, GSession::Libelle(LIB_CON_EMAIL), true, GContexte::FormaterVariable(CONT_CONNEXION, 'login'), '', 1, 70, 20, false, '', '', '', INPUTTEXT_REGEXP_EMAIL_FV);
    $select->AjouterFormulaire(GSession::Libelle(LIB_CON_CREERCOMPTE), $creerJoueurForm);
    $connexionForm->AjouterInputText(1, 2, GSession::Libelle(LIB_CON_MOTDEPASSE), INPUTTEXT_TYPE_PASSWORD, true, GContexte::FormaterVariable(CONT_CONNEXION, 'motDePasse'), '', 5, 20, 10, false, '', '', '');
    $connexionForm->SetCadreBoutons(1, 2, 1, 1);
    $bouton = $connexionForm->AjouterInputButton(1, 1, '', GSession::Libelle(LIB_CON_CONNEXION), GSession::Libelle(LIB_CON_CONNEXION), true, AJAXFONC_CHARGERCONTEXTES, true, true);
    $bouton->AjouterParamRetour('contextes[0]', CONT_CONNEXION);
    GContexte::AjouterContenu(CADRE_INFO_JOUEUR, $connexionForm);
} else {
    if (GDroit::EstConnecte(false) === true && (GSession::Connecte() === false || $dejaCharge === false)) {
        GSession::Connecte(true);
        $connecteForm = new SForm('connecte', 1, 2);
        $connecteForm->SetCadreInputs(1, 1, 1, 1);
        $connecteForm->AjouterInputInfo(1, 1, GSession::Libelle(LIB_CON_PSEUDO), GSession::Joueur(COL_PSEUDO), true);
        $connecteForm->SetCadreBoutons(1, 2, 1, 1);
        $bouton = $connecteForm->AjouterInputButton(1, 1, '', GSession::Libelle(LIB_CON_DECONNEXION), GSession::Libelle(LIB_CON_DECONNEXION), true, AJAXFONC_CHARGERCONTEXTES, true, true);
        $bouton->AjouterParamRetour('contextes[0]', CONT_DECONNEXION);
        GContexte::AjouterContenu(CADRE_INFO_JOUEUR, $connecteForm);
    }
}
Esempio n. 5
0
<?php

require_once 'cst.php';
require_once INC_GSESSION;
require_once INC_SBALISE;
GSession::Joueur(NULL, NULL, true);
GContexte::ResetContextes();
$bal = new SBalise(BAL_DIV);
$bal->SetText('contenu<br/><br/><br/><br/>');
GContexte::AjouterContenu(CADRE_CONTENU_CONTENU, $bal);
Esempio n. 6
0
<?php

require_once 'cst.php';
require_once INC_GSESSION;
require_once INC_SFORM;
require_once PATH_METIER . 'mJoueur.php';
$codeActivation = GContexte::LireVariablePost($nomContexte, 'codeActivation');
$mJoueur = new MJoueur(GSession::Joueur(COL_ID));
$mJoueur->AjouterColSelection(COL_CODEACTIVATION);
$compteActive = false;
if ($mJoueur->Charger() !== false) {
    if ($mJoueur->CodeActivation() !== $codeActivation) {
        GLog::LeverException(EXF_0030, GSession::Libelle(LIB_ACT_CODEACTIVATIONFAUX), true, false);
    } else {
        $mJoueur->Actif(true);
        $compteActive = $mJoueur->Modifier();
    }
}
if ($compteActive === false) {
    GLog::LeverException(EXF_0031, GSession::Libelle(LIB_ACT_ACTIVCOMPTEERREUR), true, false);
} else {
    GContexte::SetContexte(CONT_AIDE, true);
}
$pasDeRechargement = true;