22 lines
484 B
PHP
22 lines
484 B
PHP
<?php
|
|
require_once "../../../bootstrap.php";
|
|
require_once "../Admin/Admin.php";
|
|
|
|
use \Backend\Models\Password;
|
|
|
|
//session_start();
|
|
if(isAdmin()){
|
|
if(isset($_POST['restPassword'])){
|
|
$password = Password::firstWhere("group_id",$_POST['groupId']);
|
|
if($password){
|
|
$password->password = password_hash($_POST['newPassword'], PASSWORD_DEFAULT);
|
|
echo $password;
|
|
if(!$password->save()){
|
|
|
|
}
|
|
}else{
|
|
|
|
}
|
|
|
|
}
|
|
} |