v0.1.5b Added the rest of the create user account function, update and getUserdata

This commit is contained in:
Victor
2021-06-09 12:36:46 +02:00
parent b0fd4d4320
commit c35c4524db
2 changed files with 9 additions and 8 deletions
+6 -5
View File
@@ -2,14 +2,15 @@
require "../../bootstrap.php";
use Backend\Model\Post;
use Backend\Model\User;
if(isset($_POST['id'])){
$post = Post::query()->find($_POST['id']);
$post->title = $_POST['upTitle'];
$post->description = $_POST['upDescription'];
$user = User::query()->find($_POST['id']);
$user->name = $_POST['upName'];
$newPass = password_hash($_POST['upPassword'], PASSWORD_DEFAULT);
$user->password = $newPass;
if($post->update()){
if($user->update()){
return 1;
}
}