updating 2fa

This commit is contained in:
jakani24
2024-06-06 16:25:53 +02:00
parent 9b75095483
commit 49b7cc6656
2 changed files with 5 additions and 1 deletions

View File

@@ -41,6 +41,9 @@ include "../../../api/php/notifications/sendmessage.php"; //to send user notific
<label for="pin">2FA-Pin (sent to you via Telegram):</label> <label for="pin">2FA-Pin (sent to you via Telegram):</label>
<input type="text" class="form-control" id="pin" name="pin" required> <input type="text" class="form-control" id="pin" name="pin" required>
</div> </div>
<div class="col">
<button style="align:left" type="submit" class="btn btn-primary btn-block">Check pin</button>
</div>
</form> </form>
<!-- php code to verify 2fa pin--> <!-- php code to verify 2fa pin-->
<?php <?php

View File

@@ -310,9 +310,10 @@ async function checkRegistration() {
$_SESSION["2fa_auth"]=true; $_SESSION["2fa_auth"]=true;
$pin=mt_rand(100000, 999999); $pin=mt_rand(100000, 999999);
$_SESSION["pin"]=$pin; $_SESSION["pin"]=$pin;
$ip = $_SERVER['REMOTE_ADDR'];
send_to_user("[2FA-Pin]\nHello $username\nHere is your pin to log into cyberhex: $pin. If you did not try to log in please take steps to secure your account!\nIP: $ip\n",$username); send_to_user("[2FA-Pin]\nHello $username\nHere is your pin to log into cyberhex: $pin. If you did not try to log in please take steps to secure your account!\nIP: $ip\n",$username);
//send the user to 2fa auth page //send the user to 2fa auth page
//echo '<script>window.location.href = "/system/insecure_zone/php/2fa.php";</script>'; echo '<script>window.location.href = "/system/insecure_zone/php/2fa.php";</script>';
}else{ }else{
if($_SESSION["send_login_message"]=="1"){ if($_SESSION["send_login_message"]=="1"){