/** * Add a user */ public function addAction() { if ($_SERVER['REQUEST_METHOD'] == "POST") { $name = $_POST["name"]; $email = $_POST["email"]; $role = $_POST["role"]; $password = $_POST["password"]; $em = $this->getEntityManager(); $user = new User(); $user->setName($name)->setEmail($email)->setRole($role)->setPassword($password)->setLastAccess(new \DateTime()); $em->persist($user); $em->flush(); $_SESSION['flashMessage'] = "The user was added successfully"; $this->redirect(get_url("users_list")); } else { $this->renderView("Main:User:add.php", array('type' => 'add')); } }
public function getSchedules() { $this->__load(); return parent::getSchedules(); }