$tab_checkbox_sem_imp = getpost_variable('tab_checkbox_sem_imp');
    $tab_checkbox_sem_p = getpost_variable('tab_checkbox_sem_p');
    $tab_new_user[0]['new_jour'] = getpost_variable('new_jour');
    $tab_new_user[0]['new_mois'] = getpost_variable('new_mois');
    $tab_new_user[0]['new_year'] = getpost_variable('new_year');
}
$checkbox_user_groups = getpost_variable('checkbox_user_groups');
/* FIN de la recup des parametres    */
/*************************************/
if ($saisie_user == "ok") {
    if ($_SESSION['config']['export_users_from_ldap']) {
        foreach ($tab_login as $login) {
            ajout_user($tab_new_user[$login], $tab_checkbox_sem_imp, $tab_checkbox_sem_p, $tab_new_jours_an, $tab_new_solde, $checkbox_user_groups, $DEBUG);
        }
    } else {
        ajout_user($tab_new_user[0], $tab_checkbox_sem_imp, $tab_checkbox_sem_p, $tab_new_jours_an, $tab_new_solde, $checkbox_user_groups, $DEBUG);
    }
} else {
    affiche_formulaire_ajout_user($tab_new_user[0], $tab_new_jours_an, $tab_new_solde, $onglet, $DEBUG);
}
/*********************************************************************************/
/*  FONCTIONS   */
/*********************************************************************************/
function ajout_user(&$tab_new_user, $tab_checkbox_sem_imp, $tab_checkbox_sem_p, &$tab_new_jours_an, &$tab_new_solde, $checkbox_user_groups, $DEBUG = FALSE)
{
    $PHP_SELF = $_SERVER['PHP_SELF'];
    $session = session_id();
    if ($DEBUG) {
        echo "tab_new_jours_an = ";
        print_r($tab_new_jours_an);
        echo "<br>\n";
Beispiel #2
0
<?php

if ($access != 'VALID') {
    header('location:../../index.php');
}
//Contrôleur secondaire affichage admin
$retour = '';
include_once 'model/connexion/fonctions_connexion.php';
if (isset($_POST['login'])) {
    if ($_POST['mdp'] == $_POST['mdp2']) {
        $mdp = crypt($_POST['mdp'], SEL);
        if (ajout_user($_POST['login'], $mdp, $_POST['nom'], $_POST['pseudo'], $_POST['type'])) {
            $retour = 'Votre compte a été enregistré, vous allez recevoir un mail de confirmation';
            $html = '<html><body><p>Votre compte a bien été créé, veuillez cliquer sur le lien ci-dessous pour valider votre inscription : <br /><a href="ns366377.ovh.net/fumeron/UnionPadel/union-padelmvc/index.php?module=login&amp;action=confirm&amp;m=' . $_POST['login'] . '">Confirmer l\'inscription</a></p></body></html>';
            mail_confirm(EXPEDITEUR, MAIL, MAIL, $_POST['login'], "", "Confirmation d'inscription Union Padel", "", $html, "");
            if ($_POST['newsletter'] == 1) {
                ajout_newsletter($_POST['login']);
            }
        } else {
            $retour = 'Cette adresse email est déjà utilisée';
        }
    } else {
        $retour = 'Les mots de passe que vous avez entrés ne sont pas identiques';
    }
}
$title = 'Inscription';
include_once 'view/retour.php';
Beispiel #3
0
// Controleur secondaire - back-office/ajout_user
if (!isset($_SESSION["admin"])) {
    header('Location:?module=admin&action=login_admin');
} else {
    if (isset($_POST["nom"])) {
        $civ = $_POST["civilite"];
        $nom = $_POST["nom"];
        $prenom = $_POST["prenom"];
        $mail = $_POST["mail"];
        $mdp = md5($_POST["mdp"]);
        $adresse = $_POST["adresse"];
        $ville = $_POST["ville"];
        $cp = $_POST["cp"];
        $pays = $_POST["pays"];
        $tel = $_POST["tel"];
        $adresse_liv = $_POST["adresse_liv"];
        $ville_liv = $_POST["ville_liv"];
        $cp_liv = $_POST["cp_liv"];
        $pays_liv = $_POST["pays_liv"];
        $date = date("Y-m-d H:i:s");
        include_once "modele/utilisateurs/ajout_user.php";
        if (ajout_user($civ, $nom, $prenom, $mail, $mdp, $adresse, $ville, $cp, $pays, $tel, $adresse_liv, $ville_liv, $cp_liv, $pays_liv, $date) == false) {
            //echo "non réussi";
            header("Location:?module=utilisateurs&action=ajout_user&m=nok");
        } else {
            //echo  "réussi";
            header("Location:?module=utilisateurs&action=ajout_user&m=ok");
        }
    }
    include_once "vue/utilisateurs/ajout_user.php";
}
Beispiel #4
0
<?php

if ($access != 'VALID') {
    header('location:../../index.php');
}
//Contrôleur secondaire affichage admin
$retour = '';
if (!isset($_SESSION['admin'])) {
    header('location:../../index.php');
} else {
    include_once 'model/users/fonctions_users.php';
    if (isset($_POST['mail'])) {
        if ($_POST['mdp'] == $_POST['mdp2']) {
            $mdp = crypt($_POST['mdp'], SEL);
            if (ajout_user($_POST['mail'], $mdp, $_POST['nom'], $_POST['pseudo'], $_POST['type'])) {
                $retour = 'Le nouvel utilisateur a bien été ajouté';
            } else {
                $retour = 'Il y a eu une erreur lors de l\'ajout du nouvel utilisateur';
            }
        } else {
            $retour = 'Les mots de passe que vous avez entrés ne sont pas identiques';
        }
    }
    $url = "?module=users&amp;action=users";
    $action = "Ajouter un autre utilisateur";
    $title = 'Ajout d\'utilisateur';
    include_once 'view/retour.php';
}