From c35c4524db66646628e5264bc5336d2a30d8947c Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 9 Jun 2021 12:36:46 +0200 Subject: [PATCH] v0.1.5b Added the rest of the create user account function, update and getUserdata --- Backend/controller/getUser.php | 6 +++--- Backend/controller/updateUser.php | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Backend/controller/getUser.php b/Backend/controller/getUser.php index 02080ff..2eaecc2 100644 --- a/Backend/controller/getUser.php +++ b/Backend/controller/getUser.php @@ -1,14 +1,14 @@ 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; } }