예제 #1
0
<?php

namespace Controller;

$userManager = new \Manager\UserManager($em);
if (isset($_POST['email'])) {
    if (empty($_POST['email']) || empty($_POST['firstname']) || empty($_POST['lastname']) || empty($_POST['username']) || empty($_POST['password']) || empty($_POST['confirm'])) {
        $error = "Veuillez renseigner tout les champs";
    } elseif ($_POST['password'] != $_POST['confirm']) {
        $error = "La confirmation du mot de passe est incorrecte";
    } else {
        $userManager->createAdmin($_POST['email'], $_POST['username'], $_POST['password'], array('ROLE_GUEST'));
    }
}