This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($details["attempts"] >= MAX_VERIFY_ATTEMPTS) { | |
return "max_attempts"; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$details = $_SESSION["msisdn_verification"]; | |
if (round(microtime(true) * 1000) > $details["created_at"] + EXPIRATION_TIME) { | |
return "resend_token"; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!isset($_SESSION["msisdn_verification"])) { | |
return "resend_token"; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>Please enter the code sent to you to verify your phone number.</p> | |
<form method="POST" action="/token_verify.php"> | |
<input type="text" name="token"> | |
<input type="submit" value="Verify"> | |
</form> | |
<?php | |
if ($error == "invalid_token") { | |
?> | |
<div class="error">Invalid Token</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header("Location: /token_verify.php"); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$client = new ZenSend\Client(API_KEY); | |
$request = new ZenSend\SmsRequest(); | |
$request->body = "Please enter " . $token . " to verify your mobile number"; | |
$request->originator = "VERIFY"; | |
$request->numbers = [$_POST["msisdn"]]; | |
try { | |
$result = $client->send_sms($request); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
$details = array("msisdn" => $msisdn, | |
"token" => $token, | |
"attempts" => 0, | |
"created_at" => round(microtime(true) * 1000)); | |
$_SESSION["msisdn_verification"] = $details; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$(document).ready(function() { | |
$("#msisdn").intlTelInput({"utilsScript":"js/utils.js"}); | |
$("#verify_form").on("submit", function(e) { | |
if (!$("#msisdn").intlTelInput("isValidNumber")) { | |
e.preventDefault(); | |
$("#number_error").show(); | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form method="POST" action="/number_verify.php" id="verify_form"> | |
<input id="msisdn" type="text" name="msisdn" /> | |
<input type="submit" value="Send Token"/> | |
<div id="number_error" style="<?php echo $error == "number" ? 'display:block' : '';?>">Invalid Number</div> | |
<?php | |
if ($error == "generic") { | |
?> | |
<div id="generic_error"> | |
There was an error sending your token | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/sbin/apparmor_parser: Regex grouping error: Invalid number of items between {} | |
/sbin/apparmor_parser: Unable to parse input line '/proc/{@pid}/maps' | |
ERROR processing regexs for profile csharp_sandbox, failed to load | |
*** Error in `/sbin/apparmor_parser': free(): invalid pointer: 0x00000000006d0720 *** |