mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Added TOTP Key 2FA Function to client logins
This commit is contained in:
34
blank.php
34
blank.php
@@ -16,40 +16,6 @@
|
||||
Copy to clipboard
|
||||
</button>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
// Function to generate OTP
|
||||
function generateNumericOTP($n) {
|
||||
|
||||
// Take a generator string which consist of
|
||||
// all numeric digits
|
||||
$generator = "1357902468";
|
||||
|
||||
// Iterate for n-times and pick a single character
|
||||
// from generator and append it to $result
|
||||
|
||||
// Login for generating a random character from generator
|
||||
// ---generate a random number
|
||||
// ---take modulus of same with length of generator (say i)
|
||||
// ---append the character at place (i) from generator to result
|
||||
|
||||
$result = "";
|
||||
|
||||
for ($i = 1; $i <= $n; $i++) {
|
||||
$result .= substr($generator, (rand()%(strlen($generator))), 1);
|
||||
}
|
||||
|
||||
// Return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
// Main program
|
||||
$n = 6;
|
||||
print_r(generateNumericOTP($n));
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
echo "$session_permission_companies";
|
||||
|
||||
Reference in New Issue
Block a user