all controllers is aok

This commit is contained in:
2021-03-12 14:05:31 +01:00
parent c6e002d464
commit 91e4d3df00
10 changed files with 68 additions and 43 deletions
+9 -5
View File
@@ -2,17 +2,21 @@
require_once "../../../bootstrap.php";
require_once "../Admin/Admin.php";
use Backend\Models\Group;
use \Backend\Models\Password;
//session_start();
if(isAdmin()){
if(isset($_POST['restPassword'])){
$group = Group::find($_POST['groupId']);
if($group){
$group->password->password = password_hash($_POST['newPassword'], PASSWORD_DEFAULT);
if($group->save()){
$password = Password::firstWhere("group_id",$_POST['groupId']);
if($password){
$password->password = password_hash($_POST['newPassword'], PASSWORD_DEFAULT);
echo $password;
if(!$password->save()){
}
}else{
}
}
}