itskp-odense/Backend/controller/updateUser.php

17 lines
326 B
PHP
Raw Normal View History

2021-06-09 08:41:21 +00:00
<?php
require "../../bootstrap.php";
use Backend\Model\User;
2021-06-09 08:41:21 +00:00
if(isset($_POST['id'])){
$user = User::query()->find($_POST['id']);
$user->name = $_POST['upName'];
$newPass = password_hash($_POST['upPassword'], PASSWORD_DEFAULT);
$user->password = $newPass;
2021-06-09 08:41:21 +00:00
if($user->update()){
2021-06-09 08:41:21 +00:00
return 1;
}
}