moved things
This commit is contained in:
29
tpCrudTwig/public/add.php
Normal file
29
tpCrudTwig/public/add.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
require_once('../src/User.php');
|
||||
|
||||
if (isset($_POST)) {
|
||||
if (
|
||||
isset($_POST['login']) && !empty($_POST['login'])
|
||||
&& isset($_POST['password']) && !empty($_POST['password'])
|
||||
&& isset($_POST['lastname']) && !empty($_POST['lastname'])
|
||||
&& isset($_POST['firstname']) && !empty($_POST['firstname'])
|
||||
&& isset($_POST['role']) && !empty($_POST['role'])
|
||||
&& isset($_POST['description']) && !empty($_POST['description'])
|
||||
) {
|
||||
$login = strip_tags($_POST['login']);
|
||||
$password = strip_tags($_POST['password']);
|
||||
$lastname = strip_tags($_POST['lastname']);
|
||||
$role = strip_tags($_POST['role']);
|
||||
$firstname = strip_tags($_POST['firstname']);
|
||||
$description = strip_tags($_POST['description']);
|
||||
AddUser($login, $password, $lastname, $role, $firstname, $description);
|
||||
$_SESSION['message'] = "Utilisateur ajouté avec succès !";
|
||||
header('Location: index.php');
|
||||
}
|
||||
}
|
||||
|
||||
$vue = "users/add.twig";
|
||||
$donnees = array();
|
||||
|
||||
require_once('../modele/twig.php');
|
||||
Reference in New Issue
Block a user