linkedin + some css

This commit is contained in:
2019-03-07 16:32:27 +01:00
parent 081ed3a1de
commit a4d60d2f76
9 changed files with 89 additions and 18 deletions

View File

@ -19,6 +19,7 @@ class UserController extends Controller {
$user->setUsername($_POST["username"]);
$user->setPassword($_POST["password"]);
$user->setRole($_POST["role"]);
$user->setLinkedin($_POST["linkedin"]);
Author::add($user);
header("Location: /users/");
}
@ -49,12 +50,34 @@ class UserController extends Controller {
if($_POST["password"] != '') $user->setPassword($_POST["password"]);
$user->setRole($_POST["role"]);
$user->setJob($_POST["job"]);
$user->setLinkedin($_POST["linkedin"]);
Author::update($user);
header("Location: /users/");
}
return file_get_contents(DIR."/html/user_edit.html");
}
/**
* @route /\/user\/edit\/$/
* @editor
* @title Modifier un utilisateur
*/
public function userEdit() {
$_GET['edit_user'] = $_SESSION["author"]->getId();
if(isset($_POST["username"]) && isset($_POST["password"]) && isset($_POST["job"]) && isset($_POST["role"])) {
$user = Author::get($_GET["edit_user"]);
$user->setUsername($_POST["username"]);
if($_POST["password"] != '') $user->setPassword($_POST["password"]);
$user->setRole($_POST["role"]);
$user->setJob($_POST["job"]);
$user->setLinkedin($_POST["linkedin"]);
Author::update($user);
header("Location: /");
}
return file_get_contents(DIR."/html/user_edit.html");
}
/**
* @route /\/users\/[0-9]+\/delete\/$/
* @admin