2021-03-08 12:01:01 +00:00
|
|
|
<?php
|
2021-03-11 08:28:30 +00:00
|
|
|
require_once "../../../bootstrap.php";
|
2021-03-11 10:13:06 +00:00
|
|
|
require_once "../Admin/Admin.php";
|
2021-03-08 12:01:01 +00:00
|
|
|
|
|
|
|
use Backend\Models\Group;
|
|
|
|
|
|
|
|
session_start();
|
2021-03-11 08:28:30 +00:00
|
|
|
if(isAdmin()){
|
|
|
|
if(isset($_POST['restPassword'])){
|
2021-03-08 12:01:01 +00:00
|
|
|
$group = Group::find($_POST['groupId']);
|
|
|
|
if($group){
|
2021-03-11 08:28:30 +00:00
|
|
|
$group->password->password = password_hash($_POST['newPassword'], PASSWORD_DEFAULT);
|
2021-03-09 09:45:05 +00:00
|
|
|
if($group->save()){
|
|
|
|
|
|
|
|
}
|
2021-03-08 12:01:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|