Advertisement
Guest User

Untitled

a guest
May 21st, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.77 KB | None | 0 0
  1. //Check phone verification settings...
  2. $LoginMode = new Setting("SETTING_LOGIN_MODE", LOGIN_MODE_DEFAULT);
  3. if ($LoginMode->Get() != LOGIN_MODE_DEFAULT && $Sess->VerifyCredentials($Username, $Password)) {
  4.     //Store credentials in session for post-sms verification login
  5.     $Sess->Temp_Username = $Username;
  6.     $Sess->Temp_Password = $Password;
  7.                
  8.     //Generate random code to sms
  9.     $Sess->Temp_PhoneCode = rand(0,9) . rand(0,9) . rand(0,9) . rand(0,9) . rand(0,9) . rand(0,9);
  10.     $Sess->Temp_PhoneTime = time();
  11.        
  12.     //Message to SMS
  13.     $Message = "Your verification code: " . $Sess->Temp_PhoneCode;
  14.        
  15.     //Send it
  16.     $SMS = SMSBase::init($Message);
  17.     $SMS->send();
  18. } else {
  19.     $CUsr = $Sess->Login($Username, $Password);
  20.     if($CUsr->Get("Temporary") != 0) {
  21.         $LoginRes = "KO";
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement