2021-03-11 08:28:30 +00:00
|
|
|
<?php
|
|
|
|
require_once "../../../bootstrap.php";
|
|
|
|
require_once "Group.php";
|
|
|
|
use Backend\Models\Password;
|
|
|
|
|
2021-03-12 13:05:31 +00:00
|
|
|
if(isLogin()){
|
2021-03-11 08:28:30 +00:00
|
|
|
if(isset($_POST['updatePassword']))
|
|
|
|
$password = Password::firstWhere("group_id", groupViaToken($_SESSION["token"])->id);
|
2021-03-12 13:05:31 +00:00
|
|
|
if(passwordValidate($pass = $_POST['password'])){
|
|
|
|
$password->password = password_hash($pass,PASSWORD_DEFAULT);
|
2021-03-11 08:28:30 +00:00
|
|
|
$password->save();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|