Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Check phone verification settings...
- $LoginMode = new Setting("SETTING_LOGIN_MODE", LOGIN_MODE_DEFAULT);
- if ($LoginMode->Get() != LOGIN_MODE_DEFAULT && $Sess->VerifyCredentials($Username, $Password)) {
- //Store credentials in session for post-sms verification login
- $Sess->Temp_Username = $Username;
- $Sess->Temp_Password = $Password;
- //Generate random code to sms
- $Sess->Temp_PhoneCode = rand(0,9) . rand(0,9) . rand(0,9) . rand(0,9) . rand(0,9) . rand(0,9);
- $Sess->Temp_PhoneTime = time();
- //Message to SMS
- $Message = "Your verification code: " . $Sess->Temp_PhoneCode;
- //Send it
- $SMS = SMSBase::init($Message);
- $SMS->send();
- } else {
- $CUsr = $Sess->Login($Username, $Password);
- if($CUsr->Get("Temporary") != 0) {
- $LoginRes = "KO";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement