This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 (hash_equals($token, $details["token"])) { | |
$_SESSION["verified_msisdn"] = $details["msisdn"]; | |
unset($_SESSION["msisdn_verification"]); | |
return TRUE; | |
} | |
?> |
This file contains hidden or 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["attempts"] = $details["attempts"] + 1; | |
$_SESSION["msisdn_verification"] = $details; | |
if ($details["attempts"] >= MAX_VERIFY_ATTEMPTS) { | |
return "max_attempts"; | |
} else { | |
return "invalid_token"; | |
} | |
?> |
This file contains hidden or 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
Host * !gateway !*.* | |
HostName %h.internal.domain | |
ProxyCommand ssh gateway exec nc %h %p |
This file contains hidden or 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 | |
$verify = new ZenSend\Verify(API_KEY); | |
$username = $_POST["username"]; | |
$user = USERS[$username]; | |
if ($user && $user["password"] == $_POST["password"]) { | |
session_start(); | |
$_SESSION["username"] = $username; | |
$options = new ZenSend\VerifyOptions(); |
This file contains hidden or 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); | |
$options = new ZenSend\VerifyOptions(); | |
$options->message = "{{token}} is your COMPANY verification code"; | |
$options->originator = "YOURCOMPANY"; | |
$verify->create_session($user["msisdn"], $options); | |
$session = $client->create_msisdn_verification($msisdn, $options); | |
?> |