We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a1aec5 commit 50352f2Copy full SHA for 50352f2
interface/web/login/otp.php
@@ -118,8 +118,8 @@
118
119
//* set code
120
if(!isset($_SESSION['otp']['code']) || empty($_SESSION['otp']['code'])) {
121
- // TODO Code generator
122
- $_SESSION['otp']['code'] = 123456;
+ // Random int between 10^($code_length-1) and 10^$code_length
+ $_SESSION['otp']['code'] = rand(pow(10, $code_length - 1), pow(10, $code_length) - 1);
123
$_SESSION['otp']['starttime'] = time();
124
}
125
0 commit comments