Пример #1
0
 public function userdel()
 {
     $this->allowTo('admin');
     $id = $_POST['id_user'];
     $user = new \Manager\LogsManager();
     if ($user->delete($id)) {
         $string = "L'utilisateur vient d'être supprimé avec succès.";
     } else {
         $string = "Impossible de supprimé cet utilisateur.";
     }
     $this->show("status/sender", ["string" => $string, "nb" => 3, "link" => "setting_users"]);
 }
Пример #2
0
 public function usersave()
 {
     $manager = new \Manager\LogsManager();
     $id = $_SESSION['user']['id'];
     $userConf = ["lastname" => $lastname = strval(filter_var(filter_var($_POST['lastname'], FILTER_SANITIZE_STRING), FILTER_SANITIZE_SPECIAL_CHARS)), "firstname" => $firstname = strval(filter_var(filter_var($_POST['firstname'], FILTER_SANITIZE_STRING), FILTER_SANITIZE_SPECIAL_CHARS)), "adressClient" => $adressClient = strval(filter_var(filter_var($_POST['address'], FILTER_SANITIZE_STRING), FILTER_SANITIZE_SPECIAL_CHARS)), "postcodeClient" => $postcodeClient = strval(filter_var(filter_var($_POST['postalCode'], FILTER_SANITIZE_STRING), FILTER_SANITIZE_SPECIAL_CHARS)), "cityClient" => $cityClient = strval(filter_var(filter_var($_POST['city'], FILTER_SANITIZE_STRING), FILTER_SANITIZE_SPECIAL_CHARS)), "telephone" => $telephone = strval(filter_var(filter_var($_POST['phone'], FILTER_SANITIZE_STRING), FILTER_SANITIZE_SPECIAL_CHARS)), "birthday" => $birthday = strval(filter_var(filter_var($_POST['birthday'], FILTER_SANITIZE_STRING), FILTER_SANITIZE_SPECIAL_CHARS)), "mail" => $mail = strval(filter_var(filter_var($_POST['mail'], FILTER_SANITIZE_STRING), FILTER_SANITIZE_SPECIAL_CHARS))];
     if ($manager->update($userConf, $id)) {
         echo "oui";
     } else {
         echo "non";
     }
     $user = $manager->find($id);
     $this->show("log/userconfig", ['user' => $user]);
 }