2021-06-09 08:41:21 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require "../../bootstrap.php";
|
|
|
|
|
2021-06-09 10:36:46 +00:00
|
|
|
use Backend\Model\User;
|
2021-06-09 08:41:21 +00:00
|
|
|
|
|
|
|
if(isset($_POST['id'])){
|
2021-06-09 10:36:46 +00:00
|
|
|
$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
|
|
|
|
2021-06-09 10:36:46 +00:00
|
|
|
if($user->update()){
|
2021-06-09 08:41:21 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|