Added routes

This commit is contained in:
neerholt
2021-03-17 09:43:09 +01:00
parent 0d4f161a48
commit a84c7a9258
14 changed files with 148 additions and 54 deletions
+14 -5
View File
@@ -4,11 +4,20 @@ require_once "Group.php";
use Backend\Models\Password;
if(isLogin()){
if(isset($_POST['updatePassword']))
$password = Password::firstWhere("group_id", groupViaToken($_SESSION["token"])->id);
if(passwordValidate($pass = $_POST['password'])){
$password->password = password_hash($pass,PASSWORD_DEFAULT);
$password->save();
if(isset($_POST['updatePassword'])){
$password = Password::firstWhere("group_id", groupViaToken($_SESSION["token"])->id);
if(passwordValidate($pass = $_POST['password'])){
$password->password = password_hash($pass,PASSWORD_DEFAULT);
$password->save();
header("location: ../../../Frontend/index.html?success=PasswordUpdated");
exit();
}
}else{
header("location: ../../../Frontend/index.html?error=CouldNotUpdated");
exit();
}
}else{
header("location: ../../../Frontend/index.html?error=NotLogin");
exit();
}