Google Authenticator – WordPress Two Factor Authentication (2FA) - Version 5.4.9

Version Description

  • Google Authenticator-Two Factor Authentication (2FA) : User Experience, new support form and Security disabled by default. Added New Methods for users to choose.
Download this release

Release Info

Developer cyberlord92
Plugin Icon 128x128 Google Authenticator – WordPress Two Factor Authentication (2FA)
Version 5.4.9
Comparing to
See all releases

Code changes from version 5.4.5 to 5.4.9

Files changed (128) hide show
  1. api/Mo2f_OnPremRedirect.php +167 -15
  2. api/class-customer-common-setup.php +400 -0
  3. api/class-customer-onprem-setup.php +73 -0
  4. api/class-customer-setup.php +3 -449
  5. api/class-rba-attributes.php +5 -4
  6. api/class-two-factor-setup.php +52 -33
  7. controllers/PointersManager.php +54 -0
  8. controllers/account.php +40 -49
  9. controllers/addons.php +5 -0
  10. controllers/advanced-blocking.php +1 -2
  11. controllers/dashboard_ajax.php +19 -2
  12. controllers/feedback_footer.php +47 -0
  13. controllers/feedback_form.php +0 -71
  14. controllers/ip-blocking.php +0 -1
  15. controllers/main_controller.php +11 -5
  16. controllers/navbar.php +4 -0
  17. controllers/newtork_security_features.php +1 -1
  18. controllers/pointers.php +640 -0
  19. controllers/reports.php +1 -2
  20. controllers/support.php +1 -1
  21. controllers/tour-model.php +84 -9
  22. controllers/tour/tour_ajax.php +146 -0
  23. controllers/two-fa-intro.php +222 -0
  24. controllers/twofa/mo2fa_common_login.php +24 -5
  25. controllers/twofa/mo2fa_inline_registration.php +1223 -0
  26. controllers/twofa/setup_twofa.php +4 -2
  27. controllers/twofa/two_fa_premium_feature.php +3 -0
  28. controllers/twofa/two_fa_session_control.php +3 -0
  29. controllers/twofa/two_fa_unlimittedUser.php +0 -1
  30. controllers/twofa/two_factor_ajax.php +131 -16
  31. controllers/waf.php +2 -0
  32. controllers/wpns-loginsecurity-ajax.php +31 -11
  33. database/database_functions_2fa.php +66 -2
  34. handler/WAF/mo-waf-plugin.php +4 -4
  35. handler/ajax.php +2 -2
  36. handler/feedback_form.php +43 -12
  37. handler/login.php +1 -1
  38. handler/malware_scanner/malware_scanner_cron.php +1 -2
  39. handler/mo-waf-plugin.php +2 -2
  40. handler/security_features.php +10 -0
  41. handler/spam.php +0 -11
  42. handler/twofa/gaonprem.php +0 -2
  43. handler/twofa/setup_twofa.php +188 -50
  44. handler/twofa/two_fa_constants.php +12 -2
  45. handler/twofa/two_fa_get_details.php +26 -0
  46. handler/twofa/two_fa_login.php +6 -6
  47. handler/twofa/two_fa_pass2login.php +1648 -533
  48. handler/twofa/two_fa_settings.php +420 -140
  49. handler/twofa/two_fa_utility.php +20 -11
  50. helper/constants.php +2 -2
  51. helper/curl.php +7 -2
  52. helper/dashboard_security_notification.php +47 -10
  53. helper/messages.php +5 -0
  54. helper/pluginUtility.php +2 -2
  55. includes/css/bootstrap.min.css +3936 -76
  56. includes/css/front_end_login.css +618 -0
  57. includes/css/jquery.ui.css +743 -0
  58. includes/css/popup.css +11 -0
  59. includes/css/style_settings.css +595 -24
  60. includes/css/style_settings.min.css +1 -0
  61. includes/css/twofa_style_settings.css +0 -1
  62. includes/images/amazons3.png +0 -0
  63. includes/images/box.png +0 -0
  64. includes/images/card.png +0 -0
  65. includes/images/dropbox.png +0 -0
  66. includes/images/gdrive.jpg +0 -0
  67. includes/images/google-authenticator.png +0 -0
  68. includes/images/google.jpg +0 -0
  69. includes/images/google_authy.jpg +0 -0
  70. includes/images/hide_login_form.PNG +0 -0
  71. includes/images/login-with-password-and-2fa.PNG +0 -0
  72. includes/images/minirange-logo.png +0 -0
  73. includes/images/mo_support_icon.png +0 -0
  74. includes/images/netbanking.png +0 -0
  75. includes/images/new.png +0 -0
  76. includes/images/{normal1.png → normal1.PNG} +0 -0
  77. includes/images/onedrive.png +0 -0
  78. includes/images/paypal.png +0 -0
  79. includes/jquery-qrcode/jquery-qrcode.js +1926 -2404
  80. includes/jquery-qrcode/jquery-qrcode.min.js +2 -2
  81. includes/js/pointers.js +534 -0
  82. includes/js/settings_page.js +51 -15
  83. includes/js/skip_tour.js +19 -0
  84. includes/js/wp-pointer.dev.js +281 -0
  85. includes/lib/Mo2FABasicEnum.php +33 -0
  86. includes/lib/mo-2fa-options-enum.php +79 -0
  87. miniorange_2_factor_settings.php +83 -56
  88. readme.txt +46 -16
  89. uninstall.php +46 -86
  90. views/account/login.php +7 -1
  91. views/account/profile.php +43 -2
  92. views/account/register.php +7 -1
  93. views/addons.php +316 -0
  94. views/advanced-blocking.php +29 -37
  95. views/backup/backup.php +4 -4
  96. views/backup/backup_schdule.php +6 -3
  97. views/backup/backup_setting_view.php +1 -1
  98. views/content-protection.php +2 -2
  99. views/dashboard.php +22 -8
  100. views/feedback_footer.php +123 -0
  101. views/ip-blocking.php +1 -1
  102. views/login-security.php +11 -9
  103. views/login_spam.php +6 -2
  104. views/malware_scanner/malware_scan.php +7 -4
  105. views/malware_scanner/scan_settings_view.php +9 -4
  106. views/malware_scanner/scan_summary_view.php +6 -8
  107. views/navbar.php +28 -16
  108. views/rate-limiting.php +2 -3
  109. views/registration-security.php +3 -6
  110. views/request_demo.php +5 -1
  111. views/support.php +1 -1
  112. views/tour-model.php +146 -102
  113. views/troubleshooting.php +165 -98
  114. views/twofa/link_tracer.php +57 -0
  115. views/twofa/setup/setup_authy_authenticator.php +2 -1
  116. views/twofa/setup/setup_google_authenticator.php +80 -66
  117. views/twofa/setup/setup_google_authenticator_onpremise.php +78 -72
  118. views/twofa/setup/setup_kba_questions.php +6 -5
  119. views/twofa/setup/setup_miniorange_authenticator.php +3 -2
  120. views/twofa/setup/setup_otp_over_sms.php +4 -2
  121. views/twofa/setup_twofa.php +263 -123
  122. views/twofa/test/test_twofa_google_authy_authenticator.php +38 -1
  123. views/twofa/test/test_twofa_kba_questions.php +3 -63
  124. views/twofa/test/test_twofa_otp_over_sms.php +2 -2
  125. views/twofa/two_fa.php +35 -41
  126. views/twofa/two_fa_custom_form.php +37 -12
  127. views/twofa/two_fa_custom_login.php +38 -35
  128. views/twofa/two_fa_premium_feature.php +213 -0
api/Mo2f_OnPremRedirect.php CHANGED
@@ -1,8 +1,7 @@
1
  <?php
2
  class Mo2f_OnPremRedirect {
3
 
4
- function OnpremValidateRedirect($authType, $otpToken){
5
-
6
  switch($authType){
7
 
8
  case "GOOGLE AUTHENTICATOR" :$content = $this->mo2f_google_authenticator_onpremise($otpToken);
@@ -14,7 +13,11 @@ class Mo2f_OnPremRedirect {
14
  case "OUT OF BAND EMAIL":
15
  break;
16
  case "EMAIL":
17
- break;
 
 
 
 
18
  }
19
 
20
  }
@@ -34,8 +37,8 @@ class Mo2f_OnPremRedirect {
34
  $questions_challenged = $questions_challenged[0];
35
  $all_ques_ans = (get_user_meta($user_id , 'mo2f_kba_challenge'));
36
  $all_ques_ans = $all_ques_ans[0];
37
- $ans_1 = $all_ques_ans[$questions_challenged[0]];
38
- $ans_2 = $all_ques_ans[$questions_challenged[1]];
39
  $check_trust_device = isset( $_POST['mo2f_trust_device'] ) ? $_POST['mo2f_trust_device'] : 'false';
40
  $mo2f_rba_status = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_rba_status',$session_id_encrypt );
41
 
@@ -55,18 +58,35 @@ class Mo2f_OnPremRedirect {
55
 
56
  }
57
 
58
- function OnpremSendRedirect($useremail,$authType){
59
-
60
  switch($authType){
61
 
62
  case "Email Verification":$content = $this->mo2f_pass2login_push_email_onpremise($useremail);
63
  break;
64
  case "EMAIL":
65
- break;
 
 
 
 
 
66
  }
67
 
68
  }
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  function mo2f_google_authenticator_onpremise($otpToken){
71
  include_once dirname(dirname( __FILE__ )) . DIRECTORY_SEPARATOR. 'handler'.DIRECTORY_SEPARATOR. 'twofa' . DIRECTORY_SEPARATOR . 'gaonprem.php';
72
  $gauth_obj= new Google_auth_onpremise();
@@ -81,6 +101,143 @@ class Mo2f_OnPremRedirect {
81
  $content=$gauth_obj->verifyCode($secret, $otpToken);
82
  return $content;
83
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
  function mo2f_pass2login_push_email_onpremise($current_user, $redirect_to=null, $session_id=null)
86
  {
@@ -89,7 +246,7 @@ class Mo2f_OnPremRedirect {
89
  if(is_null($session_id)){
90
  $session_id=$this->create_session();
91
  }
92
- $email = get_user_meta($current_user->ID,'email',true);
93
  $subject = "2-Factor Authentication(Email verification)";
94
  $headers = array('Content-Type: text/html; charset=UTF-8');
95
  $txid = '';
@@ -121,17 +278,12 @@ class Mo2f_OnPremRedirect {
121
  $time = "time".$txid;
122
  $currentTimeInMillis = round(microtime(true) * 1000);
123
  update_site_option($time,$currentTimeInMillis);
124
- // $mo2fa_login_message = __('An email has been sent to ','miniorange-2-factor-authentication').$hidden_user_email. '. ' .__('We are waiting for your approval.','miniorange-2-factor-authentication');
125
- // $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_OOB_EMAIL';
126
- // $this->miniorange_pass2login_form_fields($mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id);
127
  }
128
  else
129
  {
130
  $response['status']='FAILED';
131
- //$response=array("status"=>'FAILED');
132
  $key = get_option( 'mo2f_encryption_key' );
133
  $session_id_encrypt = MO2f_Utility::encrypt_data($session_id, $key);
134
- //$this->mo2fa_pass2login($redirect_to,$session_id_encrypt);
135
  }
136
 
137
  return json_encode($response);
@@ -170,4 +322,4 @@ class Mo2f_OnPremRedirect {
170
  </table>';
171
  return $message;
172
  }
173
- }
1
  <?php
2
  class Mo2f_OnPremRedirect {
3
 
4
+ function OnpremValidateRedirect($authType, $otpToken,$current_user =null){
 
5
  switch($authType){
6
 
7
  case "GOOGLE AUTHENTICATOR" :$content = $this->mo2f_google_authenticator_onpremise($otpToken);
13
  case "OUT OF BAND EMAIL":
14
  break;
15
  case "EMAIL":
16
+ case "OTP OVER EMAIL":
17
+ case "OTP_OVER_EMAIL":
18
+ return $this->mo2f_otp_over_email($otpToken,$current_user);
19
+
20
+
21
  }
22
 
23
  }
37
  $questions_challenged = $questions_challenged[0];
38
  $all_ques_ans = (get_user_meta($user_id , 'mo2f_kba_challenge'));
39
  $all_ques_ans = $all_ques_ans[0];
40
+ $ans_1 = $all_ques_ans[$questions_challenged[0]['question']];
41
+ $ans_2 = $all_ques_ans[$questions_challenged[1]['question']];
42
  $check_trust_device = isset( $_POST['mo2f_trust_device'] ) ? $_POST['mo2f_trust_device'] : 'false';
43
  $mo2f_rba_status = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_rba_status',$session_id_encrypt );
44
 
58
 
59
  }
60
 
61
+ function OnpremSendRedirect($useremail,$authType,$currentuser){
 
62
  switch($authType){
63
 
64
  case "Email Verification":$content = $this->mo2f_pass2login_push_email_onpremise($useremail);
65
  break;
66
  case "EMAIL":
67
+
68
+ case "OTP Over Email": $content = $this->OnpremOTPOverEMail($currentuser);
69
+ return $content;
70
+ case "KBA": $content = $this->OnpremSecurityQuestions($currentuser);
71
+ return $content;
72
+
73
  }
74
 
75
  }
76
 
77
+ function OnpremSecurityQuestions($user){
78
+ $question_answers = get_user_meta($user->ID , 'mo2f_kba_challenge');
79
+ $challenge_questions = array_keys($question_answers[0]);
80
+ $random_keys = array_rand($challenge_questions,2);
81
+ $challenge_ques1 = array('question'=>$challenge_questions[$random_keys[0]]);
82
+ $challenge_ques2 = array('question'=>$challenge_questions[$random_keys[1]]);
83
+ $questions = array($challenge_ques1,$challenge_ques2);
84
+ update_user_meta( $user->ID, 'kba_questions_user', $questions );
85
+ $response=json_encode(array('txId'=>rand(100,10000000),'status'=>'SUCCESS','message'=>'Please answer the following security questions.','questions'=>$questions));
86
+ return $response;
87
+
88
+ }
89
+
90
  function mo2f_google_authenticator_onpremise($otpToken){
91
  include_once dirname(dirname( __FILE__ )) . DIRECTORY_SEPARATOR. 'handler'.DIRECTORY_SEPARATOR. 'twofa' . DIRECTORY_SEPARATOR . 'gaonprem.php';
92
  $gauth_obj= new Google_auth_onpremise();
101
  $content=$gauth_obj->verifyCode($secret, $otpToken);
102
  return $content;
103
  }
104
+ function OnpremOTPOverEMail($current_user)
105
+ {
106
+ return $this->OnpremSendOTPEMail($current_user,'mo2f_otp_email_code','mo2f_otp_email_time');
107
+ }
108
+ function OnpremSendOTPEMail($current_user,$tokenName,$timeName,$email=null)
109
+ {
110
+ global $Mo2fdbQueries;
111
+
112
+ if(!isset($current_user) or is_null($current_user))
113
+ {
114
+ if(is_user_logged_in()){
115
+ $current_user = wp_get_current_user();
116
+ }else{
117
+ $current_user = unserialize($_SESSION['mo2f_current_user']);
118
+ }
119
+ }
120
+ //$email = get_user_meta($current_user->ID,'email',true);
121
+
122
+ if(is_null($email) or empty($email) or $email == '' or !isset($email) )
123
+ $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $current_user->ID );
124
+ $subject = '2-Factor Authentication';
125
+ $headers = array('Content-Type: text/html; charset=UTF-8');
126
+ $otpToken = '';
127
+ for($i=1;$i<7;$i++)
128
+ {
129
+ $otpToken .= rand(0,9);
130
+ }
131
+ update_user_meta($current_user->ID,$tokenName,$otpToken);
132
+ update_user_meta($current_user->ID,$timeName,time());
133
+ update_user_meta($current_user->ID,'tempRegEmail',$email);
134
+ //update_site_option('otpTokenEmailV',$otpTokenH);
135
+ $message = '<table cellpadding="25" style="margin:0px auto">
136
+ <tbody>
137
+ <tr>
138
+ <td>
139
+ <table cellpadding="24" width="584px" style="margin:0 auto;max-width:584px;background-color:#f6f4f4;border:1px solid #a8adad">
140
+ <tbody>
141
+ <tr>
142
+ <td><img src="https://ci5.googleusercontent.com/proxy/10EQeM1udyBOkfD2dwxGhIaMXV4lOwCRtUecpsDkZISL0JIkOL2JhaYhVp54q6Sk656rW2rpAFJFEgGQiAOVcYIIKxXYMHHMNSNB=s0-d-e1-ft#https://login.xecurify.com/moas/images/xecurify-logo.png" style="color:#5fb336;text-decoration:none;display:block;width:auto;height:auto;max-height:35px" class="CToWUd"></td>
143
+ </tr>
144
+ </tbody>
145
+ </table>
146
+ <table cellpadding="24" style="background:#fff;border:1px solid #a8adad;width:584px;border-top:none;color:#4d4b48;font-family:Arial,Helvetica,sans-serif;font-size:13px;line-height:18px">
147
+ <tbody>
148
+ <tr>
149
+ <td>
150
+ <p style="margin-top:0;margin-bottom:20px">Dear Customers,</p>
151
+ <p style="margin-top:0;margin-bottom:10px">You initiated a transaction <b>WordPress 2 Factor Authentication Plugin</b>:</p>
152
+ <p style="margin-top:0;margin-bottom:10px">Your one time passcode is '.$otpToken.'.
153
+ <p style="margin-top:0;margin-bottom:15px">Thank you,<br>miniOrange Team</p>
154
+ <p style="margin-top:0;margin-bottom:0px;font-size:11px">Disclaimer: This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.</p>
155
+ </div></div></td>
156
+ </tr>
157
+ </tbody>
158
+ </table>
159
+ </td>
160
+ </tr>
161
+ </tbody>
162
+ </table>';
163
+
164
+ $result = wp_mail($email,$subject,$message,$headers);
165
+ if($result){
166
+ update_site_option( 'mo2f_message', 'A OTP has been sent to you on' .'<b> ' . $email . '</b>. ' . Mo2fConstants::langTranslate("ACCEPT_LINK_TO_VERIFY_EMAIL"));
167
+ $arr = array('status' => 'SUCCESS','message'=>'Successfully validated.' ,'txId' => '' );
168
+
169
+ }else{
170
+ $arr = array('status' => 'FAILED','message'=>'TEST FAILED.');
171
+ update_site_option( 'mo2f_message', Mo2fConstants::langTranslate("ERROR_DURING_PROCESS_EMAIL"));
172
+ }
173
+ $content = json_encode($arr);
174
+ return $content;
175
+
176
+ }
177
+
178
+ function mo2f_otp_over_email($otpToken,$current_user)
179
+ {
180
+ return $this->mo2f_otp_email_verify($otpToken,$current_user,'mo2f_otp_email_code','mo2f_otp_email_time');
181
+ }
182
+ function mo2f_otp_email_verify($otpToken,$current_user,$dtoken,$dtime)
183
+ {
184
+ global $Mo2fdbQueries;
185
+ if(is_null($current_user))
186
+ {
187
+ $current_user = wp_get_current_user();
188
+ }
189
+
190
+ if(isset($otpToken) and !empty($otpToken) and !is_null($current_user))
191
+ {
192
+ $user_id = $current_user->ID;
193
+
194
+
195
+
196
+
197
+ $valid_token = get_user_meta($user_id,$dtoken,true);
198
+
199
+
200
+ $cd = get_user_meta($user_id,"mo2f_email_check_code",true);
201
+
202
+
203
+ $time = get_user_meta($user_id,$dtime,true);
204
+ $accepted_time = time()-300;
205
+
206
+
207
+ if($accepted_time>$time)
208
+ {
209
+
210
+ delete_user_meta( $user_id, $dtoken );
211
+ delete_user_meta( $user_id, $dtime );
212
+ delete_user_meta( $user_id,'tempRegEmail');
213
+
214
+ $arr = array('status' => 'FAILED','message'=>'OTP Expire.');
215
+ }
216
+
217
+ else if($valid_token == $otpToken)
218
+ {
219
+ $arr = array('status' => 'SUCCESS','message'=>'Successfully validated.');
220
+ delete_user_meta( $user_id, $dtoken );
221
+ if($dtoken == 'mo2f_email_check_code')
222
+ {
223
+ $tempRegEmail = get_user_meta($user_id,'tempRegEmail',true);
224
+ if($tempRegEmail != '' or !is_null($tempRegEmail) or !$tempRegEmail)
225
+ $Mo2fdbQueries->update_user_details($user_id,array('mo2f_user_email'=> $tempRegEmail));
226
+ }
227
+ delete_user_meta( $user_id,'tempRegEmail');
228
+ }
229
+ else
230
+ {
231
+ $arr = array('status' => 'FAILED','message'=>'TEST FAILED.');
232
+ }
233
+
234
+ //exit;
235
+ $content = json_encode($arr);
236
+ return $content;
237
+
238
+ }
239
+ }
240
+
241
 
242
  function mo2f_pass2login_push_email_onpremise($current_user, $redirect_to=null, $session_id=null)
243
  {
246
  if(is_null($session_id)){
247
  $session_id=$this->create_session();
248
  }
249
+ $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $current_user->ID );
250
  $subject = "2-Factor Authentication(Email verification)";
251
  $headers = array('Content-Type: text/html; charset=UTF-8');
252
  $txid = '';
278
  $time = "time".$txid;
279
  $currentTimeInMillis = round(microtime(true) * 1000);
280
  update_site_option($time,$currentTimeInMillis);
 
 
 
281
  }
282
  else
283
  {
284
  $response['status']='FAILED';
 
285
  $key = get_option( 'mo2f_encryption_key' );
286
  $session_id_encrypt = MO2f_Utility::encrypt_data($session_id, $key);
 
287
  }
288
 
289
  return json_encode($response);
322
  </table>';
323
  return $message;
324
  }
325
+ }
api/class-customer-common-setup.php ADDED
@@ -0,0 +1,400 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /** miniOrange enables user to log in through mobile authentication as an additional layer of security over password.
3
+ * Copyright (C) 2015 miniOrange
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
17
+ * @package miniOrange OAuth
18
+ * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
19
+ */
20
+
21
+ /**
22
+ * This library is miniOrange Authentication Service.
23
+ * Contains Request Calls to Customer service.
24
+ **/
25
+
26
+ include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR.'mo2f_api.php';
27
+
28
+ class Customer_Cloud_Setup {
29
+
30
+ public $email;
31
+ public $phone;
32
+ public $customerKey;
33
+ public $transactionId;
34
+
35
+ private $auth_mode = 2; // miniorange test or not
36
+ private $https_mode = false; // website http or https
37
+
38
+
39
+ function check_customer() {
40
+ $url = MO_HOST_NAME . "/moas/rest/customer/check-if-exists";
41
+ $email = get_option( "mo2f_email" );
42
+ $mo2fApi= new Mo2f_Api();
43
+ $fields = array (
44
+ 'email' => $email
45
+ );
46
+ $field_string = json_encode ( $fields );
47
+
48
+ $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
49
+
50
+ $response = $mo2fApi->make_curl_call( $url, $field_string );
51
+ return $response;
52
+
53
+ }
54
+
55
+ function guest_audit() {
56
+ $url = MO_HOST_NAME . "/moas/rest/customer/guest-audit";
57
+ $email = get_option( "mo2f_email" );
58
+
59
+ $user = wp_get_current_user();
60
+
61
+ if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
62
+ if (empty($email))
63
+ $email = $user->user_email;
64
+ }
65
+
66
+ $mo2fApi= new Mo2f_Api();
67
+ $MoWpnsUtility = new MoWpnsUtility();
68
+ $company = get_option( 'mo2f_admin_company' ) != '' ? get_option( 'mo2f_admin_company' ) : $_SERVER['SERVER_NAME'];
69
+ $applicationName='Wordpress Two Factor;'.$MoWpnsUtility->checkPlugins();
70
+ $fields = array (
71
+ 'emailAddress' => $email,
72
+ 'companyName'=>$company,
73
+ 'cmsName'=>"WP",
74
+ 'applicationType'=>'Two Factor',
75
+ 'applicationName'=>$applicationName,
76
+ 'pluginVersion'=>MO2F_VERSION,
77
+ 'inUse'=>$MoWpnsUtility->getFeatureStatus()
78
+ );
79
+
80
+
81
+
82
+ $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
83
+
84
+ $field_string = json_encode ( $fields );
85
+
86
+ $response = $mo2fApi->make_curl_call( $url, $field_string,$headers );
87
+ return $response;
88
+
89
+ }
90
+
91
+ function send_email_alert( $email, $phone, $message ) {
92
+
93
+ $url = MO_HOST_NAME . '/moas/api/notify/send';
94
+
95
+ $mo2fApi= new Mo2f_Api();
96
+ $customerKey = "16555";
97
+ $apiKey = "fFd2XcvTGDemZvbw1bcUesNJWEqKbbUq";
98
+
99
+ $currentTimeInMillis = $mo2fApi->get_timestamp();
100
+ $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
101
+ $hashValue = hash( "sha512", $stringToHash );
102
+ $fromEmail = $email;
103
+ $subject = "WordPress 2FA Plugin Feedback - " . $email;
104
+
105
+ global $user;
106
+ $user = wp_get_current_user();
107
+ $is_nc_with_1_user = get_option( 'mo2f_is_NC' ) && get_option( 'mo2f_is_NNC' );
108
+ $is_ec_with_1_user = ! get_option( 'mo2f_is_NC' );
109
+
110
+
111
+ $customer_feature = "";
112
+
113
+ if ( $is_ec_with_1_user ) {
114
+ $customer_feature = "V1";
115
+ }else if ( $is_nc_with_1_user ) {
116
+ $customer_feature = "V3";
117
+ }
118
+
119
+ $query = '[WordPress 2 Factor Authentication Plugin: ' . $customer_feature . ' - V '.MO2F_VERSION.']: ' . $message;
120
+
121
+ $content = '<div >First Name :' . $user->user_firstname . '<br><br>Last Name :' . $user->user_lastname . ' <br><br>Company :<a href="' . $_SERVER['SERVER_NAME'] . '" target="_blank" >' . $_SERVER['SERVER_NAME'] . '</a><br><br>Phone Number :' . $phone . '<br><br>Email :<a href="mailto:' . $fromEmail . '" target="_blank">' . $fromEmail . '</a><br><br>Query :' . $query . '</div>';
122
+
123
+ $fields = array(
124
+ 'customerKey' => $customerKey,
125
+ 'sendEmail' => true,
126
+ 'email' => array(
127
+ 'customerKey' => $customerKey,
128
+ 'fromEmail' => $fromEmail,
129
+ 'fromName' => 'Xecurify',
130
+ 'toEmail' => '2fasupport@xecurify.com',
131
+ 'toName' => '2fasupport@xecurify.com',
132
+ 'subject' => $subject,
133
+ 'content' => $content
134
+ ),
135
+ );
136
+ $field_string = json_encode( $fields );
137
+
138
+ $headers = $mo2fApi->get_http_header_array();
139
+
140
+ $response = $mo2fApi->make_curl_call( $url, $field_string, $headers );
141
+ return $response;
142
+
143
+
144
+ }
145
+
146
+ function create_customer() {
147
+ global $Mo2fdbQueries;
148
+ if ( ! MO2f_Utility::is_curl_installed() ) {
149
+ $message = 'Please enable curl extension. <a href="admin.php?page=mo_2fa_troubleshooting">Click here</a> for the steps to enable curl.';
150
+
151
+ return json_encode( array( "status" => 'ERROR', "message" => $message ) );
152
+ }
153
+
154
+ $url = MO_HOST_NAME . '/moas/rest/customer/add';
155
+ $mo2fApi= new Mo2f_Api();
156
+ global $user;
157
+ $user = wp_get_current_user();
158
+ $this->email = get_option( 'mo2f_email' );
159
+ $this->phone = $Mo2fdbQueries->get_user_detail( 'mo2f_user_phone', $user->ID );
160
+ $password = get_option( 'mo2f_password' );
161
+ $company = get_option( 'mo2f_admin_company' ) != '' ? get_option( 'mo2f_admin_company' ) : $_SERVER['SERVER_NAME'];
162
+
163
+ $fields = array(
164
+ 'companyName' => $company,
165
+ 'areaOfInterest' => 'WordPress 2 Factor Authentication Plugin',
166
+ 'productInterest' => 'API_2FA',
167
+ 'email' => $this->email,
168
+ 'phone' => $this->phone,
169
+ 'password' => $password
170
+ );
171
+ $field_string = json_encode( $fields );
172
+ $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
173
+
174
+ $content = $mo2fApi->make_curl_call( $url, $field_string );
175
+
176
+ return $content;
177
+ }
178
+
179
+
180
+ function get_customer_key() {
181
+ if ( ! MO2f_Utility::is_curl_installed() ) {
182
+ $message = 'Please enable curl extension. <a href="admin.php?page=mo_2fa_troubleshooting">Click here</a> for the steps to enable curl.';
183
+
184
+ return json_encode( array( "status" => 'ERROR', "message" => $message ) );
185
+ }
186
+
187
+ $url = MO_HOST_NAME . "/moas/rest/customer/key";
188
+
189
+ $email = get_option( "mo2f_email" );
190
+ $password = get_option( "mo2f_password" );
191
+ $mo2fApi= new Mo2f_Api();
192
+ $fields = array(
193
+ 'email' => $email,
194
+ 'password' => $password
195
+ );
196
+ $field_string = json_encode( $fields );
197
+
198
+ $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
199
+
200
+ $content = $mo2fApi->make_curl_call( $url, $field_string );
201
+
202
+ return $content;
203
+ }
204
+
205
+
206
+ function send_otp_token( $uKey, $authType, $cKey, $apiKey,$currentuser=null ) {
207
+
208
+ if ( ! MO2f_Utility::is_curl_installed()) {
209
+ $message = 'Please enable curl extension. <a href="admin.php?page=mo_2fa_troubleshooting">Click here</a> for the steps to enable curl.';
210
+
211
+ return json_encode( array( "status" => 'ERROR', "message" => $message ) );
212
+ }
213
+
214
+ $url = MO_HOST_NAME . '/moas/api/auth/challenge';
215
+ $mo2fApi = new Mo2f_Api();
216
+ /* The customer Key provided to you */
217
+ $customerKey = $cKey;
218
+
219
+ /* The customer API Key provided to you */
220
+ $apiKey = $apiKey;
221
+
222
+ /* Current time in milliseconds since midnight, January 1, 1970 UTC. */
223
+ $currentTimeInMillis = $mo2fApi->get_timestamp();
224
+
225
+ /* Creating the Hash using SHA-512 algorithm */
226
+ $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
227
+ $hashValue = hash( "sha512", $stringToHash );
228
+
229
+ $headers = $mo2fApi->get_http_header_array();
230
+
231
+ $fields = '';
232
+ if ( $authType == 'EMAIL' || $authType == 'OTP Over Email' || $authType == 'OUT OF BAND EMAIL' ) {
233
+ $fields = array(
234
+ 'customerKey' => $customerKey,
235
+ 'email' => $uKey,
236
+ 'authType' => $authType,
237
+ 'transactionName' => 'WordPress 2 Factor Authentication Plugin'
238
+ );
239
+ } else if ( $authType == 'SMS' ) {
240
+ $authType = "SMS";
241
+ $fields = array(
242
+ 'customerKey' => $customerKey,
243
+ 'phone' => $uKey,
244
+ 'authType' => $authType
245
+ );
246
+ } else {
247
+ $fields = array(
248
+ 'customerKey' => $customerKey,
249
+ 'username' => $uKey,
250
+ 'authType' => $authType,
251
+ 'transactionName' => 'WordPress 2 Factor Authentication Plugin'
252
+ );
253
+ }
254
+
255
+ $field_string = json_encode( $fields );
256
+
257
+ $content = $mo2fApi->make_curl_call( $url, $field_string, $headers );
258
+ //{"txId":"8eb0f8d1-bb72-11ea-aad7-02c931e36dd8","authType":"KBA","responseType":"CHALLENGE","phoneDelivery":{"contact":null,"sendStatus":null,"sendTime":null},"emailDelivery":{"contact":null,"sendStatus":null,"sendTime":null},"status":"SUCCESS","message":"Please answer the following security questions.","questions":[{"question":"What is your first company name?"},{"question":"What was your childhood nickname?"}]}
259
+ return $content;
260
+ }
261
+
262
+
263
+ function get_customer_transactions( $cKey, $apiKey ) {
264
+
265
+ $url = MO_HOST_NAME . '/moas/rest/customer/license';
266
+
267
+ $customerKey = $cKey;
268
+ $apiKey = $apiKey;
269
+ $mo2fApi= new Mo2f_Api();
270
+ $currentTimeInMillis = $mo2fApi->get_timestamp();
271
+ $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
272
+ $hashValue = hash( "sha512", $stringToHash );
273
+
274
+ $fields = '';
275
+ $fields = array(
276
+ 'customerId' => $customerKey,
277
+ 'applicationName' => 'wp_2fa',
278
+ 'licenseType' => 'DEMO'
279
+ );
280
+
281
+ $field_string = json_encode( $fields );
282
+
283
+ $headers = $mo2fApi->get_http_header_array();
284
+
285
+ $content = $mo2fApi->make_curl_call( $url, $field_string, $headers );
286
+
287
+
288
+ return $content;
289
+ }
290
+
291
+
292
+ function validate_otp_token( $authType, $username, $transactionId, $otpToken, $cKey, $customerApiKey, $current_user =null) {
293
+ $content='';
294
+ if ( ! MO2f_Utility::is_curl_installed() ) {
295
+ $message = 'Please enable curl extension. <a href="admin.php?page=mo_2fa_troubleshooting">Click here</a> for the steps to enable curl.';
296
+
297
+ return json_encode( array( "status" => 'ERROR', "message" => $message ) );
298
+ }
299
+
300
+ $url = MO_HOST_NAME . '/moas/api/auth/validate';
301
+ $mo2fApi= new Mo2f_Api();
302
+ /* The customer Key provided to you */
303
+ $customerKey = $cKey;
304
+
305
+ /* The customer API Key provided to you */
306
+ $apiKey = $customerApiKey;
307
+
308
+ /* Current time in milliseconds since midnight, January 1, 1970 UTC. */
309
+ $currentTimeInMillis = $mo2fApi->get_timestamp();
310
+
311
+ /* Creating the Hash using SHA-512 algorithm */
312
+ $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
313
+ $hashValue = hash( "sha512", $stringToHash );
314
+
315
+ $headers = $mo2fApi->get_http_header_array();
316
+ $fields = '';
317
+ if ( $authType == 'SOFT TOKEN' || $authType == 'GOOGLE AUTHENTICATOR' ) {
318
+ /*check for soft token*/
319
+ $fields = array(
320
+ 'customerKey' => $customerKey,
321
+ 'username' => $username,
322
+ 'token' => $otpToken,
323
+ 'authType' => $authType
324
+ );
325
+ } else if ( $authType == 'KBA' ) {
326
+ $fields = array(
327
+ 'txId' => $transactionId,
328
+ 'answers' => array(
329
+ array(
330
+ 'question' => $otpToken[0],
331
+ 'answer' => $otpToken[1]
332
+ ),
333
+ array(
334
+ 'question' => $otpToken[2],
335
+ 'answer' => $otpToken[3]
336
+ )
337
+ )
338
+ );
339
+
340
+ } else {
341
+ //*check for otp over sms/email
342
+ $fields = array(
343
+ 'txId' => $transactionId,
344
+ 'token' => $otpToken
345
+ );
346
+ }
347
+ $field_string = json_encode( $fields );
348
+
349
+
350
+ $content = $mo2fApi->make_curl_call( $url, $field_string, $headers );
351
+
352
+ return $content;
353
+ }
354
+
355
+ function submit_contact_us( $q_email, $q_phone, $query ) {
356
+ if ( ! MO2f_Utility::is_curl_installed() ) {
357
+ $message = 'Please enable curl extension. <a href="admin.php?page=mo_2fa_troubleshooting">Click here</a> for the steps to enable curl.';
358
+
359
+ return json_encode( array( "status" => 'ERROR', "message" => $message ) );
360
+ }
361
+
362
+ $url = MO_HOST_NAME . "/moas/rest/customer/contact-us";
363
+ global $user;
364
+ $user = wp_get_current_user();
365
+ $is_nc_with_1_user = get_option( 'mo2f_is_NC' ) && get_option( 'mo2f_is_NNC' );
366
+ $is_ec_with_1_user = ! get_option( 'mo2f_is_NC' );
367
+
368
+ $mo2fApi= new Mo2f_Api();
369
+ $customer_feature = "";
370
+
371
+ if ( $is_ec_with_1_user ) {
372
+ $customer_feature = "V1";
373
+ } else if ( $is_nc_with_1_user ) {
374
+ $customer_feature = "V3";
375
+ }
376
+ global $moWpnsUtility;
377
+
378
+ $query = '[WordPress 2 Factor Authentication Plugin: ' . $customer_feature . ' - V '.MO2F_VERSION.'- Ticket Id:'.$moWpnsUtility->getFeatureStatus().']: ' . $query;
379
+ $fields = array(
380
+ 'firstName' => $user->user_firstname,
381
+ 'lastName' => $user->user_lastname,
382
+ 'company' => $_SERVER['SERVER_NAME'],
383
+ 'email' => $q_email,
384
+ 'ccEmail' => '2fasupport@xecurify.com',
385
+ 'phone' => $q_phone,
386
+ 'query' => $query
387
+ );
388
+ $field_string = json_encode( $fields );
389
+
390
+ $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
391
+
392
+ $content = $mo2fApi->make_curl_call( $url, $field_string );
393
+
394
+ return true;
395
+ }
396
+
397
+ }
398
+
399
+
400
+ ?>
api/class-customer-onprem-setup.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /** miniOrange enables user to log in through mobile authentication as an additional layer of security over password.
3
+ * Copyright (C) 2015 miniOrange
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
17
+ * @package miniOrange OAuth
18
+ * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
19
+ */
20
+
21
+ /**
22
+ * This library is miniOrange Authentication Service.
23
+ * Contains Request Calls to Customer service.
24
+ **/
25
+
26
+ include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR.'mo2f_api.php';
27
+
28
+ class Customer_Setup extends Customer_Cloud_Setup {
29
+
30
+
31
+
32
+ function send_otp_token( $uKey, $authType, $cKey, $apiKey,$currentuser=null ) {
33
+
34
+ $cloud_methods = array('MOBILE AUTHENTICATION','PUSH NOTIFICATIONS','SMS');
35
+ if(MO2F_IS_ONPREM and !in_array($authType, $cloud_methods)){
36
+ include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'Mo2f_OnPremRedirect.php';
37
+ $mo2fOnPremRedirect = new Mo2f_OnPremRedirect();
38
+ if(is_null($currentuser) or !isset($currentuser))
39
+ $currentuser = wp_get_current_user();
40
+ $content = $mo2fOnPremRedirect->OnpremSendRedirect($uKey,$authType,$currentuser);//change parameters as per your requirement but make sure other methods are not affected.
41
+
42
+ }else {
43
+
44
+ $content= parent::send_otp_token($uKey, $authType, $cKey, $apiKey,$currentuser=null);
45
+
46
+ }
47
+
48
+ return $content;
49
+ }
50
+
51
+
52
+ function validate_otp_token( $authType, $username, $transactionId, $otpToken, $cKey, $customerApiKey, $current_user =null) {
53
+ $content='';
54
+ if(MO2F_IS_ONPREM and $authType != 'SOFT TOKEN' and $authType !='OTP Over Email' and $authType != 'SMS' and $authType != 'OTP Over SMS'){
55
+ include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'Mo2f_OnPremRedirect.php';
56
+ $mo2fOnPremRedirect = new Mo2f_OnPremRedirect();
57
+ if(!isset($current_user) or is_null($current_user) )
58
+ $current_user = wp_get_current_user();
59
+ $content = $mo2fOnPremRedirect->OnpremValidateRedirect($authType, $otpToken,$current_user );
60
+ //change parameters as per your requirement but make sure other methods are not affected.
61
+
62
+ }else{
63
+
64
+ $content= parent::validate_otp_token( $authType, $username, $transactionId, $otpToken, $cKey, $customerApiKey, $current_user =null);
65
+
66
+ }
67
+ return $content;
68
+ }
69
+
70
+
71
+ }
72
+
73
+ ?>
api/class-customer-setup.php CHANGED
@@ -25,456 +25,10 @@
25
 
26
  include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR.'mo2f_api.php';
27
 
28
- class Customer_Setup {
29
-
30
- public $email;
31
- public $phone;
32
- public $customerKey;
33
- public $transactionId;
34
-
35
- private $auth_mode = 2; // miniorange test or not
36
- private $https_mode = false; // website http or https
37
-
38
-
39
- function check_customer() {
40
- $url = MO_HOST_NAME . "/moas/rest/customer/check-if-exists";
41
- $email = get_option( "mo2f_email" );
42
- $mo2fApi= new Mo2f_Api();
43
- $fields = array (
44
- 'email' => $email
45
- );
46
- $field_string = json_encode ( $fields );
47
-
48
- $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
49
-
50
- $response = $mo2fApi->make_curl_call( $url, $field_string );
51
- return $response;
52
-
53
- }
54
-
55
- function guest_audit() {
56
- $url = MO_HOST_NAME . "/moas/rest/customer/guest-audit";
57
- $email = get_option( "mo2f_email" );
58
-
59
- $user = wp_get_current_user();
60
-
61
- if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
62
- if (empty($email))
63
- $email = $user->user_email;
64
- }
65
-
66
- $mo2fApi= new Mo2f_Api();
67
- $MoWpnsUtility = new MoWpnsUtility();
68
- $company = get_option( 'mo2f_admin_company' ) != '' ? get_option( 'mo2f_admin_company' ) : $_SERVER['SERVER_NAME'];
69
- $applicationName='Wordpress Two Factor;'.$MoWpnsUtility->checkPlugins();
70
- $fields = array (
71
- 'emailAddress' => $email,
72
- 'companyName'=>$company,
73
- 'cmsName'=>"WP",
74
- 'applicationType'=>'Two Factor',
75
- 'applicationName'=>$applicationName,
76
- 'pluginVersion'=>MO2F_VERSION,
77
- 'inUse'=>$MoWpnsUtility->getFeatureStatus()
78
- );
79
-
80
-
81
-
82
- $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
83
-
84
- $field_string = json_encode ( $fields );
85
-
86
- $response = $mo2fApi->make_curl_call( $url, $field_string,$headers );
87
- return $response;
88
-
89
- }
90
-
91
- function send_email_alert( $email, $phone, $message ) {
92
-
93
- $url = MO_HOST_NAME . '/moas/api/notify/send';
94
-
95
- $mo2fApi= new Mo2f_Api();
96
- $customerKey = "16555";
97
- $apiKey = "fFd2XcvTGDemZvbw1bcUesNJWEqKbbUq";
98
-
99
- $currentTimeInMillis = $mo2fApi->get_timestamp();
100
- $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
101
- $hashValue = hash( "sha512", $stringToHash );
102
- $fromEmail = $email;
103
- $subject = "WordPress 2FA Plugin Feedback - " . $email;
104
-
105
- global $user;
106
- $user = wp_get_current_user();
107
- $is_nc_with_1_user = get_option( 'mo2f_is_NC' ) && get_option( 'mo2f_is_NNC' );
108
- $is_ec_with_1_user = ! get_option( 'mo2f_is_NC' );
109
-
110
-
111
- $customer_feature = "";
112
-
113
- if ( $is_ec_with_1_user ) {
114
- $customer_feature = "V1";
115
- }else if ( $is_nc_with_1_user ) {
116
- $customer_feature = "V3";
117
- }
118
-
119
- $query = '[WordPress 2 Factor Authentication Plugin: ' . $customer_feature . ' - V '.MO2F_VERSION.']: ' . $message;
120
-
121
- $content = '<div >First Name :' . $user->user_firstname . '<br><br>Last Name :' . $user->user_lastname . ' <br><br>Company :<a href="' . $_SERVER['SERVER_NAME'] . '" target="_blank" >' . $_SERVER['SERVER_NAME'] . '</a><br><br>Phone Number :' . $phone . '<br><br>Email :<a href="mailto:' . $fromEmail . '" target="_blank">' . $fromEmail . '</a><br><br>Query :' . $query . '</div>';
122
-
123
- $fields = array(
124
- 'customerKey' => $customerKey,
125
- 'sendEmail' => true,
126
- 'email' => array(
127
- 'customerKey' => $customerKey,
128
- 'fromEmail' => $fromEmail,
129
- 'fromName' => 'Xecurify',
130
- 'toEmail' => '2fasupport@xecurify.com',
131
- 'toName' => '2fasupport@xecurify.com',
132
- 'subject' => $subject,
133
- 'content' => $content
134
- ),
135
- );
136
- $field_string = json_encode( $fields );
137
-
138
- $headers = $mo2fApi->get_http_header_array();
139
-
140
- $response = $mo2fApi->make_curl_call( $url, $field_string, $headers );
141
- return $response;
142
-
143
-
144
- }
145
-
146
- function create_customer() {
147
- global $Mo2fdbQueries;
148
- if ( ! MO2f_Utility::is_curl_installed() ) {
149
- $message = 'Please enable curl extension. <a href="admin.php?page=mo_2fa_troubleshooting">Click here</a> for the steps to enable curl.';
150
-
151
- return json_encode( array( "status" => 'ERROR', "message" => $message ) );
152
- }
153
-
154
- $url = MO_HOST_NAME . '/moas/rest/customer/add';
155
- $mo2fApi= new Mo2f_Api();
156
- global $user;
157
- $user = wp_get_current_user();
158
- $this->email = get_option( 'mo2f_email' );
159
- $this->phone = $Mo2fdbQueries->get_user_detail( 'mo2f_user_phone', $user->ID );
160
- $password = get_option( 'mo2f_password' );
161
- $company = get_option( 'mo2f_admin_company' ) != '' ? get_option( 'mo2f_admin_company' ) : $_SERVER['SERVER_NAME'];
162
-
163
- $fields = array(
164
- 'companyName' => $company,
165
- 'areaOfInterest' => 'WordPress 2 Factor Authentication Plugin',
166
- 'productInterest' => 'API_2FA',
167
- 'email' => $this->email,
168
- 'phone' => $this->phone,
169
- 'password' => $password
170
- );
171
- $field_string = json_encode( $fields );
172
- $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
173
-
174
- $content = $mo2fApi->make_curl_call( $url, $field_string );
175
-
176
- return $content;
177
- }
178
-
179
-
180
- function get_customer_key() {
181
- if ( ! MO2f_Utility::is_curl_installed() ) {
182
- $message = 'Please enable curl extension. <a href="admin.php?page=mo_2fa_troubleshooting">Click here</a> for the steps to enable curl.';
183
-
184
- return json_encode( array( "status" => 'ERROR', "message" => $message ) );
185
- }
186
-
187
- $url = MO_HOST_NAME . "/moas/rest/customer/key";
188
-
189
- $email = get_option( "mo2f_email" );
190
- $password = get_option( "mo2f_password" );
191
- $mo2fApi= new Mo2f_Api();
192
- $fields = array(
193
- 'email' => $email,
194
- 'password' => $password
195
- );
196
- $field_string = json_encode( $fields );
197
-
198
- $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
199
-
200
- $content = $mo2fApi->make_curl_call( $url, $field_string );
201
-
202
- return $content;
203
- }
204
-
205
-
206
- function send_otp_token( $uKey, $authType, $cKey, $apiKey ) {
207
-
208
- if(MO2F_IS_ONPREM){
209
- include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'Mo2f_OnPremRedirect.php';
210
- $mo2fOnPremRedirect = new Mo2f_OnPremRedirect();
211
- $content = $mo2fOnPremRedirect->OnpremSendRedirect($uKey,$authType );//change parameters as per your requirement but make sure other methods are not affected.
212
-
213
- }else {
214
- if ( ! MO2f_Utility::is_curl_installed() ) {
215
- $message = 'Please enable curl extension. <a href="admin.php?page=mo_2fa_troubleshooting">Click here</a> for the steps to enable curl.';
216
-
217
- return json_encode( array( "status" => 'ERROR', "message" => $message ) );
218
- }
219
-
220
- $url = MO_HOST_NAME . '/moas/api/auth/challenge';
221
- $mo2fApi = new Mo2f_Api();
222
- /* The customer Key provided to you */
223
- $customerKey = $cKey;
224
-
225
- /* The customer API Key provided to you */
226
- $apiKey = $apiKey;
227
-
228
- /* Current time in milliseconds since midnight, January 1, 1970 UTC. */
229
- $currentTimeInMillis = $mo2fApi->get_timestamp();
230
-
231
- /* Creating the Hash using SHA-512 algorithm */
232
- $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
233
- $hashValue = hash( "sha512", $stringToHash );
234
-
235
- $headers = $mo2fApi->get_http_header_array();
236
-
237
- $fields = '';
238
- if ( $authType == 'EMAIL' || $authType == 'OUT OF BAND EMAIL' ) {
239
- $fields = array(
240
- 'customerKey' => $customerKey,
241
- 'email' => $uKey,
242
- 'authType' => $authType,
243
- 'transactionName' => 'WordPress 2 Factor Authentication Plugin'
244
- );
245
- } else if ( $authType == 'SMS' ) {
246
- $authType = "SMS";
247
- $fields = array(
248
- 'customerKey' => $customerKey,
249
- 'phone' => $uKey,
250
- 'authType' => $authType
251
- );
252
- } else {
253
- $fields = array(
254
- 'customerKey' => $customerKey,
255
- 'username' => $uKey,
256
- 'authType' => $authType,
257
- 'transactionName' => 'WordPress 2 Factor Authentication Plugin'
258
- );
259
- }
260
-
261
- $field_string = json_encode( $fields );
262
-
263
- $args = array(
264
- 'method' => 'POST',
265
- 'body' => $field_string,
266
- 'timeout' => '5',
267
- 'redirection' => '5',
268
- 'httpversion' => '1.0',
269
- 'blocking' => true,
270
- 'headers' => $headers
271
- );
272
- $content = $mo2fApi->make_curl_call( $url, $field_string, $headers );
273
- }
274
- return $content;
275
- }
276
-
277
-
278
- function get_customer_transactions( $cKey, $apiKey ) {
279
-
280
- $url = MO_HOST_NAME . '/moas/rest/customer/license';
281
-
282
- $customerKey = $cKey;
283
- $apiKey = $apiKey;
284
- $mo2fApi= new Mo2f_Api();
285
- $currentTimeInMillis = $mo2fApi->get_timestamp();
286
- $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
287
- $hashValue = hash( "sha512", $stringToHash );
288
-
289
- $fields = '';
290
- $fields = array(
291
- 'customerId' => $customerKey,
292
- 'applicationName' => 'wp_2fa',
293
- 'licenseType' => 'DEMO'
294
- );
295
-
296
- $field_string = json_encode( $fields );
297
-
298
- $headers = $mo2fApi->get_http_header_array();
299
-
300
- $content = $mo2fApi->make_curl_call( $url, $field_string, $headers );
301
-
302
- return $content;
303
- }
304
-
305
-
306
- function validate_otp_token( $authType, $username, $transactionId, $otpToken, $cKey, $customerApiKey ) {
307
- $content='';
308
- if(MO2F_IS_ONPREM){
309
- include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'Mo2f_OnPremRedirect.php';
310
- $mo2fOnPremRedirect = new Mo2f_OnPremRedirect();
311
- $content = $mo2fOnPremRedirect->OnpremValidateRedirect($authType, $otpToken );
312
- //change parameters as per your requirement but make sure other methods are not affected.
313
-
314
- }else{
315
-
316
- if ( ! MO2f_Utility::is_curl_installed() and !MO2F_IS_ONPREM ) {
317
- $message = 'Please enable curl extension. <a href="admin.php?page=mo_2fa_troubleshooting">Click here</a> for the steps to enable curl.';
318
-
319
- return json_encode( array( "status" => 'ERROR', "message" => $message ) );
320
- }
321
-
322
- $url = MO_HOST_NAME . '/moas/api/auth/validate';
323
- $mo2fApi= new Mo2f_Api();
324
- /* The customer Key provided to you */
325
- $customerKey = $cKey;
326
-
327
- /* The customer API Key provided to you */
328
- $apiKey = $customerApiKey;
329
-
330
- /* Current time in milliseconds since midnight, January 1, 1970 UTC. */
331
- $currentTimeInMillis = $mo2fApi->get_timestamp();
332
-
333
- /* Creating the Hash using SHA-512 algorithm */
334
- $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
335
- $hashValue = hash( "sha512", $stringToHash );
336
-
337
- $headers = $mo2fApi->get_http_header_array();
338
- $fields = '';
339
- if ( $authType == 'SOFT TOKEN' || $authType == 'GOOGLE AUTHENTICATOR' ) {
340
- /*check for soft token*/
341
- $fields = array(
342
- 'customerKey' => $customerKey,
343
- 'username' => $username,
344
- 'token' => $otpToken,
345
- 'authType' => $authType
346
- );
347
- } else if ( $authType == 'KBA' ) {
348
- if(MO2F_IS_ONPREM){
349
- $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
350
- if(isset($_POST['validate'])){
351
- $user_id = wp_get_current_user()->ID;
352
- }
353
- else{
354
- $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
355
- }
356
- $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
357
- $kba_ans_1 = sanitize_text_field( $_POST['mo2f_answer_1'] );
358
- $kba_ans_2 = sanitize_text_field( $_POST['mo2f_answer_2'] );
359
- $questions_challenged = get_user_meta($user_id ,'kba_questions_user');
360
- $questions_challenged = $questions_challenged[0];
361
- $all_ques_ans = (get_user_meta($user_id , 'mo2f_kba_challenge'));
362
- $all_ques_ans = $all_ques_ans[0];
363
- $ans_1 = $all_ques_ans[$questions_challenged[0]];
364
- $ans_2 = $all_ques_ans[$questions_challenged[1]];
365
- $check_trust_device = isset( $_POST['mo2f_trust_device'] ) ? $_POST['mo2f_trust_device'] : 'false';
366
- $mo2f_rba_status = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_rba_status',$session_id_encrypt );
367
-
368
- $pass2fa = new Miniorange_Password_2Factor_Login;
369
- $twofa_Settings = new Miniorange_Authentication;
370
-
371
- if(!strcmp(md5($kba_ans_1),$ans_1 ) && !strcmp(md5($kba_ans_2), $ans_2) ){
372
- if(isset($_POST['validate'])){
373
-
374
- update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "COMPLETED_TEST" ) );
375
- delete_user_meta( $user_id, 'test_2FA' );
376
- $twofa_Settings->mo_auth_show_success_message();
377
- }
378
- else{
379
- $pass2fa->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
380
- }
381
- }
382
- else {
383
-
384
- if(isset($_POST['validate'])){
385
- update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "INVALID_ANSWERS" ) );
386
- do_action('wpns_show_message', get_option( 'mo2f_message' ), 'ERROR');
387
- }
388
- else{
389
- $mo2fa_login_message = 'The answers you have provided are incorrect.';
390
- $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_KBA_AUTHENTICATION';
391
- $question_answers = get_user_meta($user_id , 'mo2f_kba_challenge', true);
392
- $challenge_questions = array_keys($question_answers);
393
- $random_keys = array_rand($challenge_questions,2);
394
- $challenge_ques1 = $challenge_questions[$random_keys[0]];
395
- $challenge_ques2 = $challenge_questions[$random_keys[1]];
396
- $questions = array($challenge_ques1,$challenge_ques2);
397
- update_user_meta( $user_id, 'kba_questions_user', $questions );
398
- $mo2f_kbaquestions = $questions;
399
- $pass2fa->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt);
400
- }
401
- }
402
-
403
- }
404
- else{
405
- $fields = array(
406
- 'txId' => $transactionId,
407
- 'answers' => array(
408
- array(
409
- 'question' => $otpToken[0],
410
- 'answer' => $otpToken[1]
411
- ),
412
- array(
413
- 'question' => $otpToken[2],
414
- 'answer' => $otpToken[3]
415
- )
416
- )
417
- );
418
- }
419
- } else {
420
- //*check for otp over sms/email
421
- $fields = array(
422
- 'txId' => $transactionId,
423
- 'token' => $otpToken
424
- );
425
- }
426
- $field_string = json_encode( $fields );
427
-
428
-
429
- $content = $mo2fApi->make_curl_call( $url, $field_string, $headers );
430
- }
431
-
432
- return $content;
433
- }
434
-
435
- function submit_contact_us( $q_email, $q_phone, $query ) {
436
- if ( ! MO2f_Utility::is_curl_installed() ) {
437
- $message = 'Please enable curl extension. <a href="admin.php?page=mo_2fa_troubleshooting">Click here</a> for the steps to enable curl.';
438
-
439
- return json_encode( array( "status" => 'ERROR', "message" => $message ) );
440
- }
441
-
442
- $url = MO_HOST_NAME . "/moas/rest/customer/contact-us";
443
- global $user;
444
- $user = wp_get_current_user();
445
- $is_nc_with_1_user = get_option( 'mo2f_is_NC' ) && get_option( 'mo2f_is_NNC' );
446
- $is_ec_with_1_user = ! get_option( 'mo2f_is_NC' );
447
-
448
- $mo2fApi= new Mo2f_Api();
449
- $customer_feature = "";
450
-
451
- if ( $is_ec_with_1_user ) {
452
- $customer_feature = "V1";
453
- } else if ( $is_nc_with_1_user ) {
454
- $customer_feature = "V3";
455
- }
456
- global $moWpnsUtility;
457
-
458
- $query = '[WordPress 2 Factor Authentication Plugin: ' . $customer_feature . ' - V '.MO2F_VERSION.'- Ticket Id:'.$moWpnsUtility->getFeatureStatus().']: ' . $query;
459
- $fields = array(
460
- 'firstName' => $user->user_firstname,
461
- 'lastName' => $user->user_lastname,
462
- 'company' => $_SERVER['SERVER_NAME'],
463
- 'email' => $q_email,
464
- 'ccEmail' => '2fasupport@xecurify.com',
465
- 'phone' => $q_phone,
466
- 'query' => $query
467
- );
468
- $field_string = json_encode( $fields );
469
-
470
- $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
471
-
472
- $content = $mo2fApi->make_curl_call( $url, $field_string );
473
-
474
- return true;
475
- }
476
 
 
477
  }
478
 
479
 
480
- ?>
25
 
26
  include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR.'mo2f_api.php';
27
 
28
+ class Customer_Setup extends Customer_Cloud_Setup {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
+ //all parent methods
31
  }
32
 
33
 
34
+ ?>
api/class-rba-attributes.php CHANGED
@@ -137,15 +137,17 @@ class Miniorange_Rba_Attributes {
137
  if(MO2F_IS_ONPREM){
138
  include_once dirname(dirname( __FILE__ )) . DIRECTORY_SEPARATOR. 'handler'.DIRECTORY_SEPARATOR. 'twofa' . DIRECTORY_SEPARATOR . 'gaonprem.php';
139
  $gauth_obj= new Google_auth_onpremise();
140
- $content=$gauth_obj->verifyCode($_SESSION['secret_ga'] , $otptoken );
 
141
  $value = json_decode($content,true);
142
  if($value['status'] == 'SUCCESS'){
143
  $user = wp_get_current_user();
144
  $user_id = $user->ID;
145
- $gauth_obj->mo_GAuth_set_secret($user_id, $_SESSION['secret_ga']);
146
  update_user_meta($user_id,'mo2f_2FA_method_to_configure','Google Authenticator');
147
  update_user_meta( $user_id, 'mo2f_external_app_type', "Google Authenticator" );
148
- update_user_meta($user_id, 'currentMethod','Google Authenticator');
 
149
  }
150
  }else{
151
  if ( ! MO2f_Utility::is_curl_installed() ) {
@@ -168,7 +170,6 @@ class Miniorange_Rba_Attributes {
168
  $content = $mo2fApi->make_curl_call( $url, $field_string, $http_header_array );
169
  }
170
 
171
- // return $mo2fApi->make_curl_call( $url, $field_string, $http_header_array );
172
  return $content;
173
  }
174
 
137
  if(MO2F_IS_ONPREM){
138
  include_once dirname(dirname( __FILE__ )) . DIRECTORY_SEPARATOR. 'handler'.DIRECTORY_SEPARATOR. 'twofa' . DIRECTORY_SEPARATOR . 'gaonprem.php';
139
  $gauth_obj= new Google_auth_onpremise();
140
+ $secret = isset($_SESSION['secret_ga'])? $_SESSION['secret_ga'] : $secret;
141
+ $content=$gauth_obj->verifyCode($secret , $otptoken );
142
  $value = json_decode($content,true);
143
  if($value['status'] == 'SUCCESS'){
144
  $user = wp_get_current_user();
145
  $user_id = $user->ID;
146
+ $gauth_obj->mo_GAuth_set_secret($user_id, $secret);
147
  update_user_meta($user_id,'mo2f_2FA_method_to_configure','Google Authenticator');
148
  update_user_meta( $user_id, 'mo2f_external_app_type', "Google Authenticator" );
149
+ global $Mo2fdbQueries;//might not need this
150
+ $Mo2fdbQueries->update_user_details( $user_id, array('mo2f_configured_2FA_method' =>'Google Authenticator') );
151
  }
152
  }else{
153
  if ( ! MO2f_Utility::is_curl_installed() ) {
170
  $content = $mo2fApi->make_curl_call( $url, $field_string, $http_header_array );
171
  }
172
 
 
173
  return $content;
174
  }
175
 
api/class-two-factor-setup.php CHANGED
@@ -133,46 +133,65 @@ class Two_Factor_Setup {
133
  }
134
 
135
  function mo2f_update_userinfo( $email, $authType, $phone, $tname, $enableAdminSecondFactor ) {
 
 
 
 
136
 
137
- if ( ! MO2f_Utility::is_curl_installed() ) {
138
- return $this->get_curl_error_message();
139
- }
140
-
141
- $url = MO_HOST_NAME . '/moas/api/admin/users/update';
142
- $customerKey = get_option( 'mo2f_customerKey' );
143
- $fields = array(
144
- 'customerKey' => $customerKey,
145
- 'username' => $email,
146
- 'phone' => $phone,
147
- 'authType' => $authType,
148
- 'transactionName' => $tname,
149
- 'adminLoginSecondFactor' => $enableAdminSecondFactor
150
- );
151
-
152
- $mo2fApi= new Mo2f_Api();
153
-
154
- $http_header_array = $mo2fApi->get_http_header_array();
155
 
156
- return $mo2fApi->make_curl_call( $url, $fields, $http_header_array );
157
- }
158
 
159
- function register_kba_details( $email, $question1, $answer1, $question2, $answer2, $question3, $answer3 ) {
160
 
161
- if ( ! MO2f_Utility::is_curl_installed() ) {
162
- return $this->get_curl_error_message();
163
- }
 
 
 
 
 
164
 
165
- $url = MO_HOST_NAME . '/moas/api/auth/register';
166
- $customerKey = get_option( 'mo2f_customerKey' );
167
- $q_and_a_list = "[{\"question\":\"" . $question1 . "\",\"answer\":\"" . $answer1 . "\" },{\"question\":\"" . $question2 . "\",\"answer\":\"" . $answer2 . "\" },{\"question\":\"" . $question3 . "\",\"answer\":\"" . $answer3 . "\" }]";
168
- $field_string = "{\"customerKey\":\"" . $customerKey . "\",\"username\":\"" . $email . "\",\"questionAnswerList\":" . $q_and_a_list . "}";
169
-
170
- $mo2fApi= new Mo2f_Api();
171
- $http_header_array = $mo2fApi->get_http_header_array();
172
 
173
- return $mo2fApi->make_curl_call( $url, $field_string, $http_header_array );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
 
175
  }
176
  }
177
 
178
- ?>
133
  }
134
 
135
  function mo2f_update_userinfo( $email, $authType, $phone, $tname, $enableAdminSecondFactor ) {
136
+ $cloud_methods = array('MOBILE AUTHENTICATION','PUSH NOTIFICATIONS','SMS', 'SOFT TOKEN');
137
+ if(MO2F_IS_ONPREM and !in_array($authType, $cloud_methods)){
138
+ $response=json_encode(array("status"=>'SUCCESS'));
139
+ }else {
140
 
141
+ if ( ! MO2f_Utility::is_curl_installed() ) {
142
+ return $this->get_curl_error_message();
143
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
 
145
+ $url = MO_HOST_NAME . '/moas/api/admin/users/update';
146
+ $customerKey = get_option( 'mo2f_customerKey' );
147
 
 
148
 
149
+ $fields = array(
150
+ 'customerKey' => $customerKey,
151
+ 'username' => $email,
152
+ 'phone' => $phone,
153
+ 'authType' => $authType,
154
+ 'transactionName' => $tname,
155
+ 'adminLoginSecondFactor' => $enableAdminSecondFactor
156
+ );
157
 
158
+ $mo2fApi = new Mo2f_Api();
159
+
160
+ $http_header_array = $mo2fApi->get_http_header_array();
 
 
 
 
161
 
162
+ $response= $mo2fApi->make_curl_call( $url, $fields, $http_header_array );
163
+ }
164
+ return $response;
165
+ }
166
+
167
+ function register_kba_details( $email, $question1, $answer1, $question2, $answer2, $question3, $answer3, $user_id=null ) {
168
+
169
+ if(MO2F_IS_ONPREM){
170
+ $answer1 = md5($answer1);
171
+ $answer2 = md5($answer2);
172
+ $answer3 = md5($answer3);
173
+ $question_answer = array($question1 => $answer1 ,$question2 => $answer2 , $question3 => $answer3 );
174
+ update_user_meta( $user_id , 'mo2f_kba_challenge', $question_answer );
175
+ global $Mo2fdbQueries;
176
+ $Mo2fdbQueries->update_user_details( $user_id, array('mo2f_configured_2FA_method' =>'Security Questions') );
177
+ $response=json_encode(array("status"=>'SUCCESS'));
178
+ }else {
179
+ if ( ! MO2f_Utility::is_curl_installed() ) {
180
+ return $this->get_curl_error_message();
181
+ }
182
+
183
+ $url = MO_HOST_NAME . '/moas/api/auth/register';
184
+ $customerKey = get_option( 'mo2f_customerKey' );
185
+ $q_and_a_list = "[{\"question\":\"" . $question1 . "\",\"answer\":\"" . $answer1 . "\" },{\"question\":\"" . $question2 . "\",\"answer\":\"" . $answer2 . "\" },{\"question\":\"" . $question3 . "\",\"answer\":\"" . $answer3 . "\" }]";
186
+ $field_string = "{\"customerKey\":\"" . $customerKey . "\",\"username\":\"" . $email . "\",\"questionAnswerList\":" . $q_and_a_list . "}";
187
+
188
+ $mo2fApi = new Mo2f_Api();
189
+ $http_header_array = $mo2fApi->get_http_header_array();
190
+
191
+ $response= $mo2fApi->make_curl_call( $url, $field_string, $http_header_array );
192
+ }
193
+ return $response;
194
 
195
  }
196
  }
197
 
 
controllers/PointersManager.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mo2FAPointersManager {
4
+
5
+ private $pfile;
6
+ private $version;
7
+ private $prefix;
8
+ private $pointers = array();
9
+
10
+ public function __construct( $file, $version, $prefix ) {
11
+ $this->pfile = file_exists( $file ) ? $file : FALSE;
12
+ $this->version = str_replace( '.', '_', $version );
13
+ $this->prefix = $prefix;
14
+ }
15
+
16
+ public function parse() {
17
+ if ( empty( $this->pfile ) ) return;
18
+ $pointers = (array) require_once $this->pfile;
19
+ if ( empty($pointers) ) return;
20
+ foreach ( $pointers as $i => $pointer ) {
21
+ if(is_array($pointer)){
22
+ $pointer['id'] = "{$this->prefix}{$this->version}_{$i}";
23
+ $this->pointers[$pointer['id']] = (object) $pointer;
24
+ }
25
+ }
26
+ }
27
+
28
+ public function filter( $page ) {
29
+ if ( empty( $this->pointers ) ) return array();
30
+ $uid = get_current_user_id();
31
+ $visited = explode( ',', (string) get_user_meta( $uid, 'mo2f_visited_pointers', TRUE ) );
32
+
33
+ $active_ids = array_diff( array_keys( $this->pointers ), $visited );
34
+
35
+
36
+ $good = array();
37
+
38
+ foreach( $this->pointers as $i => $pointer ) {
39
+ if (
40
+ in_array( $i, $active_ids, TRUE ) // is active
41
+ && isset( $pointer->where ) // has where
42
+ && in_array( $page, (array) $pointer->where, TRUE ) // current page is in where
43
+ ) {
44
+ $good[] = $pointer;
45
+ }
46
+ }
47
+ $count = count( $good );
48
+ if ( $good === 0 ) return array();
49
+ foreach( array_values( $good ) as $i => $pointer ) {
50
+ $good[$i]->next = $i+1 < $count ? $good[$i+1]->id : '';
51
+ }
52
+ return $good;
53
+ }
54
+ }
controllers/account.php CHANGED
@@ -21,7 +21,7 @@
21
  }
22
 
23
  $user = wp_get_current_user();
24
- $mo2f_current_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $user->ID);
25
 
26
  if((get_option('mo_wpns_registration_status') == 'MO_OTP_DELIVERED_SUCCESS'
27
  || get_option('mo_wpns_registration_status') == 'MO_OTP_VALIDATION_FAILURE'
@@ -39,22 +39,20 @@
39
  {
40
  delete_option ( 'password_mismatch' );
41
  update_option ( 'mo_wpns_new_registration', 'true' );
42
- $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => 'REGISTRATION_STARTED' ) );
43
  include $mo2f_dirName . 'views'.DIRECTORY_SEPARATOR.'account'.DIRECTORY_SEPARATOR.'register.php';
44
  }
45
  else
46
  {
47
- $email = get_option('mo2f_email');
48
- $key = get_option('mo2f_customerKey');
49
- $api = get_option('mo2f_api_key');
50
- $token = get_option('mo2f_customer_token');
 
 
51
  include $mo2f_dirName . 'views'.DIRECTORY_SEPARATOR.'account'.DIRECTORY_SEPARATOR.'profile.php';
52
  }
53
 
54
-
55
-
56
-
57
-
58
  /* REGISTRATION RELATED FUNCTIONS */
59
 
60
  //Function to register new customer
@@ -103,14 +101,14 @@
103
 
104
  if(strcasecmp($customerKey['status'], 'SUCCESS') == 0)
105
  {
 
 
106
  save_success_customer_config($email, $customerKey['id'], $customerKey['apiKey'], $customerKey['token'], $customerKey['appSecret']);
107
  _get_current_customer($email,$password);
108
  }
109
 
110
  break;
111
  default:
112
- /*update_option('mo_wpns_verify_customer','true');
113
- $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_VERIFY_CUSTOMER' ) );*/
114
  _get_current_customer($email,$password);
115
  break;
116
  }
@@ -122,7 +120,7 @@
122
  global $Mo2fdbQueries;
123
  $user = wp_get_current_user();
124
  update_option('mo_wpns_verify_customer','true');
125
- $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_VERIFY_CUSTOMER' ) );
126
  }
127
 
128
  //Function to go back to the registration page
@@ -133,7 +131,7 @@
133
  delete_option('mo2f_email');
134
  delete_option('mo_wpns_registration_status');
135
  delete_option('mo_wpns_verify_customer');
136
- $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => '' ) );
137
  }
138
 
139
 
@@ -163,17 +161,6 @@
163
  }
164
 
165
 
166
- //Function to validate OTP
167
-
168
-
169
-
170
-
171
-
172
-
173
- //Function to send OTP token
174
-
175
-
176
-
177
  //Function to get customer details
178
  function _get_current_customer($email,$password)
179
  {
@@ -186,15 +173,23 @@
186
  {
187
  if(isset($customerKey['phone'])){
188
  update_option( 'mo_wpns_admin_phone', $customerKey['phone'] );
189
- $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo2f_user_phone' => $customerKey['phone'] ) );
190
  }
191
  update_option('mo2f_email',$email);
 
192
  save_success_customer_config($email, $customerKey['id'], $customerKey['apiKey'], $customerKey['token'], $customerKey['appSecret']);
193
  do_action('wpns_show_message',MoWpnsMessages::showMessage('REG_SUCCESS'),'SUCCESS');
 
 
 
 
 
 
 
 
194
  }
195
  else
196
  {
197
- $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_VERIFY_CUSTOMER' ) );
198
  update_option('mo_wpns_verify_customer', 'true');
199
  delete_option('mo_wpns_new_registration');
200
  do_action('wpns_show_message',MoWpnsMessages::showMessage('ACCOUNT_EXISTS'),'ERROR');
@@ -215,26 +210,17 @@
215
  update_option( 'mo_wpns_enable_log_requests' , true );
216
  update_option( 'mo2f_miniorange_admin', $user->ID );
217
  update_option( 'mo_2factor_admin_registration_status', 'MO_2_FACTOR_CUSTOMER_REGISTERED_SUCCESS' );
 
218
 
219
- if (get_option('mo_wpns_upgrade_onprem'))
220
- {
221
- ?>
222
- <script>location.reload(true);</script>
223
- <?php
224
- }
225
- // update_option( 'mo_wpns_upgrade_onprem' , 0);
226
- $Mo2fdbQueries->insert_user( $user->ID );
227
- $Mo2fdbQueries->update_user_details( $user->ID, array(
228
- 'mo2f_EmailVerification_config_status' => get_option( 'mo2f_is_NC' ) == 0 ? true : false,
229
- 'mo2f_user_email' => $email,
230
- 'user_registration_with_miniorange' => 'SUCCESS',
231
- 'mo2f_2factor_enable_2fa_byusers' => 1,
232
- 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_PLUGIN_SETTINGS'
233
- ) );
234
  $enduser = new Two_Factor_Setup();
235
  $userinfo = json_decode( $enduser->mo2f_get_userinfo( $email ), true );
 
236
  $mo2f_second_factor = 'NONE';
237
- if ( json_last_error() == JSON_ERROR_NONE ) {
238
  if ( $userinfo['status'] == 'SUCCESS' ) {
239
  $mo2f_second_factor = mo2f_update_and_sync_user_two_factor( $user->ID, $userinfo );
240
  }
@@ -247,10 +233,6 @@
247
  $configured_2FA_method = MO2f_Utility::mo2f_decode_2_factor( $mo2f_second_factor, "servertowpdb" );
248
  if ( get_option( 'mo2f_is_NC' ) == 0 ) {
249
  $auth_method_abr = str_replace( ' ', '', $configured_2FA_method );
250
- $Mo2fdbQueries->update_user_details( $user->ID, array(
251
- 'mo2f_configured_2FA_method' => $configured_2FA_method,
252
- 'mo2f_' . $auth_method_abr . '_config_status' => true
253
- ) );
254
  } else {
255
  if ( in_array( $configured_2FA_method, array(
256
  'Email Verification',
@@ -273,7 +255,16 @@
273
  $mo2f_customer_selected_plan = get_option( 'mo2f_customer_selected_plan' );
274
  if ( ! empty( $mo2f_customer_selected_plan ) ) {
275
  delete_option( 'mo2f_customer_selected_plan' );
276
- header( 'Location: admin.php?page=mo_2fa_upgrade' );
 
 
 
 
 
 
 
 
 
277
  } else if ( $mo2f_second_factor == 'NONE' ) {
278
  if(get_user_meta( $user->ID, 'register_account_popup', true)){
279
  update_user_meta( $user->ID, 'configure_2FA', 1 );
@@ -285,4 +276,4 @@
285
  delete_option( 'mo_wpns_verify_customer' );
286
  delete_option( 'mo_wpns_registration_status' );
287
  delete_option( 'mo_wpns_password' );
288
- }
21
  }
22
 
23
  $user = wp_get_current_user();
24
+ $mo2f_current_registration_status = get_option( 'mo_2factor_user_registration_status');
25
 
26
  if((get_option('mo_wpns_registration_status') == 'MO_OTP_DELIVERED_SUCCESS'
27
  || get_option('mo_wpns_registration_status') == 'MO_OTP_VALIDATION_FAILURE'
39
  {
40
  delete_option ( 'password_mismatch' );
41
  update_option ( 'mo_wpns_new_registration', 'true' );
42
+ update_option('mo_2factor_user_registration_status','REGISTRATION_STARTED');
43
  include $mo2f_dirName . 'views'.DIRECTORY_SEPARATOR.'account'.DIRECTORY_SEPARATOR.'register.php';
44
  }
45
  else
46
  {
47
+ $email = get_option('mo2f_email');
48
+ $key = get_option('mo2f_customerKey');
49
+ $api = get_option('mo2f_api_key');
50
+ $token = get_option('mo2f_customer_token');
51
+ $EmailTransactions = get_site_option('cmVtYWluaW5nT1RQ')? get_site_option('cmVtYWluaW5nT1RQ') : 0;
52
+ $SMSTransactions = get_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z')?get_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z'):0;
53
  include $mo2f_dirName . 'views'.DIRECTORY_SEPARATOR.'account'.DIRECTORY_SEPARATOR.'profile.php';
54
  }
55
 
 
 
 
 
56
  /* REGISTRATION RELATED FUNCTIONS */
57
 
58
  //Function to register new customer
101
 
102
  if(strcasecmp($customerKey['status'], 'SUCCESS') == 0)
103
  {
104
+ update_site_option(base64_encode("totalUsersCloud"),get_site_option(base64_encode("totalUsersCloud"))+1);
105
+ update_option( 'mo2f_email', $email );
106
  save_success_customer_config($email, $customerKey['id'], $customerKey['apiKey'], $customerKey['token'], $customerKey['appSecret']);
107
  _get_current_customer($email,$password);
108
  }
109
 
110
  break;
111
  default:
 
 
112
  _get_current_customer($email,$password);
113
  break;
114
  }
120
  global $Mo2fdbQueries;
121
  $user = wp_get_current_user();
122
  update_option('mo_wpns_verify_customer','true');
123
+ update_option('mo_2factor_user_registration_status','MO_2_FACTOR_VERIFY_CUSTOMER');
124
  }
125
 
126
  //Function to go back to the registration page
131
  delete_option('mo2f_email');
132
  delete_option('mo_wpns_registration_status');
133
  delete_option('mo_wpns_verify_customer');
134
+ update_option('mo_2factor_user_registration_status','');
135
  }
136
 
137
 
161
  }
162
 
163
 
 
 
 
 
 
 
 
 
 
 
 
164
  //Function to get customer details
165
  function _get_current_customer($email,$password)
166
  {
173
  {
174
  if(isset($customerKey['phone'])){
175
  update_option( 'mo_wpns_admin_phone', $customerKey['phone'] );
 
176
  }
177
  update_option('mo2f_email',$email);
178
+
179
  save_success_customer_config($email, $customerKey['id'], $customerKey['apiKey'], $customerKey['token'], $customerKey['appSecret']);
180
  do_action('wpns_show_message',MoWpnsMessages::showMessage('REG_SUCCESS'),'SUCCESS');
181
+ update_site_option(base64_encode("totalUsersCloud"),get_site_option(base64_encode("totalUsersCloud"))+1);
182
+ $customerT = new Customer_Cloud_Setup();
183
+ $content = json_decode( $customerT->get_customer_transactions( get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
184
+ if(isset($content['smsRemaining']))
185
+ update_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z',$content['smsRemaining']);
186
+ else
187
+ update_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z',0);
188
+
189
  }
190
  else
191
  {
192
+ update_option('mo_2factor_user_registration_status','MO_2_FACTOR_VERIFY_CUSTOMER' );
193
  update_option('mo_wpns_verify_customer', 'true');
194
  delete_option('mo_wpns_new_registration');
195
  do_action('wpns_show_message',MoWpnsMessages::showMessage('ACCOUNT_EXISTS'),'ERROR');
210
  update_option( 'mo_wpns_enable_log_requests' , true );
211
  update_option( 'mo2f_miniorange_admin', $user->ID );
212
  update_option( 'mo_2factor_admin_registration_status', 'MO_2_FACTOR_CUSTOMER_REGISTERED_SUCCESS' );
213
+ update_option( 'mo_2factor_user_registration_status', 'MO_2_FACTOR_PLUGIN_SETTINGS' );
214
 
215
+ $Mo2fdbQueries->update_user_details( $user->ID, array(
216
+ 'mo2f_user_email' => $email,
217
+ 'user_registration_with_miniorange' => 'SUCCESS'
218
+ ) );
 
 
 
 
 
 
 
 
 
 
 
219
  $enduser = new Two_Factor_Setup();
220
  $userinfo = json_decode( $enduser->mo2f_get_userinfo( $email ), true );
221
+
222
  $mo2f_second_factor = 'NONE';
223
+ if ( json_last_error() == JSON_ERROR_NONE) {
224
  if ( $userinfo['status'] == 'SUCCESS' ) {
225
  $mo2f_second_factor = mo2f_update_and_sync_user_two_factor( $user->ID, $userinfo );
226
  }
233
  $configured_2FA_method = MO2f_Utility::mo2f_decode_2_factor( $mo2f_second_factor, "servertowpdb" );
234
  if ( get_option( 'mo2f_is_NC' ) == 0 ) {
235
  $auth_method_abr = str_replace( ' ', '', $configured_2FA_method );
 
 
 
 
236
  } else {
237
  if ( in_array( $configured_2FA_method, array(
238
  'Email Verification',
255
  $mo2f_customer_selected_plan = get_option( 'mo2f_customer_selected_plan' );
256
  if ( ! empty( $mo2f_customer_selected_plan ) ) {
257
  delete_option( 'mo2f_customer_selected_plan' );
258
+
259
+ if (get_option('mo2f_planname') == 'addon_plan')
260
+ {
261
+ ?><script>window.location.href="admin.php?page=mo_2fa_addons";</script><?php
262
+ }
263
+ else
264
+ {
265
+ ?><script>window.location.href="admin.php?page=mo_2fa_upgrade";</script><?php
266
+ }
267
+
268
  } else if ( $mo2f_second_factor == 'NONE' ) {
269
  if(get_user_meta( $user->ID, 'register_account_popup', true)){
270
  update_user_meta( $user->ID, 'configure_2FA', 1 );
276
  delete_option( 'mo_wpns_verify_customer' );
277
  delete_option( 'mo_wpns_registration_status' );
278
  delete_option( 'mo_wpns_password' );
279
+ }
controllers/addons.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ global $moWpnsUtility,$mo2f_dirName;
4
+
5
+ include $mo2f_dirName . 'views'.DIRECTORY_SEPARATOR.'addons.php';
controllers/advanced-blocking.php CHANGED
@@ -43,8 +43,7 @@
43
  $ip_range = get_option("mo_wpns_iprange_range_".$i);
44
  if($ip_range){
45
  $a = explode('-', $ip_range);
46
- /*$start = array();
47
- $end = array();*/
48
  $start[$i] = $a[0];
49
  $end[$i] = $a[1];
50
  }
43
  $ip_range = get_option("mo_wpns_iprange_range_".$i);
44
  if($ip_range){
45
  $a = explode('-', $ip_range);
46
+
 
47
  $start[$i] = $a[0];
48
  $end[$i] = $a[1];
49
  }
controllers/dashboard_ajax.php CHANGED
@@ -79,8 +79,13 @@ class Mo2f_ajax_dashboard
79
  if($POSTED){
80
  update_site_option('mo_2f_switch_waf', 1);
81
  update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
82
- if($_POST['option'] == 'tab_waf_switch')
83
- do_action('wpns_show_message',MoWpnsMessages::showMessage('WAF_ENABLE'),'SUCCESS');
 
 
 
 
 
84
  }
85
  else{
86
  update_site_option('mo_2f_switch_waf', 0);
@@ -107,8 +112,11 @@ class Mo2f_ajax_dashboard
107
  if($POSTED){
108
  update_site_option('mo_2f_switch_loginspam', 1);
109
  update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
 
 
110
  if($_POST['option'] == 'tab_login_switch')
111
  do_action('wpns_show_message',MoWpnsMessages::showMessage('LOGIN_ENABLE'),'SUCCESS');
 
112
  }
113
  else{
114
  update_site_option('mo_2f_switch_loginspam', 0);
@@ -138,8 +146,11 @@ class Mo2f_ajax_dashboard
138
  if($POSTED){
139
  update_site_option('mo_2f_switch_backup', 1);
140
  update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
 
 
141
  if($_POST['option'] == 'tab_backup_switch')
142
  do_action('wpns_show_message',MoWpnsMessages::showMessage('BACKUP_ENABLE'),'SUCCESS');
 
143
  }
144
  else{
145
  update_site_option('mo_2f_switch_backup', 0);
@@ -158,8 +169,11 @@ class Mo2f_ajax_dashboard
158
  if($POSTED){
159
  update_site_option('mo_2f_switch_malware', 1);
160
  update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
 
 
161
  if($_POST['option'] == 'tab_malware_switch')
162
  do_action('wpns_show_message',MoWpnsMessages::showMessage('MALWARE_ENABLE'),'SUCCESS');
 
163
  }else{
164
  update_site_option('mo_2f_switch_malware', 0);
165
  update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')-1);
@@ -172,8 +186,11 @@ class Mo2f_ajax_dashboard
172
  if($POSTED){
173
  update_site_option('mo_2f_switch_adv_block', 1);
174
  update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
 
 
175
  if($_POST['option'] == 'tab_block_switch')
176
  do_action('wpns_show_message',MoWpnsMessages::showMessage('ADV_BLOCK_ENABLE'),'SUCCESS');
 
177
  }
178
  else{
179
  update_site_option('mo_2f_switch_adv_block', 0);
79
  if($POSTED){
80
  update_site_option('mo_2f_switch_waf', 1);
81
  update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
82
+ if (isset($_POST['option'] ))
83
+ {
84
+ if($_POST['option'] == 'tab_waf_switch')
85
+ {
86
+ do_action('wpns_show_message',MoWpnsMessages::showMessage('WAF_ENABLE'),'SUCCESS');
87
+ }
88
+ }
89
  }
90
  else{
91
  update_site_option('mo_2f_switch_waf', 0);
112
  if($POSTED){
113
  update_site_option('mo_2f_switch_loginspam', 1);
114
  update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
115
+ if (isset($_POST['option'] ))
116
+ {
117
  if($_POST['option'] == 'tab_login_switch')
118
  do_action('wpns_show_message',MoWpnsMessages::showMessage('LOGIN_ENABLE'),'SUCCESS');
119
+ }
120
  }
121
  else{
122
  update_site_option('mo_2f_switch_loginspam', 0);
146
  if($POSTED){
147
  update_site_option('mo_2f_switch_backup', 1);
148
  update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
149
+ if (isset($_POST['option'] ))
150
+ {
151
  if($_POST['option'] == 'tab_backup_switch')
152
  do_action('wpns_show_message',MoWpnsMessages::showMessage('BACKUP_ENABLE'),'SUCCESS');
153
+ }
154
  }
155
  else{
156
  update_site_option('mo_2f_switch_backup', 0);
169
  if($POSTED){
170
  update_site_option('mo_2f_switch_malware', 1);
171
  update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
172
+ if (isset($_POST['option'] ))
173
+ {
174
  if($_POST['option'] == 'tab_malware_switch')
175
  do_action('wpns_show_message',MoWpnsMessages::showMessage('MALWARE_ENABLE'),'SUCCESS');
176
+ }
177
  }else{
178
  update_site_option('mo_2f_switch_malware', 0);
179
  update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')-1);
186
  if($POSTED){
187
  update_site_option('mo_2f_switch_adv_block', 1);
188
  update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
189
+ if (isset($_POST['option'] ))
190
+ {
191
  if($_POST['option'] == 'tab_block_switch')
192
  do_action('wpns_show_message',MoWpnsMessages::showMessage('ADV_BLOCK_ENABLE'),'SUCCESS');
193
+ }
194
  }
195
  else{
196
  update_site_option('mo_2f_switch_adv_block', 0);
controllers/feedback_footer.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ global $moWpnsUtility,$mo2f_dirName;
4
+
5
+ if(current_user_can( 'manage_options' ) && isset($_POST['option']))
6
+ {
7
+ switch($_POST['option'])
8
+ {
9
+ case "mo_wpns_send_query":
10
+ wpns_handle_support_form($_POST['query_email'],$_POST['query'],$_POST['query_phone']); break;
11
+ }
12
+ }
13
+
14
+ $current_user = wp_get_current_user();
15
+ $email = get_option("mo2f_email");
16
+ $phone = get_option("mo_wpns_admin_phone");
17
+
18
+
19
+ /* SUPPORT FORM RELATED FUNCTIONS */
20
+
21
+ //Function to handle support form submit
22
+ function wpns_handle_support_form($email,$query,$phone)
23
+ {
24
+
25
+ if( empty($email) || empty($query) )
26
+ {
27
+ do_action('wpns_show_message',MoWpnsMessages::showMessage('SUPPORT_FORM_VALUES'),'SUCCESS');
28
+ return;
29
+ }
30
+
31
+
32
+ $query = sanitize_text_field( $query );
33
+ $email = sanitize_text_field( $email );
34
+ $phone = sanitize_text_field( $phone );
35
+ $contact_us = new MocURL();
36
+ $submited = json_decode($contact_us->submit_contact_us($email, $phone, $query),true);
37
+
38
+ if(json_last_error() == JSON_ERROR_NONE && $submited)
39
+ {
40
+ do_action('wpns_show_message',MoWpnsMessages::showMessage('SUPPORT_FORM_SENT'),'SUCCESS');
41
+ return;
42
+ }
43
+
44
+ do_action('wpns_show_message',MoWpnsMessages::showMessage('SUPPORT_FORM_ERROR'),'ERROR');
45
+ }
46
+
47
+ include $mo2f_dirName . 'views'.DIRECTORY_SEPARATOR.'feedback_footer.php';
controllers/feedback_form.php DELETED
@@ -1,71 +0,0 @@
1
- <?php
2
- global $moWpnsUtility, $mo2f_dirName;
3
-
4
- function wpns_handle_skip_feedback($postdata){
5
- do_action('wpns_show_message',MoWpnsMessages::showMessage('FEEDBACK'),'CUSTOM_MESSAGE');
6
- deactivate_plugins( __FILE__ );
7
- }
8
-
9
- function wpns_handle_feedback($postdata)
10
- {
11
-
12
- $user = wp_get_current_user();
13
-
14
- $message = 'Plugin Deactivated';
15
-
16
- $deactivate_reason_message = array_key_exists('query_feedback', $_POST) ? htmlspecialchars($_POST['query_feedback']) : false;
17
-
18
-
19
- $reply_required = '';
20
- if (isset($_POST['get_reply']))
21
- $reply_required = htmlspecialchars($_POST['get_reply']);
22
- if (empty($reply_required)) {
23
- $reply_required = "don't reply";
24
- $message .= '<b style="color:red";> &nbsp; [Reply :' . $reply_required . ']</b>';
25
- } else {
26
- $reply_required = "yes";
27
- $message .= '[Reply :' . $reply_required . ']';
28
- }
29
-
30
-
31
- $message .= ', Feedback : ' . $deactivate_reason_message . '';
32
-
33
- if (isset($_POST['rate']))
34
- $rate_value = htmlspecialchars($_POST['rate']);
35
-
36
- $message .= ', [Rating :' . $rate_value . ']';
37
-
38
- $email = $_POST['query_mail'];
39
- if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
40
- $email = get_option('mo2f_email');
41
- if (empty($email))
42
- $email = $user->user_email;
43
- }
44
- $phone = get_option('mo_wpns_admin_phone');
45
- $feedback_reasons = new Customersaml();
46
- if (!is_null($feedback_reasons)) {
47
- if (!mo_saml_is_curl_installed()) {
48
- deactivate_plugins(__FILE__);
49
- wp_redirect('plugins.php');
50
- } else {
51
- $submited = json_decode($feedback_reasons->send_email_alert($email, $phone, $message), true);
52
- if (json_last_error() == JSON_ERROR_NONE) {
53
- if (is_array($submited) && array_key_exists('status', $submited) && $submited['status'] == 'ERROR') {
54
- update_option('mo_saml_message', $submited['message']);
55
- $this->mo_saml_show_error_message();
56
-
57
- } else {
58
- if ($submited == false) {
59
-
60
- update_option('mo_saml_message', 'Error while submitting the query.');
61
- $this->mo_saml_show_error_message();
62
- }
63
- }
64
- }
65
-
66
- deactivate_plugins(__FILE__);
67
- update_option('mo_saml_message', 'Thank you for the feedback.');
68
- $this->mo_saml_show_success_message();
69
- }
70
- }
71
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
controllers/ip-blocking.php CHANGED
@@ -38,7 +38,6 @@
38
 
39
  if( $moWpnsUtility->check_empty_or_null( $ip) )
40
  {
41
- //do_action('wpns_show_message',MoWpnsMessages::showMessage('INVALID_IP'),'ERROR');
42
  //Improper message
43
  echo("empty IP");
44
  exit;
38
 
39
  if( $moWpnsUtility->check_empty_or_null( $ip) )
40
  {
 
41
  //Improper message
42
  echo("empty IP");
43
  exit;
controllers/main_controller.php CHANGED
@@ -9,10 +9,14 @@
9
  {
10
  include $controller . 'navbar.php';
11
  include $controller . 'newtork_security_features.php';
12
- if (!get_option('mo_wpns_2fa_with_network_security_popup_visible') && get_option('mo_wpns_2fa_with_network_security'))
13
- {
 
 
 
 
 
14
  include $controller . 'tour-model.php';
15
- }
16
 
17
  if( isset( $_GET[ 'page' ]))
18
  {
@@ -44,6 +48,8 @@
44
  include $controller . 'licensing.php'; break;
45
  case 'mo_2fa_troubleshooting':
46
  include $controller . 'troubleshooting.php'; break;
 
 
47
  case 'mo_2fa_malwarescan':
48
  include $controller . 'malware_scanner'.DIRECTORY_SEPARATOR.'scan_malware.php'; break;
49
  case 'mo_2fa_two_fa':
@@ -53,7 +59,6 @@
53
  }
54
  }
55
 
56
- include $controller . 'support.php';
57
  }
58
  else
59
  {
@@ -69,6 +74,7 @@
69
  }
70
 
71
  }
 
72
  ?>
73
  <?php //if(get_option('mo_wpns_scan_initialize')) { ?>
74
  <!-- <script>
@@ -92,4 +98,4 @@
92
  });
93
  });
94
  </script> -->
95
- <?php //} ?>
9
  {
10
  include $controller . 'navbar.php';
11
  include $controller . 'newtork_security_features.php';
12
+
13
+ $tour_started=get_option('mo2f_tour_started',0);
14
+
15
+
16
+ if($tour_started<1)
17
+ include $controller . 'two-fa-intro.php';
18
+ else if($tour_started != 0)
19
  include $controller . 'tour-model.php';
 
20
 
21
  if( isset( $_GET[ 'page' ]))
22
  {
48
  include $controller . 'licensing.php'; break;
49
  case 'mo_2fa_troubleshooting':
50
  include $controller . 'troubleshooting.php'; break;
51
+ case 'mo_2fa_addons':
52
+ include $controller . 'addons.php'; break;
53
  case 'mo_2fa_malwarescan':
54
  include $controller . 'malware_scanner'.DIRECTORY_SEPARATOR.'scan_malware.php'; break;
55
  case 'mo_2fa_two_fa':
59
  }
60
  }
61
 
 
62
  }
63
  else
64
  {
74
  }
75
 
76
  }
77
+ include $controller . 'feedback_footer.php';
78
  ?>
79
  <?php //if(get_option('mo_wpns_scan_initialize')) { ?>
80
  <!-- <script>
98
  });
99
  });
100
  </script> -->
101
+ <?php //} ?>
controllers/navbar.php CHANGED
@@ -59,6 +59,7 @@
59
  $reports_url = add_query_arg( array('page' => 'mo_2fa_reports' ), $_SERVER['REQUEST_URI'] );
60
  $license_url = add_query_arg( array('page' => 'mo_2fa_upgrade' ), $_SERVER['REQUEST_URI'] );
61
  $help_url = add_query_arg( array('page' => 'mo_2fa_troubleshooting' ), $_SERVER['REQUEST_URI'] );
 
62
  $content_protect= add_query_arg( array('page' => 'content_protect' ), $_SERVER['REQUEST_URI'] );
63
  $backup = add_query_arg( array('page' => 'mo_2fa_backup' ), $_SERVER['REQUEST_URI'] );
64
  $scan_url = add_query_arg( array('page' => 'mo_2fa_malwarescan' ), $_SERVER['REQUEST_URI'] );
@@ -69,6 +70,9 @@
69
  $request_demo_url = add_query_arg(array('page' => 'mo_2fa_request_demo' ), $_SERVER['REQUEST_URI']);
70
  //dynamic
71
  $logo_url = plugin_dir_url(dirname(__FILE__)) . 'includes/images/miniorange_logo.png';
 
 
 
72
  $shw_feedback = get_option('donot_show_feedback_message') ? false: true;
73
 
74
  $moPluginHandler= new MoWpnsHandler();
59
  $reports_url = add_query_arg( array('page' => 'mo_2fa_reports' ), $_SERVER['REQUEST_URI'] );
60
  $license_url = add_query_arg( array('page' => 'mo_2fa_upgrade' ), $_SERVER['REQUEST_URI'] );
61
  $help_url = add_query_arg( array('page' => 'mo_2fa_troubleshooting' ), $_SERVER['REQUEST_URI'] );
62
+ $addons_url = add_query_arg( array('page' => 'mo_2fa_addons' ), $_SERVER['REQUEST_URI'] );
63
  $content_protect= add_query_arg( array('page' => 'content_protect' ), $_SERVER['REQUEST_URI'] );
64
  $backup = add_query_arg( array('page' => 'mo_2fa_backup' ), $_SERVER['REQUEST_URI'] );
65
  $scan_url = add_query_arg( array('page' => 'mo_2fa_malwarescan' ), $_SERVER['REQUEST_URI'] );
70
  $request_demo_url = add_query_arg(array('page' => 'mo_2fa_request_demo' ), $_SERVER['REQUEST_URI']);
71
  //dynamic
72
  $logo_url = plugin_dir_url(dirname(__FILE__)) . 'includes/images/miniorange_logo.png';
73
+ $login_with_usename_only_url = plugin_dir_url(dirname(__FILE__)) . 'includes/images/login-with-password-and-2fa.png';
74
+ $hide_login_form_url = plugin_dir_url(dirname(__FILE__)) . 'includes/images/hide_login_form.png';
75
+ $new_url = plugin_dir_url(dirname(__FILE__)) . 'includes/images/new.png';
76
  $shw_feedback = get_option('donot_show_feedback_message') ? false: true;
77
 
78
  $moPluginHandler= new MoWpnsHandler();
controllers/newtork_security_features.php CHANGED
@@ -21,4 +21,4 @@
21
 
22
 
23
 
24
- include $mo2f_dirName . 'views'.DIRECTORY_SEPARATOR.'network_security_features.php';
21
 
22
 
23
 
24
+ // include $mo2f_dirName . 'views'.DIRECTORY_SEPARATOR.'network_security_features.php';
controllers/pointers.php ADDED
@@ -0,0 +1,640 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $pointers = array();
4
+ $tab= 'default';
5
+ if(array_key_exists('tab',$_GET))
6
+ $tab = $_GET['tab'];
7
+
8
+ if(get_option('mo2f_two_factor_tour')==1)
9
+ {
10
+ $pointers['default-miniorange-2fa-select-authentication'] = array(
11
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Select Authentication Method (Step 1 out of 10)' ) ),
12
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Choose your Two Factor authentication method.' ) ),
13
+ 'anchor_id' => '#mo2f_save_free_plan_auth_methods_form',
14
+ 'isdefault' => 'yes',
15
+ 'edge' => 'bottom',
16
+ 'align' => 'middle',
17
+ 'index' => 'default-miniorange-2fa-select-authentication',
18
+ 'where' => array( 'toplevel_page_mo_2fa_two_fa' ) // <-- Please note this
19
+ );
20
+ $pointers['default-miniorange-2fa-configure'] = array(
21
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Click on configure(Step 2 out of 10)' ) ),
22
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Setup the two-factor authentication here.' ) ),
23
+ 'anchor_id' => '#GoogleAuthenticator_configuration',
24
+ 'isdefault' => 'yes',
25
+ 'edge' => 'top',
26
+ 'align' => 'left',
27
+ 'index' => 'default-miniorange-2fa-configure',
28
+ 'where' => array( 'toplevel_page_mo_2fa_two_fa' ) // <-- Please note this
29
+ );
30
+
31
+ $pointers['default-miniorange-2fa-choose_app'] = array(
32
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Choose the app type(Step 1 out of 7)' ) ),
33
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Choose the app which you want to use as the second factor' ) ),
34
+ 'anchor_id' => '#mo2f_choose_app_tour',
35
+ 'isdefault' => 'yes',
36
+ 'edge' => 'left',
37
+ 'align' => 'left',
38
+ 'index' => 'default-miniorange-2fa-choose_app1',
39
+ 'where' => array( 'toplevel_page_mo_2fa_two_fa' ) // <-- Please note this
40
+ );
41
+
42
+ $pointers['default-miniorange-2fa-download_app'] = array(
43
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Download app(Step 2 out of 7)' ) ),
44
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'If you do not have app in your phone then you can donwload the app here.' ) ),
45
+ 'anchor_id' => '#links_to_apps_tour',
46
+ 'isdefault' => 'yes',
47
+ 'edge' => 'left',
48
+ 'align' => 'left',
49
+ 'index' => 'default-miniorange-2fa-download_app1',
50
+ 'where' => array( 'toplevel_page_mo_2fa_two_fa' ) // <-- Please note this
51
+ );
52
+
53
+
54
+ $pointers['default-miniorange-2fa-scan-qrcode'] = array(
55
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Scan the QR code(Step 3 out of 7)' ) ),
56
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Scan the QR code with your app on your phone.' ) ),
57
+ 'anchor_id' => '#displayGAQrCodeTour',
58
+ 'isdefault' => 'yes',
59
+ 'edge' => 'left',
60
+ 'align' => 'left',
61
+ 'index' => 'default-miniorange-2fa-scan-qrcode1',
62
+ 'where' => array( 'toplevel_page_mo_2fa_two_fa' ) // <-- Please note this
63
+ );
64
+ $pointers['default-miniorange-2fa-choose_name_on_app'] = array(
65
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Choose app name(Step 4 out of 7)' ) ),
66
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can choose the app name which you want to display on your app for the code.' ) ),
67
+ 'anchor_id' => '#mo2f_change_app_name',
68
+ 'isdefault' => 'yes',
69
+ 'edge' => 'left',
70
+ 'align' => 'left',
71
+ 'index' => 'default-miniorange-2fa-choose_name_on_app1',
72
+ 'where' => array( 'toplevel_page_mo_2fa_two_fa' ) // <-- Please note this
73
+ );
74
+
75
+ $pointers['default-miniorange-2fa-enter_code_manually'] = array(
76
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Can\'t scan the QR code?(Step 5 out of 7)' ) ),
77
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'If you can not scan the QR code then you can follow these steps to configure the two-factor without scanning the code.' ) ),
78
+ 'anchor_id' => '#mo2f_scanbarcode_a',
79
+ 'isdefault' => 'yes',
80
+ 'edge' => 'left',
81
+ 'align' => 'left',
82
+ 'index' => 'default-miniorange-2fa-enter_code_manually1',
83
+ 'where' => array( 'toplevel_page_mo_2fa_two_fa' ) // <-- Please note this
84
+ );
85
+
86
+ $pointers['default-miniorange-2fa-enter-otp'] = array(
87
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Enter the OTP(Step 6 of 7)' ) ),
88
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'After Scanning the QR code please enter the OTP generated in the app on your phone.' ) ),
89
+ 'anchor_id' => '#EnterOTPGATour',
90
+ 'isdefault' => 'yes',
91
+ 'edge' => 'right',
92
+ 'align' => 'left',
93
+ 'index' => 'default-miniorange-2fa-enter-otp1',
94
+ 'where' => array( 'toplevel_page_mo_2fa_two_fa' ) // <-- Please note this
95
+ );
96
+ $pointers['default-miniorange-2fa-save-otp'] = array(
97
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Verify and Save(Step 7 of 7)' ) ),
98
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Verify and Save the google-authentication code.' ) ),
99
+ 'anchor_id' => '#SaveOTPGATour',
100
+ 'isdefault' => 'yes',
101
+ 'edge' => 'right',
102
+ 'align' => 'left',
103
+ 'index' => 'default-miniorange-2fa-save-otp1',
104
+ 'where' => array( 'toplevel_page_mo_2fa_two_fa' ) // <-- Please note this
105
+ );
106
+ $pointers['default-miniorange-2fa-test'] = array(
107
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Test the method(Step 3 out of 10).' ) ),
108
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'After configuring the 2-factor you can test it here by clicking on Test button.' ) ),
109
+ 'anchor_id' => '#test',
110
+ 'isdefault' => 'yes',
111
+ 'edge' => 'right',
112
+ 'align' => 'left',
113
+ 'index' => 'default-miniorange-2fa-test',
114
+ 'where' => array( 'toplevel_page_mo_2fa_two_fa' ) // <-- Please note this
115
+ );
116
+
117
+ $pointers['default-miniorange-2fa-customizations'] = array(
118
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Temporary disable two-factor(Step 4 of 10)' ) ),
119
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'While testing if you need to disable the plugin. You can do it from here.' ) ),
120
+ 'anchor_id' => '#disable_two_factor_tour',
121
+ 'isdefault' => 'yes',
122
+ 'edge' => 'top',
123
+ 'align' => 'left',
124
+ 'index' => 'default-miniorange-2fa-customizations',
125
+ 'where' => array( 'toplevel_page_mo_2fa_two_fa' ) // <-- Please note this
126
+ );
127
+ $pointers['default-miniorange-2fa-inline-registration'] = array(
128
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'User Enrollment(Step 5 of 10)' ) ),
129
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can force two-factor setup of login for other user here.' ) ),
130
+ 'anchor_id' => '#mo2f_inline_registration_tour',
131
+ 'isdefault' => 'yes',
132
+ 'edge' => 'top',
133
+ 'align' => 'left',
134
+ 'index' => 'default-miniorange-2fa-inline-registration',
135
+ 'where' => array( 'toplevel_page_mo_2fa_two_fa' ) // <-- Please note this
136
+ );
137
+ $pointers['default-minorange-2fa-integration'] = array(
138
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Integrate 2fa with custom forms(Step 6 of 10)' ) ),
139
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'We support almost all worpdress forms and some popular forms are listed here. If your form is not in the list you can contact us.' ) ),
140
+ 'anchor_id' => '#custom_form_2fa_div',
141
+ 'isdefault' => 'yes',
142
+ 'edge' => 'bottom',
143
+ 'align' => 'middle',
144
+ 'index' => 'default-minorange-2fa-integration',
145
+ 'where' => array( 'toplevel_page_mo_2fa_two_fa' ) // <-- Please note this
146
+ );
147
+ $pointers['default-minorange-2fa-premium-features'] = array(
148
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Premium features (Step 7 of 10)' ) ),
149
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can check what features you will get in the premium and upgrade to your preferred plan.' ) ),
150
+ 'anchor_id' => '#custom_login_2fa',
151
+ 'isdefault' => 'yes',
152
+ 'edge' => 'left',
153
+ 'align' => 'left',
154
+ 'index' => 'default-minorange-2fa-premium-features',
155
+ 'where' => array( 'toplevel_page_mo_2fa_two_fa' ) // <-- Please note this
156
+ );
157
+
158
+ $pointers['default-miniorange-2fa-upgrade'] = array(
159
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Upgrade your plan(step 8 out of 10)' ) ),
160
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can check the premium features and upgrade your plan here.' ) ),
161
+ 'anchor_id' => '#mo_2fa_upgrade_tour',
162
+ 'isdefault' => 'yes',
163
+ 'edge' => 'top',
164
+ 'align' => 'left',
165
+ 'index' => 'default-miniorange-2fa-upgrade',
166
+ 'where' => array( 'toplevel_page_mo_2fa_two_fa' ) // <-- Please note this
167
+ );
168
+ $pointers['default-miniorange-2fa-support_open'] = array(
169
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Contact us!!(step 9 out of 10)' ) ),
170
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Click to open support form.' ) ),
171
+ 'anchor_id' => '#mo_wpns_support_layout_tour',
172
+ 'isdefault' => 'yes',
173
+ 'edge' => 'bottom',
174
+ 'align' => 'right',
175
+ 'index' => 'default-miniorange-2fa-support_open',
176
+ 'where' => array( 'toplevel_page_mo_2fa_two_fa' ) // <-- Please note this
177
+ );
178
+
179
+
180
+ $pointers['default-miniorange-2fa-support'] = array(
181
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'We are here!!(step 10 out of 10)' ) ),
182
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'If you are having any difficulty while setting up the plugin or using any feature. We are just one click away' ) ),
183
+ 'anchor_id' => '#mo_wpns_support_layout_tour_open',
184
+ 'isdefault' => 'yes',
185
+ 'edge' => 'right',
186
+ 'align' => 'left',
187
+ 'index' => 'default-miniorange-2fa-support',
188
+ 'where' => array( 'toplevel_page_mo_2fa_two_fa' ) // <-- Please note this
189
+ );
190
+
191
+ }
192
+ if(get_option('mo2f_tour_firewall') == 1 ){
193
+ $pointers['default-miniorange-firewall-level'] = array(
194
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Choose your level of the firewall(step 1 out of 8)' ) ),
195
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Choose on which level you want to enable firewall. htaccess level is the recommended one.' ) ),
196
+ 'anchor_id' => '#mo_waf_options_tour',
197
+ 'isfirewall'=> 'yes',
198
+ 'edge' => 'top',
199
+ 'align' => 'left',
200
+ 'index' => 'default-miniorange-firewall-level',
201
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_waf' ) // <-- Please note this
202
+ );
203
+ $pointers['default-miniorange-firewall-attacks'] = array(
204
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Select the types of attacks you want to stop.(step 2 out of 8)' ) ),
205
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Enable attack protection here for different attacks.' ) ),
206
+ 'anchor_id' => '#mo2f_AttackTypes',
207
+ 'isfirewall'=> 'yes',
208
+ 'edge' => 'bottom',
209
+ 'align' => 'left',
210
+ 'index' => 'default-miniorange-firewall-attacks',
211
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_waf' ) // <-- Please note this
212
+ );
213
+ $pointers['default-miniorange-firewall-attack-limit'] = array(
214
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Choose attack limit(step 3 out of 8)' ) ),
215
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Choose the number of attacks an IP can make before getting blocked. If an IP reach the limit it will be blocked on the next attack.' ) ),
216
+ 'anchor_id' => '#mo2f_waf_block_after',
217
+ 'isfirewall'=> 'yes',
218
+ 'edge' => 'bottom',
219
+ 'align' => 'left',
220
+ 'index' => 'default-miniorange-firewall-attack-limit',
221
+ 'align' => 'left',
222
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_waf' ) // <-- Please note this
223
+ );
224
+
225
+ $pointers['default-miniorange-firewall-rate-limit'] = array(
226
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Turn on rate limiting(step 4 out of 8)' ) ),
227
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Turn on rate limiting to protect from Dos attack. Choose request limit and action for rate limiting.' ) ),
228
+ 'anchor_id' => '#mo2f_ratelimiting',
229
+ 'isfirewall'=> 'yes',
230
+ 'edge' => 'top',
231
+ 'align' => 'left',
232
+ 'index' => 'default-miniorange-firewall-rate-limit',
233
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_waf' ) // <-- Please note this
234
+ );
235
+ $pointers['default-miniorange-firewall-check-attacks'] = array(
236
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Check blocked IPs and attacks.(step 5 out of 8)' ) ),
237
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can check the Information about blocked IPs and Attacks here.' ) ),
238
+ 'anchor_id' => '#mo2f_firewall_attack_dash',
239
+ 'isfirewall'=> 'yes',
240
+ 'edge' => 'top',
241
+ 'align' => 'left',
242
+ 'index' => 'default-miniorange-firewall-check-attacks',
243
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_waf' ) // <-- Please note this
244
+ );
245
+ $pointers['default-miniorange-2fa-upgrade'] = array(
246
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Upgrade your plan (step 6 out of 8)' ) ),
247
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can check the premium features and upgrade your plan here.' ) ),
248
+ 'anchor_id' => '#mo_2fa_upgrade_tour',
249
+ 'isfirewall' => 'yes',
250
+ 'edge' => 'top',
251
+ 'align' => 'left',
252
+ 'index' => 'default-miniorange-2fa-upgrade',
253
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_waf' ) // <-- Please note this
254
+ );
255
+
256
+ $pointers['default-miniorange-firewall-support'] = array(
257
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Contact us!!(step 7 out of 8)' ) ),
258
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Click to open support form.' ) ),
259
+ 'anchor_id' => '#mo_wpns_support_layout_tour',
260
+ 'isfirewall' => 'yes',
261
+ 'edge' => 'bottom',
262
+ 'align' => 'left',
263
+ 'index' => 'default-miniorange-firewall-support',
264
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_waf' ) // <-- Please note this
265
+ );
266
+ $pointers['default-miniorange-firewall-support_open'] = array(
267
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'We are here!!(step 8 out of 8)' ) ),
268
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'If you are having any difficulty while setting up the plugin or using any feature. We are just one click away' ) ),
269
+ 'anchor_id' => '#mo_wpns_support_layout_tour_open',
270
+ 'isfirewall' => 'yes',
271
+ 'edge' => 'right',
272
+ 'align' => 'left',
273
+ 'index' => 'default-miniorange-firewall-support_open',
274
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_waf' ) // <-- Please note this
275
+ );
276
+ }
277
+
278
+ if(get_option('mo2f_tour_malware_scan') ==1){
279
+ $pointers['default-miniorange-malware-scan-modes'] = array(
280
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Scanning Modes (Step 1 of 7)' ) ),
281
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Choose the Scanning mode ' ) ),
282
+ 'anchor_id' => '#scan_status_table',
283
+ 'ismalware' => 'yes',
284
+ 'edge' => 'bottom',
285
+ 'align' => 'left',
286
+ 'index' => 'default-miniorange-malware-scan-modes',
287
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_malwarescan' ) // <-- Please note this
288
+ );
289
+ $pointers['default-miniorange-malware-custom-scan-files'] = array(
290
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Select files from custom scan (Step 2 of 7)' ) ),
291
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can select the files you want to scan. Just select the files and start the custom scan' ) ),
292
+ 'anchor_id' => '#mo2f_select_scanning_files',
293
+ 'ismalware' => 'yes',
294
+ 'edge' => 'bottom',
295
+ 'align' => 'left',
296
+ 'index' => 'default-miniorange-malware-custom-scan-files',
297
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_malwarescan' ) // <-- Please note this
298
+ );
299
+ $pointers['default-miniorange-malware-scan-reports'] = array(
300
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Scan report.(Step 3 of 7)' ) ),
301
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can check the scan report here.' ) ),
302
+ 'anchor_id' => '#scan_report_table',
303
+ 'ismalware' => 'yes',
304
+ 'edge' => 'top',
305
+ 'align' => 'left',
306
+ 'index' => 'default-miniorange-malware-scan-reports',
307
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_malwarescan' ) // <-- Please note this
308
+ );
309
+
310
+ $pointers['default-miniorange-malware-scan-dashboard'] = array(
311
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Scan dashboard (Step 4 of 7)' ) ),
312
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can check the Information about the files being scanned currently, files scanned in last scans & Infected files' ) ),
313
+ 'anchor_id' => '#mo2f_scan_dash',
314
+ 'ismalware' => 'yes',
315
+ 'edge' => 'top',
316
+ 'align' => 'left',
317
+ 'index' => 'default-miniorange-malware-scan-dashboard',
318
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_malwarescan' ) // <-- Please note this
319
+ );
320
+ $pointers['default-miniorange-2fa-upgrade'] = array(
321
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Upgrade your plan(step 5 out of 7)' ) ),
322
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can check the premium features and upgrade your plan here.' ) ),
323
+ 'anchor_id' => '#mo_2fa_upgrade_tour',
324
+ 'ismalware' => 'yes',
325
+ 'edge' => 'top',
326
+ 'align' => 'left',
327
+ 'index' => 'default-miniorange-2fa-upgrade',
328
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_malwarescan' ) // <-- Please note this
329
+ );
330
+
331
+ $pointers['default-miniorange-malware-support'] = array(
332
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Contact us!!(step 6 out of 7)' ) ),
333
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Click to open support form.' ) ),
334
+ 'anchor_id' => '#mo_wpns_support_layout_tour',
335
+ 'ismalware' => 'yes',
336
+ 'edge' => 'bottom',
337
+ 'align' => 'left',
338
+ 'index' => 'default-miniorange-malware-support',
339
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_malwarescan' ) // <-- Please note this
340
+ );
341
+ $pointers['default-miniorange-malware-support_open'] = array(
342
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'We are here!!(step 7 out of 7)' ) ),
343
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'If you are having any difficulty while setting up the plugin or using any feature. We are just one click away' ) ),
344
+ 'anchor_id' => '#mo_wpns_support_layout_tour_open',
345
+ 'ismalware' => 'yes',
346
+ 'edge' => 'right',
347
+ 'align' => 'left',
348
+ 'index' => 'default-miniorange-malware-support_open',
349
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_malwarescan' ) // <-- Please note this
350
+ );
351
+ }
352
+
353
+ if(get_option('mo2f_tour_advance_blocking') ==1){
354
+ $pointers['default-miniorange-advance-blocking-IP-blocking'] = array(
355
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Manual IP Blocking (Step 1 of 10)' ) ),
356
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can block a specific IP. Access for that IP will be blocked for your site.' ) ),
357
+ 'anchor_id' => '#mo2f_manual_ip_blocking',
358
+ 'advcblock' => 'yes',
359
+ 'edge' => 'top',
360
+ 'align' => 'left',
361
+ 'index' => 'default-miniorange-advance-blocking-IP-blocking',
362
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_advancedblocking' ) // <-- Please note this
363
+ );
364
+ $pointers['default-miniorange-advance-blocking-IP-whitelisting'] = array(
365
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Whitelist IP (Step 2 of 10)' ) ),
366
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can Whitelist a specific IP. The IP will never get blocked on your site.' ) ),
367
+ 'anchor_id' => '#mo2f_ip_whitelisting',
368
+ 'advcblock' => 'yes',
369
+ 'edge' => 'top',
370
+ 'align' => 'left',
371
+ 'index' => 'default-miniorange-advance-blocking-IP-whitelisting',
372
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_advancedblocking' ) // <-- Please note this
373
+ );
374
+
375
+ $pointers['default-miniorange-advance-blocking-IP-lookup'] = array(
376
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Lookup IP(Step 3 of 10)' ) ),
377
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can get details of an IP here. Example country, city, etc.' ) ),
378
+ 'anchor_id' => '#mo2f_ip_lookup',
379
+ 'advcblock' => 'yes',
380
+ 'edge' => 'bottom',
381
+ 'align' => 'left',
382
+ 'index' => 'default-miniorange-advance-blocking-IP-lookup',
383
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_advancedblocking' ) // <-- Please note this
384
+ );
385
+
386
+
387
+ $pointers['default-miniorange-advance-blocking-IP-range'] = array(
388
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'IP range Blocking.(Step 4 of 10)' ) ),
389
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can block a specific range of IPs. Access from those IP will be blocked for your site.' ) ),
390
+ 'anchor_id' => '#mo2f_ip_range_blocking',
391
+ 'advcblock' => 'yes',
392
+ 'edge' => 'top',
393
+ 'align' => 'left',
394
+ 'index' => 'default-miniorange-advance-blocking-IP-range',
395
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_advancedblocking' ) // <-- Please note this
396
+ );
397
+ $pointers['default-miniorange-advance-blocking-htaccess-blocking'] = array(
398
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Htaccess Blocking (Step 5 of 10)' ) ),
399
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'htaccess level blocking will block the IP before wordpress load on your site. So it will minimize server resources from illegitimate users.' ) ),
400
+ 'anchor_id' => '#mo2f_htaccess_blocking',
401
+ 'advcblock' => 'yes',
402
+ 'edge' => 'top',
403
+ 'align' => 'left',
404
+ 'index' => 'default-miniorange-advance-blocking-htaccess-blocking',
405
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_advancedblocking' ) // <-- Please note this
406
+ );
407
+ $pointers['default-miniorange-advance-blocking-browser-blocking'] = array(
408
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Browser Blocking (Step 6 of 10)' ) ),
409
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can block specific browser from which you don\'t want users to access.' ) ),
410
+ 'anchor_id' => '#mo2f_browser_blocking',
411
+ 'advcblock' => 'yes',
412
+ 'edge' => 'top',
413
+ 'align' => 'left',
414
+ 'index' => 'default-miniorange-advance-blocking-browser-blocking',
415
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_advancedblocking' ) // <-- Please note this
416
+ );
417
+ $pointers['default-miniorange-advance-blocking-country-blocking'] = array(
418
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Country Blocking (Step 7 of 10)' ) ),
419
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can choose the countries from where you don\'t want access to your site.' ) ),
420
+ 'anchor_id' => '#mo2f_country_blocking',
421
+ 'advcblock' => 'yes',
422
+ 'edge' => 'bottom',
423
+ 'align' => 'left',
424
+ 'index' => 'default-miniorange-advance-blocking-country-blocking',
425
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_advancedblocking' ) // <-- Please note this
426
+ );
427
+
428
+ $pointers['default-miniorange-2fa-upgrade'] = array(
429
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Upgrade your plan (step 8 out of 10)' ) ),
430
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can check the premium features and upgrade your plan here.' ) ),
431
+ 'anchor_id' => '#mo_2fa_upgrade_tour',
432
+ 'advcblock' => 'yes',
433
+ 'edge' => 'top',
434
+ 'align' => 'left',
435
+ 'index' => 'default-miniorange-2fa-upgrade',
436
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_advancedblocking' ) // <-- Please note this
437
+ );
438
+ $pointers['default-miniorange-advance-blocking-support'] = array(
439
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Contact us!!(step 9 out of 10)' ) ),
440
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Click to open support form.' ) ),
441
+ 'anchor_id' => '#mo_wpns_support_layout_tour',
442
+ 'advcblock' => 'yes',
443
+ 'edge' => 'bottom',
444
+ 'align' => 'left',
445
+ 'index' => 'default-miniorange-advance-blocking-support',
446
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_advancedblocking' ) // <-- Please note this
447
+ );
448
+ $pointers['default-miniorange-advance-blocking-support_open'] = array(
449
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'We are here!!(step 10 out of 10)' ) ),
450
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'If you are having any difficulty while setting up the plugin or using any feature. We are just one click away' ) ),
451
+ 'anchor_id' => '#mo_wpns_support_layout_tour_open',
452
+ 'advcblock' => 'yes',
453
+ 'edge' => 'right',
454
+ 'align' => 'left',
455
+ 'index' => 'default-miniorange-advance-blocking-support_open',
456
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_advancedblocking' ) // <-- Please note this
457
+ );
458
+ }
459
+
460
+
461
+ if(get_option('mo2f_tour_backup') == 1 ){
462
+ $pointers['default-miniorange-backup-manual-db'] = array(
463
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Manual database backup.(Step 1 of 7)' ) ),
464
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can take manual database backup here.The backup will be saved in your uploads directory.' ) ),
465
+ 'anchor_id' => '#mo2f_select_files_backup',
466
+ 'isBackup'=> 'yes',
467
+ 'edge' => 'top',
468
+ 'align' => 'left',
469
+ 'index' => 'default-miniorange-backup-manual-db',
470
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_backup' ) // <-- Please note this
471
+ );
472
+ $pointers['default-miniorange-backup-auto-db'] = array(
473
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Scheduled/Automated Database backups.(Step 2 of 7)' ) ),
474
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'With the help of this you can specify the time duration after which an automatic backup will be taken.' ) ),
475
+ 'anchor_id' => '#mo2f_auto_dbbackup',
476
+ 'isBackup'=> 'yes',
477
+ 'edge' => 'bottom',
478
+ 'align' => 'left',
479
+ 'index' => 'default-miniorange-backup-auto-db',
480
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_backup' ) // <-- Please note this
481
+ );
482
+ $pointers['default-miniorange-backup-file'] = array(
483
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Auto backup status(Step 3 of 7)' ) ),
484
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can check the auto backup status.' ) ),
485
+ 'anchor_id' => '#mo2f_schedule_backup_status',
486
+ 'isBackup'=> 'yes',
487
+ 'edge' => 'top',
488
+ 'align' => 'left',
489
+ 'index' => 'default-miniorange-backup-file',
490
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_backup' ) // <-- Please note this
491
+ );
492
+ $pointers['default-miniorange-backup-report'] = array(
493
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Report of backups.(Step 4 of 7)' ) ),
494
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can check backup taken details.' ) ),
495
+ 'anchor_id' => '#backup_report_table',
496
+ 'isBackup'=> 'yes',
497
+ 'edge' => 'bottom',
498
+ 'align' => 'left',
499
+ 'index' => 'default-miniorange-backup-report',
500
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_backup' ) // <-- Please note this
501
+ );
502
+
503
+ $pointers['default-miniorange-2fa-upgrade'] = array(
504
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Upgrade your plan (step 5 out of 7)' ) ),
505
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can check the premium features and upgrade your plan here.' ) ),
506
+ 'anchor_id' => '#mo_2fa_upgrade_tour',
507
+ 'isBackup' => 'yes',
508
+ 'edge' => 'top',
509
+ 'align' => 'left',
510
+ 'index' => 'default-miniorange-2fa-upgrade',
511
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_backup' ) // <-- Please note this
512
+ );
513
+ $pointers['default-miniorange-backup-support'] = array(
514
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Contact us!!(step 6 out of 7)' ) ),
515
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Click to open support form.' ) ),
516
+ 'anchor_id' => '#mo_wpns_support_layout_tour',
517
+ 'isBackup' => 'yes',
518
+ 'edge' => 'bottom',
519
+ 'align' => 'left',
520
+ 'index' => 'default-miniorange-backup-support',
521
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_backup' ) // <-- Please note this
522
+ );
523
+ $pointers['default-miniorange-backup-support_open'] = array(
524
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'We are here!!(step 7 out of 7)' ) ),
525
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'If you are having any difficulty while setting up the plugin or using any feature. We are just one click away' ) ),
526
+ 'anchor_id' => '#mo_wpns_support_layout_tour_open',
527
+ 'isBackup' => 'yes',
528
+ 'edge' => 'right',
529
+ 'align' => 'left',
530
+ 'index' => 'default-miniorange-backup-support_open',
531
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_backup' ) // <-- Please note this
532
+ );
533
+
534
+
535
+ }
536
+
537
+ if(get_option('mo2f_tour_loginSpam') == 1){
538
+ $pointers['default-miniorange-login-spam-bruteforce'] = array(
539
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Enable BruteForce protection.(step 1 out of 9)' ) ),
540
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Choose the number of attempts before blocking an IP on login page. It will protect you from bruteforce attack.' ) ),
541
+ 'anchor_id' => '#mo2f_bruteforce',
542
+ 'loginSpam' => 'yes',
543
+ 'edge' => 'top',
544
+ 'align' => 'left',
545
+ 'index' => 'default-miniorange-login-spam-bruteforce',
546
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_login_and_spam' ) // <-- Please note this
547
+ );
548
+ $pointers['default-miniorange-login-spam-recaptcha'] = array(
549
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Enable google reCaptcha.(step 2 out of 9)' ) ),
550
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Enable google reCaptcha ' ) ),
551
+ 'anchor_id' => '#mo2f_google_recaptcha',
552
+ 'loginSpam' => 'yes',
553
+ 'edge' => 'top',
554
+ 'align' => 'left',
555
+ 'index' => 'default-miniorange-login-spam-recaptcha',
556
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_login_and_spam' ) // <-- Please note this
557
+ );
558
+ $pointers['default-miniorange-login-spam-strong-pass'] = array(
559
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Enforce strong password(step 3 out of 9)' ) ),
560
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Enforce strong password to your users so that their account will not get hacked easily.' ) ),
561
+ 'anchor_id' => '#mo2f_enforce_strong_password_div',
562
+ 'loginSpam' => 'yes',
563
+ 'edge' => 'bottom',
564
+ 'align' => 'left',
565
+ 'index' => 'default-miniorange-login-spam-strong-pass',
566
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_login_and_spam' ) // <-- Please note this
567
+ );
568
+
569
+ $pointers['default-miniorange-login-spam-fake-registration'] = array(
570
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Turn on block fake registration(step 4 out of 9)' ) ),
571
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'This will block fake registration on your site.' ) ),
572
+ 'anchor_id' => '#mo2f_block_registration',
573
+ 'loginSpam' => 'yes',
574
+ 'edge' => 'top',
575
+ 'align' => 'left',
576
+ 'index' => 'default-miniorange-login-spam-fake-registration',
577
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_login_and_spam' ) // <-- Please note this
578
+ );
579
+ $pointers['default-miniorange-login-spam-content'] = array(
580
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Content Protection.(step 5 out of 9)' ) ),
581
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can protect your content which is directly accessible from path/URL by anyone.' ) ),
582
+ 'anchor_id' => '#mo2f_content_protection',
583
+ 'loginSpam' => 'yes',
584
+ 'edge' => 'bottom',
585
+ 'align' => 'left',
586
+ 'index' => 'default-miniorange-login-spam-content',
587
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_login_and_spam' ) // <-- Please note this
588
+ );
589
+ $pointers['default-miniorange-login-spam-block-spam'] = array(
590
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Block Spam Comment(Step 6 out of 9)' ) ),
591
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Block automated scripts and bots on comment.' ) ),
592
+ 'anchor_id' => '#mo2f_comment_protection',
593
+ 'loginSpam' => 'yes',
594
+ 'edge' => 'bottom',
595
+ 'align' => 'left',
596
+ 'index' => 'default-miniorange-login-spam-block-spam',
597
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_login_and_spam' ) // <-- Please note this
598
+ );
599
+ $pointers['default-miniorange-2fa-upgrade'] = array(
600
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Upgrade your plan(step 7 out of 9)' ) ),
601
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'You can check the premium features and upgrade your plan here.' ) ),
602
+ 'anchor_id' => '#mo_2fa_upgrade_tour',
603
+ 'loginSpam' => 'yes',
604
+ 'edge' => 'top',
605
+ 'align' => 'left',
606
+ 'index' => 'default-miniorange-2fa-upgrade',
607
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_login_and_spam' ) // <-- Please note this
608
+ );
609
+
610
+ $pointers['default-miniorange-login-spam-support'] = array(
611
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'Contact us!!(step 8 out of 9)' ) ),
612
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'Click to open support form.' ) ),
613
+ 'anchor_id' => '#mo_wpns_support_layout_tour',
614
+ 'loginSpam' => 'yes',
615
+ 'edge' => 'bottom',
616
+ 'align' => 'left',
617
+ 'index' => 'default-miniorange-login-spam-support',
618
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_login_and_spam' ) // <-- Please note this
619
+ );
620
+ $pointers['default-miniorange-login-spam-support_open'] = array(
621
+ 'title' => sprintf( '<h3>%s</h3>', esc_html__( 'We are here!!(step 9 out of 9)' ) ),
622
+ 'content' => sprintf( '<p>%s</p>', esc_html__( 'If you are having any difficulty while setting up the plugin or using any feature. We are just one click away' ) ),
623
+ 'anchor_id' => '#mo_wpns_support_layout_tour_open',
624
+ 'loginSpam' => 'yes',
625
+ 'edge' => 'right',
626
+ 'align' => 'left',
627
+ 'index' => 'default-miniorange-login-spam-support_open',
628
+ 'where' => array( 'miniorange-2-factor_page_mo_2fa_login_and_spam' ) // <-- Please note this
629
+ );
630
+
631
+
632
+
633
+ }
634
+
635
+
636
+
637
+
638
+
639
+
640
+ return $pointers;
controllers/reports.php CHANGED
@@ -22,5 +22,4 @@
22
 
23
  include $mo2f_dirName . 'views'.DIRECTORY_SEPARATOR.'reports.php';
24
 
25
- ?>
26
-
22
 
23
  include $mo2f_dirName . 'views'.DIRECTORY_SEPARATOR.'reports.php';
24
 
25
+ ?>
 
controllers/support.php CHANGED
@@ -27,7 +27,7 @@
27
  //Function to handle support form submit
28
  function wpns_handle_support_form($email,$query,$phone)
29
  {
30
-
31
  if( empty($email) || empty($query) )
32
  {
33
  do_action('wpns_show_message',MoWpnsMessages::showMessage('SUPPORT_FORM_VALUES'),'SUCCESS');
27
  //Function to handle support form submit
28
  function wpns_handle_support_form($email,$query,$phone)
29
  {
30
+
31
  if( empty($email) || empty($query) )
32
  {
33
  do_action('wpns_show_message',MoWpnsMessages::showMessage('SUPPORT_FORM_VALUES'),'SUCCESS');
controllers/tour-model.php CHANGED
@@ -4,17 +4,92 @@
4
  $current_user = wp_get_current_user();
5
  $email = get_option("mo2f_email");
6
  $phone = get_option("mo_wpns_admin_phone");
7
- $display = get_option('skip_tour')?'none':'block';
 
8
  if(empty($email))
9
  $email = $current_user->user_email;
10
  $counter = 0;
11
- $tour_body = '<p class="modal-body-para">Hey, Thank you for installing <b style="color: #E85700">miniOrange 2-Factor plugin</b>.</p>
12
- <p class="modal-body-para">Wordpress is open-source CMS and it can be used by anyone. So, attacker knows the ways to hack it, spoil organizaton\'s reputation, data theft, etc.</p>
13
- <div><table style="width: 100%; text-align: center; table-layout: fixed; font-size: medium;"><tr><td><img src="'.plugin_dir_url(dirname(__FILE__)) . 'includes/images/mo-waf-logo.png"></td><td><img src="'.plugin_dir_url(dirname(__FILE__)) . 'includes/images/login-protection-logo.png"></td><td><img src="'.plugin_dir_url(dirname(__FILE__)) . 'includes/images/database-backup-logo.png"></td><td><img src="'.plugin_dir_url(dirname(__FILE__)) . 'includes/images/malware-scanner-logo.png"></td></tr><tr><th>Web Application Firewall(WAF)</th><th>Login Protection</th><th>Database Backup</th><th>Malware scanner</th></tr></table></div>
14
- <p class="modal-body-para">How you will protect your site? We are here to take care of you site and provide high end security.</p>
15
- <p id="body-para-instr" class="modal-body-para" style="font-size: large;text-align: center;font-weight: 700;color: black;">Please select type of site to take a quick tour of setting up the plugin</p>
16
- <div style="text-align: center; padding-bottom: 10px;"><span id="span-ecommerce" onclick="change_span_css(this);" class="modal-span">Ecommerce</span><span id="span-business" onclick="change_span_css(this);" class="modal-span">Business</span><span id="span-blog" onclick="change_span_css(this);" class="modal-span">Blogs/News</span><span id="span-other" onclick="change_span_css(this);" class="modal-span">Other</span></div>';
17
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
  $waf_arr_ecc = '<div class="modal-body-div-c modal-body-div-d"><div id="div-show-hide-1" style="width: 98%; overflow: ; height: ;line-height: 1.5;"><b><u>Data theft and manipulation</u>:</b> Data manipulation can lead to alter, delete, destroy data. The manipulated data may or may not be regained. It includes very sensitive data such as user details, credit/debit card or bank details. It is very necessary to fix the existing data vulnerability issues, data leaks, change weak passwords and provide high end security to stop data breach and manipulation.<div class="modal-waf-dinner"><span class="modal-waf-sinner">Prevent SQL-Injection attacks:</span> SQL-Injection is web security vulnerability through SQL queries executed to modify, delete and destroy data. </div></div><div style="width: 2%; font-size: xx-large;"><a id="show-hide-1" onclick="open_hide(this);">-</a></div></div><div class="modal-body-div-c modal-body-div-d"><div id="div-show-hide-2" style="width: 98%; overflow: hidden; height: 50px;line-height: 1.5;"><b><u>Web Scraping</u>:</b> Web scraping is a used to extract large amount of data from websites and saved on local computer. The web scraping involves fetching and extracting data from it. It can be used to web indexing, web mining, data mining, research, tracking online presence and reputation, etc. Media scraping, price scraping are also some scraping techniques which are used to degrade/destroy media files and change the price of products.<div class="modal-waf-dinner"><span class="modal-waf-sinner">Prevent Cross-site scripting(XSS) attacks:</span> Cross site scripts used to web scraping and data extraction.</div></div><div style="width: 2%; font-size: xx-large;"><a id="show-hide-2" onclick="open_hide(this);">+</a></div></div><div class="modal-body-div-c modal-body-div-d"><div id="div-show-hide-3" style="width: 98%; overflow: hidden; height: 50px;line-height: 1.5;"><b><u>File manipualtion</u>:</b> The file manipuaiton used to alter, delete, execution of files on the sever. It leads to spoil site, spread malicious content which will harm to the business. <div class="modal-waf-dinner"><span class="modal-waf-sinner">Prevent Remote File Inclusion attacks:</span> Remote file inclusion used to include local file into the server. RFI is type of vulnerability which can lead to add malicious file through a script on server.</div><div class="modal-waf-dinner"><span class="modal-waf-sinner">Prevent Local File Inclusion attacks:</span> Local file inclusion used to access local file available on the server. LFI can be achieved by uploading malicious file to the server.</div></div><div style="width: 2%; font-size: xx-large;"><a id="show-hide-3" onclick="open_hide(this);">+</a></div></div><div class="modal-body-div-c modal-body-div-d"><div id="div-show-hide-4" style="width: 98%; overflow: hidden; height: 50px;line-height: 1.5;"><b><u>Content modification</u>:</b> Cross-site scripting used to change or modify data shown on website. Content modification affects a lot on business due to irrelevent content, malicious links which leads to spoil the trust of clients and reputation of organizations.<div class="modal-waf-dinner"><span class="modal-waf-sinner">Prevent SQL-Injection attacks:</span> SQL-Injection attack can change data in database. The data used to view content such as statistical data, charts, graphs, etc. It may mislead to business.</div><div class="modal-waf-dinner"><span class="modal-waf-sinner">Prevent Cross-site scripting(XSS) attacks:</span> Cross site script can add malicious links, change content of site. </div></div><div style="width: 2%; font-size: xx-large;"><a id="show-hide-4" onclick="open_hide(this);">+</a></div></div>';
20
 
@@ -256,4 +331,4 @@
256
 
257
  $main_pointer = array('Main' => array('Let\'s get Started', $tour_body), 'Ecommerce' => $ecommerce_site, 'Business' => $business_site, 'Blogs/News' => $blog_site, 'Other' => $other_site);
258
 
259
- include $mo2f_dirName . 'views'.DIRECTORY_SEPARATOR.'tour-model.php';
4
  $current_user = wp_get_current_user();
5
  $email = get_option("mo2f_email");
6
  $phone = get_option("mo_wpns_admin_phone");
7
+ $display = get_option('mo2f_tour_started') == 2?'block':'none';
8
+ $networkSEnable = get_option("mo_wpns_2fa_with_network_security");
9
  if(empty($email))
10
  $email = $current_user->user_email;
11
  $counter = 0;
12
+ $enableTour = $networkSEnable == 1 ? '' : 'disabled';
13
+ $tour_body = '<p class="modal-body-para">Hey, Thank you for installing <b style="color: #E85700">miniOrange 2-Factor plugin</b>.</p>
14
+ <p class="modal-body-para">Two-factor will provide extra layer of security to your users account which will help to protect your users accounts from any outside attack.</p>';
15
+ if($networkSEnable != 1)
16
+ {
17
+ $tour_body .= '<div style="margin-left:37.5%;margin-right:37.5%;">';
18
+ }
19
+
20
+ $tour_body .= '<table style="width: 100%; text-align: center; table-layout: fixed; font-size: medium;">
21
+ <div class="mo2f_hiddenradio">
22
+ <tr>
23
+
24
+ <td style="border: 1px solid black;" id="2fa">
25
+ <label>
26
+ <input type="radio" name="mo2f_two_factor" value="2fa" checked style="display:none">
27
+ <img src="'.plugin_dir_url(dirname(__FILE__)) . 'includes/images/google-authenticator.png">
28
+ </label>
29
+ </td>';
30
+ if($networkSEnable == 1)
31
+ {
32
+ $tour_body .= '<td style="border: 1px solid black;" id="waf">
33
+ <label >
34
+ <input type="radio" name="mo2f_two_factor" value="waf" style="display:none" '.$enableTour.'>
35
+ <img src="'.plugin_dir_url(dirname(__FILE__)) . 'includes/images/mo-waf-logo.png">
36
+ </label>
37
+ </td>
38
+
39
+ <td style="border: 1px solid black;" id="login">
40
+ <label >
41
+ <input type="radio" name="mo2f_two_factor" value="login" style="display:none"'.$enableTour.'>
42
+ <img src="'.plugin_dir_url(dirname(__FILE__)) . 'includes/images/login-protection-logo.png">
43
+ </label>
44
+ </td>
45
+
46
+ <td style="border: 1px solid black;" id="backup">
47
+ <label>
48
+ <input type="radio" name="mo2f_two_factor" value="backup" style="display:none"'.$enableTour.'>
49
+ <img src="'.plugin_dir_url(dirname(__FILE__)) . 'includes/images/database-backup-logo.png">
50
+ </label>
51
+ </td>
52
+
53
+ <td style="border: 1px solid black;" id="malware">
54
+ <label >
55
+ <input type="radio" name="mo2f_two_factor" value="malware" style="display:none"'.$enableTour.'>
56
+ <img src="'.plugin_dir_url(dirname(__FILE__)) . 'includes/images/malware-scanner-logo.png">
57
+ </label>
58
+ </td>';
59
+ }
60
+ $tour_body .= '</tr>
61
+ <tr>
62
+ <th>
63
+ Two-factor authentication
64
+ </th>';
65
+
66
+ if($networkSEnable == 1)
67
+ {
68
+
69
+ $tour_body .= '<th>
70
+ Web Application Firewall(WAF)
71
+ </th>
72
+
73
+ <th>
74
+ Login Protection
75
+ </th>
76
+
77
+ <th>
78
+ Database Backup
79
+ </th>
80
+
81
+ <th>
82
+ Malware scanner
83
+ </th>';
84
+ }
85
+
86
+ $tour_body .= '</tr>
87
+ </div>
88
+ </table>';
89
+ if($networkSEnable != 1)
90
+ {
91
+ $tour_body .= '</div>';
92
+ }
93
 
94
  $waf_arr_ecc = '<div class="modal-body-div-c modal-body-div-d"><div id="div-show-hide-1" style="width: 98%; overflow: ; height: ;line-height: 1.5;"><b><u>Data theft and manipulation</u>:</b> Data manipulation can lead to alter, delete, destroy data. The manipulated data may or may not be regained. It includes very sensitive data such as user details, credit/debit card or bank details. It is very necessary to fix the existing data vulnerability issues, data leaks, change weak passwords and provide high end security to stop data breach and manipulation.<div class="modal-waf-dinner"><span class="modal-waf-sinner">Prevent SQL-Injection attacks:</span> SQL-Injection is web security vulnerability through SQL queries executed to modify, delete and destroy data. </div></div><div style="width: 2%; font-size: xx-large;"><a id="show-hide-1" onclick="open_hide(this);">-</a></div></div><div class="modal-body-div-c modal-body-div-d"><div id="div-show-hide-2" style="width: 98%; overflow: hidden; height: 50px;line-height: 1.5;"><b><u>Web Scraping</u>:</b> Web scraping is a used to extract large amount of data from websites and saved on local computer. The web scraping involves fetching and extracting data from it. It can be used to web indexing, web mining, data mining, research, tracking online presence and reputation, etc. Media scraping, price scraping are also some scraping techniques which are used to degrade/destroy media files and change the price of products.<div class="modal-waf-dinner"><span class="modal-waf-sinner">Prevent Cross-site scripting(XSS) attacks:</span> Cross site scripts used to web scraping and data extraction.</div></div><div style="width: 2%; font-size: xx-large;"><a id="show-hide-2" onclick="open_hide(this);">+</a></div></div><div class="modal-body-div-c modal-body-div-d"><div id="div-show-hide-3" style="width: 98%; overflow: hidden; height: 50px;line-height: 1.5;"><b><u>File manipualtion</u>:</b> The file manipuaiton used to alter, delete, execution of files on the sever. It leads to spoil site, spread malicious content which will harm to the business. <div class="modal-waf-dinner"><span class="modal-waf-sinner">Prevent Remote File Inclusion attacks:</span> Remote file inclusion used to include local file into the server. RFI is type of vulnerability which can lead to add malicious file through a script on server.</div><div class="modal-waf-dinner"><span class="modal-waf-sinner">Prevent Local File Inclusion attacks:</span> Local file inclusion used to access local file available on the server. LFI can be achieved by uploading malicious file to the server.</div></div><div style="width: 2%; font-size: xx-large;"><a id="show-hide-3" onclick="open_hide(this);">+</a></div></div><div class="modal-body-div-c modal-body-div-d"><div id="div-show-hide-4" style="width: 98%; overflow: hidden; height: 50px;line-height: 1.5;"><b><u>Content modification</u>:</b> Cross-site scripting used to change or modify data shown on website. Content modification affects a lot on business due to irrelevent content, malicious links which leads to spoil the trust of clients and reputation of organizations.<div class="modal-waf-dinner"><span class="modal-waf-sinner">Prevent SQL-Injection attacks:</span> SQL-Injection attack can change data in database. The data used to view content such as statistical data, charts, graphs, etc. It may mislead to business.</div><div class="modal-waf-dinner"><span class="modal-waf-sinner">Prevent Cross-site scripting(XSS) attacks:</span> Cross site script can add malicious links, change content of site. </div></div><div style="width: 2%; font-size: xx-large;"><a id="show-hide-4" onclick="open_hide(this);">+</a></div></div>';
95
 
331
 
332
  $main_pointer = array('Main' => array('Let\'s get Started', $tour_body), 'Ecommerce' => $ecommerce_site, 'Business' => $business_site, 'Blogs/News' => $blog_site, 'Other' => $other_site);
333
 
334
+ include $mo2f_dirName . 'views'.DIRECTORY_SEPARATOR.'tour-model.php';
controllers/tour/tour_ajax.php ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mo_wpns_Tour
3
+ {
4
+ function __construct(){
5
+ add_action( 'admin_init' , array( $this, 'mo_wpns_save_tour_details' ) );
6
+
7
+ }
8
+
9
+ public function mo_wpns_save_tour_details(){
10
+ if(isset($_REQUEST['page']))
11
+ {
12
+ switch ($_REQUEST['page']) {
13
+ case 'mo_2fa_two_fa':
14
+ if(!get_option('mo2f_two_factor_tour'))
15
+ update_option('mo2f_two_factor_tour',1);
16
+
17
+ break;
18
+ case 'mo_2fa_waf':
19
+ if(!get_option('mo2f_tour_firewall'))
20
+ update_option('mo2f_tour_firewall',1);
21
+ break;
22
+ case 'mo_2fa_login_and_spam':
23
+ if(!get_option('mo2f_tour_loginSpam'))
24
+ update_option('mo2f_tour_loginSpam',1);
25
+ break;
26
+
27
+ case 'mo_2fa_backup':
28
+ if(!get_option('mo2f_tour_backup'))
29
+ update_option('mo2f_tour_backup',1);
30
+
31
+ break;
32
+ case 'mo_2fa_malwarescan':
33
+ if(!get_option('mo2f_tour_malware_scan'))
34
+ update_option('mo2f_tour_malware_scan',1);
35
+
36
+ break;
37
+ case 'mo_2fa_advancedblocking':
38
+ if(!get_option('mo2f_tour_advance_blocking'))
39
+ update_option('mo2f_tour_advance_blocking',1);
40
+ break;
41
+
42
+ default:
43
+ break;
44
+ }
45
+ }
46
+ add_action('wp_ajax_mo_wpns_tour', array( $this, 'mo_wpns_tour' ));
47
+
48
+ }
49
+
50
+ public function mo_wpns_tour(){
51
+ switch($_POST['call_type'])
52
+ {
53
+ case "wpns_enable_tour":
54
+ update_option('skip_tour', 0);
55
+ break;
56
+ case "skip_entire_plugin_tour":
57
+ $this->handle_skip_entire_plugin();
58
+ break;
59
+ case 'entire_plugin_tour_started':
60
+ $this->entire_plugin_tour_started();
61
+ break;
62
+ case "mo2f_close_tour_details":
63
+ $this->mo2f_close_tour_details();
64
+ break;
65
+ case "mo2f_visit_page_tour_details":
66
+ $this->mo2f_visit_page_tour_details();
67
+ break;
68
+ case "mo2f_last_visit_tab":
69
+ $this->mo2f_last_visit_tab();
70
+ break;
71
+ }
72
+ }
73
+
74
+
75
+ function mo2f_last_visit_tab()
76
+ {
77
+ $lasttab = sanitize_text_field($_POST['tab']);
78
+ update_option('mo2f_tour_tab',$lasttab);
79
+ }
80
+ function mo2f_visit_page_tour_details()
81
+ {
82
+ $currentPointer = '';
83
+ if(isset($_POST['index']))
84
+ $currentPointer = sanitize_text_field($_POST['index']);
85
+
86
+ if(strpos($currentPointer, 'support') != false)
87
+ {
88
+ exit;
89
+ }
90
+ $uid = get_current_user_id();
91
+ $visited = get_user_meta($uid,'mo2f_visited_pointers',true);
92
+ $visited = $visited.',custom_admin_pointers4_8_52_'.$currentPointer;
93
+ update_user_meta($uid,'mo2f_visited_pointers',$visited);
94
+ }
95
+ function entire_plugin_tour_started()
96
+ {
97
+ update_option('mo2f_tour_started',3);
98
+ exit;
99
+ }
100
+
101
+ function handle_skip_entire_plugin(){
102
+ update_option('mo2f_two_factor_tour',-1);
103
+ update_option('mo2f_tour_firewall',-1);
104
+ update_option('mo2f_tour_malware_scan',-1);
105
+ update_option('mo2f_tour_advance_blocking',-1);
106
+ update_option('mo2f_tour_backup',-1);
107
+ update_option('mo2f_tour_loginSpam',-1);
108
+ update_option('mo2f_tour_started',3);
109
+ exit;
110
+ }
111
+
112
+
113
+ function mo2f_close_tour_details()
114
+ {
115
+ $uid = get_current_user_id();
116
+ delete_user_meta($uid,'mo2f_visited_pointers');
117
+ $page = $_POST['page'];
118
+ $page = sanitize_text_field($page[0]);
119
+ update_option('mo2f_tour_tab','');
120
+ update_option("yeah",1);
121
+ switch ($page) {
122
+ case 'toplevel_page_mo_2fa_two_fa':
123
+ update_option('mo2f_two_factor_tour',-1);
124
+ break;
125
+ case 'miniorange-2-factor_page_mo_2fa_waf':
126
+ update_option('mo2f_tour_firewall',-1);
127
+ break;
128
+ case 'miniorange-2-factor_page_mo_2fa_malwarescan':
129
+ update_option('mo2f_tour_malware_scan',-1);
130
+ break;
131
+ case 'miniorange-2-factor_page_mo_2fa_advancedblocking':
132
+ update_option('mo2f_tour_advance_blocking',-1);
133
+ break;
134
+ case 'miniorange-2-factor_page_mo_2fa_backup':
135
+ update_option('mo2f_tour_backup',-1);
136
+ break;
137
+ case 'miniorange-2-factor_page_mo_2fa_login_and_spam':
138
+ update_option('mo2f_tour_loginSpam',-1);
139
+ break;
140
+ }
141
+
142
+ }
143
+
144
+ }
145
+ new Mo_wpns_Tour();
146
+ ?>
controllers/two-fa-intro.php ADDED
@@ -0,0 +1,222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div id="mo2f_2fa_intro" class = "modal" style="display: block;">
3
+ <div id="mo2f_2fa_intro_modal" class="modal-content" style="width: 40%;overflow: hidden;padding:50px;" >
4
+
5
+ <div class="modal-header" style="border-bottom: none;">
6
+ <h2 class="modal-title" style="text-align: center; font-size: 20px; color: #2980b9">
7
+ <span id="closeintromodal" class="close modal-span-close" onclick="skipintro();">X</span>
8
+ </h2>
9
+ </div>
10
+
11
+ <div class="modal-body" style="height: auto;">
12
+ <center>
13
+ <div class="checkmark-circle" >
14
+ <div class="background"></div>
15
+ <div class="checkmark draw"></div>
16
+ </div>
17
+ <h1>Awesome!!</h1>
18
+ <h2 style="color: black;font-size: 20px;">You are ready to use Two Factor.</h2>
19
+ </center>
20
+ <div >
21
+ <h3 style="color: black;display:none;" ><span style="color:red;">Logout</span> : You can logout and get the same experience as your users. </h3>
22
+
23
+ </div>
24
+ </div>
25
+
26
+ <div class="modal-footer" style="border: 0px;">
27
+ <button type="button" class="mo_wpns_button mo_wpns_button1 modal-button readytogo mo2f_advance_setting" onclick="skipintro();">Advance Settings</button>
28
+ <button type="button" class="mo_wpns_button mo_wpns_button1 modal-button " style="margin-left: 5%;width: 40%;background-color:#2EB150;float: left;min-height: 54px;border: 2px solid black;" title="Logout and check the user experience" onclick="mo2f_userlogout()">Logout and Configure</button>
29
+ <div class="mo2f_tooltip_addon logout mo_wpns_button mo_wpns_button1 modal-button " style="float: left;border: 2px solid black;border-left:none;width: 6%;box-shadow: none;text-decoration:none;background-color: #2EB150;margin-left: -5px;min-height: 50px;">
30
+ <span class="dashicons dashicons-info mo2f_info_tab" style="color: white;font-size: 27px;margin-top: 14px;margin-left: -12px;"></span>
31
+ <span class="mo2f_tooltiptext_addon mo2f_logout_and_configure_info" style="font-size: 20px;font-family: auto; text-align: justify;font-weight: lighter;background-color: #2EB150; font-size: 20px;">
32
+ <ul style="list-style-type:square;margin: 10px 18px 10px 18px;"><li>This will logout you and will ask you to set your 2FA on next login.</li><li> New and existing users can set their 2FA on next login.</li></ul>
33
+ </span>
34
+ <span class="mo2f_tooltiptext_addon" style="color: #2EB150;background: none; margin-left: -200px; margin-top: -38px;">
35
+ <span class="dashicons dashicons-arrow-down" style="font-size: 300%;"></span>
36
+ </span>
37
+ </div>
38
+
39
+ </div>
40
+ </div>
41
+ </div>
42
+ <form name="f" id="mo2f_skiploginform" method="post" action="">
43
+ <input type="hidden" name="mo2f_skiplogin_nonce" value="<?php echo wp_create_nonce( 'miniorange-2-factor-skiplogin-failed-nonce' ); ?>"/>
44
+ <input type="hidden" name="option" value="mo2f_skiplogin"/>
45
+ </form>
46
+ <form name="f" id="mo2f_userlogoutform" method="post" action="">
47
+ <input type="hidden" name="mo2f_userlogout_nonce" value="<?php echo wp_create_nonce( 'miniorange-2-factor-userlogout-failed-nonce' ); ?>"/>
48
+ <input type="hidden" name="option" value="mo2f_userlogout"/>
49
+ </form>
50
+
51
+ <script>
52
+ function mo2f_userlogout() {
53
+ jQuery("#mo2f_userlogoutform").submit();
54
+ }
55
+
56
+ function skipintro() {
57
+ jQuery("#mo2f_skiploginform").submit();
58
+ }
59
+ </script>
60
+
61
+ <style>
62
+
63
+ .modalhover:hover{
64
+ border:2px solid #2EB150;
65
+ background: #2EB150 !important;
66
+ color:white !important;
67
+ }
68
+ .checkmark-circle {
69
+ width: 150px;
70
+ height: 150px;
71
+ position: relative;
72
+ display: inline-block;
73
+ vertical-align: top;
74
+ }
75
+ .checkmark-circle .background {
76
+ width: 150px;
77
+ height: 150px;
78
+ border-radius: 50%;
79
+ background: #2EB150;
80
+ position: absolute;
81
+ }
82
+ .checkmark-circle .checkmark {
83
+ border-radius: 5px;
84
+ }
85
+ .checkmark-circle .checkmark.draw:after {
86
+ -webkit-animation-delay: 100ms;
87
+ -moz-animation-delay: 100ms;
88
+ animation-delay: 100ms;
89
+ -webkit-animation-duration: 1s;
90
+ -moz-animation-duration: 1s;
91
+ animation-duration: 1s;
92
+ -webkit-animation-timing-function: ease;
93
+ -moz-animation-timing-function: ease;
94
+ animation-timing-function: ease;
95
+ -webkit-animation-name: checkmark;
96
+ -moz-animation-name: checkmark;
97
+ animation-name: checkmark;
98
+ -webkit-transform: scaleX(-1) rotate(130deg);
99
+ -moz-transform: scaleX(-1) rotate(130deg);
100
+ -ms-transform: scaleX(-1) rotate(130deg);
101
+ -o-transform: scaleX(-1) rotate(130deg);
102
+ transform: scaleX(-1) rotate(130deg);
103
+ -webkit-animation-fill-mode: forwards;
104
+ -moz-animation-fill-mode: forwards;
105
+ animation-fill-mode: forwards;
106
+ }
107
+ .checkmark-circle .checkmark:after {
108
+ opacity: 1;
109
+ height: 75px;
110
+ width: 37.5px;
111
+ -webkit-transform-origin: left top;
112
+ -moz-transform-origin: left top;
113
+ -ms-transform-origin: left top;
114
+ -o-transform-origin: left top;
115
+ transform-origin: left top;
116
+ border-right: 15px solid white;
117
+ border-top: 15px solid white;
118
+ border-radius: 2.5px !important;
119
+ content: '';
120
+ left: 25px;
121
+ top: 75px;
122
+ position: absolute;
123
+ }
124
+
125
+ @-webkit-keyframes checkmark {
126
+ 0% {
127
+ height: 0;
128
+ width: 0;
129
+ opacity: 1;
130
+ }
131
+ 20% {
132
+ height: 0;
133
+ width: 37.5px;
134
+ opacity: 1;
135
+ }
136
+ 40% {
137
+ height: 75px;
138
+ width: 37.5px;
139
+ opacity: 1;
140
+ }
141
+ 100% {
142
+ height: 75px;
143
+ width: 37.5px;
144
+ opacity: 1;
145
+ }
146
+ }
147
+ @-moz-keyframes checkmark {
148
+ 0% {
149
+ height: 0;
150
+ width: 0;
151
+ opacity: 1;
152
+ }
153
+ 20% {
154
+ height: 0;
155
+ width: 37.5px;
156
+ opacity: 1;
157
+ }
158
+ 40% {
159
+ height: 75px;
160
+ width: 37.5px;
161
+ opacity: 1;
162
+ }
163
+ 100% {
164
+ height: 75px;
165
+ width: 37.5px;
166
+ opacity: 1;
167
+ }
168
+ }
169
+ @keyframes checkmark {
170
+ 0% {
171
+ height: 0;
172
+ width: 0;
173
+ opacity: 1;
174
+ }
175
+ 20% {
176
+ height: 0;
177
+ width: 37.5px;
178
+ opacity: 1;
179
+ }
180
+ 40% {
181
+ height: 75px;
182
+ width: 37.5px;
183
+ opacity: 1;
184
+ }
185
+ 100% {
186
+ height: 75px;
187
+ width: 37.5px;
188
+ opacity: 1;
189
+ }
190
+ }
191
+ body{
192
+ background-color: #e6e6e6;
193
+ width: 100%;
194
+ height: 100%;
195
+ }
196
+ #success_tic .page-body{
197
+ max-width:300px;
198
+ background-color:#FFFFFF;
199
+ margin:10% auto;
200
+ }
201
+ #success_tic .page-body .head{
202
+ text-align:center;
203
+ }
204
+ /* #success_tic .tic{
205
+ font-size:186px;
206
+ } */
207
+ .close{
208
+ opacity: 1;
209
+ position: absolute;
210
+ right: 0px;
211
+ font-size: 30px;
212
+ padding: 3px 15px;
213
+ margin-bottom: 10px;
214
+ float: right;
215
+ font-size: 21px;
216
+ font-weight: 700;
217
+ line-height: 1;
218
+ color: #000;
219
+ text-shadow: 0 1px 0 #fff;
220
+ }
221
+
222
+ </style>
controllers/twofa/mo2fa_common_login.php CHANGED
@@ -142,7 +142,6 @@ function mo2f_collect_attributes( $email, $attributes ) {
142
 
143
  function mo2f_get_user_2ndfactor( $user ) {
144
  global $Mo2fdbQueries;
145
-
146
  $mo2f_user_email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
147
  $enduser = new Two_Factor_Setup();
148
  $userinfo = json_decode( $enduser->mo2f_get_userinfo( $mo2f_user_email ), true );
@@ -228,6 +227,7 @@ function mo2f_get_forgotphone_form( $login_status, $login_message, $redirect_to,
228
  <input type="hidden" name="mo2f_configured_2FA_method"/>
229
  <input type="hidden" name="miniorange_challenge_forgotphone_nonce"
230
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-challenge-forgotphone-nonce' ); ?>"/>
 
231
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
232
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
233
  </form>
@@ -284,13 +284,13 @@ function mo2f_get_kba_authentication_prompt( $login_message, $redirect_to, $sess
284
  <div id="mo2f_kba_content">
285
  <p style="font-size:15px;">
286
  <?php $kba_questions = $cookievalue;//MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo_2_factor_kba_questions',$session_id_encrypt );
287
- echo $kba_questions[0]; ?><br>
288
  <input class="mo2f-textbox" type="password" name="mo2f_answer_1" id="mo2f_answer_1"
289
  required="true" autofocus="true"
290
  pattern="(?=\S)[A-Za-z0-9_@.$#&amp;+\-\s]{1,100}"
291
  title="Only alphanumeric letters with special characters(_@.$#&amp;+-) are allowed."
292
  autocomplete="off"><br>
293
- <?php echo $kba_questions[1]; ?><br>
294
  <input class="mo2f-textbox" type="password" name="mo2f_answer_2" id="mo2f_answer_2"
295
  required="true" pattern="(?=\S)[A-Za-z0-9_@.$#&amp;+\-\s]{1,100}"
296
  title="Only alphanumeric letters with special characters(_@.$#&amp;+-) are allowed."
@@ -314,6 +314,8 @@ function mo2f_get_kba_authentication_prompt( $login_message, $redirect_to, $sess
314
  value="<?php echo mo2f_lt( 'Validate' ); ?>"/>
315
  <input type="hidden" name="miniorange_kba_nonce"
316
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-kba-nonce' ); ?>"/>
 
 
317
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
318
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
319
  </form>
@@ -435,6 +437,7 @@ function mo2f_get_push_notification_oobemail_prompt( $id, $login_status, $login_
435
  class="mo2f_display_none_forms">
436
  <input type="hidden" name="miniorange_mobile_validation_failed_nonce"
437
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-mobile-validation-failed-nonce' ); ?>"/>
 
438
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
439
  <input type="hidden" name="currentMethod" value="emailVer"/>
440
 
@@ -442,7 +445,9 @@ function mo2f_get_push_notification_oobemail_prompt( $id, $login_status, $login_
442
  <form name="f" id="mo2f_mobile_validation_form" method="post" class="mo2f_display_none_forms">
443
  <input type="hidden" name="miniorange_mobile_validation_nonce"
444
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-mobile-validation-nonce' ); ?>"/>
 
445
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
 
446
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
447
  <input type="hidden" name="TxidEmail" value="<?php echo $mo2f_EV_txid; ?>"/>
448
 
@@ -450,6 +455,7 @@ function mo2f_get_push_notification_oobemail_prompt( $id, $login_status, $login_
450
  <form name="f" id="mo2f_show_softtoken_loginform" method="post" class="mo2f_display_none_forms">
451
  <input type="hidden" name="miniorange_softtoken"
452
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-softtoken' ); ?>"/>
 
453
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
454
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
455
  </form>
@@ -457,21 +463,23 @@ function mo2f_get_push_notification_oobemail_prompt( $id, $login_status, $login_
457
  <input type="hidden" name="request_origin_method" value="<?php echo $login_status; ?>"/>
458
  <input type="hidden" name="miniorange_forgotphone"
459
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-forgotphone' ); ?>"/>
 
460
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
461
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
462
  </form>
463
  <form name="f" id="mo2f_alternate_login_kbaform" method="post" class="mo2f_display_none_forms">
464
  <input type="hidden" name="miniorange_alternate_login_kba_nonce"
465
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-alternate-login-kba-nonce' ); ?>"/>
 
466
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
467
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
468
  </form>
469
  <script>
470
  var timeout;
471
- var is_onprem = '<?php echo MO2F_IS_ONPREM;?>';
472
  var calls = 0;
473
 
474
- if(is_onprem==1)
475
  {
476
  pollPushValidation();
477
  function pollPushValidation()
@@ -485,6 +493,7 @@ function mo2f_get_push_notification_oobemail_prompt( $id, $login_status, $login_
485
 
486
  var status = result;
487
  if (status == 1) {
 
488
  jQuery('#mo2f_mobile_validation_form').submit();
489
  } else if (status == 'ERROR' || status == 'FAILED' || status == 'DENIED' || status ==0) {
490
  jQuery('#mo2f_backto_mo_loginform').submit();
@@ -521,6 +530,7 @@ function mo2f_get_push_notification_oobemail_prompt( $id, $login_status, $login_
521
  success: function (result) {
522
  var status = JSON.parse(JSON.stringify(result)).status;
523
  if (status == 'SUCCESS') {
 
524
  jQuery('#mo2f_mobile_validation_form').submit();
525
  } else if (status == 'ERROR' || status == 'FAILED' || status == 'DENIED') {
526
  jQuery('#mo2f_backto_mo_loginform').submit();
@@ -629,11 +639,13 @@ function mo2f_get_qrcode_authentication_prompt( $login_status, $login_message, $
629
  <input type="hidden" name="miniorange_mobile_validation_nonce"
630
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-mobile-validation-nonce' ); ?>"/>
631
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
 
632
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
633
  </form>
634
  <form name="f" id="mo2f_show_softtoken_loginform" method="post" class="mo2f_display_none_forms">
635
  <input type="hidden" name="miniorange_softtoken"
636
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-softtoken' ); ?>"/>
 
637
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
638
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
639
  </form>
@@ -642,6 +654,7 @@ function mo2f_get_qrcode_authentication_prompt( $login_status, $login_message, $
642
  <input type="hidden" name="miniorange_forgotphone"
643
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-forgotphone' ); ?>"/>
644
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
 
645
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
646
  </form>
647
  <script>
@@ -755,6 +768,7 @@ function mo2f_get_otp_authentication_prompt( $login_status, $login_message, $red
755
  <input type="hidden" name="request_origin_method" value="<?php echo $login_status; ?>"/>
756
  <input type="hidden" name="miniorange_soft_token_nonce"
757
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-soft-token-nonce' ); ?>"/>
 
758
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
759
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
760
  </form>
@@ -789,6 +803,7 @@ function mo2f_get_otp_authentication_prompt( $login_status, $login_message, $red
789
  <input type="hidden" name="request_origin_method" value="<?php echo $login_status; ?>"/>
790
  <input type="hidden" name="miniorange_forgotphone"
791
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-forgotphone' ); ?>"/>
 
792
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
793
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
794
  </form>
@@ -869,12 +884,14 @@ function mo2f_get_device_form( $redirect_to, $session_id_encrypt ) {
869
  <form name="f" id="mo2f_trust_device_confirm_form" method="post" action="" class="mo2f_display_none_forms">
870
  <input type="hidden" name="mo2f_trust_device_confirm_nonce"
871
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-trust-device-confirm-nonce' ); ?>"/>
 
872
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
873
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
874
  </form>
875
  <form name="f" id="mo2f_trust_device_cancel_form" method="post" action="" class="mo2f_display_none_forms">
876
  <input type="hidden" name="mo2f_trust_device_cancel_nonce"
877
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-trust-device-cancel-nonce' ); ?>"/>
 
878
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
879
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
880
  </form>
@@ -911,4 +928,6 @@ function echo_js_css_files() {
911
  echo '<script src="' . plugins_url( 'includes/js/bootstrap.min.js', dirname(dirname(__FILE__)) ) . '" ></script>';
912
  echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/twofa_style_settings.css?version=5.1.21', dirname(dirname(__FILE__))) . '" />';
913
  }
 
 
914
  ?>
142
 
143
  function mo2f_get_user_2ndfactor( $user ) {
144
  global $Mo2fdbQueries;
 
145
  $mo2f_user_email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
146
  $enduser = new Two_Factor_Setup();
147
  $userinfo = json_decode( $enduser->mo2f_get_userinfo( $mo2f_user_email ), true );
227
  <input type="hidden" name="mo2f_configured_2FA_method"/>
228
  <input type="hidden" name="miniorange_challenge_forgotphone_nonce"
229
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-challenge-forgotphone-nonce' ); ?>"/>
230
+ <input type="hidden" name="option" value="miniorange_challenge_forgotphone">
231
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
232
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
233
  </form>
284
  <div id="mo2f_kba_content">
285
  <p style="font-size:15px;">
286
  <?php $kba_questions = $cookievalue;//MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo_2_factor_kba_questions',$session_id_encrypt );
287
+ echo $kba_questions[0]['question']; ?><br>
288
  <input class="mo2f-textbox" type="password" name="mo2f_answer_1" id="mo2f_answer_1"
289
  required="true" autofocus="true"
290
  pattern="(?=\S)[A-Za-z0-9_@.$#&amp;+\-\s]{1,100}"
291
  title="Only alphanumeric letters with special characters(_@.$#&amp;+-) are allowed."
292
  autocomplete="off"><br>
293
+ <?php echo $kba_questions[1]['question']; ?><br>
294
  <input class="mo2f-textbox" type="password" name="mo2f_answer_2" id="mo2f_answer_2"
295
  required="true" pattern="(?=\S)[A-Za-z0-9_@.$#&amp;+\-\s]{1,100}"
296
  title="Only alphanumeric letters with special characters(_@.$#&amp;+-) are allowed."
314
  value="<?php echo mo2f_lt( 'Validate' ); ?>"/>
315
  <input type="hidden" name="miniorange_kba_nonce"
316
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-kba-nonce' ); ?>"/>
317
+ <input type="hidden" name="option"
318
+ value="miniorange_kba_validate"/>
319
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
320
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
321
  </form>
437
  class="mo2f_display_none_forms">
438
  <input type="hidden" name="miniorange_mobile_validation_failed_nonce"
439
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-mobile-validation-failed-nonce' ); ?>"/>
440
+ <input type="hidden" name="option" value="miniorange_mobile_validation_failed">
441
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
442
  <input type="hidden" name="currentMethod" value="emailVer"/>
443
 
445
  <form name="f" id="mo2f_mobile_validation_form" method="post" class="mo2f_display_none_forms">
446
  <input type="hidden" name="miniorange_mobile_validation_nonce"
447
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-mobile-validation-nonce' ); ?>"/>
448
+ <input type="hidden" name="option" value="miniorange_mobile_validation">
449
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
450
+ <input type="hidden" name="tx_type"/>
451
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
452
  <input type="hidden" name="TxidEmail" value="<?php echo $mo2f_EV_txid; ?>"/>
453
 
455
  <form name="f" id="mo2f_show_softtoken_loginform" method="post" class="mo2f_display_none_forms">
456
  <input type="hidden" name="miniorange_softtoken"
457
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-softtoken' ); ?>"/>
458
+ <input type="hidden" name="option" value="miniorange_softtoken">
459
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
460
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
461
  </form>
463
  <input type="hidden" name="request_origin_method" value="<?php echo $login_status; ?>"/>
464
  <input type="hidden" name="miniorange_forgotphone"
465
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-forgotphone' ); ?>"/>
466
+ <input type="hidden" name="option" value="miniorange_forgotphone">
467
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
468
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
469
  </form>
470
  <form name="f" id="mo2f_alternate_login_kbaform" method="post" class="mo2f_display_none_forms">
471
  <input type="hidden" name="miniorange_alternate_login_kba_nonce"
472
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-alternate-login-kba-nonce' ); ?>"/>
473
+ <input type="hidden" name="option" value="miniorange_alternate_login_kba">
474
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
475
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
476
  </form>
477
  <script>
478
  var timeout;
479
+ var login_status = '<?php echo $login_status;?>';
480
  var calls = 0;
481
 
482
+ if(login_status != "MO_2_FACTOR_CHALLENGE_PUSH_NOTIFICATIONS")
483
  {
484
  pollPushValidation();
485
  function pollPushValidation()
493
 
494
  var status = result;
495
  if (status == 1) {
496
+ jQuery('input[name="tx_type"]').val("EV");
497
  jQuery('#mo2f_mobile_validation_form').submit();
498
  } else if (status == 'ERROR' || status == 'FAILED' || status == 'DENIED' || status ==0) {
499
  jQuery('#mo2f_backto_mo_loginform').submit();
530
  success: function (result) {
531
  var status = JSON.parse(JSON.stringify(result)).status;
532
  if (status == 'SUCCESS') {
533
+ jQuery('input[name="tx_type"]').val("PN");
534
  jQuery('#mo2f_mobile_validation_form').submit();
535
  } else if (status == 'ERROR' || status == 'FAILED' || status == 'DENIED') {
536
  jQuery('#mo2f_backto_mo_loginform').submit();
639
  <input type="hidden" name="miniorange_mobile_validation_nonce"
640
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-mobile-validation-nonce' ); ?>"/>
641
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
642
+ <input type="hidden" name="option" value="miniorange_mobile_validation">
643
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
644
  </form>
645
  <form name="f" id="mo2f_show_softtoken_loginform" method="post" class="mo2f_display_none_forms">
646
  <input type="hidden" name="miniorange_softtoken"
647
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-softtoken' ); ?>"/>
648
+ <input type="hidden" name="option" value="miniorange_softtoken">
649
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
650
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
651
  </form>
654
  <input type="hidden" name="miniorange_forgotphone"
655
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-forgotphone' ); ?>"/>
656
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
657
+ <input type="hidden" name="option" value="miniorange_forgotphone">
658
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
659
  </form>
660
  <script>
768
  <input type="hidden" name="request_origin_method" value="<?php echo $login_status; ?>"/>
769
  <input type="hidden" name="miniorange_soft_token_nonce"
770
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-soft-token-nonce' ); ?>"/>
771
+ <input type="hidden" name="option" value="miniorange_soft_token">
772
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
773
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
774
  </form>
803
  <input type="hidden" name="request_origin_method" value="<?php echo $login_status; ?>"/>
804
  <input type="hidden" name="miniorange_forgotphone"
805
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-forgotphone' ); ?>"/>
806
+ <input type="hidden" name="option" value="miniorange_forgotphone">
807
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
808
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
809
  </form>
884
  <form name="f" id="mo2f_trust_device_confirm_form" method="post" action="" class="mo2f_display_none_forms">
885
  <input type="hidden" name="mo2f_trust_device_confirm_nonce"
886
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-trust-device-confirm-nonce' ); ?>"/>
887
+ <input type="hidden" name="option" value="miniorange_rba_validate">
888
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
889
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
890
  </form>
891
  <form name="f" id="mo2f_trust_device_cancel_form" method="post" action="" class="mo2f_display_none_forms">
892
  <input type="hidden" name="mo2f_trust_device_cancel_nonce"
893
  value="<?php echo wp_create_nonce( 'miniorange-2-factor-trust-device-cancel-nonce' ); ?>"/>
894
+ <input type="hidden" name="option" value="miniorange_rba_cancle">
895
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
896
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
897
  </form>
928
  echo '<script src="' . plugins_url( 'includes/js/bootstrap.min.js', dirname(dirname(__FILE__)) ) . '" ></script>';
929
  echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/twofa_style_settings.css?version=5.1.21', dirname(dirname(__FILE__))) . '" />';
930
  }
931
+
932
+
933
  ?>
controllers/twofa/mo2fa_inline_registration.php ADDED
@@ -0,0 +1,1223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function fetch_methods(){
3
+ $methods = array("SMS","SOFT TOKEN","MOBILE AUTHENTICATION","PUSH NOTIFICATIONS","GOOGLE AUTHENTICATOR","KBA","OTP_OVER_EMAIL");
4
+ return $methods;
5
+ }
6
+
7
+ function prompt_user_to_select_2factor_mthod_inline($current_user_id, $login_status, $login_message,$redirect_to,$session_id,$qrCode){
8
+
9
+ global $Mo2fdbQueries;
10
+ $current_user = get_userdata($current_user_id);
11
+ $current_selected_method = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method',$current_user_id);
12
+
13
+ $redirect_to_save = get_user_meta($current_user_id,'redirect_to',true);
14
+ if(is_null($redirect_to_save) or $redirect_to_save=='')
15
+ update_user_meta($current_user_id,'redirect_to',$redirect_to);
16
+ else
17
+ {
18
+ $redirect_to = $redirect_to_save;
19
+ delete_user_meta($current_user_id,'redirect_to');
20
+ }
21
+ $session_id_save = get_user_meta($current_user_id,'session_id',true);
22
+ if(is_null($session_id_save) or $session_id_save=='')
23
+ update_user_meta($current_user_id,'session_id',$session_id);
24
+ else
25
+ {
26
+ $session_id = $session_id_save;
27
+ delete_user_meta($current_user_id,'session_id');
28
+ }
29
+ if($current_selected_method == 'MOBILE AUTHENTICATION' || $current_selected_method == 'SOFT TOKEN' || $current_selected_method == 'PUSH NOTIFICATIONS'){
30
+ if(get_option( 'mo_2factor_admin_registration_status' ) == 'MO_2_FACTOR_CUSTOMER_REGISTERED_SUCCESS')
31
+ prompt_user_for_miniorange_app_setup($current_user_id, $login_status, $login_message,$session_id,$qrCode,$current_selected_method);
32
+ else
33
+ prompt_user_for_miniorange_register($current_user_id, $login_status, $login_message);
34
+ }else if($current_selected_method == 'SMS' || $current_selected_method == 'PHONE VERIFICATION' || $current_selected_method == 'SMS AND EMAIL'){
35
+ if(get_option( 'mo_2factor_admin_registration_status' ) == 'MO_2_FACTOR_CUSTOMER_REGISTERED_SUCCESS')
36
+ prompt_user_for_phone_setup($current_user_id, $login_status, $login_message,$current_selected_method);
37
+ else
38
+ prompt_user_for_miniorange_register($current_user_id, $login_status, $login_message);
39
+ }else if($current_selected_method == 'GOOGLE AUTHENTICATOR' ){
40
+ prompt_user_for_google_authenticator_setup($current_user_id, $login_status, $login_message);
41
+ }else if($current_selected_method == 'AUTHY 2-FACTOR AUTHENTICATION'){
42
+ prompt_user_for_authy_authenticator_setup($current_user_id, $login_status, $login_message);
43
+ }else if($current_selected_method == 'KBA' ){
44
+ prompt_user_for_kba_setup($current_user_id, $login_status, $login_message);
45
+ }else if($current_selected_method == 'OUT OF BAND EMAIL' ){
46
+ $status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status',$current_user_id);
47
+ if(( $status == 'MO_2_FACTOR_PLUGIN_SETTINGS' && get_site_option('mo2f_remember_device')!=1)||(get_site_option( 'mo2f_disable_kba' ) &&$login_status == 'MO_2_FACTOR_SETUP_SUCCESS')){
48
+ if(!MO2F_IS_ONPREM)
49
+ {
50
+ $current_user = get_userdata($current_user_id);
51
+ $email = $current_user->user_email;
52
+ $tempEmail = get_user_meta($current_user->ID,'mo2f_email_miniOrange',true);
53
+ if(isset($tempEmail) and $tempEmail != '')
54
+ $email = $tempEmail;
55
+ create_user_in_miniOrange($current_user_id,$email,$current_selected_method);
56
+ }
57
+ $Mo2fdbQueries->update_user_details( $current_user_id, array('mo_2factor_user_registration_status' =>'MO_2_FACTOR_PLUGIN_SETTINGS') );
58
+ $pass2fa= new Miniorange_Password_2Factor_Login();
59
+ $pass2fa->mo2fa_pass2login(site_url());
60
+ }
61
+ prompt_user_for_setup_success($current_user_id, $login_status, $login_message);
62
+ }else{
63
+ $current_user = get_userdata($current_user_id);
64
+ if(isset($current_user->roles[0]))
65
+ $current_user_role=$current_user->roles[0];
66
+ $opt=fetch_methods($current_user);
67
+ ?>
68
+ <html>
69
+ <head>
70
+ <meta charset="utf-8"/>
71
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
72
+ <meta name="viewport" content="width=device-width, initial-scale=1">
73
+ <?php
74
+ mo2f_inline_css_and_js();
75
+ ?>
76
+ </head>
77
+ <body>
78
+ <div class="mo2f_modal1" tabindex="-1" role="dialog" id="myModal51">
79
+ <div class="mo2f-modal-backdrop"></div>
80
+ <div class="mo_customer_validation-modal-dialog mo_customer_validation-modal-md">
81
+ <div class="login mo_customer_validation-modal-content">
82
+ <div class="mo2f_modal-header">
83
+ <h3 class="mo2f_modal-title"><button type="button" class="mo2f_close" data-dismiss="modal" aria-label="Close" title="<?php echo __('Back to login','miniorange-2-factor-authentication');?>" onclick="mologinback();"><span aria-hidden="true">&times;</span></button>
84
+
85
+ <?php echo __('New security system has been enabled', 'miniorange-2-factor-authentication'); ?></h3>
86
+ </div>
87
+ <div class="mo2f_modal-body">
88
+ <?php echo __('<b> Configure a Two-Factor method to protect your account</b>', 'miniorange-2-factor-authentication');
89
+ if(isset($login_message) && !empty($login_message)) {
90
+ echo '<br><br>';
91
+
92
+ ?>
93
+
94
+ <div id="otpMessage">
95
+ <p class="mo2fa_display_message_frontend" style="text-align: left !important;"><?php echo __($login_message, 'miniorange-2-factor-authentication'); ?></p>
96
+ </div>
97
+ <?php }else
98
+ echo '<br>';
99
+ ?>
100
+
101
+ <br>
102
+ <span class="<?php if( !(in_array("GOOGLE AUTHENTICATOR", $opt)) ){ echo "mo2f_td_hide"; }else { echo "mo2f_td_show"; }?>">
103
+ <label title="<?php echo __('You have to enter 6 digits code generated by Authenticator App to login. Supported in Smartphones only.', 'miniorange-2-factor-authentication'); ?>">
104
+ <input type="radio" name="mo2f_selected_2factor_method" value="GOOGLE AUTHENTICATOR" />
105
+ <?php echo __('Google / Authy / Microsoft Authenticator<br> &nbsp;&nbsp;&nbsp; &nbsp;
106
+ (Any TOTP Based Authenticatior App)', 'miniorange-2-factor-authentication'); ?>
107
+ </label>
108
+ <br>
109
+ </span>
110
+ <span class="<?php if( !(in_array("OUT OF BAND EMAIL", $opt)) ){ echo "mo2f_td_hide"; }else { echo "mo2f_td_show"; } ?>" >
111
+ <label title="<?php echo __('You will receive an email with link. You have to click the ACCEPT or DENY link to verify your email. Supported in Desktops, Laptops, Smartphones.', 'miniorange-2-factor-authentication'); ?>">
112
+ <input type="radio" name="mo2f_selected_2factor_method" value="OUT OF BAND EMAIL" />
113
+ <?php echo __('Email Verification', 'miniorange-2-factor-authentication'); ?>
114
+ </label>
115
+ <br>
116
+ </span>
117
+ <span class="<?php if( !(in_array("SMS", $opt)) ){ echo "mo2f_td_hide"; }else { echo "mo2f_td_show"; } ?>" >
118
+ <label title="<?php echo __('You will receive a one time passcode via SMS on your phone. You have to enter the otp on your screen to login. Supported in Smartphones, Feature Phones.', 'miniorange-2-factor-authentication'); ?>">
119
+ <input type="radio" name="mo2f_selected_2factor_method" value="SMS" />
120
+ <?php echo __('OTP Over SMS', 'miniorange-2-factor-authentication'); ?>
121
+ </label>
122
+ <br>
123
+ </span>
124
+ <span class="<?php if( !(in_array("PHONE VERIFICATION", $opt)) ){ echo "mo2f_td_hide"; }else { echo "mo2f_td_show"; } ?>">
125
+ <label title="<?php echo __('You will receive a phone call telling a one time passcode. You have to enter the one time passcode to login. Supported in Landlines, Smartphones, Feature phones.', 'miniorange-2-factor-authentication'); ?>">
126
+ <input type="radio" name="mo2f_selected_2factor_method" value="PHONE VERIFICATION" />
127
+ <?php echo __('Phone Call Verification', 'miniorange-2-factor-authentication'); ?>
128
+ </label>
129
+ <br>
130
+ </span>
131
+ <span class="<?php if( !(in_array("SOFT TOKEN", $opt)) ){ echo "mo2f_td_hide"; }else { echo "mo2f_td_show"; } ?>" >
132
+ <label title="<?php echo __('You have to enter 6 digits code generated by miniOrange Authenticator App like Google Authenticator code to login. Supported in Smartphones only.', 'miniorange-2-factor-authentication'); ?>" >
133
+ <input type="radio" name="mo2f_selected_2factor_method" value="SOFT TOKEN" />
134
+ <?php echo __('Soft Token', 'miniorange-2-factor-authentication'); ?>
135
+ </label>
136
+ <br>
137
+ </span>
138
+ <span class="<?php if( !(in_array("MOBILE AUTHENTICATION", $opt)) ){ echo "mo2f_td_hide"; }else { echo "mo2f_td_show"; }?>">
139
+ <label title="<?php echo __('You have to scan the QR Code from your phone using miniOrange Authenticator App to login. Supported in Smartphones only.', 'miniorange-2-factor-authentication'); ?>">
140
+ <input type="radio" name="mo2f_selected_2factor_method" value="MOBILE AUTHENTICATION" />
141
+ <?php echo __('QR Code Authentication', 'miniorange-2-factor-authentication'); ?>
142
+ </label>
143
+ <br>
144
+ </span>
145
+ <span class="<?php if( !(in_array("PUSH NOTIFICATIONS", $opt)) ){ echo "mo2f_td_hide"; }else { echo "mo2f_td_show"; } ?>" >
146
+ <label title="<?php echo __('You will receive a push notification on your phone. You have to ACCEPT or DENY it to login. Supported in Smartphones only.', 'miniorange-2-factor-authentication'); ?>">
147
+ <input type="radio" name="mo2f_selected_2factor_method" value="PUSH NOTIFICATIONS" />
148
+ <?php echo __('Push Notification', 'miniorange-2-factor-authentication'); ?>
149
+ </label>
150
+ <br>
151
+ </span>
152
+ <span class="<?php if( !(in_array("AUTHY 2-FACTOR AUTHENTICATION", $opt)) ){ echo "mo2f_td_hide"; }else { echo "mo2f_td_show"; }?>">
153
+ <label title="<?php echo __('You have to enter 6 digits code generated by Authy 2-Factor Authentication App to login. Supported in Smartphones only.', 'miniorange-2-factor-authentication'); ?>">
154
+ <input type="radio" name="mo2f_selected_2factor_method" value="AUTHY 2-FACTOR AUTHENTICATION" />
155
+ <?php echo __('Authy 2-Factor Authentication', 'miniorange-2-factor-authentication'); ?>
156
+ </label>
157
+ <br>
158
+ </span>
159
+ <span class="<?php if( !(in_array("KBA", $opt)) ){ echo "mo2f_td_hide"; }else { echo "mo2f_td_show"; }?>">
160
+ <label title="<?php echo __('You have to answers some knowledge based security questions which are only known to you to authenticate yourself. Supported in Desktops,Laptops,Smartphones.', 'miniorange-2-factor-authentication'); ?>" >
161
+ <input type="radio" name="mo2f_selected_2factor_method" value="KBA" />
162
+ <?php echo __('Security Questions ( KBA )', 'miniorange-2-factor-authentication'); ?>
163
+ </label>
164
+ <br>
165
+ </span>
166
+ <span class="<?php if( !(in_array("SMS AND EMAIL", $opt)) ){ echo "mo2f_td_hide"; }else { echo "mo2f_td_show"; }?>">
167
+ <label title="<?php echo __('You will receive a one time passcode via SMS on your phone and your email. You have to enter the otp on your screen to login. Supported in Smartphones, Feature Phones.', 'miniorange-2-factor-authentication'); ?>" >
168
+ <input type="radio" name="mo2f_selected_2factor_method" value="SMS AND EMAIL" />
169
+ <?php echo __('OTP Over SMS and Email', 'miniorange-2-factor-authentication'); ?>
170
+ </label>
171
+ <br>
172
+ </span>
173
+ <span class="<?php if( !(in_array("OTP_OVER_EMAIL", $opt)) ){ echo "mo2f_td_hide"; }else { echo "mo2f_td_hide"; }?>">
174
+ <label title="<?php echo __('You will receive a one time passcode on your email. You have to enter the otp on your screen to login. Supported in Smartphones, Feature Phones.', 'miniorange-2-factor-authentication'); ?>" >
175
+ <input type="radio" name="mo2f_selected_2factor_method" value="OTP OVER EMAIL" />
176
+ <?php echo __('OTP Over Email', 'miniorange-2-factor-authentication'); ?>
177
+ </label>
178
+ </span>
179
+ <?php //if(isset($login_message) && !empty($login_message)){ ?>
180
+ <br><a href="#skiptwofactor" style="color:#F4D03F ;font-weight:bold;margin-left:35%;"><?php echo __('Skip Two Factor', 'miniorange-2-factor-authentication'); ?></a>>>
181
+ <?php//} ?>
182
+ <br />
183
+ <?php mo2f_customize_logo() ?>
184
+ </div>
185
+ </div>
186
+ </div>
187
+ </div>
188
+ <form name="f" id="mo2f_backto_mo_loginform" method="post" action="<?php echo wp_login_url(); ?>" style="display:none;">
189
+ <input type="hidden" name="miniorange_mobile_validation_failed_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-mobile-validation-failed-nonce'); ?>" />
190
+ </form>
191
+ <form name="f" method="post" action="" id="mo2f_select_2fa_methods_form" style="display:none;">
192
+ <input type="hidden" name="mo2f_selected_2factor_method" />
193
+ <input type="hidden" name="miniorange_inline_save_2factor_method_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-inline-save-2factor-method-nonce'); ?>" />
194
+ <input type="hidden" name="option" value="miniorange_inline_save_2factor_method" />
195
+ <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
196
+ <input type="hidden" name="session_id" value="<?php echo $session_id; ?>"/>
197
+ </form>
198
+ <!-- --><?php //if(isset($login_message) && !empty($login_message)){ ?>
199
+ <form name="f" id="mo2f_skip_loginform" method="post" action="" style="display:none;">
200
+ <input type="hidden" name="option" value="mo2f_skip_2fa_setup" />
201
+ <input type="hidden" name="miniorange_skip_2fa_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-skip-nonce'); ?>" />
202
+ <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
203
+ <input type="hidden" name="session_id" value="<?php echo $session_id; ?>"/>
204
+
205
+ </form>
206
+ <!-- --><?php //} ?>
207
+ </body>
208
+ <script>
209
+ function mologinback(){
210
+ jQuery('#mo2f_backto_mo_loginform').submit();
211
+ }
212
+ jQuery('input:radio[name=mo2f_selected_2factor_method]').click(function() {
213
+ var selectedMethod = jQuery(this).val();
214
+ document.getElementById("mo2f_select_2fa_methods_form").elements[0].value = selectedMethod;
215
+ jQuery('#mo2f_select_2fa_methods_form').submit();
216
+ });
217
+ jQuery('a[href="#skiptwofactor"]').click(function(e) {
218
+
219
+ jQuery('#mo2f_skip_loginform').submit();
220
+ });
221
+ </script>
222
+ </html>
223
+ <?php
224
+ }
225
+ }
226
+
227
+ function create_user_in_miniOrange($current_user_id,$email,$currentMethod)
228
+ {
229
+
230
+ global $Mo2fdbQueries;
231
+ $mo2f_user_email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $current_user_id );
232
+ if(isset($mo2f_user_email) and $mo2f_user_email != '')
233
+ $email = $mo2f_user_email;
234
+
235
+ $current_user = get_userdata($current_user_id);
236
+ if($current_user_id == get_option('mo2f_miniorange_admin'))
237
+ $email = get_option('mo2f_email');
238
+
239
+ $enduser = new Two_Factor_Setup();
240
+ $check_user = json_decode( $enduser->mo_check_user_already_exist( $email ), true );
241
+
242
+ if(json_last_error() == JSON_ERROR_NONE){
243
+
244
+ if($check_user['status'] == 'ERROR'){
245
+ return Mo2fConstants:: langTranslate( $check_user['message']);
246
+
247
+ }
248
+ else if(strcasecmp($check_user['status' ], 'USER_FOUND') == 0){
249
+
250
+ $Mo2fdbQueries->update_user_details( $current_user_id, array(
251
+ 'user_registration_with_miniorange' =>'SUCCESS',
252
+ 'mo2f_user_email' =>$email,
253
+ 'mo_2factor_user_registration_status' =>'MO_2_FACTOR_INITIALIZE_TWO_FACTOR'
254
+ ) );
255
+ update_site_option(base64_encode("totalUsersCloud"),get_site_option(base64_encode("totalUsersCloud"))+1);
256
+
257
+ $mo2fa_login_status = 'MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS';
258
+ }
259
+ else if(strcasecmp($check_user['status'], 'USER_NOT_FOUND') == 0){
260
+
261
+ $content = json_decode($enduser->mo_create_user($current_user,$email), true);
262
+ if(json_last_error() == JSON_ERROR_NONE) {
263
+ if(strcasecmp($content['status'], 'SUCCESS') == 0) {
264
+ update_site_option(base64_encode("totalUsersCloud"),get_site_option(base64_encode("totalUsersCloud"))+1);
265
+ $Mo2fdbQueries->update_user_details( $current_user_id, array(
266
+ 'user_registration_with_miniorange' =>'SUCCESS',
267
+ 'mo2f_user_email' =>$email,
268
+ 'mo_2factor_user_registration_status' =>'MO_2_FACTOR_INITIALIZE_TWO_FACTOR'
269
+ ) );
270
+
271
+ $mo2fa_login_message = '';
272
+ $mo2fa_login_status = 'MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS';
273
+ }
274
+ }
275
+
276
+
277
+ }
278
+ else if(strcasecmp($check_user['status'], 'USER_FOUND_UNDER_DIFFERENT_CUSTOMER') == 0){
279
+ $mo2fa_login_message = __('The email associated with your account is already registered. Please contact your admin to change the email.','miniorange-2-factor-authentication');
280
+ $mo2fa_login_status = 'MO_2_FACTOR_PROMPT_FOR_RELOGIN';
281
+ mo2f_inline_email_form($email,$current_user_id);
282
+ exit;
283
+ }
284
+
285
+ }
286
+
287
+ }
288
+
289
+ function mo2f_inline_email_form($email,$current_user_id)
290
+ {
291
+ ?>
292
+ <html>
293
+ <head>
294
+ <meta charset="utf-8"/>
295
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
296
+ <meta name="viewport" content="width=device-width, initial-scale=1">
297
+ <?php
298
+ mo2f_inline_css_and_js();
299
+ ?>
300
+ </head>
301
+ <body>
302
+ <div class="mo2f_modal" tabindex="-1" role="dialog" id="myModal5">
303
+ <div class="mo2f-modal-backdrop"></div>
304
+ <div class="mo_customer_validation-modal-dialog mo_customer_validation-modal-md">
305
+ <div class="login mo_customer_validation-modal-content">
306
+ <div class="mo2f_modal-header">
307
+ <h3 class="mo2f_modal-title"><button type="button" class="mo2f_close" data-dismiss="modal" aria-label="Close" title="<?php echo __('Back to login','miniorange-2-factor-authentication');?>" onclick="mologinback();"><span aria-hidden="true">&times;</span></button>
308
+ <?php echo __('Email already registered.', 'miniorange-2-factor-authentication'); ?></h3>
309
+ </div>
310
+ <div class="mo2f_modal-body">
311
+ <form action="" method="post" name="f">
312
+ <p>The Email assoicated with your account is already registered in miniOrnage. Please use a different email address or contact miniOrange.
313
+ </p><br>
314
+ <i><b>Enter your Email:&nbsp;&nbsp;&nbsp; </b> <input type ='email' id='emailInlineCloud' name='emailInlineCloud' size= '40' required value="<?php echo $email;?>"/></i>
315
+ <br>
316
+ <p id="emailalredyused" style="color: red;" hidden>This email is already associated with miniOrange.</p>
317
+ <br>
318
+ <input type="hidden" name="miniorange_emailChange_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-email-change-nonce'); ?>" />
319
+ <input type="text" name="current_user_id" hidden id="current_user_id" value="<?php echo $current_user_id;?>" />
320
+ <button type="submit" class="mo_wpns_button mo_wpns_button1" style ="margin-left: 165px;" id="save_entered_email_inlinecloud">Save</button>
321
+ </form>
322
+ <br>
323
+ <?php mo2f_customize_logo() ?>
324
+ </div>
325
+ </div>
326
+ </div>
327
+ </div>
328
+ <form name="f" id="mo2f_backto_mo_loginform" method="post" action="<?php echo wp_login_url(); ?>" style="display:none;">
329
+ <input type="hidden" name="miniorange_mobile_validation_failed_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-mobile-validation-failed-nonce'); ?>" />
330
+ </form>
331
+ <form name="f" method="post" action="" id="mo2f_select_2fa_methods_form" style="display:none;">
332
+ <input type="hidden" name="mo2f_selected_2factor_method" />
333
+ <input type="hidden" name="miniorange_inline_save_2factor_method_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-inline-save-2factor-method-nonce'); ?>" />
334
+ <input type="hidden" name="option" value="miniorange_inline_save_2factor_method" />
335
+ <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
336
+ <input type="hidden" name="session_id" value="<?php echo $session_id; ?>"/>
337
+ </form>
338
+ <?php if(get_site_option('mo2f_skip_inline_option')&& !get_site_option('mo2f_enable_emailchange')){ ?>
339
+ <form name="f" id="mo2f_skip_loginform" method="post" action="" style="display:none;">
340
+ <input type="hidden" name="miniorange_skip_2fa" value="<?php echo wp_create_nonce('miniorange-2-factor-skip-nonce'); ?>" />
341
+ </form>
342
+ <?php } ?>
343
+ </body>
344
+ <script type="text/javascript">
345
+ jQuery('#save_entered_email_inlinecloud1').click(function(){
346
+ var email = jQuery('#emailInlineCloud').val();
347
+ var nonce = '<?php echo wp_create_nonce("checkuserinminiOrangeNonce");?>';
348
+ var data = {
349
+ 'action' : 'mo_two_factor_ajax',
350
+ 'mo_2f_two_factor_ajax' : 'mo2f_check_user_exist_miniOrange',
351
+ 'email' : email,
352
+ 'nonce' : nonce
353
+
354
+ };
355
+
356
+ var ajaxurl = '<?php echo esc_url(admin_url('')); ?>';
357
+
358
+
359
+ jQuery.post(ajaxurl, data, function(response) {
360
+
361
+ if(response == 'alreadyExist')
362
+ {
363
+ jQuery('#emailalredyused').show();
364
+ }
365
+ else if(response =='USERCANBECREATED')
366
+ {
367
+ document.getElementById("mo2f_select_2fa_methods_form").elements[0].value = selectedMethod;
368
+ jQuery('#mo2f_select_2fa_methods_form').submit();
369
+ }
370
+ });
371
+
372
+ });
373
+
374
+
375
+ </script>
376
+
377
+ <?php
378
+ }
379
+ function prompt_user_for_miniorange_app_setup($current_user_id, $login_status, $login_message,$session_id,$qrCode,$currentMethod){
380
+
381
+ global $Mo2fdbQueries;
382
+ if(isset($qrCode)){
383
+ $qrCodedata = $qrCode['mo2f-login-qrCode'];
384
+ $showqrCode = $qrCode['mo2f_show_qr_code'];
385
+ }
386
+ $current_user = get_userdata($current_user_id);
387
+ $email = $current_user->user_email;
388
+
389
+ $opt=fetch_methods($current_user);
390
+
391
+ $mobile_registration_status = $Mo2fdbQueries->get_user_detail( 'mobile_registration_status',$current_user_id);
392
+ ?>
393
+ <html>
394
+ <head> <meta charset="utf-8"/>
395
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
396
+ <meta name="viewport" content="width=device-width, initial-scale=1">
397
+ <?php
398
+ mo2f_inline_css_and_js();
399
+ ?>
400
+ </head>
401
+ <body>
402
+ <div class="mo2f_modal" tabindex="-1" role="dialog" id="myModal5">
403
+ <div class="mo2f-modal-backdrop"></div>
404
+ <div class="mo2f_modal-dialog mo2f_modal-lg" >
405
+ <div class="login mo_customer_validation-modal-content">
406
+ <div class="mo2f_modal-header">
407
+ <h4 class="mo2f_modal-title"><button type="button" class="mo2f_close" data-dismiss="modal" aria-label="Close" title="<?php echo __('Back to login', 'miniorange-2-factor-authentication'); ?>" onclick="mologinback();"><span aria-hidden="true">&times;</span></button>
408
+ <?php echo __('Setup miniOrange', 'miniorange-2-factor-authentication'); ?> <b><?php echo __('Authenticator', 'miniorange-2-factor-authentication'); ?></b> <?php echo __('App', 'miniorange-2-factor-authentication'); ?></h4>
409
+ </div>
410
+ <div class="mo2f_modal-body">
411
+ <?php if(isset($login_message) && !empty($login_message)) { ?>
412
+
413
+ <div id="otpMessage">
414
+ <p class="mo2fa_display_message_frontend" style="text-align: left !important;"><?php echo __($login_message, 'miniorange-2-factor-authentication'); ?></p>
415
+ </div>
416
+ <?php } ?>
417
+ <div style="margin-right:7px;"><?php download_instruction_for_mobile_app($current_user_id,$mobile_registration_status); ?></div>
418
+ <div class="mo_margin_left">
419
+ <h3><?php echo __('Step-2 : Scan QR code', 'miniorange-2-factor-authentication'); ?></h3><hr class="mo_hr">
420
+ <div id="mo2f_configurePhone"><h4><?php echo __('Please click on \'Configure your phone\' button below to see QR Code.', 'miniorange-2-factor-authentication'); ?></h4>
421
+ <center>
422
+ <?php if (sizeof($opt) > 1) { ?>
423
+ <input type="button" name="back" id="mo2f_inline_back_btn" class="miniorange_button" value="<?php echo __('Back', 'miniorange-2-factor-authentication'); ?>" />
424
+ <?php } ?>
425
+ <input type="button" name="submit" onclick="moconfigureapp();" class="miniorange_button" value="<?php echo __('Configure your phone', 'miniorange-2-factor-authentication'); ?>" />
426
+ </center>
427
+ </div>
428
+ <?php
429
+ if(isset($showqrCode) && $showqrCode == 'MO_2_FACTOR_SHOW_QR_CODE' && isset($_POST['miniorange_inline_show_qrcode_nonce']) && wp_verify_nonce( $_POST['miniorange_inline_show_qrcode_nonce'], 'miniorange-2-factor-inline-show-qrcode-nonce' )){
430
+ initialize_inline_mobile_registration($current_user,$session_id,$qrCodedata); ?>
431
+ <?php } ?>
432
+
433
+ <?php mo2f_customize_logo() ?>
434
+ </div>
435
+ <br>
436
+ <br>
437
+ </div>
438
+ </div>
439
+ </div>
440
+ </div>
441
+ <form name="f" id="mo2f_backto_mo_loginform" method="post" action="<?php echo wp_login_url(); ?>" style="display:none;">
442
+ <input type="hidden" name="miniorange_mobile_validation_failed_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-mobile-validation-failed-nonce'); ?>" />
443
+ </form>
444
+ <form name="f" method="post" action="" id="mo2f_inline_configureapp_form" style="display:none;">
445
+ <input type="hidden" name="option" value="miniorange_inline_show_mobile_config"/>
446
+ <input type="hidden" name="session_id" value="<?php echo $session_id; ?>"/>
447
+ <input type="hidden" name="miniorange_inline_show_qrcode_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-inline-show-qrcode-nonce'); ?>" />
448
+ </form>
449
+ <form name="f" method="post" id="mo2f_inline_mobile_register_form" action="" style="display:none;">
450
+ <input type="hidden" name="option" value="miniorange_inline_complete_mobile"/>
451
+ <input type="hidden" name="session_id" value="<?php echo $session_id; ?>"/>
452
+ <input type="hidden" name="mo_auth_inline_mobile_registration_complete_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-inline-mobile-registration-complete-nonce'); ?>" />
453
+ </form>
454
+ <?php if (sizeof($opt) > 1) { ?>
455
+ <form name="f" method="post" action="" id="mo2f_goto_two_factor_form">
456
+ <input type="hidden" name="option" value="miniorange_back_inline"/>
457
+ <input type="hidden" name="miniorange_inline_two_factor_setup" value="<?php echo wp_create_nonce('miniorange-2-factor-inline-setup-nonce'); ?>" />
458
+ </form>
459
+ <?php } ?>
460
+ <script>
461
+ function mologinback(){
462
+ jQuery('#mo2f_backto_mo_loginform').submit();
463
+ }
464
+ function moconfigureapp(){
465
+ jQuery('#mo2f_inline_configureapp_form').submit();
466
+ }
467
+ jQuery('#mo2f_inline_back_btn').click(function() {
468
+ jQuery('#mo2f_goto_two_factor_form').submit();
469
+ });
470
+ <?php
471
+ if(isset($showqrCode) && $showqrCode == 'MO_2_FACTOR_SHOW_QR_CODE' && isset($_POST['miniorange_inline_show_qrcode_nonce']) && wp_verify_nonce( $_POST['miniorange_inline_show_qrcode_nonce'], 'miniorange-2-factor-inline-show-qrcode-nonce' )){
472
+ ?>
473
+ <?php } ?>
474
+ </script>
475
+ </body>
476
+ </html>
477
+ <?php
478
+ }
479
+
480
+ function prompt_user_for_google_authenticator_setup($current_user_id, $login_status, $login_message){
481
+ $mo2f_google_auth=json_decode(get_user_meta($current_user_id,'mo2f_google_auth', true),true);
482
+
483
+ $data = isset($mo2f_google_auth) ? $mo2f_google_auth['ga_qrCode'] : null;
484
+ $ga_secret = isset($mo2f_google_auth) ? $mo2f_google_auth['ga_secret'] : null;
485
+
486
+ ?>
487
+ <html>
488
+ <head> <meta charset="utf-8"/>
489
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
490
+ <meta name="viewport" content="width=device-width, initial-scale=1">
491
+ <?php
492
+ mo2f_inline_css_and_js();
493
+ ?>
494
+ </head>
495
+ <style>
496
+ * {
497
+ box-sizing: border-box;
498
+ }
499
+ [class*="mcol-"] {
500
+ float: left;
501
+ padding: 15px;
502
+ }
503
+ /* For desktop: */
504
+ .mcol-1 {width: 50%;}
505
+ .mcol-2 {width: 50%;}
506
+ @media only screen and (max-width: 768px) {
507
+ /* For mobile phones: */
508
+ [class*="mcol-"] {
509
+ width: 100%;
510
+ }
511
+ }
512
+ </style>
513
+ <body>
514
+ <div class="mo2f_modal" tabindex="-1" role="dialog" id="myModal5">
515
+ <div class="mo2f-modal-backdrop"></div>
516
+ <div class="mo2f_modal-dialog mo2f_modal-lg" >
517
+ <div class="login mo_customer_validation-modal-content">
518
+ <div class="mo2f_modal-header">
519
+ <h4 class="mo2f_modal-title" style="color:black;"><button type="button" class="mo2f_close" data-dismiss="modal" aria-label="Close" title="<?php echo __('Back to login','miniorange-2-factor-authentication');?>" onclick="mologinback();"><span aria-hidden="true">&times;</span></button>
520
+ <?php echo __('Setup Authenticator', 'miniorange-2-factor-authentication'); ?></h4>
521
+ </div>
522
+ <div class="mo2f_modal-body">
523
+ <?php
524
+
525
+ $current_user = get_userdata($current_user_id);
526
+ $opt=fetch_methods($current_user);
527
+ ?>
528
+ <?php if(isset($login_message) && !empty($login_message)) { ?>
529
+ <div id="otpMessage"
530
+ <?php if(get_user_meta($current_user_id, 'mo2f_is_error', true)) { ?>style="background-color:#FADBD8; color:#E74C3C;?>"<?php update_user_meta($current_user_id, 'mo2f_is_error', false);} ?>
531
+ >
532
+ <p class="mo2fa_display_message_frontend" style="text-align: left !important;"><?php echo __($login_message, 'miniorange-2-factor-authentication'); ?></p>
533
+ </div>
534
+ <?php if(isset($login_message)) {?> <br/> <?php } ?>
535
+ <?php } ?>
536
+ <div class="mcol-1">
537
+ <div id="mo2f_choose_app_tour">
538
+ <label for="authenticator_type"><b>Choose an Authenticator app:</b></label>
539
+
540
+ <select id="authenticator_type">
541
+ <option value="google_authenticator">Google Authenticator</option>
542
+ <option value="msft_authenticator">Microsoft Authenticator</option>
543
+ <option value="authy_authenticator">Authy Authenticator</option>
544
+ <option value="last_pass_auth">LastPass Authenticator</option>
545
+ <option value="free_otp_auth">FreeOTP Authenticator</option>
546
+ <option value="duo_auth">Duo Mobile Authenticator</option>
547
+ </select>
548
+ <div id="links_to_apps_tour" style="background-color:white;padding:5px;">
549
+ <span id="links_to_apps">
550
+ <p style="background-color:#e8e4e4;padding:5px;">Get the App - <a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;
551
+ <a href="http://itunes.apple.com/us/app/google-authenticator/id388497605" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p></a>
552
+
553
+ </span>
554
+ </div>
555
+ </div>
556
+ <div style="font-size: 18px !important;"><?php echo __('Scan the QR code from the Authenticator App.', 'miniorange-2-factor-authentication'); ?></div>
557
+ <ol>
558
+ <li><?php echo __('In the app, tap on Menu and select "Set up account"', 'miniorange-2-factor-authentication'); ?></li>
559
+ <li><?php echo __('Select "Scan a barcode". Use your phone\'s camera to scan this barcode.', 'miniorange-2-factor-authentication'); ?></li>
560
+ <br>
561
+ <?php if(MO2F_IS_ONPREM){ ?>
562
+ <div class="mo2f_gauth" data-qrcode="<?php echo $data;?>" style="float:left;margin-left:10%;"></div>
563
+ <?php
564
+
565
+ } else{ ?>
566
+ <div style="margin-left: 14%;">
567
+ <div class="mo2f_gauth_column_cloud mo2f_gauth_left" >
568
+ <div id="displayQrCode"><?php echo '<img id="displayGAQrCodeTour" style="line-height: 0;background:white;" src="data:image/jpg;base64,' . $data . '" />'; ?></div>
569
+ </div>
570
+ </div>
571
+ <?php }
572
+ ?>
573
+ <div style="margin-top: 55%"><a href="#mo2f_scanbarcode_a" aria-expanded="false" style="color:#21618C;"><b><?php echo __('Can\'t scan the barcode?', 'miniorange-2-factor-authentication'); ?></b></a></div>
574
+
575
+ </ol>
576
+ <div id="mo2f_scanbarcode_a" hidden>
577
+ <ol >
578
+ <li><?php echo __('Tap Menu and select "Set up account."', 'miniorange-2-factor-authentication'); ?></li>
579
+ <li><?php echo __('Select "Enter provided key"', 'miniorange-2-factor-authentication'); ?></li>
580
+ <li><?php echo __('In "Enter account name" type your full email address.', 'miniorange-2-factor-authentication'); ?></li>
581
+ <li class="mo2f_list"><?php echo __('In "Enter your key" type your secret key:', 'miniorange-2-factor-authentication'); ?></li>
582
+ <div style="padding: 10px; background-color: #f9edbe;width: 20em;text-align: center;" >
583
+ <div style="font-size: 14px; font-weight: bold;line-height: 1.5;" >
584
+ <?php echo $ga_secret; ?>
585
+ </div>
586
+ <div style="font-size: 80%;color: #666666;">
587
+ <?php echo __('Spaces don\'t matter.', 'miniorange-2-factor-authentication'); ?>
588
+ </div>
589
+ </div>
590
+ <li class="mo2f_list"><?php echo __('Key type: make sure "Time-based" is selected.', 'miniorange-2-factor-authentication'); ?></li>
591
+ <li class="mo2f_list"><?php echo __('Tap Add.', 'miniorange-2-factor-authentication'); ?></li>
592
+ </ol>
593
+ </div>
594
+ </div>
595
+ <div class="mcol-2">
596
+ <div style="font-size: 18px !important;"><b><?php echo __('Verify and Save', 'miniorange-2-factor-authentication'); ?> </b> </div><br />
597
+ <div style="font-size: 15px !important;"><?php echo __('Once you have scanned the barcode, enter the 6-digit verification code generated by the Authenticator app', 'miniorange-2-factor-authentication'); ?></div><br />
598
+ <form name="" method="post" id="mo2f_inline_verify_ga_code_form">
599
+ <span><b><?php echo __('Code:', 'miniorange-2-factor-authentication'); ?> </b>
600
+ <br />
601
+ <input type="hidden" name="option" value="miniorange_inline_ga_validate">
602
+ <input class="mo2f_IR_GA_token" style="margin-left:36.5%;" autofocus="true" required="true" pattern="[0-9]{4,8}" type="text" id="google_auth_code" name="google_auth_code" placeholder="<?php echo __('Enter OTP', 'miniorange-2-factor-authentication'); ?>" /></span><br/>
603
+ <div class="center">
604
+ <input type="submit" name="validate" id="validate" class="miniorange_button" value="<?php echo __('Verify and Save', 'miniorange-2-factor-authentication'); ?>" />
605
+ </div>
606
+ <input type="hidden" name="mo2f_inline_validate_ga_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-inline-google-auth-nonce'); ?>" />
607
+ </form>
608
+ <form name="f" method="post" action="" id="mo2f_goto_two_factor_form" class="center">
609
+ <input type="submit" name="back" id="mo2f_inline_back_btn" class="miniorange_button" value="<?php echo mo2f_lt('Back');?>" />
610
+ <input type="hidden" name="option" value="miniorange_back_inline"/>
611
+ <input type="hidden" name="miniorange_inline_two_factor_setup" value="<?php echo wp_create_nonce('miniorange-2-factor-inline-setup-nonce'); ?>" />
612
+ </form>
613
+ </div>
614
+ <br>
615
+ <br>
616
+ <?php mo2f_customize_logo() ?>
617
+ </div>
618
+ </div>
619
+ </div>
620
+ </div>
621
+ <form name="f" id="mo2f_backto_mo_loginform" method="post" action="<?php echo wp_login_url(); ?>" style="display:none;">
622
+ <input type="hidden" name="miniorange_mobile_validation_failed_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-mobile-validation-failed-nonce'); ?>" />
623
+ </form>
624
+ <form name="f" method="post" id="mo2f_inline_app_type_ga_form" action="" style="display:none;">
625
+ <input type="hidden" name="google_phone_type" />
626
+ <input type="hidden" name="mo2f_inline_ga_phone_type_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-inline-ga-phone-type-nonce'); ?>" />
627
+ </form>
628
+ </body>
629
+ <script>
630
+ jQuery('#authenticator_type').change(function(){
631
+ var auth_type = jQuery(this).val();
632
+ if(auth_type == 'google_authenticator'){
633
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;">' +
634
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
635
+ '<a href="http://itunes.apple.com/us/app/google-authenticator/id388497605" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
636
+ jQuery('#mo2f_change_app_name').show();
637
+ jQuery('#links_to_apps').show();
638
+ }else if(auth_type == 'msft_authenticator'){
639
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;">' +
640
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=com.azure.authenticator" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
641
+ '<a href="https://apps.apple.com/us/app/microsoft-authenticator/id983156458" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
642
+ jQuery('#links_to_apps').show();
643
+ }else if(auth_type == 'free_otp_auth'){
644
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;">' +
645
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=org.fedorahosted.freeotp" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
646
+ '<a href="https://apps.apple.com/us/app/freeotp-authenticator/id872559395" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
647
+ jQuery('#links_to_apps').show();
648
+ }else if(auth_type == 'duo_auth'){
649
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;">' +
650
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=com.duosecurity.duomobile" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
651
+ '<a href="https://apps.apple.com/in/app/duo-mobile/id422663827" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
652
+ jQuery('#links_to_apps').show();
653
+ }else if(auth_type == 'authy_authenticator'){
654
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;">' +
655
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=com.authy.authy" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
656
+ '<a href="https://itunes.apple.com/in/app/authy/id494168017" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
657
+ jQuery('#links_to_apps').show();
658
+ }else{
659
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;">' +
660
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=com.lastpass.authenticator" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
661
+ '<a href="https://itunes.apple.com/in/app/lastpass-authenticator/id1079110004" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
662
+ jQuery('#mo2f_change_app_name').show();
663
+ jQuery('#links_to_apps').show();
664
+ }
665
+ });
666
+ function mologinback(){
667
+ jQuery('#mo2f_backto_mo_loginform').submit();
668
+ }
669
+ jQuery('input:radio[name=mo2f_inline_app_type_radio]').click(function() {
670
+ var selectedPhone = jQuery(this).val();
671
+ document.getElementById("mo2f_inline_app_type_ga_form").elements[0].value = selectedPhone;
672
+ jQuery('#mo2f_inline_app_type_ga_form').submit();
673
+ });
674
+ jQuery('a[href="#mo2f_scanbarcode_a"]').click(function(){
675
+ jQuery("#mo2f_scanbarcode_a").toggle();
676
+ });
677
+ </script>
678
+ <?php
679
+ echo '<head>';
680
+ echo '<script type="text/javascript" src="'.plugins_url( "/includes/jquery-qrcode/jquery-qrcode.js", dirname(dirname(__FILE__ ))).'"></script>';
681
+ echo '<script type="text/javascript" src="'.plugins_url( "/includes/jquery-qrcode/jquery-qrcode.min.js", dirname(dirname(__FILE__ ))).'"></script>';
682
+ echo '</head>';
683
+ }
684
+
685
+ function mo2f_inline_css_and_js(){
686
+ echo '<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>';
687
+ echo '<script src="' . plugins_url('includes/js/bootstrap.min.js',dirname(dirname( __FILE__))). '" ></script>';
688
+ echo '<link rel="stylesheet" type="text/css" href="' . plugins_url('includes/css/bootstrap.min.css', dirname(dirname(__FILE__))) . '" />';
689
+ echo '<link rel="stylesheet" type="text/css" href="' . plugins_url('includes/css/front_end_login.css',dirname(dirname( __FILE__))). '" />';
690
+ echo '<link rel="stylesheet" type="text/css" href="' . plugins_url('includes/css/style_settings.css', dirname(dirname(__FILE__))). '" />';
691
+ echo '<link rel="stylesheet" type="text/css" href="' . plugins_url('includes/css/hide-login.css',dirname(dirname( __FILE__))) . '" />';
692
+ }
693
+
694
+
695
+ function initialize_inline_mobile_registration($current_user,$session_id,$qrCode){
696
+ $data = $qrCode;
697
+ $mo2f_login_transaction_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_transactionId', $session_id );
698
+ $url = MO_HOST_NAME;
699
+ $opt=fetch_methods($current_user);
700
+ ?>
701
+ <p><?php echo __('Open your miniOrange', 'miniorange-2-factor-authentication'); ?><b> <?php echo __('Authenticator', 'miniorange-2-factor-authentication'); ?></b> <?php echo __('app and click on', 'miniorange-2-factor-authentication'); ?> <b><?php echo __('Configure button', 'miniorange-2-factor-authentication'); ?> </b> <?php echo __('to scan the QR Code. Your phone should have internet connectivity to scan QR code.', 'miniorange-2-factor-authentication'); ?> </p>
702
+ <div class="red" style="color:#E74C3C;">
703
+ <p><?php echo __('I am not able to scan the QR code,', 'miniorange-2-factor-authentication'); ?> <a data-toggle="mo2f_collapse" href="#mo2f_scanqrcode" aria-expanded="false" style="color:#3498DB;"><?php echo __('click here ', 'miniorange-2-factor-authentication'); ?></a></p></div>
704
+ <div class="mo2f_collapse" id="mo2f_scanqrcode" style="margin-left:5px;">
705
+ <?php echo __('Follow these instructions below and try again.', 'miniorange-2-factor-authentication'); ?>
706
+ <ol>
707
+ <li><?php echo __('Make sure your desktop screen has enough brightness.', 'miniorange-2-factor-authentication'); ?></li>
708
+ <li><?php echo __('Open your app and click on Configure button to scan QR Code again.', 'miniorange-2-factor-authentication'); ?></li>
709
+ <li><?php echo __('If you get cross mark on QR Code then click on \'Refresh QR Code\' link.', 'miniorange-2-factor-authentication'); ?></li>
710
+ </ol>
711
+ </div>
712
+ <table class="mo2f_settings_table">
713
+ <a href="#mo2f_refreshQRCode" style="color:#3498DB;"><?php echo __('Click here to Refresh QR Code.', 'miniorange-2-factor-authentication'); ?></a>
714
+ <div id="displayInlineQrCode" style="margin-left:36%;"><?php echo '<img style="width:200px;" src="data:image/jpg;base64,' . $data . '" />'; ?>
715
+ </div>
716
+ </table>
717
+ <center>
718
+ <?php
719
+ if (sizeof($opt) > 1) { ?>
720
+ <input type="button" name="back" id="mo2f_inline_back_btn" class="miniorange_button" value="<?php echo __('Back', 'miniorange-2-factor-authentication'); ?>" />
721
+ <?php }
722
+ ?>
723
+ </center>
724
+ <script>
725
+ jQuery('a[href="#mo2f_refreshQRCode"]').click(function(e) {
726
+ jQuery('#mo2f_inline_configureapp_form').submit();
727
+ });
728
+ jQuery("#mo2f_configurePhone").empty();
729
+ jQuery("#mo2f_app_div").hide();
730
+ var timeout;
731
+ pollInlineMobileRegistration();
732
+ function pollInlineMobileRegistration()
733
+ {
734
+ var transId = "<?php echo $mo2f_login_transaction_id; ?>";
735
+ var jsonString = "{\"txId\":\""+ transId + "\"}";
736
+ var postUrl = "<?php echo $url; ?>" + "/moas/api/auth/registration-status";
737
+ jQuery.ajax({
738
+ url: postUrl,
739
+ type : "POST",
740
+ dataType : "json",
741
+ data : jsonString,
742
+ contentType : "application/json; charset=utf-8",
743
+ success : function(result) {
744
+ var status = JSON.parse(JSON.stringify(result)).status;
745
+ if (status == 'SUCCESS') {
746
+ var content = "<br/><div id='success'><img style='width:165px;margin-top:-1%;margin-left:2%;' src='" + "<?php echo plugins_url( 'includes/images/right.png' , dirname(dirname(__FILE__ )));?>" + "' /></div>";
747
+ jQuery("#displayInlineQrCode").empty();
748
+ jQuery("#displayInlineQrCode").append(content);
749
+ setTimeout(function(){jQuery("#mo2f_inline_mobile_register_form").submit();}, 1000);
750
+ } else if (status == 'ERROR' || status == 'FAILED') {
751
+ var content = "<br/><div id='error'><img style='width:165px;margin-top:-1%;margin-left:2%;' src='" + "<?php echo plugins_url( 'includes/images/wrong.png' , __FILE__ );?>" + "' /></div>";
752
+ jQuery("#displayInlineQrCode").empty();
753
+ jQuery("#displayInlineQrCode").append(content);
754
+ jQuery("#messages").empty();
755
+ jQuery("#messages").append("<div class='error mo2f_error_container'> <p class='mo2f_msgs'>An Error occured processing your request. Please try again to configure your phone.</p></div>");
756
+ } else {
757
+ timeout = setTimeout(pollInlineMobileRegistration, 3000);
758
+ }
759
+ }
760
+ });
761
+ }
762
+ </script>
763
+ <?php
764
+ }
765
+ function prompt_user_for_kba_setup($current_user_id, $login_status, $login_message){
766
+ $current_user = get_userdata($current_user_id);
767
+ $opt=fetch_methods($current_user);
768
+
769
+ ?>
770
+ <html>
771
+ <head> <meta charset="utf-8"/>
772
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
773
+ <meta name="viewport" content="width=device-width, initial-scale=1">
774
+ <?php
775
+ mo2f_inline_css_and_js();
776
+ ?>
777
+ <style>
778
+ .mo2f_kba_ques, .mo2f_table_textbox{
779
+ background: whitesmoke none repeat scroll 0% 0%;
780
+ }
781
+ </style>
782
+ </head>
783
+ <body>
784
+ <div class="mo2f_modal" tabindex="-1" role="dialog" id="myModal5">
785
+ <div class="mo2f-modal-backdrop"></div>
786
+ <div class="mo2f_modal-dialog mo2f_modal-lg">
787
+ <div class="login mo_customer_validation-modal-content">
788
+ <div class="mo2f_modal-header">
789
+ <h4 class="mo2f_modal-title"><button type="button" class="mo2f_close" data-dismiss="modal" aria-label="Close" title="<?php echo __('Back to login','miniorange-2-factor-authentication');?>" onclick="mologinback();"><span aria-hidden="true">&times;</span></button>
790
+ <?php echo __('Setup Security Question (KBA)', 'miniorange-2-factor-authentication'); ?></h4>
791
+ </div>
792
+ <div class="mo2f_modal-body">
793
+ <?php if(isset($login_message) && !empty($login_message)) { ?>
794
+ <div id="otpMessage">
795
+ <p class="mo2fa_display_message_frontend" style="text-align: left !important;"><?php echo __($login_message, 'miniorange-2-factor-authentication'); ?></p>
796
+ </div>
797
+ <?php } ?>
798
+ <form name="f" method="post" action="" >
799
+ <?php mo2f_configure_kba_questions(); ?>
800
+ <br />
801
+ <div class ="row">
802
+ <div class="col-md-4" style="margin: 0 auto;width: 100px;">
803
+ <input type="submit" name="validate" class="miniorange_button" style="width: 30%;background-color:#ff4168;" value="<?php echo __('Save', 'miniorange-2-factor-authentication'); ?>" />
804
+ <button type="button" class="miniorange_button" style="width: 30%;background-color:#ff4168;" onclick="mobackinline();">Back</button>
805
+
806
+ </div>
807
+ </div>
808
+ <input type="hidden" name="option" value="mo2f_inline_kba_option" />
809
+ <input type="hidden" name="mo2f_inline_save_kba_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-inline-save-kba-nonce'); ?>" />
810
+ </form>
811
+ <?php if (sizeof($opt) > 1) { ?>
812
+ <form name="f" method="post" action="" id="mo2f_goto_two_factor_form" class="mo2f_display_none_forms">
813
+ <div class ="row">
814
+ <div class="col-md-4" style="margin: 0 auto;width: 100px;">
815
+ <input type="hidden" name="option" value="miniorange_back_inline"/>
816
+ </div>
817
+ </div>
818
+ <input type="hidden" name="miniorange_inline_two_factor_setup" value="<?php echo wp_create_nonce('miniorange-2-factor-inline-setup-nonce'); ?>" />
819
+ </form>
820
+ <?php } ?>
821
+
822
+ <?php mo2f_customize_logo() ?>
823
+ </div>
824
+ </div>
825
+ </div>
826
+ </div>
827
+ <form name="f" id="mo2f_backto_mo_loginform" method="post" action="<?php echo wp_login_url(); ?>" style="display:none;">
828
+ <input type="hidden" name="miniorange_mobile_validation_failed_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-mobile-validation-failed-nonce'); ?>" />
829
+ </form>
830
+ </body>
831
+ <script>
832
+
833
+
834
+
835
+
836
+
837
+
838
+ function mologinback(){
839
+ jQuery('#mo2f_backto_mo_loginform').submit();
840
+ }
841
+
842
+ function mobackinline(){
843
+ jQuery('#mo2f_goto_two_factor_form').submit();
844
+ }
845
+ </script>
846
+ </html>
847
+ <?php
848
+ }function prompt_user_for_miniorange_register($current_user_id, $login_status, $login_message){
849
+ $current_user = get_userdata($current_user_id);
850
+ $opt=fetch_methods($current_user);
851
+ ?>
852
+ <html>
853
+ <head> <meta charset="utf-8"/>
854
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
855
+ <meta name="viewport" content="width=device-width, initial-scale=1">
856
+ <?php
857
+ mo2f_inline_css_and_js();
858
+ ?>
859
+ <style>
860
+ .mo2f_kba_ques, .mo2f_table_textbox{
861
+ background: whitesmoke none repeat scroll 0% 0%;
862
+ }
863
+ </style>
864
+ </head>
865
+ <body>
866
+ <div class="mo2f_modal" tabindex="-1" role="dialog" id="myModal5">
867
+ <div class="mo2f-modal-backdrop"></div>
868
+ <div class="mo2f_modal-dialog mo2f_modal-lg">
869
+ <div class="login mo_customer_validation-modal-content">
870
+ <div class="mo2f_modal-header">
871
+ <h3 class="mo2f_modal-title" style="color:black;"><button type="button" class="mo2f_close" data-dismiss="modal" aria-label="Close" title="<?php echo __('Back to login','miniorange-2-factor-authentication');?>" onclick="mologinback();"><span aria-hidden="true">&times;</span></button>
872
+ <b> <?php echo __('Connect with miniOrange', 'miniorange-2-factor-authentication'); ?></b></h3>
873
+ </div>
874
+ <div class="mo2f_modal-body">
875
+ <?php if(isset($login_message) && !empty($login_message)){ ?>
876
+ <div id="otpMessage">
877
+ <p class="mo2fa_display_message_frontend" style="text-align: left !important;" ><?php echo $login_message; ?></p>
878
+ </div>
879
+ <?php } ?>
880
+ <form name="mo2f_inline_register_form" id="mo2f_inline_register_form" method="post" action="">
881
+ <input type="hidden" name="option" value="miniorange_inline_register" />
882
+ <p>This method requires you to have an account with miniOrange.</p>
883
+ <table class="mo_wpns_settings_table">
884
+ <tr>
885
+ <td><b><font color="#FF0000">*</font>Email:</b></td>
886
+ <td><input class="mo_wpns_table_textbox" type="email" name="email"
887
+ required placeholder="person@example.com"/></td>
888
+ </tr>
889
+ <tr>
890
+ <td><b><font color="#FF0000">*</font>Password:</b></td>
891
+ <td><input class="mo_wpns_table_textbox" required type="password"
892
+ name="password" placeholder="Choose your password (Min. length 6)" /></td>
893
+ </tr>
894
+ <tr>
895
+ <td><b><font color="#FF0000">*</font>Confirm Password:</b></td>
896
+ <td><input class="mo_wpns_table_textbox" required type="password"
897
+ name="confirmPassword" placeholder="Confirm your password" /></td>
898
+ </tr>
899
+ <tr>
900
+ <td>&nbsp;</td>
901
+ <td><br><input type="submit" name="submit" value="Create Account"
902
+ class="miniorange_button" />
903
+ <a href="#mo2f_account_exist">Already have an account?</a>
904
+ </tr>
905
+ </table>
906
+ </form>
907
+ <form name="f" id="mo2f_inline_login_form" method="post" action="" hidden>
908
+ <p><b>It seems you already have an account with miniOrange. Please enter your miniOrange email and password.<br></b><a target="_blank" href="https://login.xecurify.com/moas/idp/resetpassword"> Click here if you forgot your password?</a></p>
909
+ <input type="hidden" name="option" value="miniorange_inline_login"/>
910
+ <table class="mo_wpns_settings_table">
911
+ <tr>
912
+ <td><b><font color="#FF0000">*</font>Email:</b></td>
913
+ <td><input class="mo_wpns_table_textbox" type="email" name="email"
914
+ required placeholder="person@example.com"
915
+ /></td>
916
+ </tr>
917
+ <tr>
918
+ <td><b><font color="#FF0000">*</font>Password:</b></td>
919
+ <td><input class="mo_wpns_table_textbox" required type="password"
920
+ name="password" placeholder="Enter your miniOrange password" /></td>
921
+ </tr>
922
+ <tr>
923
+ <td>&nbsp;</td>
924
+ <td><input type="submit" class="miniorange_button" />
925
+ <input type="button" id="cancel_link" class="miniorange_button" value="<?php echo __('Go Back to Registration', 'miniorange-2-factor-authentication'); ?>" />
926
+ </tr>
927
+ </table>
928
+ </form>
929
+ <br>
930
+ <input type="button" name="back" id="mo2f_inline_back_btn" class="miniorange_button" value="<?php echo __('<< Back to Menu', 'miniorange-2-factor-authentication'); ?>" />
931
+ <?php mo2f_customize_logo() ?>
932
+ </div>
933
+ </div>
934
+ </div>
935
+ </div>
936
+ <form name="f" method="post" action="" id="mo2f_goto_two_factor_form" >
937
+ <input type="hidden" name="option" value="miniorange_back_inline"/>
938
+ <input type="hidden" name="miniorange_inline_two_factor_setup" value="<?php echo wp_create_nonce('miniorange-2-factor-inline-setup-nonce'); ?>" />
939
+ </form>
940
+ <form name="f" id="mo2f_backto_mo_loginform" method="post" action="<?php echo wp_login_url(); ?>" style="display:none;">
941
+ <input type="hidden" name="miniorange_mobile_validation_failed_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-mobile-validation-failed-nonce'); ?>" />
942
+ </form>
943
+ </body>
944
+ <script>
945
+ jQuery('#mo2f_inline_back_btn').click(function() {
946
+ jQuery('#mo2f_goto_two_factor_form').submit();
947
+ });
948
+ jQuery('a[href=\"#mo2f_account_exist\"]').click(function (e) {
949
+ jQuery('#mo2f_inline_login_form').show();
950
+ jQuery('#mo2f_inline_register_form').hide();
951
+ });
952
+ jQuery('#cancel_link').click(function(){
953
+ jQuery('#mo2f_inline_register_form').show();
954
+ jQuery('#mo2f_inline_login_form').hide();
955
+ });
956
+ function mologinback(){
957
+ jQuery('#mo2f_backto_mo_loginform').submit();
958
+ }
959
+ </script>
960
+ </html>
961
+ <?php
962
+ }
963
+ function prompt_user_for_setup_success($id, $login_status, $login_message){
964
+ global $Mo2fdbQueries;
965
+ ?>
966
+ <html>
967
+ <head> <meta charset="utf-8"/>
968
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
969
+ <meta name="viewport" content="width=device-width, initial-scale=1">
970
+ <?php
971
+ mo2f_inline_css_and_js();
972
+ ?>
973
+ <style>
974
+ .mo2f_kba_ques, .mo2f_table_textbox{
975
+ background: whitesmoke none repeat scroll 0% 0%;
976
+ }
977
+ </style>
978
+ </head>
979
+ <body>
980
+ <div class="mo2f_modal" tabindex="-1" role="dialog" id="myModal5">
981
+ <div class="mo2f-modal-backdrop"></div>
982
+ <div class="mo2f_modal-dialog mo2f_modal-lg">
983
+ <div class="login mo_customer_validation-modal-content">
984
+ <div class="mo2f_modal-header">
985
+ <h4 class="mo2f_modal-title"><button type="button" class="mo2f_close" data-dismiss="modal" aria-label="Close" title="<?php echo __('Back to login', 'miniorange-2-factor-authentication'); ?>" onclick="mologinback();"><span aria-hidden="true">&times;</span></button>
986
+ <?php echo __('Two Factor Setup Complete', 'miniorange-2-factor-authentication'); ?></h4>
987
+ </div>
988
+ <div class="mo2f_modal-body center">
989
+ <?php
990
+ global $Mo2fdbQueries;
991
+ $mo2f_second_factor = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method',$id);
992
+ if($mo2f_second_factor == 'OUT OF BAND EMAIL'){
993
+ $mo2f_second_factor = 'Email Verification';
994
+ }else if($mo2f_second_factor == 'SMS'){
995
+ $mo2f_second_factor = 'OTP over SMS';
996
+ }else if($mo2f_second_factor == 'OTP_OVER_EMAIL'){
997
+ $mo2f_second_factor = 'OTP_OVER_EMAIL';
998
+ }else if($mo2f_second_factor == 'PHONE VERIFICATION'){
999
+ $mo2f_second_factor = 'Phone Call Verification';
1000
+ }else if($mo2f_second_factor == 'SOFT TOKEN'){
1001
+ $mo2f_second_factor = 'Soft Token';
1002
+ }else if($mo2f_second_factor == 'MOBILE AUTHENTICATION'){
1003
+ $mo2f_second_factor = 'QR Code Authentication';
1004
+ }else if($mo2f_second_factor == 'PUSH NOTIFICATIONS'){
1005
+ $mo2f_second_factor = 'Push Notification';
1006
+ }else if($mo2f_second_factor == 'GOOGLE AUTHENTICATOR'){
1007
+ if(get_user_meta($id,'mo2f_external_app_type',true) == 'GOOGLE AUTHENTICATOR'){
1008
+ $mo2f_second_factor = 'Google Authenticator';
1009
+ }else{
1010
+ $mo2f_second_factor = 'Authy 2-Factor Authentication';
1011
+ }
1012
+ }else if($mo2f_second_factor == 'KBA'){
1013
+ $mo2f_second_factor = 'Security Questions (KBA)';
1014
+ }
1015
+ $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method',$id);
1016
+ $status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status',$id);
1017
+
1018
+ if(get_site_option( 'mo2f_disable_kba' )!=1){
1019
+ if($status != 'MO_2_FACTOR_PLUGIN_SETTINGS'){
1020
+ ?><div id="validation_msg" style="color:red;text-align:left !important;"></div>
1021
+ <div id="mo2f_show_kba_reg" class="mo2f_inline_padding" style="text-align:left !important;" >
1022
+ <?php if(isset($login_message) && !empty($login_message)){ ?>
1023
+ <div id="otpMessage">
1024
+ <p class="mo2fa_display_message_frontend" style="text-align: left !important;" ><?php echo $login_message; ?></p>
1025
+ </div>
1026
+ <?php } ?>
1027
+ <h4> <?php echo __('Please set your security questions as an alternate login or backup method.', 'miniorange-2-factor-authentication'); ?></h4>
1028
+ <form name="f" method="post" action="" >
1029
+ <?php mo2f_configure_kba_questions(); ?>
1030
+ <br>
1031
+ <center>
1032
+ <input type="submit" name="validate" class="miniorange_button" value="<?php echo __('Save', 'miniorange-2-factor-authentication'); ?>" />
1033
+ </center>
1034
+ <input type="hidden" name="mo2f_inline_kba_option" />
1035
+ <input type="hidden" name="mo2f_inline_save_kba_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-inline-save-kba-nonce'); ?>" />
1036
+ <input type="hidden" name="mo2f_inline_kba_status" value="<?php echo $login_status; ?>" />
1037
+ </form>
1038
+ </div>
1039
+ <?php }
1040
+ }else{
1041
+ $mo2fa_login_status = 'MO_2_FACTOR_SETUP_SUCCESS';
1042
+ $Mo2fdbQueries->update_user_details( $id, array('mo_2factor_user_registration_status' =>'MO_2_FACTOR_PLUGIN_SETTINGS') );
1043
+ $status = 'MO_2_FACTOR_PLUGIN_SETTINGS';
1044
+ }
1045
+ if($status == 'MO_2_FACTOR_PLUGIN_SETTINGS'){
1046
+ if(get_site_option('mo2f_remember_device')!=1)
1047
+ {
1048
+ $pass2fa= new Miniorange_Password_2Factor_Login();
1049
+ $pass2fa->mo2fa_pass2login(site_url());
1050
+ ?>
1051
+ <center>
1052
+ <p style="font-size:17px;"><?php echo __('You have successfully set up ', 'miniorange-2-factor-authentication'); ?><b style="color:#28B463;"><?php echo $mo2f_second_factor; ?> </b><?php echo __('as your Two Factor method.', 'miniorange-2-factor-authentication'); ?><br><br>
1053
+ <?php echo __('From now, when you login, you will be prompted for', 'miniorange-2-factor-authentication'); ?> <span style="color:#28B463;"><?php echo __($mo2f_second_factor, 'miniorange-2-factor-authentication'); ?></span> <?php echo __('as your 2nd factor method of authentication.', 'miniorange-2-factor-authentication'); ?>
1054
+ </p>
1055
+ </center>
1056
+ <br>
1057
+ <center>
1058
+ <p style="font-size:16px;"><a href="#" onclick="mologinback();"style="color:#CB4335;"><b><?php echo __('Click Here', 'miniorange-2-factor-authentication'); ?></b></a> <?php echo __('to sign-in to your account.', 'miniorange-2-factor-authentication'); ?>
1059
+ <br>
1060
+ </center>
1061
+ <?php
1062
+ }else{
1063
+ $redirect_to = isset($_POST[ 'redirect_to' ]) ? $_POST[ 'redirect_to' ] : null;
1064
+ $mo_enable_rem = new Miniorange_Password_2Factor_Login();
1065
+ mo2f_collect_device_attributes_handler($redirect_to);
1066
+ }
1067
+ }
1068
+ mo2f_customize_logo() ?>
1069
+ </div>
1070
+ </div>
1071
+ </div>
1072
+ </div>
1073
+ <form name="f" id="mo2f_backto_mo_loginform" method="post" action="<?php echo wp_login_url(); ?>" style="display:none;">
1074
+ <input type="hidden" name="miniorange_mobile_validation_failed_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-mobile-validation-failed-nonce'); ?>" />
1075
+ </form>
1076
+ </body>
1077
+ <script>
1078
+ function mologinback(){
1079
+ jQuery('#mo2f_backto_mo_loginform').submit();
1080
+ }
1081
+ </script>
1082
+ </html>
1083
+ <?php
1084
+ }
1085
+
1086
+ function prompt_user_for_phone_setup($current_user_id, $login_status, $login_message,$currentMethod){
1087
+ $current_user = get_userdata($current_user_id);
1088
+ $opt=fetch_methods($current_user);
1089
+ global $Mo2fdbQueries;
1090
+ $current_selected_method = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method',$current_user_id);
1091
+ $current_user = get_userdata($current_user_id);
1092
+ $email = $current_user->user_email;
1093
+ ?>
1094
+ <html>
1095
+ <head> <meta charset="utf-8"/>
1096
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
1097
+ <meta name="viewport" content="width=device-width, initial-scale=1">
1098
+ <?php
1099
+ mo2f_inline_css_and_js();
1100
+
1101
+ echo '<script src="' . plugins_url('includes/js/bootstrap.min.js',dirname(dirname(__FILE__))) . '" ></script>';
1102
+ echo '<script src="' . plugins_url('includes/js/phone.js',dirname(dirname( __FILE__))). '" ></script>';
1103
+ echo '<link rel="stylesheet" type="text/css" href="' . plugins_url('includes/css/phone.css', dirname(dirname(__FILE__))). '" />';
1104
+ ?>
1105
+ </head>
1106
+ <body>
1107
+ <div class="mo2f_modal" tabindex="-1" role="dialog" id="myModal5">
1108
+ <div class="mo2f-modal-backdrop"></div>
1109
+ <div class="mo_customer_validation-modal-dialog mo_customer_validation-modal-md" >
1110
+ <div class="login mo_customer_validation-modal-content">
1111
+ <div class="mo2f_modal-header">
1112
+ <h4 class="mo2f_modal-title"><button type="button" class="mo2f_close" data-dismiss="modal" aria-label="Close" title="<?php echo __('Back to login','miniorange-2-factor-authentication');?>" onclick="mologinback();"><span aria-hidden="true">&times;</span></button>
1113
+ <?php
1114
+ if($current_selected_method == 'SMS AND EMAIL'){?>
1115
+ <?php echo __('Verify Your Phone and Email', 'miniorange-2-factor-authentication'); ?></h4>
1116
+ <?php }
1117
+ else if($current_selected_method == 'OTP OVER EMAIL'){
1118
+ ?>
1119
+ <?php echo __('Verify Your EMAIL', 'miniorange-2-factor-authentication'); ?></h4>
1120
+ <?php }
1121
+ else{
1122
+ ?>
1123
+ <?php echo __('Verify Your Phone', 'miniorange-2-factor-authentication'); ?></h3>
1124
+ <?php } ?>
1125
+ </div>
1126
+ <div class="mo2f_modal-body">
1127
+ <?php if(isset($login_message) && !empty($login_message)) { ?>
1128
+ <div id="otpMessage"
1129
+ <?php if(get_user_meta($current_user_id, 'mo2f_is_error', true)) { ?>style="background-color:#FADBD8; color:#E74C3C;?>"<?php update_user_meta($current_user_id, 'mo2f_is_error', false);} ?>
1130
+ >
1131
+ <p class="mo2fa_display_message_frontend" style="text-align: left !important; "> <?php echo $login_message; ?></p>
1132
+ </div>
1133
+ <?php if(isset($login_message)) {?> <br/> <?php } ?>
1134
+ <?php } ?>
1135
+ <div class="mo2f_row">
1136
+ <form name="f" method="post" action="" id="mo2f_inline_verifyphone_form">
1137
+ <p>
1138
+ <?php
1139
+ if($current_selected_method == 'SMS AND EMAIL'){?>
1140
+ <?php echo __('Enter your phone number. An One Time Passcode(OTP) wll be sent to this number and your email address.', 'miniorange-2-factor-authentication'); ?></p>
1141
+ <?php
1142
+ }else if($current_selected_method == 'OTP OVER EMAIL'){
1143
+ //no message
1144
+ }else{
1145
+ ?>
1146
+ <?php echo __('Enter your phone number', 'miniorange-2-factor-authentication'); ?></h4>
1147
+ <?php }
1148
+ if(!($current_selected_method == 'OTP OVER EMAIL')){
1149
+ ?>
1150
+ <input class="mo2f_table_textbox" type="text" name="verify_phone" id="phone"
1151
+ value="<?php echo get_user_meta($current_user_id,'mo2f_user_phone',true); ?>" pattern="[\+]?[0-9]{1,4}\s?[0-9]{7,12}" required="true" title="<?php echo __('Enter phone number without any space or dashes', 'miniorange-2-factor-authentication'); ?>" /><br />
1152
+ <?php } ?>
1153
+ <?php
1154
+ $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email',$current_user_id);
1155
+ if($current_selected_method == 'SMS AND EMAIL' ||$current_selected_method == 'OTP OVER EMAIL' ){?>
1156
+ <input class="mo2f_IR_phone" type="text" name="verify_email" id="email"
1157
+ value="<?php echo $email ; ?>" title="<?php echo __('Enter your email', 'miniorange-2-factor-authentication'); ?>" style="width: 250px;" disabled /><br />
1158
+ <?php } ?>
1159
+ <input type="submit" name="verify" class="miniorange_button" value="<?php echo __('Send OTP', 'miniorange-2-factor-authentication'); ?>" />
1160
+ <input type="hidden" name="option" value="miniorange_inline_complete_otp_over_sms"/>
1161
+ <input type="hidden" name="miniorange_inline_verify_phone_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-inline-verify-phone-nonce'); ?>" />
1162
+ </form>
1163
+ </div>
1164
+ <form name="f" method="post" action="" id="mo2f_inline_validateotp_form" >
1165
+ <p>
1166
+ <?php
1167
+ if($current_selected_method == 'SMS AND EMAIL'){?>
1168
+ <h4><?php echo __('Enter One Time Passcode', 'miniorange-2-factor-authentication'); ?></h4>
1169
+ <?php }
1170
+ else{
1171
+ ?>
1172
+ <?php echo mo2f_lt('Please enter the One Time Passcode sent to your phone.');?></p>
1173
+ <?php } ?>
1174
+ <input class="mo2f_IR_phone_OTP" required="true" pattern="[0-9]{4,8}" autofocus="true" type="text" name="otp_token" placeholder="<?php echo __('Enter the code', 'miniorange-2-factor-authentication'); ?>" id="otp_token"/><br>
1175
+ <span style="color:#1F618D;"><?php echo mo2f_lt('Didn\'t get code?');?></span> &nbsp;
1176
+ <?php if ($current_selected_method == 'PHONE VERIFICATION'){ ?>
1177
+ <a href="#resendsmslink" style="color:#F4D03F ;font-weight:bold;"><?php echo __('CALL AGAIN', 'miniorange-2-factor-authentication'); ?></a>
1178
+ <?php } else {?>
1179
+ <a href="#resendsmslink" style="color:#F4D03F ;font-weight:bold;"><?php echo __('RESEND IT', 'miniorange-2-factor-authentication'); ?></a>
1180
+ <?php } ?>
1181
+ <br /><br />
1182
+ <input type="submit" name="validate" class="miniorange_button" value="<?php echo __('Verify Code', 'miniorange-2-factor-authentication'); ?>" />
1183
+ <?php if (sizeof($opt) > 1) { ?>
1184
+
1185
+ <input type="hidden" name="option" value="miniorange_back_inline"/>
1186
+ <input type="button" name="back" id="mo2f_inline_back_btn" class="miniorange_button" value="<?php echo __('Back', 'miniorange-2-factor-authentication'); ?>" />
1187
+ <?php } ?>
1188
+ <input type="hidden" name="option" value="miniorange_inline_complete_otp"/>
1189
+ <input type="hidden" name="miniorange_inline_validate_otp_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-inline-validate-otp-nonce'); ?>" />
1190
+ </form>
1191
+ <?php mo2f_customize_logo() ?>
1192
+ </div>
1193
+ </div>
1194
+ </div>
1195
+ </div>
1196
+ <form name="f" id="mo2f_backto_mo_loginform" method="post" action="<?php echo wp_login_url(); ?>" style="display:none;">
1197
+ <input type="hidden" name="miniorange_mobile_validation_failed_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-mobile-validation-failed-nonce'); ?>" />
1198
+ </form>
1199
+ <form name="f" method="post" action="" id="mo2fa_inline_resend_otp_form" style="display:none;">
1200
+ <input type="hidden" name="miniorange_inline_resend_otp_nonce" value="<?php echo wp_create_nonce('miniorange-2-factor-inline-resend-otp-nonce'); ?>" />
1201
+ </form>
1202
+ <?php if (sizeof($opt) > 1) { ?>
1203
+ <form name="f" method="post" action="" id="mo2f_goto_two_factor_form" >
1204
+ <input type="hidden" name="option" value="miniorange_back_inline"/>
1205
+ <input type="hidden" name="miniorange_inline_two_factor_setup" value="<?php echo wp_create_nonce('miniorange-2-factor-inline-setup-nonce'); ?>" />
1206
+ </form>
1207
+ <?php } ?>
1208
+ </body>
1209
+ <script>
1210
+ jQuery("#phone").intlTelInput();
1211
+ function mologinback(){
1212
+ jQuery('#mo2f_backto_mo_loginform').submit();
1213
+ }
1214
+ jQuery('#mo2f_inline_back_btn').click(function() {
1215
+ jQuery('#mo2f_goto_two_factor_form').submit();
1216
+ });
1217
+ jQuery('a[href="#resendsmslink"]').click(function(e) {
1218
+ jQuery('#mo2fa_inline_resend_otp_form').submit();
1219
+ });
1220
+ </script>
1221
+ </html>
1222
+ <?php
1223
+ }
controllers/twofa/setup_twofa.php CHANGED
@@ -2,12 +2,14 @@
2
 
3
  $email_registered = 1;
4
  global $Mo2fdbQueries;
5
- $email = get_user_meta(get_current_user_id(),'email',true);
6
  if(isset($email))
7
  $email_registered = 1;
8
  else
9
  $email_registered = 0;
10
 
 
 
11
  if(current_user_can( 'manage_options' ) && isset($_POST['option']))
12
  {
13
  switch($_POST['option'])
@@ -30,4 +32,4 @@
30
  do_action('wpns_show_message',MoWpnsMessages::showMessage('TWO_FA_ON_LOGIN_PROMPT_DISABLED'),'ERROR');
31
  }
32
  }
33
- }
2
 
3
  $email_registered = 1;
4
  global $Mo2fdbQueries;
5
+ $email =$Mo2fdbQueries->get_user_detail( 'mo2f_user_email', get_current_user_id() );
6
  if(isset($email))
7
  $email_registered = 1;
8
  else
9
  $email_registered = 0;
10
 
11
+ $upgrade_url = add_query_arg(array('page' => 'mo_2fa_upgrade' ), $_SERVER['REQUEST_URI']);
12
+
13
  if(current_user_can( 'manage_options' ) && isset($_POST['option']))
14
  {
15
  switch($_POST['option'])
32
  do_action('wpns_show_message',MoWpnsMessages::showMessage('TWO_FA_ON_LOGIN_PROMPT_DISABLED'),'ERROR');
33
  }
34
  }
35
+ }
controllers/twofa/two_fa_premium_feature.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+
3
+ include $mo2f_dirName . 'views'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_premium_feature.php';
controllers/twofa/two_fa_session_control.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+
3
+ include $mo2f_dirName . 'views'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_session_control.php';
controllers/twofa/two_fa_unlimittedUser.php CHANGED
@@ -1,4 +1,3 @@
1
-
2
  <?php
3
  global $moWpnsUtility, $mo2f_dirName;
4
  include $mo2f_dirName . 'views'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_unlimittedUser.php';
 
1
  <?php
2
  global $moWpnsUtility, $mo2f_dirName;
3
  include $mo2f_dirName . 'views'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_unlimittedUser.php';
controllers/twofa/two_factor_ajax.php CHANGED
@@ -16,20 +16,89 @@ class mo_2f_ajax
16
  $this->mo2f_save_email_verification(); break;
17
  case 'mo2f_unlimitted_user':
18
  $this->mo2f_unlimitted_user();break;
 
 
 
 
19
  case 'CheckEVStatus':
20
  $this->CheckEVStatus(); break;
21
  case 'mo2f_role_based_2_factor':
22
  $this->mo2f_role_based_2_factor();break;
23
  case 'mo2f_enable_disable_twofactor':
24
- $this->mo2f_enable_disable_twofactor(); break;
 
 
25
  case 'mo2f_shift_to_onprem':
26
  $this->mo2f_shift_to_onprem();break;
27
  }
28
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  function mo2f_shift_to_onprem(){
30
- update_option('is_onprem', 1);
31
- update_option( 'mo2f_remember_device',0);
32
- wp_send_json('true');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  }
34
 
35
 
@@ -40,7 +109,7 @@ function mo2f_shift_to_onprem(){
40
  $error = new WP_Error();
41
  $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
42
 
43
- //return $error;
44
  }
45
 
46
  $enable = sanitize_text_field($_POST['mo2f_enable_2fa']);
@@ -54,6 +123,23 @@ function mo2f_shift_to_onprem(){
54
  }
55
  }
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  function mo2f_role_based_2_factor(){
58
  if ( !wp_verify_nonce($_POST['nonce'],'unlimittedUserNonce') ){
59
  wp_send_json('ERROR');
@@ -75,11 +161,40 @@ function mo2f_shift_to_onprem(){
75
  foreach($enabledrole as $role){
76
  update_option($role, 1);
77
  }
78
- //update_option('mo2fa_administrator_login_url',$_POST['mo2fa_administrator_login_url']);
79
  wp_send_json('true');
80
  return;
81
  }
82
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
84
  function mo2f_unlimitted_user()
85
  {
@@ -103,13 +218,11 @@ function mo2f_shift_to_onprem(){
103
  add_option('mo2fa_'.$id.'_login_url',home_url());
104
  }
105
  }
106
- //update_option('is_onprem' ,1);
107
  echo "OnPremiseActive";
108
  exit;
109
  }
110
  else
111
  {
112
- //update_option('is_onprem' ,0);
113
  echo "OnPremiseDeactive";
114
  exit;
115
  }
@@ -127,13 +240,13 @@ function mo2f_shift_to_onprem(){
127
  {
128
 
129
  $email = sanitize_text_field($_POST['email']);
 
130
  $error = false;
131
  $user_id = sanitize_text_field($_POST['user_id']);
132
- $onprem = MO2F_IS_ONPREM;
133
- if($onprem)
134
  {
135
  $twofactor_transactions = new Mo2fDB;
136
- $exceeded = $twofactor_transactions->check_user_limit_exceeded($user_id);
137
 
138
  if($exceeded){
139
  echo "USER_LIMIT_EXCEEDED";
@@ -147,10 +260,12 @@ function mo2f_shift_to_onprem(){
147
  if($email!='' && !$error)
148
  {
149
  global $Mo2fdbQueries;
150
- update_option('is_onprem' , 1);
151
- $Mo2fdbQueries->update_user_details(get_current_user_id(),array('mo2f_EmailVerification_config_status'=>true));
152
- $Mo2fdbQueries->update_user_details(get_current_user_id(),array('mo2f_configured_2FA_method'=>"Email Verification"));
153
- update_user_meta($user_id,'email',$email);
 
 
154
  echo "settingsSaved";
155
  exit;
156
  }
16
  $this->mo2f_save_email_verification(); break;
17
  case 'mo2f_unlimitted_user':
18
  $this->mo2f_unlimitted_user();break;
19
+ case 'mo2f_check_user_exist_miniOrange':
20
+ $this->mo2f_check_user_exist_miniOrange();break;
21
+ case 'mo2f_single_user':
22
+ $this->mo2f_single_user();break;
23
  case 'CheckEVStatus':
24
  $this->CheckEVStatus(); break;
25
  case 'mo2f_role_based_2_factor':
26
  $this->mo2f_role_based_2_factor();break;
27
  case 'mo2f_enable_disable_twofactor':
28
+ $this->mo2f_enable_disable_twofactor(); break;
29
+ case 'mo2f_enable_disable_inline':
30
+ $this->mo2f_enable_disable_inline(); break;
31
  case 'mo2f_shift_to_onprem':
32
  $this->mo2f_shift_to_onprem();break;
33
  }
34
  }
35
+ function mo2f_check_user_exist_miniOrange()
36
+ {
37
+ $nonce = sanitize_text_field($_POST['nonce']);
38
+
39
+ if ( ! wp_verify_nonce( $nonce, 'checkuserinminiOrangeNonce' ) ) {
40
+ $error = new WP_Error();
41
+ $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
42
+ echo "NonceDidNotMatch";
43
+ exit;
44
+ }
45
+
46
+ if(!get_option('mo2f_customerKey')){
47
+ echo "NOTLOGGEDIN";
48
+ exit;
49
+ }
50
+ $user = wp_get_current_user();
51
+ global $Mo2fdbQueries;
52
+ $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
53
+ if($email == '' or is_null($email))
54
+ $email = $user->user_email;
55
+
56
+
57
+
58
+ if(isset($_POST['email']))
59
+ {
60
+ $email = sanitize_text_field($_POST['email']);
61
+ }
62
+
63
+ $enduser = new Two_Factor_Setup();
64
+ $check_user = json_decode( $enduser->mo_check_user_already_exist( $email ), true );
65
+
66
+
67
+ if(strcasecmp($check_user['status'], 'USER_FOUND_UNDER_DIFFERENT_CUSTOMER') == 0 ){
68
+ echo "alreadyExist";
69
+ exit;
70
+ }
71
+ else
72
+ {
73
+
74
+ update_user_meta($user->ID,'mo2f_email_miniOrange',$email);
75
+ echo "USERCANBECREATED";
76
+ exit;
77
+ }
78
+
79
+ }
80
  function mo2f_shift_to_onprem(){
81
+
82
+ $current_user = wp_get_current_user();
83
+ $current_userID = $current_user->ID;
84
+ $miniorangeID = get_option( 'mo2f_miniorange_admin' );
85
+ if(is_null($miniorangeID) or $miniorangeID =='')
86
+ $is_customer_admin = true;
87
+ else
88
+ $is_customer_admin = $miniorangeID == $current_userID ? true : false;
89
+ if($is_customer_admin)
90
+ {
91
+ update_option('is_onprem', 1);
92
+ update_option( 'mo2f_remember_device',0);
93
+ wp_send_json('true');
94
+ }
95
+ else
96
+ {
97
+ $adminUser = get_user_by('id',$miniorangeID);
98
+ $email = $adminUser->user_email;
99
+ wp_send_json($email);
100
+ }
101
+
102
  }
103
 
104
 
109
  $error = new WP_Error();
110
  $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
111
 
112
+ //return $error;
113
  }
114
 
115
  $enable = sanitize_text_field($_POST['mo2f_enable_2fa']);
123
  }
124
  }
125
 
126
+ function mo2f_enable_disable_inline(){
127
+ $nonce = sanitize_text_field($_POST['mo2f_nonce_enable_inline']);
128
+
129
+ if ( ! wp_verify_nonce( $nonce, 'mo2f-nonce-enable-inline' ) ) {
130
+ wp_send_json("error");
131
+ }
132
+ $enable = sanitize_text_field($_POST['mo2f_inline_registration']);
133
+ if($enable == 'true'){
134
+ update_site_option('mo2f_inline_registration' , 1);
135
+ wp_send_json('true');
136
+ }
137
+ else{
138
+ update_site_option('mo2f_inline_registration' , 0);
139
+ wp_send_json('false');
140
+ }
141
+ }
142
+
143
  function mo2f_role_based_2_factor(){
144
  if ( !wp_verify_nonce($_POST['nonce'],'unlimittedUserNonce') ){
145
  wp_send_json('ERROR');
161
  foreach($enabledrole as $role){
162
  update_option($role, 1);
163
  }
 
164
  wp_send_json('true');
165
  return;
166
  }
167
+ function mo2f_single_user()
168
+ {
169
+ if(!wp_verify_nonce($_POST['nonce'],'singleUserNonce'))
170
+ {
171
+ echo "NonceDidNotMatch";
172
+ exit;
173
+ }
174
+ else
175
+ {
176
+ $current_user = wp_get_current_user();
177
+ $current_userID = $current_user->ID;
178
+ $miniorangeID = get_option( 'mo2f_miniorange_admin' );
179
+ $is_customer_admin = $miniorangeID == $current_userID ? true : false;
180
+
181
+ if(is_null($miniorangeID) or $miniorangeID =='')
182
+ $is_customer_admin = true;
183
+
184
+ if($is_customer_admin)
185
+ {
186
+ update_option('is_onprem', 0);
187
+ wp_send_json('true');
188
+ }
189
+ else
190
+ {
191
+ $adminUser = get_user_by('id',$miniorangeID);
192
+ $email = $adminUser->user_email;
193
+ wp_send_json($email);
194
+ }
195
+
196
+ }
197
+ }
198
 
199
  function mo2f_unlimitted_user()
200
  {
218
  add_option('mo2fa_'.$id.'_login_url',home_url());
219
  }
220
  }
 
221
  echo "OnPremiseActive";
222
  exit;
223
  }
224
  else
225
  {
 
226
  echo "OnPremiseDeactive";
227
  exit;
228
  }
240
  {
241
 
242
  $email = sanitize_text_field($_POST['email']);
243
+ $currentMethod = sanitize_text_field($_POST['current_method']);
244
  $error = false;
245
  $user_id = sanitize_text_field($_POST['user_id']);
246
+ if(MO2F_IS_ONPREM)
 
247
  {
248
  $twofactor_transactions = new Mo2fDB;
249
+ $exceeded = $twofactor_transactions->check_alluser_limit_exceeded($user_id);
250
 
251
  if($exceeded){
252
  echo "USER_LIMIT_EXCEEDED";
260
  if($email!='' && !$error)
261
  {
262
  global $Mo2fdbQueries;
263
+ $Mo2fdbQueries->update_user_details(get_current_user_id(),array(
264
+ 'mo2f_EmailVerification_config_status'=>true,
265
+ 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_PLUGIN_SETTINGS',
266
+ 'mo2f_configured_2FA_method'=>"Email Verification",
267
+ 'mo2f_user_email' => $email
268
+ ));
269
  echo "settingsSaved";
270
  exit;
271
  }
controllers/waf.php CHANGED
@@ -13,6 +13,8 @@
13
  $IPblockedByWAF = $mo_wpns_handler->get_blocked_ip_waf();
14
  $totalIPBlocked = $manualBlocks+$realTime+$IPblockedByWAF;
15
  $mo_waf = get_site_option('WAFEnabled');
 
 
16
  if($mo_waf)
17
  {
18
  $mo_waf = false;
13
  $IPblockedByWAF = $mo_wpns_handler->get_blocked_ip_waf();
14
  $totalIPBlocked = $manualBlocks+$realTime+$IPblockedByWAF;
15
  $mo_waf = get_site_option('WAFEnabled');
16
+ if(!get_option('mo2f_tour_firewall'))
17
+ update_option('mo2f_tour_firewall',1);
18
  if($mo_waf)
19
  {
20
  $mo_waf = false;
controllers/wpns-loginsecurity-ajax.php CHANGED
@@ -30,22 +30,42 @@ class wpns_ajax
30
  $this->wpns_waf_rate_limiting_form(); break;
31
  case 'wpns_ip_lookup':
32
  $this->wpns_ip_lookup(); break;
33
- case 'wpns_upgrade':
34
- $this->wpns_upgrade(); break;
35
- case 'wpns_upgrade_idp':
36
- $this->wpns_upgrade_idp(); break;
 
37
  }
38
  }
39
-
40
- function wpns_upgrade()
41
  {
42
- update_option('mo_wpns_upgrade_onprem' , 1);
43
- update_option('mo_wpns_plantype', $_POST['plantype'] );
44
-
 
 
 
 
 
 
 
 
 
 
 
45
  }
46
- function wpns_upgrade_idp()
47
  {
48
- update_option('mo_wpns_upgrade_onprem' , 0);
 
 
 
 
 
 
 
 
 
49
  }
50
  function wpns_handle_bf_configuration_form(){
51
 
30
  $this->wpns_waf_rate_limiting_form(); break;
31
  case 'wpns_ip_lookup':
32
  $this->wpns_ip_lookup(); break;
33
+ case 'wpns_all_plans':
34
+ $this->wpns_all_plans(); break;
35
+ case 'wpns_logout_form':
36
+ $this->wpns_logout_form(); break;
37
+
38
  }
39
  }
40
+ function wpns_logout_form()
 
41
  {
42
+ global $moWpnsUtility;
43
+ if( !$moWpnsUtility->check_empty_or_null( get_option('mo_wpns_registration_status') ) ) {
44
+ delete_option('mo2f_email');
45
+ }
46
+ delete_option('mo2f_customerKey');
47
+ delete_option('mo2f_api_key');
48
+ delete_option('mo2f_customer_token');
49
+ delete_option('mo_wpns_transactionId');
50
+ delete_option('mo_wpns_registration_status');
51
+ delete_option( 'mo_2factor_admin_registration_status' );
52
+
53
+ $two_fa_settings = new Miniorange_Authentication();
54
+ $two_fa_settings->mo_auth_deactivate();
55
+
56
  }
57
+ function wpns_all_plans()
58
  {
59
+ $mo2f_all_plannames = $_POST['planname'];
60
+ update_option('mo2f_planname', $mo2f_all_plannames);
61
+ if ($mo2f_all_plannames == 'addon_plan')
62
+ {
63
+ update_option('mo2f_planname', 'addon_plan');
64
+ }
65
+ elseif ($mo2f_all_plannames == '2fa_plan')
66
+ {
67
+ update_option('mo2f_planname', '2fa_plan');
68
+ }
69
  }
70
  function wpns_handle_bf_configuration_form(){
71
 
database/database_functions_2fa.php CHANGED
@@ -20,6 +20,7 @@ class Mo2fDB {
20
  } else {
21
  $current_db_version = get_option( 'mo2f_dbversion' );
22
  if ( $current_db_version < MoWpnsConstants::DB_VERSION ) {
 
23
  update_option( 'mo2f_dbversion', MoWpnsConstants::DB_VERSION );
24
  $this->generate_tables();
25
  }
@@ -44,6 +45,7 @@ class Mo2fDB {
44
  `mo2f_EmailVerification_config_status` tinyint,
45
  `mo2f_SecurityQuestions_config_status` tinyint,
46
  `mo2f_GoogleAuthenticator_config_status` tinyint,
 
47
  `mobile_registration_status` tinyint,
48
  `mo2f_2factor_enable_2fa_byusers` tinyint DEFAULT 1,
49
  `mo2f_configured_2FA_method` mediumtext NOT NULL ,
@@ -55,6 +57,19 @@ class Mo2fDB {
55
 
56
  dbDelta( $sql );
57
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
58
 
59
  $tableName = $this->userLoginInfoTable;
60
 
@@ -178,7 +193,8 @@ class Mo2fDB {
178
 
179
  if($table_type == "user_login_info_table")
180
  $table = $this->userLoginInfoTable;
181
-
 
182
  global $wpdb;
183
  $sql="SHOW COLUMNS FROM " . $table . "
184
  LIKE '" . $column_name . "'";
@@ -271,7 +287,7 @@ class Mo2fDB {
271
 
272
  $user_already_configured = $wpdb->query(
273
  "SELECT meta_key FROM ".$wpdb->base_prefix ."usermeta
274
- WHERE meta_key = 'currentMethod' and user_id =".$user_id );
275
 
276
  if($value < 3 || $user_already_configured){
277
  return false;
@@ -280,5 +296,53 @@ class Mo2fDB {
280
  return true;
281
  }
282
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
 
284
  }
20
  } else {
21
  $current_db_version = get_option( 'mo2f_dbversion' );
22
  if ( $current_db_version < MoWpnsConstants::DB_VERSION ) {
23
+
24
  update_option( 'mo2f_dbversion', MoWpnsConstants::DB_VERSION );
25
  $this->generate_tables();
26
  }
45
  `mo2f_EmailVerification_config_status` tinyint,
46
  `mo2f_SecurityQuestions_config_status` tinyint,
47
  `mo2f_GoogleAuthenticator_config_status` tinyint,
48
+ `mo2f_OTPOverEmail_config_status` tinyint,
49
  `mobile_registration_status` tinyint,
50
  `mo2f_2factor_enable_2fa_byusers` tinyint DEFAULT 1,
51
  `mo2f_configured_2FA_method` mediumtext NOT NULL ,
57
 
58
  dbDelta( $sql );
59
  }
60
+ add_site_option( 'cmVtYWluaW5nT1RQ' ,30);
61
+ add_site_option( 'bGltaXRSZWFjaGVk' ,0);
62
+ add_site_option( base64_encode('totalUsersCloud'),0);
63
+ add_site_option( 'mo2f_inline_registration',1);
64
+
65
+ $check_if_column_exists = $this->check_if_column_exists( 'mo2f_user_details', "mo2f_OTPOverEmail_config_status" );
66
+
67
+ if ( ! $check_if_column_exists ) {
68
+ $query = "ALTER TABLE `$tableName` ADD COLUMN `mo2f_OTPOverEmail_config_status` tinyint";
69
+ $this->execute_add_column( $query );
70
+
71
+ }
72
+
73
 
74
  $tableName = $this->userLoginInfoTable;
75
 
193
 
194
  if($table_type == "user_login_info_table")
195
  $table = $this->userLoginInfoTable;
196
+ else if($table_type == "mo2f_user_details")
197
+ $table = $this->userDetailsTable;
198
  global $wpdb;
199
  $sql="SHOW COLUMNS FROM " . $table . "
200
  LIKE '" . $column_name . "'";
287
 
288
  $user_already_configured = $wpdb->query(
289
  "SELECT meta_key FROM ".$wpdb->base_prefix ."usermeta
290
+ WHERE meta_key = 'currentMethod' and user_id =".$user_id);
291
 
292
  if($value < 3 || $user_already_configured){
293
  return false;
296
  return true;
297
  }
298
  }
299
+ function check_alluser_limit_exceeded($user_id){
300
+
301
+ global $wpdb;
302
+ $value = $wpdb->query(
303
+ "SELECT * FROM ".$this->userDetailsTable
304
+ );
305
+ $user_already_configured = $wpdb->query(
306
+ "SELECT * FROM ".$this->userDetailsTable ." WHERE user_id =".$user_id );
307
+
308
+ if($value < 3 || $user_already_configured){
309
+ return false;
310
+ }
311
+ else{
312
+ return true;
313
+ }
314
+ }
315
+
316
+ function get_all_onprem_userids(){
317
+
318
+ global $wpdb;
319
+ $value = $wpdb->get_results(
320
+ "SELECT * FROM ".$wpdb->base_prefix ."usermeta
321
+ WHERE meta_key = 'currentMethod'"
322
+ );
323
+
324
+
325
+ foreach ($value as $row){
326
+
327
+ if(isset($row->user_id)){
328
+
329
+ $this->insert_user( $row->user_id);
330
+
331
+ $this->update_user_details( $row->user_id,
332
+ array(
333
+ 'mo2f_GoogleAuthenticator_config_status' => get_user_meta($row->user_id,'Google Authenticator',true),
334
+ 'mo2f_SecurityQuestions_config_status' => get_user_meta($row->user_id,'Security Questions',true),
335
+ 'mo2f_EmailVerification_config_status' => get_user_meta($row->user_id,'Email Verification',true),
336
+ 'mo2f_AuthyAuthenticator_config_status' =>0,
337
+ 'mo2f_user_email' => get_user_meta($row->user_id,'email',true),
338
+ 'mo2f_user_phone' => '',
339
+ 'user_registration_with_miniorange' => '',
340
+ 'mobile_registration_status' => '',
341
+ 'mo2f_configured_2FA_method' => get_user_meta($row->user_id,'currentMethod',true),
342
+ 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_PLUGIN_SETTINGS'
343
+ ) );
344
+ }
345
+ }
346
+ }
347
 
348
  }
handler/WAF/mo-waf-plugin.php CHANGED
@@ -8,11 +8,11 @@
8
  $wafDB = $dir[0].'/handler/WAF/database/mo-waf-plugin-db.php';
9
  $errorPage = $dir[0].'handler/mo-error.html';
10
  $blockPage = $dir[0].'handler/mo-block.html';
11
-
12
  include_once($wafInclude);
13
  include_once($pluginU);
14
  include_once($wafDB);
15
-
16
 
17
  global $wpdb,$mowpnshandle;
18
  $mowpnshandle = new MoWpnsHandler();
@@ -82,7 +82,7 @@
82
  $XSSScore = 0;
83
  $limitAttack = get_option('limitAttack');
84
 
85
-
86
  foreach ($attackC as $key1 => $value1)
87
  {
88
  for($lev=1;$lev<=$ParanoiaLevel;$lev++)
@@ -99,7 +99,7 @@
99
  {
100
  if(preg_match($regex[$value1][$lev][$i], $value))
101
  {
102
-
103
  if($value1 == "SQL")
104
  {
105
  $SQLScore += $score[$value1][$lev][$i];
8
  $wafDB = $dir[0].'/handler/WAF/database/mo-waf-plugin-db.php';
9
  $errorPage = $dir[0].'handler/mo-error.html';
10
  $blockPage = $dir[0].'handler/mo-block.html';
11
+
12
  include_once($wafInclude);
13
  include_once($pluginU);
14
  include_once($wafDB);
15
+
16
 
17
  global $wpdb,$mowpnshandle;
18
  $mowpnshandle = new MoWpnsHandler();
82
  $XSSScore = 0;
83
  $limitAttack = get_option('limitAttack');
84
 
85
+
86
  foreach ($attackC as $key1 => $value1)
87
  {
88
  for($lev=1;$lev<=$ParanoiaLevel;$lev++)
99
  {
100
  if(preg_match($regex[$value1][$lev][$i], $value))
101
  {
102
+
103
  if($value1 == "SQL")
104
  {
105
  $SQLScore += $score[$value1][$lev][$i];
handler/ajax.php CHANGED
@@ -4,10 +4,10 @@ class AjaxHandler
4
  {
5
  function __construct()
6
  {
7
- add_action( 'admin_init' , array( $this, 'mo_wpns_saml_actions' ) );
8
  }
9
 
10
- function mo_wpns_saml_actions()
11
  {
12
  global $moWpnsUtility,$mo2f_dirName;
13
 
4
  {
5
  function __construct()
6
  {
7
+ add_action( 'admin_init' , array( $this, 'mo_wpns_2fa_actions' ) );
8
  }
9
 
10
+ function mo_wpns_2fa_actions()
11
  {
12
  global $moWpnsUtility,$mo2f_dirName;
13
 
handler/feedback_form.php CHANGED
@@ -13,7 +13,8 @@ class FeedbackHandler
13
 
14
  if (current_user_can('manage_options') && isset($_POST['option'])) {
15
  switch ($_REQUEST['option']) {
16
- case "mo_wpns_skip_feedback":
 
17
  case "mo_wpns_feedback":
18
  $this->wpns_handle_feedback($_POST); break;
19
  case "mo_wpns_backup_download":
@@ -27,6 +28,7 @@ class FeedbackHandler
27
 
28
  function wpns_handle_feedback($postdata)
29
  {
 
30
  if(MO2F_TEST_MODE){
31
  deactivate_plugins(dirname(dirname(__FILE__ ))."\\miniorange_2_factor_settings.php");
32
  return;
@@ -34,22 +36,48 @@ class FeedbackHandler
34
 
35
  $user = wp_get_current_user();
36
  $feedback_option = $_POST['option'];
37
- $message = 'Plugin Deactivated';
 
 
 
 
38
 
39
  $deactivate_reason_message = array_key_exists('wpns_query_feedback', $_POST) ? htmlspecialchars($_POST['wpns_query_feedback']) : false;
 
 
 
 
 
 
 
 
 
40
 
 
 
 
 
 
41
 
42
- $reply_required = '';
43
- if (isset($_POST['get_reply']))
44
- $reply_required = htmlspecialchars($_POST['get_reply']);
45
- if (empty($reply_required)) {
46
- $reply_required = "don't reply";
47
- $message .= '<b style="color:red";> &nbsp; [Reply :' . $reply_required . ']</b>';
48
- } else {
49
- $reply_required = "yes";
50
- $message .= '[Reply :' . $reply_required . ']';
 
 
 
 
 
 
 
 
 
51
  }
52
-
53
 
54
  $message .= ', Feedback : ' . $deactivate_reason_message . '';
55
 
@@ -85,7 +113,10 @@ class FeedbackHandler
85
  }
86
  }
87
 
 
 
88
  deactivate_plugins(dirname(dirname(__FILE__ ))."\\miniorange_2_factor_settings.php");
 
89
  do_action('wpns_show_message','Thank you for the feedback.','SUCCESS');
90
 
91
  }
13
 
14
  if (current_user_can('manage_options') && isset($_POST['option'])) {
15
  switch ($_REQUEST['option']) {
16
+ case "mo_wpns_skip_feedback":
17
+ case "mo_wpns_rating":
18
  case "mo_wpns_feedback":
19
  $this->wpns_handle_feedback($_POST); break;
20
  case "mo_wpns_backup_download":
28
 
29
  function wpns_handle_feedback($postdata)
30
  {
31
+
32
  if(MO2F_TEST_MODE){
33
  deactivate_plugins(dirname(dirname(__FILE__ ))."\\miniorange_2_factor_settings.php");
34
  return;
36
 
37
  $user = wp_get_current_user();
38
  $feedback_option = $_POST['option'];
39
+ if ($feedback_option != "mo_wpns_rating")
40
+ {
41
+ $message = 'Plugin Deactivated';
42
+ }
43
+
44
 
45
  $deactivate_reason_message = array_key_exists('wpns_query_feedback', $_POST) ? htmlspecialchars($_POST['wpns_query_feedback']) : false;
46
+ $activation_date = get_site_option('mo2f_activated_time');
47
+ $current_date = time();
48
+ $diff = $activation_date - $current_date;
49
+ if($activation_date == false){
50
+ $days = 'NA';
51
+ }
52
+ else{
53
+ $days = abs(round($diff / 86400));
54
+ }
55
 
56
+ if ($feedback_option != "mo_wpns_rating")
57
+ {
58
+ $reply_required = '';
59
+ if (isset($_POST['get_reply']))
60
+ $reply_required = htmlspecialchars($_POST['get_reply']);
61
 
62
+ if (empty($reply_required)) {
63
+ $reply_required = "don't reply";
64
+ $message .= ' &nbsp; [Reply:<b style="color:red";>' . $reply_required . '</b>,';
65
+ } else {
66
+ $reply_required = "yes";
67
+ $message .= '[Reply:' . $reply_required . ',';
68
+ }
69
+ }
70
+ else
71
+ {
72
+ $message ='[' ;
73
+ }
74
+ $message .= 'D:' . $days . ',';
75
+ if(get_option("mo_wpns_2fa_with_network_security")){
76
+ $message .= '2FA+NS]';
77
+ }
78
+ else{
79
+ $message .= '2FA]';
80
  }
 
81
 
82
  $message .= ', Feedback : ' . $deactivate_reason_message . '';
83
 
113
  }
114
  }
115
 
116
+ if($feedback_option =='mo_wpns_feedback' || $feedback_option =='mo_wpns_skip_feedback')
117
+ {
118
  deactivate_plugins(dirname(dirname(__FILE__ ))."\\miniorange_2_factor_settings.php");
119
+ }
120
  do_action('wpns_show_message','Thank you for the feedback.','SUCCESS');
121
 
122
  }
handler/login.php CHANGED
@@ -341,10 +341,10 @@ class LoginHandler
341
  $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
342
  return $error;
343
  } else {
344
- update_option('mo_wpns_upgrade_onprem',0);
345
  if(!$Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $user->ID) =='MO_2_FACTOR_PLUGIN_SETTINGS'){
346
  //$Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => '' ) );
347
  delete_user_meta( $user->ID, 'register_account_popup' );
 
348
  }
349
  }
350
  }
341
  $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
342
  return $error;
343
  } else {
 
344
  if(!$Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $user->ID) =='MO_2_FACTOR_PLUGIN_SETTINGS'){
345
  //$Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => '' ) );
346
  delete_user_meta( $user->ID, 'register_account_popup' );
347
+
348
  }
349
  }
350
  }
handler/malware_scanner/malware_scanner_cron.php CHANGED
@@ -584,7 +584,6 @@ class Mo_wpns_Scan_Handler_Cron{
584
  $arr= explode('\\', $source_file_path_for_explode);
585
  $theme_path=get_theme_root();
586
  if ($value == $base && ($scan_config['core_scan'] == 1)){
587
- // $arr = explode(DIRECTORY_SEPARATOR, $iterator->getSubPathName());
588
  if(($arr[count($arr)-1]== 'index.php' && (count($arr)==1 || in_array($arr[count($arr)-2], array('wp-content', 'plugins', 'themes'))) && !in_array('miniorangescan', $arr)) || (!in_array('plugins', $arr) && !in_array('themes', $arr) && !in_array('miniorangescan', $arr))){
589
 
590
  }else{
@@ -1048,4 +1047,4 @@ class Mo_wpns_Scan_Handler_Cron{
1048
 
1049
  }
1050
  new Mo_wpns_Scan_Handler_Cron;
1051
- ?>
584
  $arr= explode('\\', $source_file_path_for_explode);
585
  $theme_path=get_theme_root();
586
  if ($value == $base && ($scan_config['core_scan'] == 1)){
 
587
  if(($arr[count($arr)-1]== 'index.php' && (count($arr)==1 || in_array($arr[count($arr)-2], array('wp-content', 'plugins', 'themes'))) && !in_array('miniorangescan', $arr)) || (!in_array('plugins', $arr) && !in_array('themes', $arr) && !in_array('miniorangescan', $arr))){
588
 
589
  }else{
1047
 
1048
  }
1049
  new Mo_wpns_Scan_Handler_Cron;
1050
+ ?>
handler/mo-waf-plugin.php CHANGED
@@ -172,7 +172,7 @@
172
  $XSSScore = 0;
173
  $limitAttack = get_option('limitAttack');
174
 
175
-
176
  foreach ($attackC as $key1 => $value1) {
177
  for($lev=1;$lev<=$ParanoiaLevel;$lev++)
178
  {
@@ -407,4 +407,4 @@
407
 
408
 
409
 
410
- ?>
172
  $XSSScore = 0;
173
  $limitAttack = get_option('limitAttack');
174
 
175
+
176
  foreach ($attackC as $key1 => $value1) {
177
  for($lev=1;$lev<=$ParanoiaLevel;$lev++)
178
  {
407
 
408
 
409
 
410
+ ?>
handler/security_features.php CHANGED
@@ -12,11 +12,21 @@ class Mo_2fa_security_features
12
  function wpns_2fa_with_network_security($postvalue)
13
  {
14
  $nonce= sanitize_text_field(wp_unslash($_POST['mo_security_features_nonce']));
 
15
  if ( wp_verify_nonce( $nonce, 'mo_2fa_security_features_nonce' ) )
16
  {
17
  $enable_newtwork_security_features = isset($postvalue['mo_wpns_2fa_with_network_security']) ? true : false;
18
 
19
  update_option( 'mo_wpns_2fa_with_network_security', $enable_newtwork_security_features);
 
 
 
 
 
 
 
 
 
20
  update_option( 'mo_wpns_2fa_with_network_security_popup_visible', 0);
21
  if(get_option('mo_wpns_2fa_with_network_security'))
22
  {
12
  function wpns_2fa_with_network_security($postvalue)
13
  {
14
  $nonce= sanitize_text_field(wp_unslash($_POST['mo_security_features_nonce']));
15
+ add_option( 'mo2f_two_factor_tour',0);
16
  if ( wp_verify_nonce( $nonce, 'mo_2fa_security_features_nonce' ) )
17
  {
18
  $enable_newtwork_security_features = isset($postvalue['mo_wpns_2fa_with_network_security']) ? true : false;
19
 
20
  update_option( 'mo_wpns_2fa_with_network_security', $enable_newtwork_security_features);
21
+
22
+ if ($enable_newtwork_security_features)
23
+ {
24
+ $mo2f_enable_all_enable = new Mo2f_ajax_dashboard();
25
+ $mo2f_enable_all_enable -> mo2f_handle_all_enable(1);
26
+ }
27
+
28
+
29
+
30
  update_option( 'mo_wpns_2fa_with_network_security_popup_visible', 0);
31
  if(get_option('mo_wpns_2fa_with_network_security'))
32
  {
handler/spam.php CHANGED
@@ -8,20 +8,9 @@
8
  {
9
  add_filter( 'preprocess_comment' , array($this, 'comment_spam_check' ) );
10
  add_action( 'comment_form_after_fields' , array($this, 'comment_spam_custom_field' ) );
11
- //add_filter( 'comment_form_submit_button', array($this, 'captcha_on_submit' ) );
12
  }
13
  }
14
 
15
- /*function captcha_on_submit(){
16
- echo '<input type="hidden" name="mocomment" />';
17
- if(get_option('mo_wpns_enable_comment_recaptcha'))
18
- {
19
- echo '<script src="'.MoWpnsConstants::RECAPTCHA_URL.'"></script>';
20
- echo '<div class="g-recaptcha" data-sitekey="'.get_option('mo_wpns_recaptcha_site_key').'"></div> ';
21
- }
22
- echo '<input type="submit" value ="Post Comment">';
23
-
24
- }*/
25
  function comment_spam_check( $comment_data )
26
  {
27
  if(!is_user_logged_in()){
8
  {
9
  add_filter( 'preprocess_comment' , array($this, 'comment_spam_check' ) );
10
  add_action( 'comment_form_after_fields' , array($this, 'comment_spam_custom_field' ) );
 
11
  }
12
  }
13
 
 
 
 
 
 
 
 
 
 
 
14
  function comment_spam_check( $comment_data )
15
  {
16
  if(!is_user_logged_in()){
handler/twofa/gaonprem.php CHANGED
@@ -70,8 +70,6 @@ class Google_auth_onpremise{
70
  $rnd = false;
71
  if (function_exists('random_bytes')) {
72
  $rnd = random_bytes($secretLength);
73
- } elseif (function_exists('mcrypt_create_iv')) {
74
- $rnd = mcrypt_create_iv($secretLength, MCRYPT_DEV_URANDOM);
75
  } elseif (function_exists('openssl_random_pseudo_bytes')) {
76
  $rnd = openssl_random_pseudo_bytes($secretLength, $cryptoStrong);
77
  if (!$cryptoStrong) {
70
  $rnd = false;
71
  if (function_exists('random_bytes')) {
72
  $rnd = random_bytes($secretLength);
 
 
73
  } elseif (function_exists('openssl_random_pseudo_bytes')) {
74
  $rnd = openssl_random_pseudo_bytes($secretLength, $cryptoStrong);
75
  if (!$cryptoStrong) {
handler/twofa/setup_twofa.php CHANGED
@@ -19,6 +19,9 @@
19
 
20
  if ( $selected_2_factor_method == 'NONE' ) {
21
  return $selected_2_factor_method;
 
 
 
22
  }
23
 
24
  $wpdb_2fa_methods = array(
@@ -29,7 +32,9 @@
29
  "AuthyAuthenticator" => "Authy Authenticator",
30
  "SecurityQuestions" => "Security Questions",
31
  "EmailVerification" => "Email Verification",
32
- "OTPOverSMS" => "OTP Over SMS"
 
 
33
  );
34
 
35
  $server_2fa_methods = array(
@@ -42,7 +47,7 @@
42
  "Email Verification" => "OUT OF BAND EMAIL",
43
  "OTP Over SMS" => "SMS",
44
  "EMAIL" => "OTP Over Email",
45
-
46
  );
47
 
48
  $server_to_wpdb_2fa_methods = array(
@@ -53,16 +58,19 @@
53
  "KBA" => "Security Questions",
54
  "OUT OF BAND EMAIL" => "Email Verification",
55
  "SMS" => "OTP Over SMS",
56
- "EMAIL" => "OTP Over Email"
 
 
57
  );
58
-
59
  if ( $decode_type == "wpdb" ) {
60
- return $wpdb_2fa_methods[ $selected_2_factor_method ];
61
  } else if ( $decode_type == "server" ) {
62
- return $server_2fa_methods[ $selected_2_factor_method ];
63
  } else {
64
- return $server_to_wpdb_2fa_methods[ $selected_2_factor_method ];
65
  }
 
66
 
67
  }
68
 
@@ -75,10 +83,10 @@
75
  "miniOrange Push Notification",
76
  "Google Authenticator",
77
  "Security Questions",
78
- "Authy Authenticator",
79
- "Email Verification",
80
  "OTP Over SMS",
81
  "OTP Over Email",
 
 
82
  "OTP Over SMS and Email",
83
  "Hardware Token"
84
  );
@@ -89,17 +97,44 @@
89
  "miniOrange Push Notification" => "Accept a push notification in your miniOrange Authenticator App to login.",
90
  "Google Authenticator" => "Enter the soft token from the account in your <b>Google/Authy/LastPass Authenticator App</b> to login.",
91
  "Security Questions" => "Answer the three security questions you had set, to login.",
92
- "Authy Authenticator" => "Enter the soft token from the account in your Authy Authenticator App to login.",
93
- "Email Verification" => "Accept the verification link sent to your email to login.",
94
  "OTP Over SMS" => "Enter the One Time Passcode sent to your phone to login.",
95
  "OTP Over Email" => "Enter the One Time Passcode sent to your email to login.",
 
 
96
  "OTP Over SMS and Email" => "Enter the One Time Passcode sent to your phone and email to login.",
97
  "Hardware Token" => "Enter the One Time Passcode on your Hardware Token to login."
98
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
 
100
-
101
- $two_factor_methods_EC = array_slice( $all_two_factor_methods, 0, 8 );
102
- $two_factor_methods_NC = array_slice( $all_two_factor_methods, 0, 5 );
103
  if(MO2F_IS_ONPREM or $category != 'free_plan')
104
  {
105
  $all_two_factor_methods = array(
@@ -135,7 +170,8 @@
135
  $can_user_configure_2fa_method = $can_display_admin_features || ( !$can_display_admin_features && $is_customer_registered );
136
  $is_NC = get_option( 'mo2f_is_NC' );
137
  $is_EC = ! $is_NC;
138
- $form = '';
 
139
  $form .= '<form name="f" method="post" action="" id="mo2f_save_' . $category . '_auth_methods_form">
140
  <div id="mo2f_' . $category . '_auth_methods" >
141
  <br>
@@ -148,7 +184,8 @@
148
  $auth_method = $auth_methods[ $i ][ $j ];
149
  if(MO2F_IS_ONPREM and $category =='free_plan')
150
  {
151
- if($auth_method != 'Email Verification' and $auth_method != 'Security Questions' and $auth_method != 'Google Authenticator')
 
152
  {
153
  //continue;
154
  }
@@ -171,7 +208,7 @@
171
  if(MO2F_IS_ONPREM)
172
  {
173
  $iscurrentMethod = 0;
174
- $currentMethod = get_user_meta($user->ID,'currentMethod',true);
175
  if($currentMethod == $auth_method)
176
  $iscurrentMethod = 1;
177
 
@@ -189,30 +226,108 @@
189
 
190
  }
191
  $form .= '<div>
192
- <div class="mo2f_thumbnail_method">
193
- <div style="width: 30%; float:left;">';
194
 
195
  if($is_image){
196
- $form .= '<img src="' . plugins_url( "includes/images/authmethods/" . $auth_method_abr . ".png", dirname(dirname(__FILE__ ))) . '" style="width: 40px;height: 40px !important; padding: 20px; line-height: 80px;" />';
197
  }
198
 
199
  $form .= '</div>
200
- <div class="mo2f_thumbnail_method_desc"><b>' . $auth_method .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  '</b><br>
202
- <p style="padding:0px; padding-left:0px;"> ' . $two_factor_methods_descriptions[ $auth_method ] . '</p>
203
 
204
  </div>
205
  </div>
206
  </div>';
207
 
208
  if ( $is_auth_method_av && $category == 'free_plan' ) {
 
209
  $is_auth_method_configured = $Mo2fdbQueries->get_user_detail( 'mo2f_' . $auth_method_abr . '_config_status', $user->ID );
210
-
211
  $form .= '<div style="height:40px;width:100%;position: absolute;bottom: 0;background-color:';
212
  $iscurrentMethod = 0;
213
  if(MO2F_IS_ONPREM)
214
  {
215
- $currentMethod = get_user_meta($user->ID,'currentMethod',true);
216
  if($currentMethod == $auth_method)
217
  $iscurrentMethod = 1;
218
  $form .= $iscurrentMethod ? '#48b74b' : '#20b2aa';
@@ -222,10 +337,9 @@
222
  if(MO2F_IS_ONPREM)
223
  {
224
  $twofactor_transactions = new Mo2fDB;
225
- $exceeded = $twofactor_transactions->check_user_limit_exceeded($user->ID);
226
  if($exceeded){
227
- $twofactor_registered = get_user_meta($user->ID , 'currentMethod');
228
- if(empty($twofactor_registered)){
229
  $can_user_configure_2fa_method = false;
230
  }
231
  else{
@@ -238,19 +352,22 @@
238
  $is_customer_registered = true;
239
  $user = wp_get_current_user();
240
  $form .= ';color:white">';
241
- $is_auth_method_configured = get_user_meta($user->ID,$auth_method,true);
242
 
243
  $check = $is_customer_registered? true : false;
244
  $show = 0;
 
 
245
 
246
- if($auth_method == 'Email Verification' || $auth_method == 'Security Questions' || $auth_method == 'Google Authenticator')
247
- {
 
 
248
  $show = 1;
249
  }
 
250
  if ( $check ) {
251
  $form .= '<div class="mo2f_configure_2_factor">
252
  <button type="button" id="'.$auth_method_abr.'_configuration" class="mo2f_configure_set_2_factor" onclick="configureOrSet2ndFactor_' . $category . '(\'' . $auth_method_abr . '\', \'configure2factor\');"';
253
- $form .= $can_user_configure_2fa_method? "" : " disabled ";
254
  $form .= $show==1 ? "" : " disabled ";
255
  $form .= '>';
256
  if($show)
@@ -259,7 +376,6 @@
259
  $form .= 'Available in cloud solution';
260
  $form .= '</button></div>';
261
  }
262
-
263
  if ( ($is_auth_method_configured && ! $is_auth_method_selected) or MO2F_IS_ONPREM) {
264
  $form .= '<div class="mo2f_set_2_factor">
265
  <button type="button" id="'.$auth_method_abr.'_set_2_factor" class="mo2f_configure_set_2_factor" onclick="configureOrSet2ndFactor_' . $category . '(\'' . $auth_method_abr . '\', \'select2factor\');"';
@@ -273,22 +389,31 @@
273
  $form .= '</div>';
274
 
275
  }
276
- else
277
- {
278
- $form .= ';color:white">';
279
- $check = !$is_customer_registered? true : ($auth_method != "Email Verification"? true : false);
 
 
 
 
 
 
 
 
280
  if ( $check ) {
281
  $form .= '<div class="mo2f_configure_2_factor">
282
- <button type="button" id="'.$auth_method_abr.'_configuration" class="mo2f_configure_set_2_factor" onclick="configureOrSet2ndFactor_' . $category . '(\'' . $auth_method_abr . '\', \'configure2factor\');"';
283
- $form .= $can_user_configure_2fa_method ? "" : " disabled ";
284
  $form .= '>';
285
  $form .= $is_auth_method_configured ? 'Reconfigure' : 'Configure';
286
  $form .= '</button></div>';
287
  }
 
288
  if ( ($is_auth_method_configured && ! $is_auth_method_selected) or MO2F_IS_ONPREM ) {
289
  $form .= '<div class="mo2f_set_2_factor">
290
- <button type="button" id="'.$auth_method_abr.'_set_2_factor" class="mo2f_configure_set_2_factor" onclick="configureOrSet2ndFactor_' . $category . '(\'' . $auth_method_abr . '\', \'select2factor\');"';
291
- $form .= $can_user_configure_2fa_method ? "" : " disabled ";
292
  $form .= '>Set as 2-factor</button>
293
  </div>';
294
  }
@@ -323,6 +448,7 @@
323
 
324
 
325
  function mo2f_get_activated_second_factor( $user ) {
 
326
  global $Mo2fdbQueries;
327
  $user_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $user->ID );
328
  $is_customer_registered = $Mo2fdbQueries->get_user_detail( 'user_registration_with_miniorange', $user->ID ) == 'SUCCESS' ? true : false;
@@ -341,7 +467,6 @@ function mo2f_get_activated_second_factor( $user ) {
341
  if ( $user_registration_status == 'MO_2_FACTOR_PLUGIN_SETTINGS' && $is_customer_registered ) {
342
  $enduser = new Two_Factor_Setup();
343
  $userinfo = json_decode( $enduser->mo2f_get_userinfo( $useremail ), true );
344
-
345
  if ( json_last_error() == JSON_ERROR_NONE ) {
346
  if ( $userinfo['status'] == 'ERROR' ) {
347
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( $userinfo['message'] ) );
@@ -369,10 +494,18 @@ function mo2f_get_activated_second_factor( $user ) {
369
  function mo2f_update_and_sync_user_two_factor( $user_id, $userinfo ) {
370
  global $Mo2fdbQueries;
371
  $mo2f_second_factor = isset( $userinfo['authType'] ) && ! empty( $userinfo['authType'] ) ? $userinfo['authType'] : 'NONE';
 
 
 
 
 
 
 
372
 
 
373
  if ( $mo2f_second_factor == 'OUT OF BAND EMAIL' ) {
374
  $Mo2fdbQueries->update_user_details( $user_id, array( 'mo2f_EmailVerification_config_status' => true ) );
375
- } else if ( $mo2f_second_factor == 'SMS' ) {
376
  $phone_num = $userinfo['phone'];
377
  $Mo2fdbQueries->update_user_details( $user_id, array( 'mo2f_OTPOverSMS_config_status' => true ) );
378
  $_SESSION['user_phone'] = $phone_num;
@@ -381,11 +514,12 @@ function mo2f_update_and_sync_user_two_factor( $user_id, $userinfo ) {
381
  'MOBILE AUTHENTICATION',
382
  'PUSH NOTIFICATIONS'
383
  ) ) ) {
384
- $Mo2fdbQueries->update_user_details( $user_id, array(
385
- 'mo2f_miniOrangeSoftToken_config_status' => true,
386
- 'mo2f_miniOrangeQRCodeAuthentication_config_status' => true,
387
- 'mo2f_miniOrangePushNotification_config_status' => true
388
- ) );
 
389
  } else if ( $mo2f_second_factor == 'KBA' ) {
390
  $Mo2fdbQueries->update_user_details( $user_id, array( 'mo2f_SecurityQuestions_config_status' => true ) );
391
  } else if ( $mo2f_second_factor == 'GOOGLE AUTHENTICATOR' ) {
@@ -416,7 +550,7 @@ function mo2f_update_and_sync_user_two_factor( $user_id, $userinfo ) {
416
  function display_customer_registration_forms($user){
417
 
418
  global $Mo2fdbQueries;
419
- $mo2f_current_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $user->ID);
420
  $mo2f_message = get_option( 'mo2f_message' );
421
  ?>
422
 
@@ -439,7 +573,7 @@ function display_customer_registration_forms($user){
439
  </div>
440
  </div>
441
  <?php }
442
- if(in_array($mo2f_current_registration_status, array("REGISTRATION_STARTED", "MO_2_FACTOR_OTP_DELIVERED_SUCCESS", "MO_2_FACTOR_OTP_DELIVERED_FAILURE", "MO_2_FACTOR_VERIFY_CUSTOMER")) || get_option('mo_wpns_upgrade_onprem')){
443
  mo2f_show_registration_screen($user);
444
  }
445
  ?>
@@ -518,6 +652,7 @@ function mo2f_show_2FA_configuration_screen( $user, $selected2FAmethod ) {
518
 
519
  function mo2f_show_2FA_test_screen( $user, $selected2FAmethod ) {
520
 
 
521
  switch ( $selected2FAmethod ) {
522
  case "miniOrange QR Code Authentication":
523
  mo2f_test_miniorange_qr_code_authentication( $user );
@@ -537,6 +672,9 @@ function mo2f_show_2FA_test_screen( $user, $selected2FAmethod ) {
537
  case "Security Questions":
538
  mo2f_test_kba_security_questions( $user );
539
  break;
 
 
 
540
  default:
541
  mo2f_test_google_authy_authenticator( $user, $selected2FAmethod );
542
  }
@@ -736,4 +874,4 @@ function mo2f_shortcode_description($mo2f_user_email) { ?>
736
  <?php
737
  }
738
 
739
- ?>
19
 
20
  if ( $selected_2_factor_method == 'NONE' ) {
21
  return $selected_2_factor_method;
22
+ }else if($selected_2_factor_method == "OTP Over Email")
23
+ {
24
+ $selected_2_factor_method = "EMAIL";
25
  }
26
 
27
  $wpdb_2fa_methods = array(
32
  "AuthyAuthenticator" => "Authy Authenticator",
33
  "SecurityQuestions" => "Security Questions",
34
  "EmailVerification" => "Email Verification",
35
+ "OTPOverSMS" => "OTP Over SMS",
36
+ "OTPOverEmail" => "OTP Over Email",
37
+ "EMAIL" => "OTP Over Email",
38
  );
39
 
40
  $server_2fa_methods = array(
47
  "Email Verification" => "OUT OF BAND EMAIL",
48
  "OTP Over SMS" => "SMS",
49
  "EMAIL" => "OTP Over Email",
50
+ "OTPOverEmail" => "OTP Over Email"
51
  );
52
 
53
  $server_to_wpdb_2fa_methods = array(
58
  "KBA" => "Security Questions",
59
  "OUT OF BAND EMAIL" => "Email Verification",
60
  "SMS" => "OTP Over SMS",
61
+ "EMAIL" => "OTP Over Email",
62
+ "OTPOverEmail" => "OTP Over Email",
63
+ "OTP OVER EMAIL" => "OTP Over Email",
64
  );
65
+ $methodname='';
66
  if ( $decode_type == "wpdb" ) {
67
+ $methodname = isset($wpdb_2fa_methods[ $selected_2_factor_method ])?$wpdb_2fa_methods[ $selected_2_factor_method ]:$selected_2_factor_method;
68
  } else if ( $decode_type == "server" ) {
69
+ $methodname = isset($server_2fa_methods[ $selected_2_factor_method ])?$server_2fa_methods[ $selected_2_factor_method ]:$selected_2_factor_method;
70
  } else {
71
+ $methodname = isset($server_to_wpdb_2fa_methods[ $selected_2_factor_method ])?$server_to_wpdb_2fa_methods[ $selected_2_factor_method ]:$selected_2_factor_method;
72
  }
73
+ return $methodname;
74
 
75
  }
76
 
83
  "miniOrange Push Notification",
84
  "Google Authenticator",
85
  "Security Questions",
 
 
86
  "OTP Over SMS",
87
  "OTP Over Email",
88
+ "Authy Authenticator",
89
+ "Email Verification",
90
  "OTP Over SMS and Email",
91
  "Hardware Token"
92
  );
97
  "miniOrange Push Notification" => "Accept a push notification in your miniOrange Authenticator App to login.",
98
  "Google Authenticator" => "Enter the soft token from the account in your <b>Google/Authy/LastPass Authenticator App</b> to login.",
99
  "Security Questions" => "Answer the three security questions you had set, to login.",
 
 
100
  "OTP Over SMS" => "Enter the One Time Passcode sent to your phone to login.",
101
  "OTP Over Email" => "Enter the One Time Passcode sent to your email to login.",
102
+ "Authy Authenticator" => "Enter the soft token from the account in your Authy Authenticator App to login.",
103
+ "Email Verification" => "Accept the verification link sent to your email to login.",
104
  "OTP Over SMS and Email" => "Enter the One Time Passcode sent to your phone and email to login.",
105
  "Hardware Token" => "Enter the One Time Passcode on your Hardware Token to login."
106
  );
107
+ $two_factor_methods_doc = array(
108
+ "Security Questions" => "https://developers.miniorange.com/docs/security/wordpress/wp-security/step-by-setup-guide-to-set-up-security-question",
109
+ "Google Authenticator" => "https://developers.miniorange.com/docs/security/wordpress/wp-security/google-authenticator",
110
+ "miniOrange QR Code Authentication" => "https://developers.miniorange.com/docs/security/wordpress/wp-security/step-by-setup-guide-to-set-up-miniorange-QR-code",
111
+ "Email Verification" => "",
112
+ "miniOrange Soft Token" => "https://developers.miniorange.com/docs/security/wordpress/wp-security/step-by-setup-guide-to-set-up-miniorange-soft-token",
113
+ "miniOrange Push Notification" => "https://developers.miniorange.com/docs/security/wordpress/wp-security/step-by-setup-guide-to-set-up-miniorange-push-notification",
114
+ "Authy Authenticator" => "",
115
+ "OTP Over SMS" => "https://developers.miniorange.com/docs/security/wordpress/wp-security/step-by-setup-guide-to-set-up-otp-over-sms",
116
+ "OTP Over Email" => "",
117
+ "OTP Over SMS and Email" => "",
118
+ "Hardware Token" => "",
119
+ "" => ""
120
+ );
121
+ $two_factor_methods_video = array(
122
+ "Security Questions" => "",
123
+ "Google Authenticator" => "https://www.youtube.com/watch?v=vVGXjedIaGs",
124
+ "miniOrange QR Code Authentication" => "",
125
+ "Email Verification" => "",
126
+ "miniOrange Soft Token" => "",
127
+ "miniOrange Push Notification" => "",
128
+ "Authy Authenticator" => "",
129
+ "OTP Over SMS" => "",
130
+ "OTP Over Email" => "",
131
+ "OTP Over SMS and Email" => "",
132
+ "Hardware Token" => "",
133
+ "" => ""
134
+ );
135
 
136
+ $two_factor_methods_EC = array_slice( $all_two_factor_methods, 0, 9 );
137
+ $two_factor_methods_NC = array_slice( $all_two_factor_methods, 0, 7 );
 
138
  if(MO2F_IS_ONPREM or $category != 'free_plan')
139
  {
140
  $all_two_factor_methods = array(
170
  $can_user_configure_2fa_method = $can_display_admin_features || ( !$can_display_admin_features && $is_customer_registered );
171
  $is_NC = get_option( 'mo2f_is_NC' );
172
  $is_EC = ! $is_NC;
173
+
174
+ $form = '<div class="overlay1" id="overlay" hidden ></div>';
175
  $form .= '<form name="f" method="post" action="" id="mo2f_save_' . $category . '_auth_methods_form">
176
  <div id="mo2f_' . $category . '_auth_methods" >
177
  <br>
184
  $auth_method = $auth_methods[ $i ][ $j ];
185
  if(MO2F_IS_ONPREM and $category =='free_plan')
186
  {
187
+
188
+ if($auth_method != 'Email Verification' and $auth_method != 'Security Questions' and $auth_method != 'Google Authenticator' and $auth_method !='miniOrange QR Code Authentication' and $auth_method !='miniOrange Soft Token' and $auth_method != 'miniOrange Push Notification' and $auth_method != 'OTP Over SMS' and $auth_method != 'OTP Over Email')
189
  {
190
  //continue;
191
  }
208
  if(MO2F_IS_ONPREM)
209
  {
210
  $iscurrentMethod = 0;
211
+ $currentMethod = $configured_auth_method;
212
  if($currentMethod == $auth_method)
213
  $iscurrentMethod = 1;
214
 
226
 
227
  }
228
  $form .= '<div>
229
+ <div class="mo2f_thumbnail_method" style="width:100%";>
230
+ <div style="width: 17%; float:left;padding-top:5px;padding-left:5px;">';
231
 
232
  if($is_image){
233
+ $form .= '<img src="' . plugins_url( "includes/images/authmethods/" . $auth_method_abr . ".png", dirname(dirname(__FILE__ ))) . '" style="width: 40px;height: 40px !important; " line-height: 80px;" />';
234
  }
235
 
236
  $form .= '</div>
237
+ <div class="mo2f_thumbnail_method_desc" style="padding: 8px;width: 83%;">';
238
+ switch ($auth_method) {
239
+ case 'Google Authenticator':
240
+ $form .=' <span style="float:right">
241
+ <a href='.$two_factor_methods_doc[$auth_method].' target="_blank">
242
+ <span class="dashicons dashicons-text-page" style="font-size:19px;color:#269eb3;float: right;"></span>
243
+
244
+ </a>
245
+
246
+ <a href='.$two_factor_methods_video[$auth_method].' target="_blank">
247
+ <span class="dashicons dashicons-video-alt3" style="font-size:18px;color:red;float: right; margin-right: 5px;"></span>
248
+ </a>
249
+ </span>';
250
+ break;
251
+
252
+ case 'Security Questions':
253
+ $form .=' <span style="float:right">
254
+ <a href='.$two_factor_methods_doc[$auth_method].' target="_blank">
255
+ <span class="dashicons dashicons-text-page" style="font-size:19px;color:#269eb3;float: right;"></span>
256
+
257
+ </a>
258
+
259
+
260
+ </span>';
261
+ break;
262
+
263
+ case 'OTP Over SMS':
264
+ $form .=' <span style="float:right">
265
+ <a href='.$two_factor_methods_doc[$auth_method].' target="_blank">
266
+ <span class="dashicons dashicons-text-page" style="font-size:19px;color:#269eb3;float: right;"></span>
267
+
268
+ </a>
269
+
270
+
271
+ </span>';
272
+ break;
273
+
274
+
275
+ case 'miniOrange Soft Token':
276
+ $form .=' <span style="float:right">
277
+ <a href='.$two_factor_methods_doc[$auth_method].' target="_blank">
278
+ <span class="dashicons dashicons-text-page" style="font-size:19px;color:#269eb3;float: right;"></span>
279
+
280
+ </a>
281
+
282
+
283
+ </span>';
284
+
285
+ break;
286
+
287
+ case 'miniOrange QR Code Authentication':
288
+ $form .=' <span style="float:right">
289
+ <a href='.$two_factor_methods_doc[$auth_method].' target="_blank">
290
+ <span class="dashicons dashicons-text-page" style="font-size:19px;color:#269eb3;float: right;"></span>
291
+
292
+ </a>
293
+
294
+
295
+ </span>';
296
+
297
+ break;
298
+
299
+ case 'miniOrange Push Notification':
300
+ $form .=' <span style="float:right">
301
+ <a href='.$two_factor_methods_doc[$auth_method].' target="_blank">
302
+ <span class="dashicons dashicons-text-page" style="font-size:19px;color:#269eb3;float: right;"></span>
303
+
304
+ </a>
305
+
306
+
307
+ </span>';
308
+ break;
309
+
310
+ default:
311
+ {$form .= "";}
312
+ break;
313
+ }
314
+ $form .=' <b>' . $auth_method .
315
  '</b><br>
316
+ <p style="padding:0px; padding-left:0px;font-size: 16px;"> ' . $two_factor_methods_descriptions[ $auth_method ] . '</p>
317
 
318
  </div>
319
  </div>
320
  </div>';
321
 
322
  if ( $is_auth_method_av && $category == 'free_plan' ) {
323
+
324
  $is_auth_method_configured = $Mo2fdbQueries->get_user_detail( 'mo2f_' . $auth_method_abr . '_config_status', $user->ID );
325
+
326
  $form .= '<div style="height:40px;width:100%;position: absolute;bottom: 0;background-color:';
327
  $iscurrentMethod = 0;
328
  if(MO2F_IS_ONPREM)
329
  {
330
+ $currentMethod = $configured_auth_method;
331
  if($currentMethod == $auth_method)
332
  $iscurrentMethod = 1;
333
  $form .= $iscurrentMethod ? '#48b74b' : '#20b2aa';
337
  if(MO2F_IS_ONPREM)
338
  {
339
  $twofactor_transactions = new Mo2fDB;
340
+ $exceeded = $twofactor_transactions->check_alluser_limit_exceeded($user->ID);
341
  if($exceeded){
342
+ if(empty($configured_auth_method)){
 
343
  $can_user_configure_2fa_method = false;
344
  }
345
  else{
352
  $is_customer_registered = true;
353
  $user = wp_get_current_user();
354
  $form .= ';color:white">';
 
355
 
356
  $check = $is_customer_registered? true : false;
357
  $show = 0;
358
+
359
+
360
 
361
+ $cloud_methods = array('miniOrange QR Code Authentication' , 'miniOrange Soft Token','miniOrange Push Notification');
362
+
363
+ if($auth_method == 'Email Verification' || $auth_method == 'Security Questions' || $auth_method == 'Google Authenticator' || $auth_method == 'miniOrange QR Code Authentication' || $auth_method =='miniOrange Soft Token' || $auth_method == 'miniOrange Push Notification' || $auth_method == 'OTP Over SMS' || $auth_method == 'OTP Over Email')
364
+ {
365
  $show = 1;
366
  }
367
+
368
  if ( $check ) {
369
  $form .= '<div class="mo2f_configure_2_factor">
370
  <button type="button" id="'.$auth_method_abr.'_configuration" class="mo2f_configure_set_2_factor" onclick="configureOrSet2ndFactor_' . $category . '(\'' . $auth_method_abr . '\', \'configure2factor\');"';
 
371
  $form .= $show==1 ? "" : " disabled ";
372
  $form .= '>';
373
  if($show)
376
  $form .= 'Available in cloud solution';
377
  $form .= '</button></div>';
378
  }
 
379
  if ( ($is_auth_method_configured && ! $is_auth_method_selected) or MO2F_IS_ONPREM) {
380
  $form .= '<div class="mo2f_set_2_factor">
381
  <button type="button" id="'.$auth_method_abr.'_set_2_factor" class="mo2f_configure_set_2_factor" onclick="configureOrSet2ndFactor_' . $category . '(\'' . $auth_method_abr . '\', \'select2factor\');"';
389
  $form .= '</div>';
390
 
391
  }
392
+ else
393
+ {
394
+ if(get_option('mo2f_miniorange_admin'))
395
+ $allowed = wp_get_current_user()->ID == get_option('mo2f_miniorange_admin');
396
+ else
397
+ $allowed = 1;
398
+ $cloudswitch = 0;
399
+ if(!$allowed)
400
+ $allowed = 2;
401
+ $form .= ';color:white">';
402
+ $check = !$is_customer_registered? true : ($auth_method != "Email Verification" and $auth_method != "OTP Over Email"? true : false);
403
+
404
  if ( $check ) {
405
  $form .= '<div class="mo2f_configure_2_factor">
406
+ <button type="button" id="'.$auth_method_abr.'_configuration" class="mo2f_configure_set_2_factor" onclick="configureOrSet2ndFactor_' . $category . '(\'' . $auth_method_abr . '\', \'configure2factor\','.$cloudswitch.','.$allowed.');"';
407
+ $form .= $can_user_configure_2fa_method ? "" : " ";
408
  $form .= '>';
409
  $form .= $is_auth_method_configured ? 'Reconfigure' : 'Configure';
410
  $form .= '</button></div>';
411
  }
412
+
413
  if ( ($is_auth_method_configured && ! $is_auth_method_selected) or MO2F_IS_ONPREM ) {
414
  $form .= '<div class="mo2f_set_2_factor">
415
+ <button type="button" id="'.$auth_method_abr.'_set_2_factor" class="mo2f_configure_set_2_factor" onclick="configureOrSet2ndFactor_' . $category . '(\'' . $auth_method_abr . '\', \'select2factor\','.$cloudswitch.','.$allowed.');"';
416
+ $form .= $can_user_configure_2fa_method ? "" : " ";
417
  $form .= '>Set as 2-factor</button>
418
  </div>';
419
  }
448
 
449
 
450
  function mo2f_get_activated_second_factor( $user ) {
451
+
452
  global $Mo2fdbQueries;
453
  $user_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $user->ID );
454
  $is_customer_registered = $Mo2fdbQueries->get_user_detail( 'user_registration_with_miniorange', $user->ID ) == 'SUCCESS' ? true : false;
467
  if ( $user_registration_status == 'MO_2_FACTOR_PLUGIN_SETTINGS' && $is_customer_registered ) {
468
  $enduser = new Two_Factor_Setup();
469
  $userinfo = json_decode( $enduser->mo2f_get_userinfo( $useremail ), true );
 
470
  if ( json_last_error() == JSON_ERROR_NONE ) {
471
  if ( $userinfo['status'] == 'ERROR' ) {
472
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( $userinfo['message'] ) );
494
  function mo2f_update_and_sync_user_two_factor( $user_id, $userinfo ) {
495
  global $Mo2fdbQueries;
496
  $mo2f_second_factor = isset( $userinfo['authType'] ) && ! empty( $userinfo['authType'] ) ? $userinfo['authType'] : 'NONE';
497
+
498
+ if(MO2F_IS_ONPREM)
499
+ {
500
+ $mo2f_second_factor = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user_id );
501
+ $mo2f_second_factor = $mo2f_second_factor ? $mo2f_second_factor : 'NONE';
502
+ return $mo2f_second_factor;
503
+ }
504
 
505
+ $Mo2fdbQueries->update_user_details( $user_id, array( 'mo2f_user_email' => $userinfo['email'] ) );
506
  if ( $mo2f_second_factor == 'OUT OF BAND EMAIL' ) {
507
  $Mo2fdbQueries->update_user_details( $user_id, array( 'mo2f_EmailVerification_config_status' => true ) );
508
+ } else if ( $mo2f_second_factor == 'SMS' and !MO2F_IS_ONPREM) {
509
  $phone_num = $userinfo['phone'];
510
  $Mo2fdbQueries->update_user_details( $user_id, array( 'mo2f_OTPOverSMS_config_status' => true ) );
511
  $_SESSION['user_phone'] = $phone_num;
514
  'MOBILE AUTHENTICATION',
515
  'PUSH NOTIFICATIONS'
516
  ) ) ) {
517
+ if(!MO2F_IS_ONPREM)
518
+ $Mo2fdbQueries->update_user_details( $user_id, array(
519
+ 'mo2f_miniOrangeSoftToken_config_status' => true,
520
+ 'mo2f_miniOrangeQRCodeAuthentication_config_status' => true,
521
+ 'mo2f_miniOrangePushNotification_config_status' => true
522
+ ) );
523
  } else if ( $mo2f_second_factor == 'KBA' ) {
524
  $Mo2fdbQueries->update_user_details( $user_id, array( 'mo2f_SecurityQuestions_config_status' => true ) );
525
  } else if ( $mo2f_second_factor == 'GOOGLE AUTHENTICATOR' ) {
550
  function display_customer_registration_forms($user){
551
 
552
  global $Mo2fdbQueries;
553
+ $mo2f_current_registration_status = get_option( 'mo_2factor_user_registration_status');
554
  $mo2f_message = get_option( 'mo2f_message' );
555
  ?>
556
 
573
  </div>
574
  </div>
575
  <?php }
576
+ if(in_array($mo2f_current_registration_status, array("REGISTRATION_STARTED", "MO_2_FACTOR_OTP_DELIVERED_SUCCESS", "MO_2_FACTOR_OTP_DELIVERED_FAILURE", "MO_2_FACTOR_VERIFY_CUSTOMER")) ){
577
  mo2f_show_registration_screen($user);
578
  }
579
  ?>
652
 
653
  function mo2f_show_2FA_test_screen( $user, $selected2FAmethod ) {
654
 
655
+
656
  switch ( $selected2FAmethod ) {
657
  case "miniOrange QR Code Authentication":
658
  mo2f_test_miniorange_qr_code_authentication( $user );
672
  case "Security Questions":
673
  mo2f_test_kba_security_questions( $user );
674
  break;
675
+ case "OTP Over Email":
676
+ mo2f_test_otp_over_email($user,$selected2FAmethod);
677
+ break;
678
  default:
679
  mo2f_test_google_authy_authenticator( $user, $selected2FAmethod );
680
  }
874
  <?php
875
  }
876
 
877
+ ?>
handler/twofa/two_fa_constants.php CHANGED
@@ -325,8 +325,12 @@ class Mo2fConstants {
325
  Return mo2f_lt( 'Please enter the one time passcode below.' );
326
  break;
327
  case 'ERROR_IN_SENDING_OTP':
328
- Return mo2f_lt( 'There was an error in sending one time passcode. Please click on Resend OTP to try again.' );
329
  break;
 
 
 
 
330
  case 'PUSH_NOTIFICATION_SENT':
331
  Return mo2f_lt( 'A Push notification has been sent to your miniOrange Authenticator App.' );
332
  break;
@@ -363,6 +367,12 @@ class Mo2fConstants {
363
  case 'SET_2FA':
364
  Return mo2f_lt( 'is set as your Two-Factor method.' );
365
  break;
 
 
 
 
 
 
366
  case 'VERIFICATION_EMAIL_SENT':
367
  Return mo2f_lt( 'A verification email is sent to' );
368
  break;
@@ -418,4 +428,4 @@ class Mo2fConstants {
418
  }
419
 
420
  new Mo2fConstants;
421
- ?>
325
  Return mo2f_lt( 'Please enter the one time passcode below.' );
326
  break;
327
  case 'ERROR_IN_SENDING_OTP':
328
+ Return mo2f_lt( 'There was an error in sending one-time passcode. Your transaction limit might have exceeded. Please contact miniOrange or upgrade to our premium plan.' );
329
  break;
330
+ case 'ERROR_IN_SENDING_OTP_ONPREM':
331
+ Return mo2f_lt( 'There was an error in sending one-time passcode. Please check your SMTP Setup and remaining transactions.' );
332
+ break;
333
+
334
  case 'PUSH_NOTIFICATION_SENT':
335
  Return mo2f_lt( 'A Push notification has been sent to your miniOrange Authenticator App.' );
336
  break;
367
  case 'SET_2FA':
368
  Return mo2f_lt( 'is set as your Two-Factor method.' );
369
  break;
370
+
371
+ case 'SET_2FA_otp':
372
+ Return mo2f_lt( 'is set as your Two-Factor method. You have 10 free transactions.' );
373
+ break;
374
+
375
+
376
  case 'VERIFICATION_EMAIL_SENT':
377
  Return mo2f_lt( 'A verification email is sent to' );
378
  break;
428
  }
429
 
430
  new Mo2fConstants;
431
+ ?>
handler/twofa/two_fa_get_details.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class two_fa_get_details {
4
+
5
+ function getUserMethod($userid){
6
+ $userMethod = get_user_meta($userid,'currentMethod',true);
7
+ return $userMethod;
8
+ }
9
+ function setUserMethod($userid,$currentMethod){
10
+ $response= update_user_meta($userid,'currentMethod',$currentMethod);
11
+ //$userMethod = get_user_meta($userid,'currentMethod',true);
12
+ return $response;
13
+ }
14
+
15
+ function setUserEmail($userid,$email){
16
+ $response= update_user_meta($userid,'email',$email);
17
+ //$userMethod = get_user_meta($userid,'currentMethod',true);
18
+ return $response;
19
+ }
20
+
21
+ function getUserEmail($userid){
22
+ $userEmail = get_user_meta($userid , 'email',true);
23
+ return $userEmail;
24
+
25
+ }
26
+ }
handler/twofa/two_fa_login.php CHANGED
@@ -22,7 +22,7 @@
22
  * Contains Request Calls to Customer service.
23
  **/
24
  include dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'controllers'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'mo2fa_common_login.php';
25
-
26
  class Miniorange_Mobile_Login {
27
 
28
  function mo2fa_default_login( $user, $username, $password ) {
@@ -34,7 +34,6 @@ class Miniorange_Mobile_Login {
34
  } else {
35
  if(MO2F_IS_ONPREM and (!get_option('mo2f_login_option') or get_option('mo2f_enable_login_with_2nd_factor')))
36
  {
37
- $mo2f_configured_2FA_method = get_user_meta($currentuser->ID,'currentMethod',true);
38
  $attributes = isset( $_POST['miniorange_rba_attribures'] ) ? $_POST['miniorange_rba_attribures'] : null;
39
  $session_id = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
40
  $redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : null;
@@ -162,6 +161,7 @@ class Miniorange_Mobile_Login {
162
  $bootstrappath = plugins_url( 'includes/css/bootstrap.min.css?version='.MO2F_VERSION.'', dirname(dirname(__FILE__)) );
163
  $bootstrappath = str_replace('/handler/includes/css', '/includes/css', $bootstrappath);
164
  wp_enqueue_style( 'bootstrap_script', $bootstrappath );
 
165
  }
166
 
167
  function mo_2_factor_hide_login() {
@@ -198,7 +198,6 @@ class Miniorange_Mobile_Login {
198
  $session_id = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
199
  $message = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_login_message', $session_id );
200
  //if the php session folder has insufficient permissions, cookies to be used
201
- //$message = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_login_message' );
202
  if($message=='')
203
  {
204
  $message = 'Invalid Username';
@@ -216,7 +215,7 @@ class Miniorange_Mobile_Login {
216
  }
217
 
218
  function miniorange_login_form_fields( $mo2fa_login_status = null, $mo2fa_login_message = null ) {
219
-
220
  $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : (isset( $_POST['session_id'] ) ? $_POST['session_id'] : null);
221
  $pass2fa_login_session = new Miniorange_Password_2Factor_Login();
222
 
@@ -237,7 +236,8 @@ class Miniorange_Mobile_Login {
237
  $user = get_user_by('login',$userName);
238
  if($user)
239
  {
240
- $currentMethod = get_user_meta($user->ID, 'currentMethod', true);
 
241
  if($currentMethod == 'None' or $currentMethod == '')
242
  $login_status_phone_enable = 'MO_2_FACTOR_LOGIN_WHEN_PHONELOGIN_ENABLED';
243
  }
@@ -400,4 +400,4 @@ class Miniorange_Mobile_Login {
400
  }
401
  }
402
 
403
- ?>
22
  * Contains Request Calls to Customer service.
23
  **/
24
  include dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'controllers'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'mo2fa_common_login.php';
25
+ include dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'controllers'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'mo2fa_inline_registration.php';
26
  class Miniorange_Mobile_Login {
27
 
28
  function mo2fa_default_login( $user, $username, $password ) {
34
  } else {
35
  if(MO2F_IS_ONPREM and (!get_option('mo2f_login_option') or get_option('mo2f_enable_login_with_2nd_factor')))
36
  {
 
37
  $attributes = isset( $_POST['miniorange_rba_attribures'] ) ? $_POST['miniorange_rba_attribures'] : null;
38
  $session_id = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
39
  $redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : null;
161
  $bootstrappath = plugins_url( 'includes/css/bootstrap.min.css?version='.MO2F_VERSION.'', dirname(dirname(__FILE__)) );
162
  $bootstrappath = str_replace('/handler/includes/css', '/includes/css', $bootstrappath);
163
  wp_enqueue_style( 'bootstrap_script', $bootstrappath );
164
+ wp_enqueue_script( 'bootstrap_script', plugins_url( 'includes/js/bootstrap.min.js', dirname(__FILE__ )) );
165
  }
166
 
167
  function mo_2_factor_hide_login() {
198
  $session_id = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
199
  $message = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_login_message', $session_id );
200
  //if the php session folder has insufficient permissions, cookies to be used
 
201
  if($message=='')
202
  {
203
  $message = 'Invalid Username';
215
  }
216
 
217
  function miniorange_login_form_fields( $mo2fa_login_status = null, $mo2fa_login_message = null ) {
218
+ global $Mo2fdbQueries;
219
  $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : (isset( $_POST['session_id'] ) ? $_POST['session_id'] : null);
220
  $pass2fa_login_session = new Miniorange_Password_2Factor_Login();
221
 
236
  $user = get_user_by('login',$userName);
237
  if($user)
238
  {
239
+ //$currentMethod = get_user_meta($user->ID, 'currentMethod', true);
240
+ $currentMethod = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user->ID );
241
  if($currentMethod == 'None' or $currentMethod == '')
242
  $login_status_phone_enable = 'MO_2_FACTOR_LOGIN_WHEN_PHONELOGIN_ENABLED';
243
  }
400
  }
401
  }
402
 
403
+ ?>
handler/twofa/two_fa_pass2login.php CHANGED
@@ -30,8 +30,1269 @@ class Miniorange_Password_2Factor_Login {
30
  private $mo2f_rbastatus;
31
  private $mo2f_transactionid;
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
- public function miniorange_pass2login_redirect() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  do_action('mo2f_network_init');
36
  global $Mo2fdbQueries;
37
 
@@ -77,10 +1338,7 @@ class Miniorange_Password_2Factor_Login {
77
 
78
  if(MO2F_IS_ONPREM )
79
  {
80
- $configuredMethod = get_user_meta($user->ID,'currentMethod',true);
81
- $mo2f_configured_2FA_method = empty($configuredMethod) ? 0 : 1;
82
  $mo_2factor_user_registration_status = 'MO_2_FACTOR_PLUGIN_SETTINGS';
83
- $email = get_user_meta($user->ID , 'email',true);
84
 
85
  }
86
  if ( $mo2f_configured_2FA_method ) {
@@ -89,12 +1347,11 @@ class Miniorange_Password_2Factor_Login {
89
  $this->mo2f_pass2login_kba_verification( $user->ID, $redirect_to, $session_id );
90
  } else {
91
  $mo2f_second_factor = '';
92
- $mo2f_second_factor = mo2f_get_user_2ndfactor( $user );
93
  if(MO2F_IS_ONPREM)
94
  {
95
- //$user = get_userdatabylogin('admin');
96
- $mo2f_second_factor = get_user_meta($user->ID,'currentMethod',true);
97
-
98
  if($mo2f_second_factor == 'Security Questions')
99
  {
100
  $mo2f_second_factor = 'KBA';
@@ -105,7 +1362,9 @@ class Miniorange_Password_2Factor_Login {
105
  }
106
  else if($mo2f_second_factor != 'Email Verification')
107
  $mo2f_second_factor = 'NONE';
108
- }
 
 
109
 
110
  if ( $mo2f_second_factor == 'MOBILE AUTHENTICATION' ) {
111
  $this->mo2f_pass2login_mobile_verification( $user, $redirect_to, $session_id );
@@ -175,437 +1434,160 @@ class Miniorange_Password_2Factor_Login {
175
  update_site_option($txIdGet,1);
176
  $body = "Transaction has been successfully validated.<br><br>Please continue with the transaction.";
177
  $head = "TRANSACTION SUCCESSFUL";
178
- $color = "green";
179
- }
180
- else if($accessTokenGet==$otpTokenD)
181
- {
182
- update_site_option($txIdGet,0);
183
- $body = "Transaction has been Canceled.<br><br>Please Try Again.";
184
- $head = "TRANSACTION DENIED";
185
- }
186
- }
187
- delete_site_option($userIDGet);
188
- delete_site_option($userIDd);
189
- delete_site_option($time);
190
-
191
- }
192
-
193
- $this->display_email_verification($head,$body,$color);
194
- exit;
195
-
196
- }
197
- else if(isset($_POST['txid']))
198
- {
199
- $txidpost = sanitize_text_field($_POST['txid']);
200
- $status = get_site_option($txidpost);
201
- update_option('optionVal1',$status); //??
202
- if($status ==1 || $status ==0)
203
- delete_site_option($txidpost);
204
- echo $status;
205
- exit();
206
- }
207
-
208
- else if ( isset( $_POST['mo2f_trust_device_confirm_nonce'] ) ) { /*register device as rba profile */
209
- $nonce = $_POST['mo2f_trust_device_confirm_nonce'];
210
- if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-trust-device-confirm-nonce' ) ) {
211
- $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
212
- $this->remove_current_activity($session_id_encrypt);
213
- $error = new WP_Error();
214
- $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR ' ) . '</strong>:' . mo2f_lt( 'Invalid Request.' ) );
215
- return $error;
216
- } else {
217
- $this->miniorange_pass2login_start_session();
218
- $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
219
- try {
220
- $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id', $session_id_encrypt );
221
- $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user_id );
222
- $mo2f_rba_status = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_rba_status',$session_id_encrypt );
223
- mo2f_register_profile( $email, 'true', $mo2f_rba_status );
224
- } catch ( Exception $e ) {
225
- echo $e->getMessage();
226
- }
227
- $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
228
- $this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
229
- }
230
- }else if ( isset( $_POST['mo2f_trust_device_cancel_nonce'] ) ) { /*do not register device as rba profile */
231
- $nonce = $_POST['mo2f_trust_device_cancel_nonce'];
232
- if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-trust-device-cancel-nonce' ) ) {
233
- $error = new WP_Error();
234
- $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
235
- return $error;
236
- } else {
237
- $this->miniorange_pass2login_start_session();
238
- $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
239
- $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
240
- $this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
241
- }
242
- }else if ( isset( $_POST['miniorange_challenge_forgotphone_nonce'] ) ) { /*check kba validation*/
243
- $nonce = $_POST['miniorange_challenge_forgotphone_nonce'];
244
- if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-challenge-forgotphone-nonce' ) ) {
245
- $error = new WP_Error();
246
- $error->add( 'empty_username', '<strong>' . __( 'ERROR' ) . '</strong>:' . __( 'Invalid Request.' ) );
247
- return $error;
248
- } else {
249
- $this->miniorange_pass2login_start_session();
250
- $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
251
- $forgot_phone_enable = get_option( 'mo2f_enable_forgotphone' );
252
- $forgot_phone_kba_enable = get_option( 'mo2f_enable_forgotphone_kba' );
253
- $forgot_phone_email_enable = get_option( 'mo2f_enable_forgotphone_email' );
254
- $second_factor = isset( $_POST['mo2f_configured_2FA_method'] ) ? $_POST['mo2f_configured_2FA_method'] : 'KBA';
255
- $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
256
- $user = unserialize( $_SESSION['mo2f_current_user'] );
257
- $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id', $session_id_encrypt );
258
- $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user_id );
259
- $kba_configuration_status = $Mo2fdbQueries->get_user_detail( 'mo2f_SecurityQuestions_config_status', $user_id );
260
-
261
- if ( $forgot_phone_enable && $forgot_phone_email_enable && $second_factor == 'OTP OVER EMAIL' ) {
262
- $customer = new Customer_Setup();
263
- $content = json_decode( $customer->send_otp_token( $email, 'EMAIL', get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
264
- $mo2fa_login_message = '';
265
- $mo2f_login_status = '';
266
-
267
- if ( strcasecmp( $content['status'], 'SUCCESS' ) == 0 ) {
268
- MO2f_Utility::set_user_values( $session_id_encrypt, "mo2f_transactionId", $content['txId'] );
269
- $this->mo2f_transactionid=$content['txId'];
270
- $mo2fa_login_message = 'A one time passcode has been sent to <b>' . MO2f_Utility::mo2f_get_hidden_email( $email ) . '</b>. Please enter the OTP to verify your identity.';
271
- $mo2f_login_status = 'MO_2_FACTOR_CHALLENGE_OTP_OVER_EMAIL';
272
- } else {
273
- $mo2fa_login_message = 'Error occured while sending OTP over your regsitered email. Please try again.';
274
- $mo2f_login_status = 'MO_2_FACTOR_CHALLENGE_KBA_AND_OTP_OVER_EMAIL';
275
- }
276
- $this->miniorange_pass2login_form_fields( $mo2f_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
277
- } else if ( $forgot_phone_enable && $forgot_phone_kba_enable ) {
278
- if ( $kba_configuration_status ) {
279
- $this->mo2f_pass2login_kba_verification( $user_id, $redirect_to, $session_id_encrypt );
280
- } else {
281
- $mo2fa_login_message = 'Your KBA is not configured. Please choose other option to procedd further.';
282
- $mo2f_login_status = 'MO_2_FACTOR_CHALLENGE_KBA_AND_OTP_OVER_EMAIL';
283
- $this->miniorange_pass2login_form_fields( $mo2f_login_status, $mo2fa_login_message, $redirect_to, null,$session_id_encrypt );
284
- }
285
- }
286
- }
287
- }else if ( isset( $_POST['miniorange_alternate_login_kba_nonce'] ) ) { /*check kba validation*/
288
- $nonce = $_POST['miniorange_alternate_login_kba_nonce'];
289
- if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-alternate-login-kba-nonce' ) ) {
290
- $error = new WP_Error();
291
- $error->add( 'empty_username', __( '<strong>ERROR</strong>: Invalid Request.' ) );
292
- return $error;
293
- } else {
294
- $this->miniorange_pass2login_start_session();
295
- $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
296
- $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
297
- $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
298
- $this->mo2f_pass2login_kba_verification( $user_id, $redirect_to,$session_id_encrypt );
299
- }
300
- }else if ( isset( $_POST['miniorange_kba_nonce'] ) ) { /*check kba validation*/
301
- $nonce = $_POST['miniorange_kba_nonce'];
302
- if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-kba-nonce' ) ) {
303
- $error = new WP_Error();
304
- $error->add( 'empty_username', __( '<strong>ERROR</strong>: Invalid Request.' ) );
305
- return $error;
306
- }
307
- else{
308
-
309
- $this->miniorange_pass2login_start_session();
310
- $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
311
- $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
312
- $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
313
- if ( isset( $user_id ) ) {
314
- if ( MO2f_Utility::mo2f_check_empty_or_null( $_POST['mo2f_answer_1'] ) || MO2f_Utility::mo2f_check_empty_or_null( $_POST['mo2f_answer_2'] ) ) {
315
- $mo2fa_login_message = 'Please provide both the answers.';
316
- $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_KBA_AUTHENTICATION';
317
- $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
318
- }
319
- $otpToken = array();
320
- $kba_questions = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo_2_factor_kba_questions',$session_id_encrypt );
321
-
322
- $otpToken[0] = $kba_questions[0];
323
- $otpToken[1] = sanitize_text_field( $_POST['mo2f_answer_1'] );
324
- $otpToken[2] = $kba_questions[1];
325
- $otpToken[3] = sanitize_text_field( $_POST['mo2f_answer_2'] );
326
- $check_trust_device = isset( $_POST['mo2f_trust_device'] ) ? $_POST['mo2f_trust_device'] : 'false';
327
- //if the php session folder has insufficient permissions, cookies to be used
328
- $mo2f_login_transaction_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_transactionId', $session_id_encrypt );
329
-
330
- $mo2f_rba_status = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_rba_status',$session_id_encrypt );
331
- $kba_validate = new Customer_Setup();
332
- $kba_validate_response = json_decode( $kba_validate->validate_otp_token( 'KBA', null, $mo2f_login_transaction_id, $otpToken, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
333
- $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user_id );
334
- if ( strcasecmp( $kba_validate_response['status'], 'SUCCESS' ) == 0 ) {
335
- if ( get_option( 'mo2f_remember_device' ) && $check_trust_device == 'on' ) {
336
- try {
337
- mo2f_register_profile( $email, 'true', $mo2f_rba_status );
338
- } catch ( Exception $e ) {
339
- echo $e->getMessage();
340
- }
341
- $this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
342
- } else {
343
- $this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
344
- }
345
- } else {
346
-
347
- $mo2fa_login_message = 'The answers you have provided are incorrect.';
348
- $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_KBA_AUTHENTICATION';
349
- $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt);
350
- }
351
- } else {
352
- $this->remove_current_activity($session_id_encrypt);
353
- return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Please try again..' ) );
354
- }
355
-
356
- }
357
- }else if ( isset( $_POST['miniorange_mobile_validation_nonce'] ) ) {
358
- /*check mobile validation */
359
- $nonce = $_POST['miniorange_mobile_validation_nonce'];
360
- if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-mobile-validation-nonce' ) ) {
361
- $error = new WP_Error();
362
- $error->add( 'empty_username', __( '<strong>ERROR</strong>: Invalid Request.' ) );
363
- return $error;
364
- } else {
365
- if(MO2F_IS_ONPREM )
366
- {
367
- $txid = $_POST['TxidEmail'];
368
- $status = get_option($txid);
369
- if($status != '')
370
- {
371
- if($status != 1)
372
- {
373
- return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Please try again.' ) );
374
- }
375
- }
376
- }
377
- $this->miniorange_pass2login_start_session();
378
- $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
379
- //if the php session folder has insufficient permissions, cookies to be used
380
- $mo2f_login_transaction_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_transactionId',$session_id_encrypt );
381
- $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
382
- $checkMobileStatus = new Two_Factor_Setup();
383
- $content = $checkMobileStatus->check_mobile_status( $mo2f_login_transaction_id );
384
- $response = json_decode( $content, true );
385
- if(MO2F_IS_ONPREM)
386
- {
387
- $this->mo2fa_pass2login($redirect_to,$session_id_encrypt);
388
- }
389
- if ( json_last_error() == JSON_ERROR_NONE ) {
390
- if ( $response['status'] == 'SUCCESS' ) {
391
- if ( get_option( 'mo2f_remember_device' ) ) {
392
- $mo2fa_login_status = 'MO_2_FACTOR_REMEMBER_TRUSTED_DEVICE';
393
- $this->miniorange_pass2login_form_fields( $mo2fa_login_status, null, $redirect_to, null,$session_id_encrypt );
394
- } else {
395
- $this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
396
- }
397
- } else {
398
- $this->remove_current_activity($session_id_encrypt);
399
- return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Please try again.' ) );
400
- }
401
- } else {
402
- $this->remove_current_activity($session_id_encrypt);
403
- return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Please try again.' ) );
404
- }
405
- }
406
- }else if ( isset( $_POST['miniorange_mobile_validation_failed_nonce'] ) ) { /*Back to miniOrange Login Page if mobile validation failed and from back button of mobile challenge, soft token and default login*/
407
- $nonce = $_POST['miniorange_mobile_validation_failed_nonce'];
408
- if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-mobile-validation-failed-nonce' ) ) {
409
- $error = new WP_Error();
410
- $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
411
- return $error;
412
- } else {
413
- $this->miniorange_pass2login_start_session();
414
- $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
415
- $this->remove_current_activity($session_id_encrypt);
416
-
417
- }
418
- }else if ( isset( $_POST['miniorange_forgotphone'] ) ) { /*Click on the link of forgotphone */
419
- $nonce = $_POST['miniorange_forgotphone'];
420
- if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-forgotphone' ) ) {
421
- $error = new WP_Error();
422
- $error->add( 'empty_username', __( '<strong>ERROR</strong>: Invalid Request.' ) );
423
- return $error;
424
- } else {
425
- $mo2fa_login_status = isset( $_POST['request_origin_method'] ) ? $_POST['request_origin_method'] : null;
426
- $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
427
- $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
428
- $mo2fa_login_message = '';
429
- $this->miniorange_pass2login_start_session();
430
- $customer = new Customer_Setup();
431
- $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
432
- $user_email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user_id );
433
- $kba_configuration_status = $Mo2fdbQueries->get_user_detail( 'mo2f_SecurityQuestions_config_status', $user_id );
434
-
435
- if ( $kba_configuration_status ) {
436
- $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_KBA_AND_OTP_OVER_EMAIL';
437
- $pass2fa_login = new Miniorange_Password_2Factor_Login();
438
- $pass2fa_login->mo2f_pass2login_kba_verification( $user_id, $redirect_to,$session_id_encrypt );
439
- } else {
440
- $hidden_user_email = MO2f_Utility::mo2f_get_hidden_email( $user_email );
441
- $content = json_decode( $customer->send_otp_token( $user_email, 'EMAIL', get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
442
-
443
- if ( strcasecmp( $content['status'], 'SUCCESS' ) == 0 ) {
444
- $session_cookie_variables = array( 'mo2f-login-qrCode', 'mo2f_transactionId' );
445
- MO2f_Utility::unset_session_variables( $session_cookie_variables );
446
- MO2f_Utility::unset_cookie_variables( $session_cookie_variables );
447
- MO2f_Utility::unset_temp_user_details_in_table( 'mo2f_transactionId',$session_id_encrypt );
448
-
449
- //if the php session folder has insufficient permissions, cookies to be used
450
- MO2f_Utility::set_user_values( $session_id_encrypt,'mo2f_login_message', 'A one time passcode has been sent to <b>' . $hidden_user_email . '</b>. Please enter the OTP to verify your identity.' );
451
- MO2f_Utility::set_user_values( $session_id_encrypt, 'mo2f_transactionId', $content['txId'] );
452
- $this->mo2f_transactionid=$content['txId'];
453
- $mo2fa_login_message = 'A one time passcode has been sent to <b>' . $hidden_user_email . '</b>. Please enter the OTP to verify your identity.';
454
- $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_OTP_OVER_EMAIL';
455
- } else {
456
- $mo2fa_login_message = 'Error occurred while sending OTP over email. Please try again.';
457
  }
458
- $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to, null,$session_id_encrypt );
459
  }
460
- $pass2fa_login = new Miniorange_Password_2Factor_Login();
461
- $pass2fa_login->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
462
- }
463
- }else if ( isset( $_POST['miniorange_softtoken'] ) ) { /*Click on the link of phone is offline */
464
- $nonce = $_POST['miniorange_softtoken'];
465
- if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-softtoken' ) ) {
466
- $error = new WP_Error();
467
- $error->add( 'empty_username', __( '<strong>ERROR</strong>: Invalid Request.' ) );
468
- return $error;
469
- } else {
470
- $this->miniorange_pass2login_start_session();
471
- $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
472
- $session_cookie_variables = array( 'mo2f-login-qrCode', 'mo2f_transactionId' );
473
- MO2f_Utility::unset_session_variables( $session_cookie_variables );
474
- MO2f_Utility::unset_cookie_variables( $session_cookie_variables );
475
- MO2f_Utility::unset_temp_user_details_in_table('mo2f_transactionId',$session_id_encrypt );
476
- $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
477
- $mo2fa_login_message = 'Please enter the one time passcode shown in the miniOrange<b> Authenticator</b> app.';
478
- $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN';
479
- $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
480
  }
481
- }else if ( isset( $_POST['miniorange_soft_token_nonce'] ) ) { /*Validate Soft Token,OTP over SMS,OTP over EMAIL,Phone verification */
482
- $nonce = $_POST['miniorange_soft_token_nonce'];
483
- if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-soft-token-nonce' ) ) {
 
 
 
 
 
484
  $error = new WP_Error();
485
- $error->add( 'empty_username', __( '<strong>ERROR</strong>: Invalid Request.' ) );
486
  return $error;
487
- } else {
488
- $this->miniorange_pass2login_start_session();
489
- $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
490
- $mo2fa_login_status = isset( $_POST['request_origin_method'] ) ? $_POST['request_origin_method'] : null;
491
- $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
492
- $softtoken = '';
493
- $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
494
-
495
- $attempts = get_option('mo2f_attempts_before_redirect', 3);
496
- if ( MO2f_utility::mo2f_check_empty_or_null( $_POST['mo2fa_softtoken'] ) ) {
497
- if($attempts>1 || $attempts=='disabled')
498
- {
499
- update_option('mo2f_attempts_before_redirect', $attempts-1 );
500
- $mo2fa_login_message = 'Please enter OTP to proceed.';
501
- $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
502
- }else{
503
- $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
504
- $this->remove_current_activity($session_id_encrypt);
505
- return new WP_Error( 'limit_exceeded', '<strong>ERROR</strong>: Number of attempts exceeded.');
506
- }
507
- } else {
 
508
 
509
- $softtoken = sanitize_text_field( $_POST['mo2fa_softtoken'] );
510
- if ( ! MO2f_utility::mo2f_check_number_length( $softtoken ) ) {
511
- if($attempts>1|| $attempts=='disabled')
512
- {
513
- update_option('mo2f_attempts_before_redirect', $attempts-1 );
514
- $mo2fa_login_message = 'Invalid OTP. Only digits within range 4-8 are allowed. Please try again.';
515
- $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
516
-
517
- }else{
518
- $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
519
- $this->remove_current_activity($session_id_encrypt);
520
- update_option('mo2f_attempts_before_redirect', 3);
521
- return new WP_Error( 'limit_exceeded', '<strong>ERROR</strong>: Number of attempts exceeded.');
522
- }
523
- }
524
- }
525
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
526
 
527
- $user_email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user_id );
 
528
 
529
- if ( isset( $user_id ) ) {
530
- $customer = new Customer_Setup();
531
- $content = '';
532
- //if the php session folder has insufficient permissions, cookies to be used
533
- $mo2f_login_transaction_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_transactionId', $session_id_encrypt );
534
- if ( isset( $mo2fa_login_status ) && $mo2fa_login_status == 'MO_2_FACTOR_CHALLENGE_OTP_OVER_EMAIL' ) {
535
- $content = json_decode( $customer->validate_otp_token( 'EMAIL', null, $mo2f_login_transaction_id, $softtoken, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
536
- } else if ( isset( $mo2fa_login_status ) && $mo2fa_login_status == 'MO_2_FACTOR_CHALLENGE_OTP_OVER_SMS' ) {
537
- $content = json_decode( $customer->validate_otp_token( 'SMS', null, $mo2f_login_transaction_id, $softtoken, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
538
- } else if ( isset( $mo2fa_login_status ) && $mo2fa_login_status == 'MO_2_FACTOR_CHALLENGE_PHONE_VERIFICATION' ) {
539
- $content = json_decode( $customer->validate_otp_token( 'PHONE VERIFICATION', null, $mo2f_login_transaction_id, $softtoken, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
540
- } else if ( isset( $mo2fa_login_status ) && $mo2fa_login_status == 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN' ) {
541
- $content = json_decode( $customer->validate_otp_token( 'SOFT TOKEN', $user_email, null, $softtoken, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
542
- } else if ( isset( $mo2fa_login_status ) && $mo2fa_login_status == 'MO_2_FACTOR_CHALLENGE_GOOGLE_AUTHENTICATION' ) {
543
 
544
- $content = json_decode( $customer->validate_otp_token( 'GOOGLE AUTHENTICATOR', $user_email, null, $softtoken, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
545
 
546
- } else {
547
- $this->remove_current_activity($session_id_encrypt);
548
- return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Invalid Request. Please try again.' ) );
549
- }
550
 
551
- if ( strcasecmp( $content['status'], 'SUCCESS' ) == 0 ) {
552
- update_option('mo2f_attempts_before_redirect', 3);
553
- if ( get_option( 'mo2f_remember_device' ) ) {
554
- $mo2fa_login_status = 'MO_2_FACTOR_REMEMBER_TRUSTED_DEVICE';
555
- $this->miniorange_pass2login_form_fields( $mo2fa_login_status, null, $redirect_to,null,$session_id_encrypt );
556
- } else {
557
- $this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
558
- }
559
- } else {
560
- if($attempts>1 || $attempts=='disabled')
561
- {
562
- update_option('mo2f_attempts_before_redirect', $attempts-1);
563
- $message = $mo2fa_login_status == 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN' ? 'You have entered an invalid OTP.<br>Please click on <b>Sync Time</b> in the miniOrange Authenticator app to sync your phone time with the miniOrange servers and try again.' : 'Invalid OTP. Please try again.';
564
- $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $message, $redirect_to,null,$session_id_encrypt );
565
- }else{
566
- $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
567
- $this->remove_current_activity($session_id_encrypt);
568
- update_option('mo2f_attempts_before_redirect', 3);
569
- return new WP_Error( 'limit_exceeded', '<strong>ERROR</strong>: Number of attempts exceeded.');
570
- }
571
- }
572
 
573
- } else {
574
- $this->remove_current_activity($session_id_encrypt);
575
- return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Please try again..' ) );
576
- }
577
- }
578
- }else if ( isset( $_POST['miniorange_inline_skip_registration_nonce'] ) ) { /*Validate Soft Token,OTP over SMS,OTP over EMAIL,Phone verification */
579
- $nonce = $_POST['miniorange_inline_skip_registration_nonce'];
580
- if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-inline-skip-registration-nonce' ) ) {
581
- $error = new WP_Error();
582
- $error->add( 'empty_username', __( '<strong>ERROR</strong>: Invalid Request.' ) );
583
 
584
- return $error;
585
- } else {
586
- $this->miniorange_pass2login_start_session();
587
- $session_id = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
588
- $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id);
589
- $this->mo2fa_pass2login(null, $session_id );
590
- }
591
- }else if ( isset( $_POST['miniorange_attribute_collection_nonce'] ) ) { /*Handling Rba Attributes from other plugins */
592
- $nonce = $_POST['miniorange_attribute_collection_nonce'];
593
- if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-login-attribute-collection-nonce' ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
594
  $error = new WP_Error();
595
  $error->add( 'empty_username', __( '<strong>ERROR</strong>: Invalid Request.' ) );
596
 
597
  return $error;
598
- } else {
599
- $this->miniorange_pass2login_start_session();
600
-
601
- $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
602
- $currentuser = get_user_by( 'id', $user_id );
603
 
604
 
605
- $attributes = isset( $_POST['miniorange_rba_attribures'] ) ? $_POST['miniorange_rba_attribures'] : null;
606
- $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
607
- $session_id = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
608
- $this->miniorange_initiate_2nd_factor( $currentuser, $attributes, $redirect_to,$session_id );
609
  }
610
  }
611
  }
@@ -615,7 +1597,6 @@ class Miniorange_Password_2Factor_Login {
615
  if(empty($message) && get_option("deniedMessage") )
616
  {
617
  delete_option('deniedMessage');
618
- //return "<strong style='color: red'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You have denied the request</strong>";
619
  }
620
  else
621
  return $message;
@@ -704,7 +1685,8 @@ class Miniorange_Password_2Factor_Login {
704
  $random_keys = array_rand($challenge_questions,2);
705
  $challenge_ques1 = $challenge_questions[$random_keys[0]];
706
  $challenge_ques2 = $challenge_questions[$random_keys[1]];
707
- $questions = array($challenge_ques1,$challenge_ques2);
 
708
  update_user_meta( $user_id, 'kba_questions_user', $questions );
709
  $mo2fa_login_message = 'Please answer the following questions:';
710
  $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_KBA_AUTHENTICATION';
@@ -722,8 +1704,8 @@ class Miniorange_Password_2Factor_Login {
722
  MO2f_Utility::set_user_values( $session_id,"mo2f_transactionId", $response['txId'] );
723
  $this->mo2f_transactionid = $response['txId'];
724
  $questions = array();
725
- $questions[0] = $response['questions'][0]['question'];
726
- $questions[1] = $response['questions'][1]['question'];
727
  MO2f_Utility::set_user_values( $session_id, 'mo_2_factor_kba_questions', $questions );
728
  $this->mo2f_kbaquestions=$questions;
729
  $mo2fa_login_message = 'Please answer the following questions:';
@@ -750,50 +1732,103 @@ class Miniorange_Password_2Factor_Login {
750
 
751
  $login_status = $mo2fa_login_status;
752
  $login_message = $mo2fa_login_message;
753
- if ( $this->miniorange_pass2login_check_mobile_status( $login_status ) ) { //for mobile
 
754
  $transactionid = $this->mo2f_transactionid ? $this->mo2f_transactionid : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_transactionId',$session_id_encrypt );
755
  mo2f_get_qrcode_authentication_prompt( $login_status, $login_message, $redirect_to, $qrCode, $session_id_encrypt, $transactionid );
756
  exit;
757
- } else if ( $this->miniorange_pass2login_check_otp_status( $login_status ) ) { //for soft-token,otp over email,sms,phone verification,google auth
 
 
 
 
 
 
758
  $user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
759
  mo2f_get_otp_authentication_prompt( $login_status, $login_message, $redirect_to, $session_id_encrypt,$user_id );
760
  exit;
761
- } else if ( $this->miniorange_pass2login_check_forgotphone_status( $login_status ) ) { // forgot phone page if both KBA and Email are configured.
762
- mo2f_get_forgotphone_form( $login_status, $login_message, $redirect_to, $session_id_encrypt );
 
 
763
  exit;
764
- }else if ( $this->miniorange_pass2login_check_push_oobemail_status( $login_status ) ) { //for push and out of band email.
765
- $transactionid = $this->mo2f_transactionid ? $this->mo2f_transactionid : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_transactionId',$session_id_encrypt );
766
- $user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
767
- mo2f_get_push_notification_oobemail_prompt( $user_id, $login_status, $login_message, $redirect_to, $session_id_encrypt, $transactionid );
768
  exit;
769
- } else if ( $this->miniorange_pass2login_reconfig_google( $login_status ) ) { //MO_2_FACTOR_RECONFIG_GOOGLE
770
- // shortcode
771
- $user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
772
- $this->mo2f_redirect_shortcode_addon( $user_id, $login_status, $login_message, 'reconfigure_google' );
773
  exit;
774
- } else if ( $this->miniorange_pass2login_reconfig_kba( $login_status ) ) { //MO_2_FACTOR_RECONFIG_KBA
775
- $user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
776
- $this->mo2f_redirect_shortcode_addon( $user_id, $login_status, $login_message, 'reconfigure_kba' );
777
  exit;
778
- } else if ( $this->miniorange_pass2login_check_kba_status( $login_status ) ) { // for Kba
779
- $kbaquestions = $this->mo2f_kbaquestions ? $this->mo2f_kbaquestions : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo_2_factor_kba_questions',$session_id_encrypt );
780
- if(MO2F_IS_ONPREM){
 
781
  $user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
782
- $ques = get_user_meta( $user_id, 'kba_questions_user');
783
- mo2f_get_kba_authentication_prompt( $login_message, $redirect_to, $session_id_encrypt, $ques[0] );
784
- }
785
- else{
786
- mo2f_get_kba_authentication_prompt( $login_message, $redirect_to, $session_id_encrypt, $kbaquestions );
787
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
788
  exit;
789
- } else if ( $this->miniorange_pass2login_check_trusted_device_status( $login_status ) ) { // trusted device
790
- mo2f_get_device_form( $redirect_to, $session_id_encrypt );
 
 
 
791
  exit;
792
- } else { //show login screen
793
- $this->mo_2_factor_pass2login_show_wp_login_form();
794
- if(MO2F_IS_ONPREM){
795
  $this->mo_2_factor_pass2login_show_wp_login_form();
796
- }
 
 
 
797
  }
798
  }
799
 
@@ -975,15 +2010,13 @@ class Miniorange_Password_2Factor_Login {
975
  $session_id=$this->create_session();
976
  }
977
  $challengeMobile = new Customer_Setup();
978
- if(MO2F_IS_ONPREM){
979
- $user_email = get_user_meta($current_user->ID,'email',true);
980
  include_once dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'api'.DIRECTORY_SEPARATOR.'Mo2f_OnPremRedirect.php';
981
  $mo2fOnPremRedirect = new Mo2f_OnPremRedirect();
982
- // $content = $mo2fOnPremRedirect->OnpremSendRedirect($uKey,$authType );//change parameters as per your requirement but make sure other methods are not affected.
983
  $content = $mo2fOnPremRedirect->mo2f_pass2login_push_email_onpremise($current_user, $redirect_to, $session_id );
984
 
985
  }else {
986
- $user_email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $current_user->ID );
987
  $content = $challengeMobile->send_otp_token( $user_email, $mo2f_second_factor, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) );
988
  }
989
  $response = json_decode( $content, true );
@@ -1017,7 +2050,18 @@ class Miniorange_Password_2Factor_Login {
1017
  $session_id=$this->create_session();
1018
  }
1019
  $mo2f_external_app_type = get_user_meta( $user->ID, 'mo2f_external_app_type', true );
1020
- $mo2f_user_phone = $Mo2fdbQueries->get_user_detail( 'mo2f_user_phone', $user->ID );
 
 
 
 
 
 
 
 
 
 
 
1021
  if ( $mo2f_second_factor == 'SOFT TOKEN' ) {
1022
  $mo2fa_login_message = 'Please enter the one time passcode shown in the miniOrange<b> Authenticator</b> app.';
1023
  $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN';
@@ -1028,19 +2072,67 @@ class Miniorange_Password_2Factor_Login {
1028
  $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to, null,$session_id );
1029
  } else {
1030
  $challengeMobile = new Customer_Setup();
1031
- $content = $challengeMobile->send_otp_token( $mo2f_user_phone, $mo2f_second_factor, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) );
1032
- $response = json_decode( $content, true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1033
  if ( json_last_error() == JSON_ERROR_NONE ) {
1034
  if ( $response['status'] == 'SUCCESS' ) {
 
 
 
 
 
 
 
 
 
 
 
1035
  $message = 'The OTP has been sent to ' . MO2f_Utility::get_hidden_phone( $response['phoneDelivery']['contact'] ) . '. Please enter the OTP you received to Validate.';
1036
  update_option( 'mo2f_number_of_transactions', get_option( 'mo2f_number_of_transactions' ) - 1 );
1037
  MO2f_Utility::set_user_values( $session_id, "mo2f_transactionId", $response['txId'] );
1038
  $this->mo2f_transactionid=$response['txId'];
1039
  $mo2fa_login_message = $message;
1040
- $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_OTP_OVER_SMS';
 
 
 
 
 
1041
  $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null, $session_id );
1042
  } else {
1043
- $message = $response['message'] . ' You can click on <b>Forgot your phone</b> link to login via alternate method.';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1044
  MO2f_Utility::set_user_values( $session_id, "mo2f_transactionId", $response['txId'] );
1045
  $this->mo2f_transactionid=$response['txId'];
1046
  $mo2fa_login_message = $message;
@@ -1088,6 +2180,7 @@ class Miniorange_Password_2Factor_Login {
1088
  }
1089
 
1090
  function miniorange_initiate_2nd_factor( $currentuser, $attributes = null, $redirect_to = null, $otp_token = "",$session_id_encrypt=null ) {
 
1091
  global $Mo2fdbQueries;
1092
  $this->miniorange_pass2login_start_session();
1093
  if(is_null($session_id_encrypt)) {
@@ -1100,14 +2193,20 @@ class Miniorange_Password_2Factor_Login {
1100
  $this->mo2f_userID=$currentuser->ID;
1101
  $this->fstfactor='VALIDATE_SUCCESS';
1102
 
1103
- $is_customer_admin = get_option( 'mo2f_miniorange_admin' ) == $currentuser->ID ? true : false;
1104
 
1105
- if(MO2F_IS_ONPREM)
1106
- {
1107
  $is_customer_admin = true;
 
 
 
 
 
 
1108
  }
1109
- if ( $is_customer_admin ) {
1110
- $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $currentuser->ID );
1111
  $mo_2factor_user_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $currentuser->ID );
1112
  $kba_configuration_status = $Mo2fdbQueries->get_user_detail( 'mo2f_SecurityQuestions_config_status', $currentuser->ID );
1113
 
@@ -1118,13 +2217,12 @@ class Miniorange_Password_2Factor_Login {
1118
  }
1119
  update_user_meta( $currentuser->ID, 'mo2f_user_login_attempts', $mo2f_allwed_login_attempts );
1120
 
1121
- if(MO2F_IS_ONPREM)
1122
- {
1123
- $mo_2factor_user_registration_status = 'MO_2_FACTOR_PLUGIN_SETTINGS';
1124
- $email = get_user_meta($currentuser->ID , 'email',true);
1125
- }
1126
- if ( ($email && $mo_2factor_user_registration_status == 'MO_2_FACTOR_PLUGIN_SETTINGS') or (MO2F_IS_ONPREM and $mo_2factor_user_registration_status == 'MO_2_FACTOR_PLUGIN_SETTINGS')) { //checking if user has configured any 2nd factor method
1127
- try {
1128
  $mo2f_rba_status = mo2f_collect_attributes( $email, stripslashes( $attributes ) ); // Rba flow
1129
  MO2f_Utility::set_user_values( $session_id_encrypt, 'mo2f_rba_status', $mo2f_rba_status );
1130
  $this->mo2f_rbastatus=$mo2f_rba_status;
@@ -1142,36 +2240,38 @@ class Miniorange_Password_2Factor_Login {
1142
  $this->mo2f_restrict_access( 'Access_denied' );
1143
  exit;
1144
  } else {
 
1145
  $mo2f_second_factor = '';
1146
- $mo2f_second_factor = mo2f_get_user_2ndfactor( $currentuser );
1147
- if(MO2F_IS_ONPREM)
1148
- {
1149
- $user = $currentuser;
1150
- $roles = ( array ) $user->roles;
1151
- $flag = 0;
1152
- foreach ( $roles as $role ) {
1153
- if(get_option('mo2fa_'.$role)=='1')
1154
- $flag=1;
1155
- }
1156
- //$user = get_userdatabylogin('admin');
1157
- $mo2f_second_factor = get_user_meta($currentuser->ID,'currentMethod',true);
1158
-
1159
- if($mo2f_second_factor == 'Security Questions')
1160
- {
1161
  $mo2f_second_factor = 'KBA';
1162
- }
1163
  else if($mo2f_second_factor == 'Google Authenticator')
1164
- {
1165
- $mo2f_second_factor = 'GOOGLE AUTHENTICATOR';
1166
- }
1167
- else if($mo2f_second_factor != 'Email Verification')
1168
- {
1169
- $mo2f_second_factor = 'NONE';
1170
- }
1171
- if($flag == 0){
1172
- $mo2f_second_factor = 'NONE';
1173
- }
1174
- }
 
 
 
 
1175
  if((($mo2f_second_factor == 'GOOGLE AUTHENTICATOR') || ($mo2f_second_factor =='SOFT TOKEN') || ($mo2f_second_factor =='AUTHY AUTHENTICATOR')) && get_option('mo2f_enable_2fa_prompt_on_login_page')&& !get_option('mo2f_remember_device') && !isset($_POST['mo_woocommerce_login_prompt']) )
1176
  {
1177
  $error=$this->mo2f_validate_soft_token($currentuser, $redirect_to, $mo2f_second_factor, $otp_token,$session_id_encrypt);
@@ -1181,45 +2281,63 @@ class Miniorange_Password_2Factor_Login {
1181
  }
1182
  }
1183
  else{
 
1184
  if ( MO2f_Utility::check_if_request_is_from_mobile_device( $_SERVER['HTTP_USER_AGENT'] ) && $kba_configuration_status ) {
1185
  $this->mo2f_pass2login_kba_verification( $currentuser->ID, $redirect_to, $session_id_encrypt );
1186
  } else {
1187
- if ( $mo2f_second_factor == 'MOBILE AUTHENTICATION' ) {
1188
- $this->mo2f_pass2login_mobile_verification( $currentuser, $redirect_to, $session_id_encrypt );
1189
- } else if ( $mo2f_second_factor == 'PUSH NOTIFICATIONS' || $mo2f_second_factor == 'OUT OF BAND EMAIL' ) {
1190
- $this->mo2f_pass2login_push_oobemail_verification( $currentuser, $mo2f_second_factor, $redirect_to, $session_id_encrypt );
1191
- }
1192
- else if($mo2f_second_factor == 'Email Verification'){
1193
- $this->mo2f_pass2login_push_oobemail_verification( $currentuser, $mo2f_second_factor, $redirect_to, $session_id_encrypt );
1194
- }
1195
- else if ( $mo2f_second_factor == 'SOFT TOKEN' || $mo2f_second_factor == 'SMS' || $mo2f_second_factor == 'PHONE VERIFICATION' || $mo2f_second_factor == 'GOOGLE AUTHENTICATOR' ) {
1196
- $this->mo2f_pass2login_otp_verification( $currentuser, $mo2f_second_factor, $redirect_to, $session_id_encrypt );
1197
- } else if ( $mo2f_second_factor == 'KBA' ) {
1198
- $this->mo2f_pass2login_kba_verification( $currentuser->ID, $redirect_to , $session_id_encrypt );
1199
- }else if ( $mo2f_second_factor == 'NONE' ) {
1200
- $this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
1201
- } else {
1202
- $this->remove_current_activity($session_id_encrypt);
1203
- $error = new WP_Error();
1204
- $error->add( 'empty_username', __( '<strong>ERROR</strong>: Two Factor method has not been configured.' ) );
1205
- return $error;
1206
- }
1207
- }
1208
  }
1209
 
1210
  }
1211
- } else {
1212
- //$this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
 
 
1213
  return $currentuser;
1214
  }
1215
 
1216
  } else { //plugin is not activated for current role then logged him in without asking 2 factor
1217
- //$this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
1218
  return $currentuser;
1219
  }
1220
 
1221
  }
1222
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1223
  function mo2f_validate_soft_token($currentuser, $redirect_to = null, $mo2f_second_factor, $softtoken,$session_id_encrypt){
1224
  global $Mo2fdbQueries;
1225
  $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $currentuser->ID );
@@ -1290,14 +2408,12 @@ class Miniorange_Password_2Factor_Login {
1290
 
1291
  $redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : null;
1292
  $mo2f_configured_2FA_method = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $currentuser->ID );
1293
- if(MO2F_IS_ONPREM){
1294
- $mo2f_configured_2FA_method = get_user_meta($currentuser->ID,'currentMethod',true);
1295
- }
1296
- if (MO2F_IS_ONPREM && $mo2f_configured_2FA_method=='Security Questions')
1297
  {
1298
- $this->miniorange_initiate_2nd_factor($currentuser, null , $redirect_to , "" , $session_id );
1299
  }
1300
- elseif(MO2F_IS_ONPREM && $mo2f_configured_2FA_method =='Email Verification')
1301
  {
1302
  $this->miniorange_initiate_2nd_factor($currentuser, null , $redirect_to , null ,$session_id );
1303
  }
@@ -1328,7 +2444,6 @@ class Miniorange_Password_2Factor_Login {
1328
  $session_id=$this->create_session();
1329
  }
1330
 
1331
- // $key = get_option('mo2f_customer_token');
1332
 
1333
  $error=$this->miniorange_initiate_2nd_factor( $currentuser, $attributes, $redirect_to, $otp_token, $session_id );
1334
 
30
  private $mo2f_rbastatus;
31
  private $mo2f_transactionid;
32
 
33
+ function mo2f_inline_login(){
34
+ global $moWpnsUtility;
35
+ $email = sanitize_email( $_POST['email'] );
36
+ $password = sanitize_text_field( $_POST['password'] );
37
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
38
+ $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
39
+ $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
40
+ if( $moWpnsUtility->check_empty_or_null( $email ) || $moWpnsUtility->check_empty_or_null( $password ) )
41
+ {
42
+ $login_message=MoWpnsMessages::showMessage('REQUIRED_FIELDS');
43
+ $login_status="MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS";
44
+ $this->miniorange_pass2login_form_fields($login_status, $login_message,$redirect_to,null,$session_id_encrypt);
45
+ return;
46
+ }
47
+ $this->inline_get_current_customer($user_id,$email,$password,$redirect_to,$session_id_encrypt);
48
+ }
49
+ function mo2f_inline_register(){
50
+ global $moWpnsUtility, $Mo2fdbQueries;
51
+ $email = sanitize_email($_POST['email']);
52
+ $company = $_SERVER["SERVER_NAME"];
53
+ $password = sanitize_text_field($_POST['password']);
54
+ $confirmPassword = sanitize_text_field($_POST['confirmPassword']);
55
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
56
+ $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
57
+ $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
58
+ if( strlen( $password ) < 6 || strlen( $confirmPassword ) < 6)
59
+ {
60
+ $login_message=MoWpnsMessages::showMessage('PASS_LENGTH');
61
+ $login_status="MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS";
62
+ $this->miniorange_pass2login_form_fields($login_status, $login_message,$redirect_to,null,$session_id_encrypt);
63
+ }
64
+ if( $password != $confirmPassword )
65
+ {
66
+ $login_message=MoWpnsMessages::showMessage('PASS_MISMATCH');
67
+ $login_status="MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS";
68
+ $this->miniorange_pass2login_form_fields($login_status, $login_message,$redirect_to,null,$session_id_encrypt);
69
+ }
70
+ if( MoWpnsUtility::check_empty_or_null( $email ) || MoWpnsUtility::check_empty_or_null( $password )
71
+ || MoWpnsUtility::check_empty_or_null( $confirmPassword ) )
72
+ {
73
+ $login_message=MoWpnsMessages::showMessage('REQUIRED_FIELDS');
74
+ $login_status="MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS";
75
+ $this->miniorange_pass2login_form_fields($login_status, $login_message,$redirect_to,null,$session_id_encrypt);
76
+ }
77
+
78
+ update_option( 'mo2f_email', $email );
79
+
80
+ update_option( 'mo_wpns_company' , $company );
81
+
82
+ update_option( 'mo_wpns_password' , $password );
83
+
84
+ $customer = new MocURL();
85
+ $content = json_decode($customer->check_customer($email), true);
86
+ $Mo2fdbQueries->insert_user( $user_id );
87
+ switch ($content['status'])
88
+ {
89
+ case 'CUSTOMER_NOT_FOUND':
90
+ $customerKey = json_decode($customer->create_customer($email, $company, $password, $phone = '', $first_name = '', $last_name = ''), true);
91
+
92
+ if(strcasecmp($customerKey['status'], 'SUCCESS') == 0)
93
+ {
94
+ $this->inline_save_success_customer_config($email, $customerKey['id'], $customerKey['apiKey'], $customerKey['token'], $customerKey['appSecret']);
95
+ $this->inline_get_current_customer($user_id,$email,$password,$redirect_to,$session_id_encrypt);
96
+ }
97
+
98
+ break;
99
+ default:
100
+ $this->inline_get_current_customer($user_id,$email,$password,$redirect_to,$session_id_encrypt);
101
+ break;
102
+ }
103
+
104
+ }
105
+
106
+ function inline_get_current_customer($user,$email,$password,$redirect_to,$session_id_encrypt)
107
+ {
108
+ global $Mo2fdbQueries;
109
+ $customer = new MocURL();
110
+ $content = $customer->get_customer_key($email, $password);
111
+ $customerKey = json_decode($content, true);
112
+ if(json_last_error() == JSON_ERROR_NONE)
113
+ {
114
+ if(isset($customerKey['phone'])){
115
+ update_option( 'mo_wpns_admin_phone', $customerKey['phone'] );
116
+ $Mo2fdbQueries->update_user_details( $user, array( 'mo2f_user_phone' => $customerKey['phone'] ) );
117
+ }
118
+ update_option('mo2f_email',$email);
119
+ $this->inline_save_success_customer_config($email, $customerKey['id'], $customerKey['apiKey'], $customerKey['token'], $customerKey['appSecret']);
120
+ $login_message=MoWpnsMessages::showMessage('REG_SUCCESS');
121
+ $login_status="MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS";
122
+ $this->miniorange_pass2login_form_fields($login_status, $login_message,$redirect_to,null,$session_id_encrypt);
123
+ }
124
+ else
125
+ {
126
+ $Mo2fdbQueries->update_user_details( $user, array( 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_VERIFY_CUSTOMER' ) );
127
+ $login_message=MoWpnsMessages::showMessage('ACCOUNT_EXISTS');
128
+ $login_status="MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS";
129
+ $this->miniorange_pass2login_form_fields($login_status, $login_message,$redirect_to,null,$session_id_encrypt);
130
+ }
131
+ }
132
+
133
+ function inline_save_success_customer_config($email, $id, $apiKey, $token, $appSecret)
134
+ {
135
+ global $Mo2fdbQueries;
136
+ update_option( 'mo2f_customerKey' , $id );
137
+ update_option( 'mo2f_api_key' , $apiKey );
138
+ update_option( 'mo2f_customer_token' , $token );
139
+ update_option( 'mo2f_app_secret' , $appSecret );
140
+ update_option( 'mo_wpns_enable_log_requests' , true );
141
+ update_option( 'mo2f_miniorange_admin', $id );
142
+ update_option( 'mo_2factor_admin_registration_status', 'MO_2_FACTOR_CUSTOMER_REGISTERED_SUCCESS' );
143
+
144
+ }
145
+ function mo2f_inline_validate_otp(){
146
+ if(isset($_POST['miniorange_inline_validate_otp_nonce'])){
147
+ $nonce = $_POST['miniorange_inline_validate_otp_nonce'];
148
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-inline-validate-otp-nonce' ) ) {
149
+ $error = new WP_Error();
150
+ $error->add('empty_username', '<strong>'. __('ERROR','miniorange-2-factor-authentication') .'</strong>: '. __('Invalid Request.', 'miniorange-2-factor-authentication'));
151
+ return $error;
152
+ } else {
153
+ global $Mo2fdbQueries;
154
+ $this->miniorange_pass2login_start_session();
155
+ $otp_token = '';
156
+ $mo2fa_login_status = 'MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS';
157
+ $mo2fa_login_message = '';
158
+ if( MO2f_Utility::mo2f_check_empty_or_null( $_POST['otp_token'] ) ) {
159
+ $mo2fa_login_message = __('All the fields are required. Please enter valid entries.','miniorange-2-factor-authentication');
160
+ $this->miniorange_pass2login_form_fields($mo2fa_login_status, $mo2fa_login_message);
161
+ } else{
162
+ $otp_token = sanitize_text_field( $_POST['otp_token'] );
163
+ }
164
+
165
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
166
+ $current_user = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
167
+ $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
168
+ $selected_2factor_method = $Mo2fdbQueries->get_user_detail('mo2f_configured_2FA_method',$current_user);
169
+ $user_phone = $Mo2fdbQueries->get_user_detail('mo2f_user_phone',$current_user);
170
+ $customer = new Customer_Setup();
171
+ $content = json_decode($customer->validate_otp_token( $selected_2factor_method, null, get_user_meta($current_user,'mo2f_transactionId',true), $otp_token, get_site_option('mo2f_customerKey'), get_site_option('mo2f_api_key') ),true);
172
+ if($content['status'] == 'ERROR'){
173
+ $mo2fa_login_message = Mo2fConstants::langTranslate($content['message']);
174
+ }else if(strcasecmp($content['status'], 'SUCCESS') == 0) { //OTP validated
175
+ $phone = get_user_meta($current_user,'mo2f_user_phone',true) ;
176
+ if($user_phone && strlen($user_phone) >= 4){
177
+ if($phone != $user_phone ){
178
+
179
+ $Mo2fdbQueries->update_user_details( $current_user, array(
180
+ 'mobile_registration_status' =>false
181
+ ) );
182
+ }
183
+ }
184
+
185
+ $email = $Mo2fdbQueries->get_user_detail('mo2f_user_email',$current_user);
186
+ if(!($Mo2fdbQueries->get_user_detail('mo2f_configured_2FA_method',$current_user)=='OTP OVER EMAIL')){
187
+ $Mo2fdbQueries->update_user_details( $current_user, array(
188
+ 'mo2f_OTPOverSMS_config_status' =>true,
189
+ 'mo2f_user_phone' =>$phone
190
+ ) );
191
+ }else{
192
+ $Mo2fdbQueries->update_user_details( $current_user, array('mo2f_email_otp_registration_status'=>true) );
193
+
194
+ }
195
+ // unset($_SESSION[ 'mo2f_phone']);
196
+ // if(MO2F_IS_ONPREM)
197
+ // update_user_meta($current_user,'currentMethod','OTP Over SMS'); ///current_user = current_user_id
198
+ // else
199
+ // {
200
+ $Mo2fdbQueries->update_user_details($current_user, array(
201
+ "mo2f_configured_2FA_method" => 'OTP Over SMS',
202
+ 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_PLUGIN_SETTINGS',
203
+ ) );
204
+ $TwoF_setup = new Two_Factor_Setup();
205
+ $response = json_decode($TwoF_setup->mo2f_update_userinfo($email,'SMS',null,null,null),true);
206
+
207
+ // }
208
+ $mo2fa_login_status = 'MO_2_FACTOR_SETUP_SUCCESS';
209
+
210
+ }else{ // OTP Validation failed.
211
+ $mo2fa_login_message = __('Invalid OTP. Please try again.','miniorange-2-factor-authentication');
212
+ }
213
+ $this->miniorange_pass2login_form_fields($mo2fa_login_status, $mo2fa_login_message,$redirect_to,null,$session_id_encrypt);
214
+ }
215
+ }
216
+
217
+ }
218
+ function mo2f_inline_send_otp(){
219
+ if(isset($_POST['miniorange_inline_verify_phone_nonce'])){
220
+ $nonce = $_POST['miniorange_inline_verify_phone_nonce'];
221
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-inline-verify-phone-nonce' ) ) {
222
+ $error = new WP_Error();
223
+ $error->add('empty_username', '<strong>'. __('ERROR','miniorange-2-factor-authentication') .'</strong>: '. __('Invalid Request.', 'miniorange-2-factor-authentication'));
224
+ return $error;
225
+ } else {
226
+ global $Mo2fdbQueries;
227
+ $this->miniorange_pass2login_start_session();
228
+ $phone = sanitize_text_field( $_POST['verify_phone'] );
229
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
230
+ $current_user = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
231
+ $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
232
+ $customer = new Customer_Setup();
233
+ $selected_2factor_method = $Mo2fdbQueries->get_user_detail('mo2f_configured_2FA_method',$current_user);
234
+ $parameters = array();
235
+ $email = $Mo2fdbQueries->get_user_detail('mo2f_user_email',$current_user);
236
+
237
+ $mo2fa_login_message = '';
238
+ $mo2fa_login_status = 'MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS';
239
+ if($selected_2factor_method=='SMS' || $selected_2factor_method=='PHONE VERIFICATION' ||$selected_2factor_method== 'SMS AND EMAIL'){
240
+ $phone = sanitize_text_field( $_POST['verify_phone'] );
241
+ $phone = sanitize_text_field( $_POST['verify_phone'] );
242
+ if( MO2f_Utility::mo2f_check_empty_or_null( $phone ) ){
243
+ $mo2fa_login_message = __('Please enter your phone number.','miniorange-2-factor-authentication');
244
+ $this->miniorange_pass2login_form_fields($mo2fa_login_status, $mo2fa_login_message,$redirect_to,null,$session_id_encrypt);
245
+ }
246
+ $phone = str_replace(' ', '', $phone);
247
+ // $_SESSION['mo2f_phone'] = $phone;
248
+ update_user_meta($current_user,'mo2f_user_phone',$phone);
249
+ }
250
+ if($selected_2factor_method == 'OTP_OVER_SMS' || $selected_2factor_method == 'SMS' ){
251
+ $currentMethod = "SMS";
252
+ }else if($selected_2factor_method == 'SMS AND EMAIL'){
253
+ $currentMethod = "OTP_OVER_SMS_AND_EMAIL";
254
+ $parameters = array("phone" => $phone, "email" => $email);
255
+ }else if($selected_2factor_method == 'PHONE VERIFICATION'){
256
+ $currentMethod = "PHONE_VERIFICATION";
257
+ }else if($selected_2factor_method == 'OTP OVER EMAIL'){
258
+ $currentMethod = "OTP_OVER_EMAIL";
259
+ $parameters = $email;
260
+ }
261
+ if($selected_2factor_method == 'SMS AND EMAIL'){
262
+ $content = json_decode($customer->send_otp_token($parameters,$currentMethod,get_site_option( 'mo2f_customerKey'),get_site_option( 'mo2f_api_key')), true);
263
+ }
264
+ else if($selected_2factor_method == 'OTP OVER EMAIL'){
265
+ $content = json_decode($customer->send_otp_token($email,$currentMethod,get_site_option( 'mo2f_customerKey'),get_site_option( 'mo2f_api_key')), true);
266
+ }
267
+ else{
268
+ $content = json_decode($customer->send_otp_token($phone,$currentMethod,get_site_option( 'mo2f_customerKey'),get_site_option( 'mo2f_api_key')), true);
269
+
270
+ }
271
+ if(json_last_error() == JSON_ERROR_NONE) { /* Generate otp token */
272
+ if($content['status'] == 'ERROR'){
273
+ $mo2fa_login_message = Mo2fConstants::langTranslate($content['message']);
274
+ }else if($content['status'] == 'SUCCESS'){
275
+ // $_SESSION[ 'mo2f_transactionId' ] = $content['txId'];
276
+ update_user_meta($current_user,'mo2f_transactionId',$content['txId']);
277
+ if($selected_2factor_method == 'SMS'){
278
+ update_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z',get_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z')-1);
279
+ $mo2fa_login_message = __('The One Time Passcode has been sent to','miniorange-2-factor-authentication'). $phone . '.' . __('Please enter the one time passcode below to verify your number.','miniorange-2-factor-authentication');
280
+ }else if($selected_2factor_method == 'SMS AND EMAIL'){
281
+ $mo2fa_login_message = 'The One Time Passcode has been sent to ' . $parameters["phone"] . ' and '. $parameters["email"] . '. Please enter the one time passcode sent to your email and phone to verify.';
282
+ }else if($selected_2factor_method == 'OTP OVER EMAIL'){
283
+ $mo2fa_login_message = __('The One Time Passcode has been sent to ','miniorange-2-factor-authentication') . $parameters . '.' . __('Please enter the one time passcode sent to your email to verify.','miniorange-2-factor-authentication');
284
+ }else if($selected_2factor_method== 'PHONE VERIFICATION'){
285
+ $mo2fa_login_message = __('You will receive a phone call on this number ','miniorange-2-factor-authentication') . $phone . '.' . __('Please enter the one time passcode below to verify your number.','miniorange-2-factor-authentication');
286
+ }
287
+ }else if($content['status'] == 'FAILED'){
288
+ $mo2fa_login_message = __($content['message'],'miniorange-2-factor-authentication');
289
+ }else{
290
+ $mo2fa_login_message = __('An error occured while validating the user. Please Try again.','miniorange-2-factor-authentication');
291
+ }
292
+ }else{
293
+ $mo2fa_login_message = __('Invalid request. Please try again','miniorange-2-factor-authentication');
294
+ }
295
+ $this->miniorange_pass2login_form_fields($mo2fa_login_status, $mo2fa_login_message,$redirect_to,null,$session_id_encrypt);
296
+ }
297
+ }
298
+
299
+ }
300
+ function mo2f_inline_validate_kba(){
301
+ if(isset($_POST['mo2f_inline_save_kba_nonce'])){
302
+ $nonce = $_POST['mo2f_inline_save_kba_nonce'];
303
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-inline-save-kba-nonce' ) ) {
304
+ $error = new WP_Error();
305
+ $error->add('empty_username', '<strong>'. __('ERROR','miniorange-2-factor-authentication') .'</strong>: '. __('Invalid Request.', 'miniorange-2-factor-authentication'));
306
+ return $error;
307
+ } else {
308
+ global $Mo2fdbQueries;
309
+ $this->miniorange_pass2login_start_session();
310
+ $mo2fa_login_message = '';
311
+ $mo2fa_login_status = isset($_POST['mo2f_inline_kba_status']) ? 'MO_2_FACTOR_SETUP_SUCCESS' : 'MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS';
312
+ $temp_array = array($_POST['mo2f_kbaquestion_1'],$_POST['mo2f_kbaquestion_2'],$_POST['mo2f_kbaquestion_3']);
313
+ $kba_questions = array();
314
+ foreach($temp_array as $question){
315
+ if(MO2f_Utility::mo2f_check_empty_or_null( $question)){
316
+ $mo2fa_login_message = __('All the fields are required. Please enter valid entries.','miniorange-2-factor-authentication');
317
+ $this->miniorange_pass2login_form_fields($mo2fa_login_status, $mo2fa_login_message);
318
+ }else{
319
+ $ques = sanitize_text_field($question);
320
+ $ques = addcslashes(stripslashes($ques), '"\\');
321
+ array_push($kba_questions, $ques);
322
+ }
323
+ }
324
+ if(!(array_unique($kba_questions) == $kba_questions)){
325
+ $mo2fa_login_message = __('The questions you select must be unique.','miniorange-2-factor-authentication');
326
+ $this->miniorange_pass2login_form_fields($mo2fa_login_status, $mo2fa_login_message);
327
+ }
328
+ $temp_array_ans = array($_POST['mo2f_kba_ans1'],$_POST['mo2f_kba_ans2'],$_POST['mo2f_kba_ans3']);
329
+ $kba_answers = array();
330
+ foreach($temp_array_ans as $answer){
331
+ if(MO2f_Utility::mo2f_check_empty_or_null( $answer)){
332
+ $mo2fa_login_message = __('All the fields are required. Please enter valid entries.','miniorange-2-factor-authentication');
333
+ $this->miniorange_pass2login_form_fields($mo2fa_login_status, $mo2fa_login_message);
334
+ }else{
335
+ $ques = sanitize_text_field($answer);
336
+ $answer = strtolower($answer);
337
+ array_push($kba_answers, $answer);
338
+ }
339
+ }
340
+ $size = sizeof($kba_questions);
341
+ $kba_q_a_list = array();
342
+ for($c = 0; $c < $size; $c++){
343
+ array_push($kba_q_a_list, $kba_questions[$c]);
344
+ array_push($kba_q_a_list, $kba_answers[$c]);
345
+ }
346
+
347
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
348
+ $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
349
+ $current_user = get_user_by('id',$user_id);
350
+ $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
351
+
352
+ $email = $Mo2fdbQueries->get_user_detail('mo2f_user_email',$current_user->ID);
353
+ $mo2fa_login_status = 'MO_2_FACTOR_SETUP_SUCCESS';
354
+ $Mo2fdbQueries->update_user_details( $current_user->ID, array(
355
+ 'mo2f_SecurityQuestions_config_status' =>true,
356
+ 'mo_2factor_user_registration_status' =>'MO_2_FACTOR_PLUGIN_SETTINGS'
357
+ ) );
358
+ if(!MO2F_IS_ONPREM)
359
+ {
360
+ $kba_q1 = $_POST['mo2f_kbaquestion_1'];
361
+ $kba_a1 = sanitize_text_field( $_POST['mo2f_kba_ans1'] );
362
+ $kba_q2 = $_POST['mo2f_kbaquestion_2'];
363
+ $kba_a2 = sanitize_text_field( $_POST['mo2f_kba_ans2'] );
364
+ $kba_q3 = sanitize_text_field( $_POST['mo2f_kbaquestion_3'] );
365
+ $kba_a3 = sanitize_text_field( $_POST['mo2f_kba_ans3'] );
366
+
367
+ $kba_q1 = addcslashes( stripslashes( $kba_q1 ), '"\\' );
368
+ $kba_q2 = addcslashes( stripslashes( $kba_q2 ), '"\\' );
369
+ $kba_q3 = addcslashes( stripslashes( $kba_q3 ), '"\\' );
370
+
371
+ $kba_a1 = addcslashes( stripslashes( $kba_a1 ), '"\\' );
372
+ $kba_a2 = addcslashes( stripslashes( $kba_a2 ), '"\\' );
373
+ $kba_a3 = addcslashes( stripslashes( $kba_a3 ), '"\\' );
374
+
375
+ $kba_registration = new Two_Factor_Setup();
376
+ $kba_reg_reponse = json_decode( $kba_registration->register_kba_details( $email, $kba_q1, $kba_a1, $kba_q2, $kba_a2, $kba_q3, $kba_a3, $user_id ), true );
377
+
378
+ if ( json_last_error() == JSON_ERROR_NONE ) {
379
+
380
+ if ( $kba_reg_reponse['status'] == 'SUCCESS' ) {
381
+ $response = json_decode( $kba_registration->mo2f_update_userinfo( $email, 'KBA', null, null, null ), true );
382
+ }
383
+
384
+ }
385
+ }
386
+
387
+ $kba_q1 = $kba_q_a_list[0];
388
+ $kba_a1 = md5($kba_q_a_list[1]);
389
+ $kba_q2 = $kba_q_a_list[2];
390
+ $kba_a2 = md5($kba_q_a_list[3]);
391
+ $kba_q3 = $kba_q_a_list[4];
392
+ $kba_a3 = md5($kba_q_a_list[5]);
393
+ $question_answer = array($kba_q1 => $kba_a1 ,$kba_q2 => $kba_a2 , $kba_q3 => $kba_a3 );
394
+ update_user_meta( $current_user->ID , 'mo2f_kba_challenge', $question_answer );
395
+ if(!isset($_POST['mo2f_inline_kba_status'])){
396
+ update_user_meta($current_user->ID,'mo2f_2FA_method_to_configure','Security Questions');
397
+ $Mo2fdbQueries->update_user_details( $current_user->ID, array( 'mo2f_configured_2FA_method' => 'Security Questions' ) );
398
+ // update_user_meta($current_user->ID, 'currentMethod','Security Questions');
399
+ }
400
+ $this->miniorange_pass2login_form_fields($mo2fa_login_status, $mo2fa_login_message,$redirect_to,null,$session_id_encrypt);
401
+ }
402
+ }
403
+ }
404
+
405
+ function mo2f_inline_validate_mobile_authentication(){
406
+ if(isset($_POST['mo_auth_inline_mobile_registration_complete_nonce'])){
407
+ $nonce = $_POST['mo_auth_inline_mobile_registration_complete_nonce'];
408
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-inline-mobile-registration-complete-nonce' ) ) {
409
+ $error = new WP_Error();
410
+ $error->add('empty_username', '<strong>'. __('ERROR','miniorange-2-factor-authentication') .'</strong>: '. __('Invalid Request.', 'miniorange-2-factor-authentication'));
411
+ return $error;
412
+ } else {
413
+ global $Mo2fdbQueries;
414
+ $this->miniorange_pass2login_start_session();
415
+ // unset($_SESSION[ 'mo2f-login-qrCode' ]);
416
+ // unset($_SESSION[ 'mo2f-login-transactionId' ]);
417
+ // unset($_SESSION[ 'mo2f_show_qr_code'] );
418
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
419
+ MO2f_Utility::unset_temp_user_details_in_table( 'mo2f_transactionId',$session_id_encrypt );
420
+ $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
421
+ // $current_user = get_user_by('id',$user_id);
422
+ $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
423
+ $selected_2factor_method = $Mo2fdbQueries->get_user_detail('mo2f_configured_2FA_method',$user_id);
424
+ $email = $Mo2fdbQueries->get_user_detail('mo2f_user_email',$user_id);
425
+ $mo2fa_login_message = '';
426
+ $mo2fa_login_status = 'MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS';
427
+ $enduser = new Two_Factor_Setup();
428
+ if($selected_2factor_method == 'SOFT TOKEN')
429
+ $selected_2factor_method_onprem = 'miniOrange Soft Token';
430
+ else if($selected_2factor_method == 'PUSH NOTIFICATIONS')
431
+ $selected_2factor_method_onprem = 'miniOrange Push Notification';
432
+ else if($selected_2factor_method == 'MOBILE AUTHENTICATION')
433
+ $selected_2factor_method_onprem = 'miniOrange QR Code Authentication';
434
+
435
+ // update_user_meta($user_id,'currentMethod',$selected_2factor_method_onprem);
436
+ $response = json_decode($enduser->mo2f_update_userinfo($email,$selected_2factor_method,null,null,null),true);
437
+ if(json_last_error() == JSON_ERROR_NONE) { /* Generate Qr code */
438
+ if($response['status'] == 'ERROR'){
439
+ $mo2fa_login_message = Mo2fConstants::langTranslate($response['message']);
440
+ }else if($response['status'] == 'SUCCESS'){
441
+ $Mo2fdbQueries->update_user_details( $user_id, array(
442
+ 'mobile_registration_status' =>true,
443
+ 'mo2f_miniOrangeQRCodeAuthentication_config_status' => true,
444
+ 'mo2f_miniOrangeSoftToken_config_status' => true,
445
+ 'mo2f_miniOrangePushNotification_config_status' => true,
446
+ 'mo2f_configured_2FA_method' =>$selected_2factor_method_onprem ,
447
+ 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_PLUGIN_SETTINGS',
448
+ ) );
449
+ // $Mo2fdbQueries->update_user_details( $current_user->ID, array( 'mo2f_configured_2FA_method' => 'Security Questions' ) );
450
+ $mo2fa_login_status = 'MO_2_FACTOR_SETUP_SUCCESS';
451
+ }else{
452
+ $mo2fa_login_message = __('An error occured while validating the user. Please Try again.','miniorange-2-factor-authentication');
453
+ }
454
+ }else{
455
+ $mo2fa_login_message = __('Invalid request. Please try again','miniorange-2-factor-authentication');
456
+ }
457
+ $this->miniorange_pass2login_form_fields($mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt);
458
+ }
459
+ }
460
+
461
+ }
462
+
463
+ function mo2f_inline_setup_success($current_user_id,$redirect_to,$session_id){
464
+ global $Mo2fdbQueries;
465
+ $Mo2fdbQueries->update_user_details( $current_user_id, array('mo_2factor_user_registration_status' =>'MO_2_FACTOR_PLUGIN_SETTINGS') );
466
+ $pass2fa= new Miniorange_Password_2Factor_Login();
467
+ $pass2fa->mo2fa_pass2login($redirect_to,$session_id);
468
+ exit;
469
+ }
470
+
471
+ function mo2f_inline_get_qr_code_for_mobile($email,$id){
472
+ $registerMobile = new Two_Factor_Setup();
473
+ $content = $registerMobile->register_mobile($email);
474
+ $response = json_decode($content, true);
475
+ $message = '';
476
+ $miniorageqr=array();
477
+ if(json_last_error() == JSON_ERROR_NONE) {
478
+ if($response['status'] == 'ERROR'){
479
+ $miniorageqr['message']=Mo2fConstants::langTranslate($response['message']);;
480
+ delete_user_meta( $id, 'miniorageqr' );
481
+ }else{
482
+ if($response['status'] == 'IN_PROGRESS'){
483
+
484
+ $miniorageqr['message']='';
485
+ $miniorageqr['mo2f-login-qrCode']=$response['qrCode'];
486
+ $miniorageqr['mo2f-login-transactionId']=$response['txId'];
487
+ $miniorageqr['mo2f_show_qr_code']='MO_2_FACTOR_SHOW_QR_CODE';
488
+ update_user_meta($id,'miniorageqr',$miniorageqr);
489
+ }else{
490
+ $miniorageqr['message']=__('An error occured while processing your request. Please Try again.','miniorange-2-factor-authentication');
491
+ delete_user_meta( $id, 'miniorageqr' );
492
+ }
493
+ }
494
+ }
495
+ return $miniorageqr;
496
+ }
497
+
498
+ function inline_mobile_configure(){
499
+ if(isset($_POST['miniorange_inline_show_qrcode_nonce'])){
500
+ $nonce = $_POST['miniorange_inline_show_qrcode_nonce'];
501
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-inline-show-qrcode-nonce' ) ) {
502
+ $error = new WP_Error();
503
+ $error->add('empty_username', '<strong>'. __('ERROR','miniorange-2-factor-authentication') .'</strong>: '. __('Invalid Request.', 'miniorange-2-factor-authentication'));
504
+ return $error;
505
+ } else {
506
+ global $Mo2fdbQueries;
507
+ $this->miniorange_pass2login_start_session();
508
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
509
+
510
+ $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
511
+
512
+ $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
513
+ $current_user = get_user_by('id',$user_id);
514
+ $mo2fa_login_message = '';
515
+ $mo2fa_login_status = 'MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS';
516
+ $user_registration_status = $Mo2fdbQueries->get_user_detail('mo_2factor_user_registration_status',$current_user->ID);
517
+ if($user_registration_status == 'MO_2_FACTOR_INITIALIZE_TWO_FACTOR') {
518
+ $email = $Mo2fdbQueries->get_user_detail('mo2f_user_email',$current_user->ID);
519
+ $miniorageqr = $this->mo2f_inline_get_qr_code_for_mobile($email,$current_user->ID);
520
+ $mo2fa_login_message=$miniorageqr['message'];
521
+ MO2f_Utility::set_user_values( $session_id_encrypt,'mo2f_transactionId', $miniorageqr['mo2f-login-transactionId'] );
522
+ $this->mo2f_transactionid=$miniorageqr['mo2f-login-transactionId'];
523
+ }else{
524
+ $mo2fa_login_message = __('Invalid request. Please register with miniOrange before configuring your mobile.','miniorange-2-factor-authentication');
525
+ }
526
+ $this->miniorange_pass2login_form_fields($mo2fa_login_status, $mo2fa_login_message,$redirect_to,$miniorageqr,$session_id_encrypt);
527
+ }
528
+ }
529
+ }
530
+
531
+ function inline_validate_and_set_ga(){
532
+ if(isset($_POST['mo2f_inline_validate_ga_nonce'])){
533
+ $nonce = $_POST['mo2f_inline_validate_ga_nonce'];
534
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-inline-google-auth-nonce' ) ) {
535
+ $error = new WP_Error();
536
+ $error->add('empty_username', '<strong>'. __('ERROR','miniorange-2-factor-authentication') .'</strong>: '. __('Invalid Request.', 'miniorange-2-factor-authentication'));
537
+ return $error;
538
+ } else {
539
+ global $Mo2fdbQueries;
540
+ $this->miniorange_pass2login_start_session();
541
+ $otpToken = $_POST['google_auth_code'];
542
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
543
+ $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
544
+ $current_user = get_user_by('id',$user_id);
545
+ $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
546
+ $mo2f_google_auth=json_decode(get_user_meta($user_id,'mo2f_google_auth', true),true);
547
+ $mo2f_google_auth = isset($mo2f_google_auth) ?$mo2f_google_auth : null;
548
+ // $mo2f_google_auth = isset($_SESSION['mo2f_google_auth']) ? $_SESSION['mo2f_google_auth'] : null;
549
+ $ga_secret = $mo2f_google_auth != null ? $mo2f_google_auth['ga_secret'] : null;
550
+ $mo2fa_login_message = '';
551
+ $mo2fa_login_status = 'MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS';
552
+ if(MO2f_Utility::mo2f_check_number_length($otpToken)){
553
+ $email = $Mo2fdbQueries->get_user_detail('mo2f_user_email',$current_user->ID);
554
+ //$selected_2factor_method = $Mo2fdbQueries->get_user_detail('mo2f_configured_2FA_method',$current_user->ID);
555
+ $google_auth = new Miniorange_Rba_Attributes();
556
+ $google_response = json_decode($google_auth->mo2f_validate_google_auth($email,$otpToken,$ga_secret),true);
557
+ if(json_last_error() == JSON_ERROR_NONE) {
558
+ if($google_response['status'] == 'SUCCESS'){
559
+ $response = $google_response;
560
+ if(json_last_error() == JSON_ERROR_NONE || MO2F_IS_ONPREM) {
561
+ if($response['status'] == 'SUCCESS'){
562
+ $Mo2fdbQueries->update_user_details( $current_user->ID, array(
563
+ 'mo2f_GoogleAuthenticator_config_status' => true,
564
+ 'mo2f_configured_2FA_method' => 'Google Authenticator',
565
+ 'mo2f_AuthyAuthenticator_config_status' => false,
566
+ 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_PLUGIN_SETTINGS'
567
+ ) );
568
+
569
+ if(MO2F_IS_ONPREM){
570
+ update_user_meta($current_user->ID,'mo2f_2FA_method_to_configure','GOOGLE AUTHENTICATOR');
571
+ //update_user_meta($current_user->ID, 'currentMethod','Google Authenticator');
572
+ //update_user_meta($current_user->ID,'Google Authenticator',true);
573
+ $gauth_obj= new Google_auth_onpremise();
574
+ $gauth_obj->mo_GAuth_set_secret($current_user->ID, $ga_secret);
575
+ }
576
+ update_user_meta($current_user->ID,'mo2f_external_app_type','GOOGLE AUTHENTICATOR');
577
+ $mo2fa_login_status = 'MO_2_FACTOR_SETUP_SUCCESS';
578
+ unset($_SESSION['mo2f_google_auth']);
579
+ }else{
580
+ $mo2fa_login_message = __('An error occured while processing your request. Please Try again.','miniorange-2-factor-authentication');
581
+ }
582
+ }else{
583
+ $mo2fa_login_message = __('An error occured while processing your request. Please Try again.','miniorange-2-factor-authentication');
584
+ }
585
+ }else{
586
+ $mo2fa_login_message = __('An error occured while processing your request. Please Try again.','miniorange-2-factor-authentication');
587
+ }
588
+ }else{
589
+ $mo2fa_login_message = __('An error occured while validating the user. Please Try again.','miniorange-2-factor-authentication');
590
+ }
591
+ }else{
592
+ $mo2fa_login_message = __('Only digits are allowed. Please enter again.','miniorange-2-factor-authentication');
593
+ }
594
+ $this->miniorange_pass2login_form_fields($mo2fa_login_status, $mo2fa_login_message,$redirect_to,null,$session_id_encrypt);
595
+ }
596
+ }
597
+ }
598
+
599
+ function back_to_select_2fa(){
600
+ if( isset($_POST['miniorange_inline_two_factor_setup'])){ /* return back to choose second factor screen */
601
+ $nonce = $_POST['miniorange_inline_two_factor_setup'];
602
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-inline-setup-nonce' ) ) {
603
+ $error = new WP_Error();
604
+ $error->add('empty_username', '<strong>'. __('ERROR','miniorange-2-factor-authentication') .'</strong>: '. __('Invalid Request.', 'miniorange-2-factor-authentication'));
605
+ return $error;
606
+ } else {
607
+ global $Mo2fdbQueries;
608
+ $this->miniorange_pass2login_start_session();
609
+ unset($_SESSION['mo2f_google_auth']);
610
+ unset($_SESSION['mo2f_authy_keys']);
611
+ unset($_SESSION['secret_ga']);
612
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
613
+ $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
614
+ $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
615
+ $current_user = get_user_by('id',$user_id);
616
+ $Mo2fdbQueries->update_user_details( $current_user->ID, array( "mo2f_configured_2FA_method" => '' ) );
617
+ $mo2fa_login_message = '';
618
+ $mo2fa_login_status ='MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS';
619
+ $this->miniorange_pass2login_form_fields($mo2fa_login_status, $mo2fa_login_message, $redirect_to, null, $session_id_encrypt);
620
+ }
621
+ }
622
+ }
623
+
624
+ function create_user_in_miniOrange($current_user_id,$email,$currentMethod)
625
+ {
626
+ $tempEmail = get_user_meta($current_user_id,'mo2f_email_miniOrange',true);
627
+ if(isset($tempEmail) and $tempEmail != '')
628
+ $email = $tempEmail;
629
+ global $Mo2fdbQueries;
630
+
631
+ $enduser = new Two_Factor_Setup();
632
+ if($current_user_id == get_option('mo2f_miniorange_admin'))
633
+ $email = get_option('mo2f_email');
634
+
635
+ $check_user = json_decode( $enduser->mo_check_user_already_exist( $email ), true );
636
+
637
+ if(json_last_error() == JSON_ERROR_NONE){
638
+
639
+
640
+
641
+ if($check_user['status'] == 'ERROR'){
642
+ return $check_user;
643
+
644
+ }
645
+ else if(strcasecmp($check_user['status' ], 'USER_FOUND') == 0){
646
+
647
+ $Mo2fdbQueries->update_user_details( $current_user_id, array(
648
+ 'user_registration_with_miniorange' =>'SUCCESS',
649
+ 'mo2f_user_email' =>$email,
650
+ 'mo_2factor_user_registration_status' =>'MO_2_FACTOR_INITIALIZE_TWO_FACTOR'
651
+ ) );
652
+ update_site_option(base64_encode("totalUsersCloud"),get_site_option(base64_encode("totalUsersCloud"))+1);
653
+
654
+ $mo2fa_login_status = 'MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS';
655
+ return $check_user;
656
+ }
657
+ else if(strcasecmp($check_user['status'], 'USER_NOT_FOUND') == 0){
658
+ $current_user = get_user_by('id',$current_user_id);
659
+ $content = json_decode($enduser->mo_create_user($current_user,$email), true);
660
+
661
+ if(json_last_error() == JSON_ERROR_NONE) {
662
+ if(strcasecmp($content['status'], 'SUCCESS') == 0) {
663
+ update_site_option(base64_encode("totalUsersCloud"),get_site_option(base64_encode("totalUsersCloud"))+1);
664
+ $Mo2fdbQueries->update_user_details( $current_user_id, array(
665
+ 'user_registration_with_miniorange' =>'SUCCESS',
666
+ 'mo2f_user_email' =>$email,
667
+ 'mo_2factor_user_registration_status' =>'MO_2_FACTOR_INITIALIZE_TWO_FACTOR'
668
+ ) );
669
+
670
+ $mo2fa_login_message = '';
671
+ $mo2fa_login_status = 'MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS';
672
+ return $check_user;
673
+ }else{
674
+ $check_user['status']='ERROR';
675
+ $check_user['message']='There is an issue in user creation in miniOrange. Please skip and contact miniorange';
676
+ return $check_user;
677
+ }
678
+ }
679
+
680
+
681
+ }
682
+ else if(strcasecmp($check_user['status'], 'USER_FOUND_UNDER_DIFFERENT_CUSTOMER') == 0){
683
+ $mo2fa_login_message = __('The email associated with your account is already registered. Please contact your admin to change the email.','miniorange-2-factor-authentication');
684
+ $check_user['status']='ERROR';
685
+ $check_user['message']=$mo2fa_login_message;
686
+ return $check_user;
687
+ // $mo2fa_login_status = 'MO_2_FACTOR_PROMPT_FOR_RELOGIN';
688
+ }
689
+
690
+ }
691
+ // }
692
+
693
+ }
694
+ function mo2f_skip_2fa_setup()
695
+ {
696
+ if(isset($_POST['miniorange_skip_2fa_nonce'])){
697
+ $nonce = $_POST['miniorange_skip_2fa_nonce'];
698
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-skip-nonce' ) ) {
699
+ $error = new WP_Error();
700
+ $error->add('empty_username', '<strong>'. __('ERROR','miniorange-2-factor-authentication') .'</strong>: '. __('Invalid Request.', 'miniorange-2-factor-authentication'));
701
+ return $error;
702
+ }
703
+ else{
704
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
705
+ global $Mo2fdbQueries;
706
+ $redirect_to = sanitize_text_field($_POST['redirect_to']);
707
+ $session_id_encrypt = sanitize_text_field($session_id_encrypt);
708
+ $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
709
+
710
+ $Mo2fdbQueries->update_user_details( $user_id, array('mo2f_2factor_enable_2fa_byusers' => 0) );
711
+
712
+ $this->mo2fa_pass2login($redirect_to);
713
+ }
714
+ }
715
+ }
716
+
717
+ function save_inline_2fa_method(){
718
+ if(isset($_POST['miniorange_inline_save_2factor_method_nonce'])){
719
+ $nonce = $_POST['miniorange_inline_save_2factor_method_nonce'];
720
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-inline-save-2factor-method-nonce' ) ) {
721
+ $error = new WP_Error();
722
+ $error->add('empty_username', '<strong>'. __('ERROR','miniorange-2-factor-authentication') .'</strong>: '. __('Invalid Request.', 'miniorange-2-factor-authentication'));
723
+ return $error;
724
+ } else {
725
+
726
+
727
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
728
+ global $Mo2fdbQueries;
729
+ $this->miniorange_pass2login_start_session();
730
+ $mo2fa_login_message = '';
731
+ $mo2fa_login_status = 'MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS';
732
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
733
+ $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
734
+ $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
735
+ $current_user = get_user_by('id',$user_id);
736
+ $currentUserId = $current_user->ID;
737
+ $email = $Mo2fdbQueries->get_user_detail('mo2f_user_email',$current_user->ID);
738
+ $user_registration_with_miniorange = $Mo2fdbQueries->get_user_detail('user_registration_with_miniorange',$current_user->ID);
739
+ if($user_registration_with_miniorange == 'SUCCESS'){
740
+ $selected_method = isset($_POST['mo2f_selected_2factor_method']) ? $_POST['mo2f_selected_2factor_method'] : 'NONE';
741
+
742
+ if($selected_method == 'OUT OF BAND EMAIL'){
743
+ if(!MO2F_IS_ONPREM)
744
+ {
745
+ $current_user = get_userdata($currentUserId);
746
+ $email = $current_user->user_email;
747
+ $response = $this->create_user_in_miniOrange($currentUserId,$email,$selected_method);
748
+
749
+ if($response['status']=='ERROR') {
750
+ $mo2fa_login_status = 'MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS';
751
+ $mo2fa_login_message=$response['message'].'Skip the two-factor for login';
752
+ }
753
+ else
754
+ {
755
+ $enduser = new Two_Factor_Setup();
756
+
757
+ $Mo2fdbQueries->update_user_details( $currentUserId, array(
758
+ 'mo2f_email_verification_status' =>true,
759
+ 'mo2f_configured_2FA_method' =>'Email Verification',
760
+ 'mo2f_user_email' => $email
761
+ ) );
762
+ $mo2fa_login_status = 'MO_2_FACTOR_SETUP_SUCCESS';
763
+ }
764
+ }
765
+ else
766
+ {
767
+ $enduser = new Two_Factor_Setup();
768
+
769
+ $Mo2fdbQueries->update_user_details( $currentUserId, array(
770
+ 'mo2f_email_verification_status' =>true,
771
+ 'mo2f_configured_2FA_method' =>'Email Verification',
772
+ 'mo2f_user_email' => $email
773
+ ) );
774
+ $mo2fa_login_status = 'MO_2_FACTOR_SETUP_SUCCESS';
775
+ }
776
+ }else if($selected_method == 'OTP OVER EMAIL'){
777
+ if(!MO2F_IS_ONPREM)
778
+ {
779
+ $current_user = get_userdata($currentUserId);
780
+ $email = $current_user->user_email;
781
+ $response = $this->create_user_in_miniOrange($currentUserId,$email,$selected_method);
782
+ if($response['status']=='ERROR') {
783
+ $mo2fa_login_status = 'MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS';
784
+ $mo2fa_login_message=$response['message'].'Skip the two-factor for login';
785
+ }
786
+ else
787
+ {
788
+ $enduser = new Two_Factor_Setup();
789
+
790
+ $Mo2fdbQueries->update_user_details( $currentUserId,
791
+ array('mo2f_OTPOverEmail_config_status'=>true,
792
+ 'mo2f_configured_2FA_method' =>'OTP Over Email',
793
+ 'mo2f_user_email' => $email,
794
+ 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_PLUGIN_SETTINGS'
795
+ ) );
796
+ $mo2fa_login_status = 'MO_2_FACTOR_SETUP_SUCCESS';
797
+ $response = json_decode($enduser->mo2f_update_userinfo($email,'EMAIL',null,null,null),true);
798
+
799
+ }
800
+ }
801
+ else
802
+ {
803
+ $enduser = new Two_Factor_Setup();
804
+
805
+ $Mo2fdbQueries->update_user_details( $currentUserId,
806
+ array('mo2f_OTPOverEmail_config_status'=>true,
807
+ 'mo2f_configured_2FA_method' =>'OTP Over Email',
808
+ 'mo2f_user_email' => $email,
809
+ 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_PLUGIN_SETTINGS'
810
+ ) );
811
+ $mo2fa_login_status = 'MO_2_FACTOR_SETUP_SUCCESS';
812
+ $response = json_decode($enduser->mo2f_update_userinfo($email,'EMAIL',null,null,null),true);
813
+ }
814
+ }else if($selected_method == "GOOGLE AUTHENTICATOR"){
815
+ $this->miniorange_pass2login_start_session();
816
+ $mo2fa_login_message = '';
817
+ $mo2fa_login_status = 'MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS';
818
+ $google_auth = new Miniorange_Rba_Attributes();
819
+
820
+ $gauth_name= get_site_option('mo2f_google_appname');
821
+ $google_account_name= $gauth_name ? $gauth_name : 'miniOrangeAu';
822
+
823
+ $email = $Mo2fdbQueries->get_user_detail('mo2f_user_email',$current_user->ID);
824
+
825
+ if ( MO2F_IS_ONPREM ) { //this should not be here
826
+ $Mo2fdbQueries->update_user_details( $current_user->ID, array(
827
+ 'mo2f_configured_2FA_method' =>$selected_method,
828
+ ) );
829
+ include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'gaonprem.php';
830
+ $gauth_obj = new Google_auth_onpremise();
831
+
832
+ $onpremise_secret = $gauth_obj->createSecret();
833
+ $issuer = get_site_option( 'mo2f_GA_account_name', 'miniOrangeAu' );
834
+ $url = $gauth_obj->geturl( $onpremise_secret, $issuer, $email );
835
+ $mo2f_google_auth = array();
836
+ $mo2f_google_auth['ga_qrCode'] = $url;
837
+ $mo2f_google_auth['ga_secret'] = $onpremise_secret;
838
+ $_SESSION['mo2f_google_auth'] = $mo2f_google_auth;
839
+ update_user_meta($current_user->ID,'mo2f_google_auth', json_encode($mo2f_google_auth));
840
+
841
+ }else{
842
+ $current_user = get_userdata($currentUserId);
843
+ $email = $current_user->user_email;
844
+ $tempemail = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $currentUserId );
845
+
846
+ if(!isset($tempemail) and !is_null($tempemail) and $tempemail != '')
847
+ {
848
+ $email = $tempemail;
849
+ }
850
+
851
+ $response = $this->create_user_in_miniOrange($currentUserId,$email,$selected_method);
852
+ if($response['status']=='ERROR') {
853
+ $mo2fa_login_message=$response['message'];
854
+ $mo2fa_login_status = 'MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS';
855
+
856
+ }else{
857
+ $Mo2fdbQueries->update_user_details( $current_user->ID, array(
858
+ 'mo2f_configured_2FA_method' =>$selected_method,
859
+ ) );
860
+ $google_response = json_decode( $google_auth->mo2f_google_auth_service( $email, $google_account_name ), true );
861
+ if ( json_last_error() == JSON_ERROR_NONE ) {
862
+ if ( $google_response['status'] == 'SUCCESS' ) {
863
+
864
+ $mo2f_google_auth = array();
865
+ $mo2f_google_auth['ga_qrCode'] = $google_response['qrCodeData'];
866
+ $mo2f_google_auth['ga_secret'] = $google_response['secret'];
867
+ $_SESSION['mo2f_google_auth'] = $mo2f_google_auth;
868
+ update_user_meta( $current_user->ID, 'mo2f_google_auth', json_encode( $mo2f_google_auth ) );
869
+
870
+ } else {
871
+ $mo2fa_login_message = __( 'Invalid request. Please register with miniOrange to configure 2 Factor plugin.', 'miniorange-2-factor-authentication' );
872
+ }
873
+ }
874
+ }
875
+ }
876
+
877
+
878
+ }else{
879
+ //inline for others
880
+ if(!MO2F_IS_ONPREM or $selected_method == 'MOBILE AUTHENTICATION' or $selected_method == 'PUSH NOTIFICATIONS' or $selected_method == 'SOFT TOKEN' )
881
+ {
882
+ $current_user = get_userdata($currentUserId);
883
+ $email = $current_user->user_email;
884
+ $response = $this->create_user_in_miniOrange($currentUserId,$email,$selected_method);
885
+ if($response['status']=='ERROR') {
886
+ $mo2fa_login_status = 'MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS';
887
+ $mo2fa_login_message=$response['message'].'Skip the two-factor for login';
888
+ }else {
889
+ $Mo2fdbQueries->update_user_details( $current_user->ID, array('mo2f_configured_2FA_method' =>$selected_method) );
890
+ }
891
+ }else{
892
+ $Mo2fdbQueries->update_user_details( $current_user->ID, array(
893
+ 'mo2f_configured_2FA_method' =>$selected_method,
894
+ ) );
895
+ }
896
+ }
897
+ }else{
898
+ $mo2fa_login_message = __('Invalid request. Please register with miniOrange to configure 2 Factor plugin.','miniorange-2-factor-authentication');
899
+ }
900
+ $this->miniorange_pass2login_form_fields($mo2fa_login_status, $mo2fa_login_message, $redirect_to, null, $session_id_encrypt);
901
+ }
902
+ }
903
+ }
904
+
905
+ function check_kba_validation($POSTED){
906
+ if ( isset( $POSTED['miniorange_kba_nonce'] ) ) { /*check kba validation*/
907
+ $nonce = $POSTED['miniorange_kba_nonce'];
908
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-kba-nonce' ) ) {
909
+ $error = new WP_Error();
910
+ $error->add( 'empty_username', __( '<strong>ERROR</strong>: Invalid Request.' ) );
911
+ return $error;
912
+ }else{
913
+ $this->miniorange_pass2login_start_session();
914
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
915
+ $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
916
+ $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
917
+ if ( isset( $user_id ) ) {
918
+ if ( MO2f_Utility::mo2f_check_empty_or_null( $_POST['mo2f_answer_1'] ) || MO2f_Utility::mo2f_check_empty_or_null( $_POST['mo2f_answer_2'] ) ) {
919
+ $mo2fa_login_message = 'Please provide both the answers.';
920
+ $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_KBA_AUTHENTICATION';
921
+ $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
922
+ }
923
+ $otpToken = array();
924
+ $kba_questions = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo_2_factor_kba_questions',$session_id_encrypt );
925
+ $otpToken[0] = $kba_questions[0]['question'];
926
+ $otpToken[1] = sanitize_text_field( $_POST['mo2f_answer_1'] );
927
+ $otpToken[2] = $kba_questions[1]['question'];
928
+ $otpToken[3] = sanitize_text_field( $_POST['mo2f_answer_2'] );
929
+ $check_trust_device = isset( $_POST['mo2f_trust_device'] ) ? $_POST['mo2f_trust_device'] : 'false';
930
+ //if the php session folder has insufficient permissions, cookies to be used
931
+ $mo2f_login_transaction_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_transactionId', $session_id_encrypt );
932
+ $mo2f_rba_status = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_rba_status',$session_id_encrypt );
933
+ $kba_validate = new Customer_Setup();
934
+ $kba_validate_response = json_decode( $kba_validate->validate_otp_token( 'KBA', null, $mo2f_login_transaction_id, $otpToken, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
935
+ Global $Mo2fdbQueries;
936
+ $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user_id );
937
+ if ( strcasecmp( $kba_validate_response['status'], 'SUCCESS' ) == 0 ) {
938
+ if ( get_option( 'mo2f_remember_device' ) && $check_trust_device == 'on' ) {
939
+ try {
940
+ mo2f_register_profile( $email, 'true', $mo2f_rba_status );
941
+ } catch ( Exception $e ) {
942
+ echo $e->getMessage();
943
+ }
944
+ $this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
945
+ } else {
946
+ $this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
947
+ }
948
+ } else {
949
+ $mo2fa_login_message = 'The answers you have provided are incorrect.';
950
+ $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_KBA_AUTHENTICATION';
951
+ $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt);
952
+ }
953
+ } else {
954
+ $this->remove_current_activity($session_id_encrypt);
955
+ return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Please try again..' ) );
956
+ }
957
+ }
958
+ }
959
+ }
960
+ function check_rba_cancalation($POSTED){
961
+ $nonce = $POSTED['mo2f_trust_device_cancel_nonce'];
962
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-trust-device-cancel-nonce' ) ) {
963
+ $error = new WP_Error();
964
+ $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
965
+ return $error;
966
+ } else {
967
+ $this->miniorange_pass2login_start_session();
968
+ $session_id_encrypt = isset( $POSTED['session_id'] ) ? $POSTED['session_id'] : null;
969
+ $redirect_to = isset( $POSTED['redirect_to'] ) ? $POSTED['redirect_to'] : null;
970
+ $this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
971
+ }
972
+ }
973
+ function check_rba_validation($POSTED){
974
+ $nonce = $POSTED['mo2f_trust_device_confirm_nonce'];
975
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-trust-device-confirm-nonce' ) ) {
976
+ $session_id_encrypt = isset( $POSTED['session_id'] ) ? $POSTED['session_id'] : null;
977
+ $this->remove_current_activity($session_id_encrypt);
978
+ $error = new WP_Error();
979
+ $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR ' ) . '</strong>:' . mo2f_lt( 'Invalid Request.' ) );
980
+ return $error;
981
+ } else {
982
+ $this->miniorange_pass2login_start_session();
983
+ $session_id_encrypt = isset( $POSTED['session_id'] ) ? $POSTED['session_id'] : null;
984
+ try {
985
+ $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id', $session_id_encrypt );
986
+ Global $Mo2fdbQueries;
987
+ $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user_id );
988
+ $mo2f_rba_status = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_rba_status',$session_id_encrypt );
989
+ mo2f_register_profile( $email, 'true', $mo2f_rba_status );
990
+ } catch ( Exception $e ) {
991
+ echo $e->getMessage();
992
+ }
993
+ $redirect_to = isset( $POSTED['redirect_to'] ) ? $POSTED['redirect_to'] : null;
994
+ $this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
995
+ }
996
+ }
997
+ function check_miniorange_challenge_forgotphone($POSTED){/*check kba validation*/
998
+ $nonce = $_POST['miniorange_forgotphone'];
999
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-forgotphone' ) ) {
1000
+ $error = new WP_Error();
1001
+ $error->add( 'empty_username', __( '<strong>ERROR</strong>: Invalid Request.' ) );
1002
+ return $error;
1003
+ } else {
1004
+ $mo2fa_login_status = isset( $_POST['request_origin_method'] ) ? $_POST['request_origin_method'] : null;
1005
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
1006
+ $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
1007
+ $mo2fa_login_message = '';
1008
+ $this->miniorange_pass2login_start_session();
1009
+ $customer = new Customer_Setup();
1010
+ $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
1011
+ Global $Mo2fdbQueries;
1012
+ $user_email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user_id );
1013
+ $kba_configuration_status = $Mo2fdbQueries->get_user_detail( 'mo2f_SecurityQuestions_config_status', $user_id );
1014
+ if ( $kba_configuration_status ) {
1015
+ $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_KBA_AND_OTP_OVER_EMAIL';
1016
+ $pass2fa_login = new Miniorange_Password_2Factor_Login();
1017
+ $pass2fa_login->mo2f_pass2login_kba_verification( $user_id, $redirect_to,$session_id_encrypt );
1018
+ } else {
1019
+ $hidden_user_email = MO2f_Utility::mo2f_get_hidden_email( $user_email );
1020
+ $content = json_decode( $customer->send_otp_token( $user_email, 'EMAIL', get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
1021
+ if ( strcasecmp( $content['status'], 'SUCCESS' ) == 0 ) {
1022
+ $session_cookie_variables = array( 'mo2f-login-qrCode', 'mo2f_transactionId' );
1023
+ MO2f_Utility::unset_session_variables( $session_cookie_variables );
1024
+ MO2f_Utility::unset_cookie_variables( $session_cookie_variables );
1025
+ MO2f_Utility::unset_temp_user_details_in_table( 'mo2f_transactionId',$session_id_encrypt );
1026
+ //if the php session folder has insufficient permissions, cookies to be used
1027
+ MO2f_Utility::set_user_values( $session_id_encrypt,'mo2f_login_message', 'A one time passcode has been sent to <b>' . $hidden_user_email . '</b>. Please enter the OTP to verify your identity.' );
1028
+ MO2f_Utility::set_user_values( $session_id_encrypt, 'mo2f_transactionId', $content['txId'] );
1029
+ $this->mo2f_transactionid=$content['txId'];
1030
+ $mo2fa_login_message = 'A one time passcode has been sent to <b>' . $hidden_user_email . '</b>. Please enter the OTP to verify your identity.';
1031
+ $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_OTP_OVER_EMAIL';
1032
+ } else {
1033
+ $mo2fa_login_message = 'Error occurred while sending OTP over email. Please try again.';
1034
+ }
1035
+ $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to, null,$session_id_encrypt );
1036
+ }
1037
+ $pass2fa_login = new Miniorange_Password_2Factor_Login();
1038
+ $pass2fa_login->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
1039
+ }
1040
+ }
1041
+ function check_miniorange_alternate_login_kba($POSTED){
1042
+ $nonce = $POSTED['miniorange_alternate_login_kba_nonce'];
1043
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-alternate-login-kba-nonce' ) ) {
1044
+ $error = new WP_Error();
1045
+ $error->add( 'empty_username', __( '<strong>ERROR</strong>: Invalid Request.' ) );
1046
+ return $error;
1047
+ } else {
1048
+ $this->miniorange_pass2login_start_session();
1049
+ $session_id_encrypt = isset( $POSTED['session_id'] ) ? $POSTED['session_id'] : null;
1050
+ $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
1051
+ $redirect_to = isset( $POSTED['redirect_to'] ) ? $POSTED['redirect_to'] : null;
1052
+ $this->mo2f_pass2login_kba_verification( $user_id, $redirect_to,$session_id_encrypt );
1053
+ }
1054
+ }
1055
+ function check_miniorange_mobile_validation($POSTED){
1056
+ /*check mobile validation */
1057
+ $nonce = $POSTED['miniorange_mobile_validation_nonce'];
1058
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-mobile-validation-nonce' ) ) {
1059
+ $error = new WP_Error();
1060
+ $error->add( 'empty_username', __( '<strong>ERROR</strong>: Invalid Request.' ) );
1061
+ return $error;
1062
+ } else {
1063
+ if(MO2F_IS_ONPREM && (isset($POSTED['tx_type']) && $POSTED['tx_type'] !='PN'))
1064
+ {
1065
+ $txid = $POSTED['TxidEmail'];
1066
+ $status = get_option($txid);
1067
+ if($status != '')
1068
+ {
1069
+ if($status != 1)
1070
+ {
1071
+ return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Please try again.' ) );
1072
+ }
1073
+ }
1074
+ }
1075
+ $this->miniorange_pass2login_start_session();
1076
+ $session_id_encrypt = isset( $POSTED['session_id'] ) ? $POSTED['session_id'] : null;
1077
+ //if the php session folder has insufficient permissions, cookies to be used
1078
+ $mo2f_login_transaction_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_transactionId',$session_id_encrypt );
1079
+ $redirect_to = isset( $POSTED['redirect_to'] ) ? $POSTED['redirect_to'] : null;
1080
+ $checkMobileStatus = new Two_Factor_Setup();
1081
+ $content = $checkMobileStatus->check_mobile_status( $mo2f_login_transaction_id );
1082
+ $response = json_decode( $content, true );
1083
+ if(MO2F_IS_ONPREM)
1084
+ {
1085
+ $this->mo2fa_pass2login($redirect_to,$session_id_encrypt);
1086
+ }
1087
+ if ( json_last_error() == JSON_ERROR_NONE ) {
1088
+ if ( $response['status'] == 'SUCCESS' ) {
1089
+ if ( get_option( 'mo2f_remember_device' ) ) {
1090
+ $mo2fa_login_status = 'MO_2_FACTOR_REMEMBER_TRUSTED_DEVICE';
1091
+ $this->miniorange_pass2login_form_fields( $mo2fa_login_status, null, $redirect_to, null,$session_id_encrypt );
1092
+ } else {
1093
+ $this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
1094
+ }
1095
+ } else {
1096
+ $this->remove_current_activity($session_id_encrypt);
1097
+ return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Please try again.' ) );
1098
+ }
1099
+ } else {
1100
+ $this->remove_current_activity($session_id_encrypt);
1101
+ return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Please try again.' ) );
1102
+ }
1103
+ }
1104
+ }
1105
+ function check_miniorange_mobile_validation_failed($POSTED){
1106
+ /*Back to miniOrange Login Page if mobile validation failed and from back button of mobile challenge, soft token and default login*/
1107
+ $nonce = $POSTED['miniorange_mobile_validation_failed_nonce'];
1108
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-mobile-validation-failed-nonce' ) ) {
1109
+ $error = new WP_Error();
1110
+ $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
1111
+ return $error;
1112
+ } else {
1113
+ $this->miniorange_pass2login_start_session();
1114
+ $session_id_encrypt = isset( $POSTED['session_id'] ) ? $POSTED['session_id'] : null;
1115
+ $this->remove_current_activity($session_id_encrypt);
1116
 
1117
+ }
1118
+ }
1119
+ function check_miniorange_forgotphone($POSTED){
1120
+ $nonce = $POSTED['miniorange_forgotphone'];
1121
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-forgotphone' ) ) {
1122
+ $error = new WP_Error();
1123
+ $error->add( 'empty_username', __( '<strong>ERROR</strong>: Invalid Request.' ) );
1124
+ return $error;
1125
+ } else {
1126
+ global $Mo2fdbQueries;
1127
+ $mo2fa_login_status = isset( $POSTED['request_origin_method'] ) ? $POSTED['request_origin_method'] : null;
1128
+ $session_id_encrypt = isset( $POSTED['session_id'] ) ? $POSTED['session_id'] : null;
1129
+ $redirect_to = isset( $POSTED['redirect_to'] ) ? $POSTED['redirect_to'] : null;
1130
+ $mo2fa_login_message = '';
1131
+ $this->miniorange_pass2login_start_session();
1132
+ $customer = new Customer_Setup();
1133
+ $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
1134
+ $user_email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user_id );
1135
+ $kba_configuration_status = $Mo2fdbQueries->get_user_detail( 'mo2f_SecurityQuestions_config_status', $user_id );
1136
+ if ( $kba_configuration_status ) {
1137
+ $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_KBA_AND_OTP_OVER_EMAIL';
1138
+ $pass2fa_login = new Miniorange_Password_2Factor_Login();
1139
+ $pass2fa_login->mo2f_pass2login_kba_verification( $user_id, $redirect_to,$session_id_encrypt );
1140
+ } else {
1141
+ $hidden_user_email = MO2f_Utility::mo2f_get_hidden_email( $user_email );
1142
+ $content = json_decode( $customer->send_otp_token( $user_email, 'EMAIL', get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
1143
+ if ( strcasecmp( $content['status'], 'SUCCESS' ) == 0 ) {
1144
+ $session_cookie_variables = array( 'mo2f-login-qrCode', 'mo2f_transactionId' );
1145
+ MO2f_Utility::unset_session_variables( $session_cookie_variables );
1146
+ MO2f_Utility::unset_cookie_variables( $session_cookie_variables );
1147
+ MO2f_Utility::unset_temp_user_details_in_table( 'mo2f_transactionId',$session_id_encrypt );
1148
+ //if the php session folder has insufficient permissions, cookies to be used
1149
+ MO2f_Utility::set_user_values( $session_id_encrypt,'mo2f_login_message', 'A one time passcode has been sent to <b>' . $hidden_user_email . '</b>. Please enter the OTP to verify your identity.' );
1150
+ MO2f_Utility::set_user_values( $session_id_encrypt, 'mo2f_transactionId', $content['txId'] );
1151
+ $this->mo2f_transactionid=$content['txId'];
1152
+ $mo2fa_login_message = 'A one time passcode has been sent to <b>' . $hidden_user_email . '</b>. Please enter the OTP to verify your identity.';
1153
+ $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_OTP_OVER_EMAIL';
1154
+ } else {
1155
+ $mo2fa_login_message = 'Error occurred while sending OTP over email. Please try again.';
1156
+ }
1157
+ $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to, null,$session_id_encrypt );
1158
+ }
1159
+ $pass2fa_login = new Miniorange_Password_2Factor_Login();
1160
+ $pass2fa_login->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
1161
+ }
1162
+ }
1163
+ function check_miniorange_softtoken($POSTED){
1164
+ /*Click on the link of phone is offline */
1165
+ $nonce = $POSTED['miniorange_softtoken'];
1166
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-softtoken' ) ) {
1167
+ $error = new WP_Error();
1168
+ $error->add( 'empty_username', __( '<strong>ERROR</strong>: Invalid Request.' ) );
1169
+ return $error;
1170
+ } else {
1171
+ $this->miniorange_pass2login_start_session();
1172
+ $session_id_encrypt = isset( $POSTED['session_id'] ) ? $POSTED['session_id'] : null;
1173
+ $session_cookie_variables = array( 'mo2f-login-qrCode', 'mo2f_transactionId' );
1174
+ MO2f_Utility::unset_session_variables( $session_cookie_variables );
1175
+ MO2f_Utility::unset_cookie_variables( $session_cookie_variables );
1176
+ MO2f_Utility::unset_temp_user_details_in_table('mo2f_transactionId',$session_id_encrypt );
1177
+ $redirect_to = isset( $POSTED['redirect_to'] ) ? $POSTED['redirect_to'] : null;
1178
+ $mo2fa_login_message = 'Please enter the one time passcode shown in the miniOrange<b> Authenticator</b> app.';
1179
+ $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN';
1180
+ $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
1181
+ }
1182
+ }
1183
+ function check_miniorange_soft_token($POSTED){
1184
+ /*Validate Soft Token,OTP over SMS,OTP over EMAIL,Phone verification */
1185
+ $nonce = $_POST['miniorange_soft_token_nonce'];
1186
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-soft-token-nonce' ) ) {
1187
+ $error = new WP_Error();
1188
+ $error->add( 'empty_username', __( '<strong>ERROR</strong>: Invalid Request.' ) );
1189
+ return $error;
1190
+ }else {
1191
+ $this->miniorange_pass2login_start_session();
1192
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
1193
+ $mo2fa_login_status = isset( $_POST['request_origin_method'] ) ? $_POST['request_origin_method'] : null;
1194
+ $redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
1195
+ $softtoken = '';
1196
+ $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
1197
+ $attempts = get_option('mo2f_attempts_before_redirect', 3);
1198
+ if ( MO2f_utility::mo2f_check_empty_or_null( $_POST['mo2fa_softtoken'] ) ) {
1199
+ if($attempts>1 || $attempts=='disabled')
1200
+ {
1201
+ update_option('mo2f_attempts_before_redirect', $attempts-1 );
1202
+ $mo2fa_login_message = 'Please enter OTP to proceed.';
1203
+ $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
1204
+ }else{
1205
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
1206
+ $this->remove_current_activity($session_id_encrypt);
1207
+ return new WP_Error( 'limit_exceeded', '<strong>ERROR</strong>: Number of attempts exceeded.');
1208
+ }
1209
+ } else {
1210
+ $softtoken = sanitize_text_field( $_POST['mo2fa_softtoken'] );
1211
+ if ( ! MO2f_utility::mo2f_check_number_length( $softtoken ) ) {
1212
+ if($attempts>1|| $attempts=='disabled')
1213
+ {
1214
+ update_option('mo2f_attempts_before_redirect', $attempts-1 );
1215
+ $mo2fa_login_message = 'Invalid OTP. Only digits within range 4-8 are allowed. Please try again.';
1216
+ $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
1217
+ }else{
1218
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
1219
+ $this->remove_current_activity($session_id_encrypt);
1220
+ update_option('mo2f_attempts_before_redirect', 3);
1221
+ return new WP_Error( 'limit_exceeded', '<strong>ERROR</strong>: Number of attempts exceeded.');
1222
+ }
1223
+ }
1224
+ }
1225
+ global $Mo2fdbQueries;
1226
+ $user_email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user_id );
1227
+ if ( isset( $user_id ) ) {
1228
+ $customer = new Customer_Setup();
1229
+ $content = '';
1230
+ $current_user = get_userdata($user_id);
1231
+ //if the php session folder has insufficient permissions, cookies to be used
1232
+ $mo2f_login_transaction_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_transactionId', $session_id_encrypt );
1233
+ if ( isset( $mo2fa_login_status ) && $mo2fa_login_status == 'MO_2_FACTOR_CHALLENGE_OTP_OVER_EMAIL' ) {
1234
+ $content = json_decode( $customer->validate_otp_token( 'EMAIL', null, $mo2f_login_transaction_id, $softtoken, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ),$current_user ), true );
1235
+ } else if ( isset( $mo2fa_login_status ) && $mo2fa_login_status == 'MO_2_FACTOR_CHALLENGE_OTP_OVER_SMS' ) {
1236
+ $content = json_decode( $customer->validate_otp_token( 'SMS', null, $mo2f_login_transaction_id, $softtoken, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
1237
+ } else if ( isset( $mo2fa_login_status ) && $mo2fa_login_status == 'MO_2_FACTOR_CHALLENGE_PHONE_VERIFICATION' ) {
1238
+ $content = json_decode( $customer->validate_otp_token( 'PHONE VERIFICATION', null, $mo2f_login_transaction_id, $softtoken, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
1239
+ } else if ( isset( $mo2fa_login_status ) && $mo2fa_login_status == 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN' ) {
1240
+ $content = json_decode( $customer->validate_otp_token( 'SOFT TOKEN', $user_email, null, $softtoken, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
1241
+ } else if ( isset( $mo2fa_login_status ) && $mo2fa_login_status == 'MO_2_FACTOR_CHALLENGE_GOOGLE_AUTHENTICATION' ) {
1242
+ $content = json_decode( $customer->validate_otp_token( 'GOOGLE AUTHENTICATOR', $user_email, null, $softtoken, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
1243
+ } else {
1244
+ $this->remove_current_activity($session_id_encrypt);
1245
+ return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Invalid Request. Please try again.' ) );
1246
+ }
1247
+ if ( strcasecmp( $content['status'], 'SUCCESS' ) == 0 ) {
1248
+ update_option('mo2f_attempts_before_redirect', 3);
1249
+ if ( get_option( 'mo2f_remember_device' ) ) {
1250
+ $mo2fa_login_status = 'MO_2_FACTOR_REMEMBER_TRUSTED_DEVICE';
1251
+ $this->miniorange_pass2login_form_fields( $mo2fa_login_status, null, $redirect_to,null,$session_id_encrypt );
1252
+ } else {
1253
+ $this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
1254
+ }
1255
+ } else {
1256
+ if($attempts>1 || $attempts=='disabled')
1257
+ {
1258
+ update_option('mo2f_attempts_before_redirect', $attempts-1);
1259
+ $message = $mo2fa_login_status == 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN' ? 'You have entered an invalid OTP.<br>Please click on <b>Sync Time</b> in the miniOrange Authenticator app to sync your phone time with the miniOrange servers and try again.' : 'Invalid OTP. Please try again.';
1260
+ $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $message, $redirect_to,null,$session_id_encrypt );
1261
+ }else{
1262
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
1263
+ $this->remove_current_activity($session_id_encrypt);
1264
+ update_option('mo2f_attempts_before_redirect', 3);
1265
+ return new WP_Error( 'limit_exceeded', '<strong>ERROR</strong>: Number of attempts exceeded.');
1266
+ }
1267
+ }
1268
+ } else {
1269
+ $this->remove_current_activity($session_id_encrypt);
1270
+ return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Please try again..' ) );
1271
+ }
1272
+ }
1273
+ }
1274
+ function check_miniorange_attribute_collection($POSTED){
1275
+ $nonce = $POSTED['miniorange_attribute_collection_nonce'];
1276
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-login-attribute-collection-nonce' ) ) {
1277
+ $error = new WP_Error();
1278
+ $error->add( 'empty_username', __( '<strong>ERROR</strong>: Invalid Request.' ) );
1279
+ return $error;
1280
+ } else {
1281
+ $this->miniorange_pass2login_start_session();
1282
+ $session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
1283
+ $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
1284
+ $currentuser = get_user_by( 'id', $user_id );
1285
+ $attributes = isset( $POSTED['miniorange_rba_attribures'] ) ? $POSTED['miniorange_rba_attribures'] : null;
1286
+ $redirect_to = isset( $POSTED['redirect_to'] ) ? $POSTED['redirect_to'] : null;
1287
+ $session_id = isset( $POSTED['session_id'] ) ? $POSTED['session_id'] : null;
1288
+ $this->miniorange_initiate_2nd_factor( $currentuser, $attributes, $redirect_to,$session_id );
1289
+ }
1290
+ }
1291
+ function check_miniorange_inline_skip_registration($POSTED){
1292
+ $error = new WP_Error();
1293
+ $error->add( 'empty_username', __( '<strong>ERROR</strong>: Invalid Request.' ) );
1294
+ }
1295
+ function miniorange_pass2login_redirect() {
1296
  do_action('mo2f_network_init');
1297
  global $Mo2fdbQueries;
1298
 
1338
 
1339
  if(MO2F_IS_ONPREM )
1340
  {
 
 
1341
  $mo_2factor_user_registration_status = 'MO_2_FACTOR_PLUGIN_SETTINGS';
 
1342
 
1343
  }
1344
  if ( $mo2f_configured_2FA_method ) {
1347
  $this->mo2f_pass2login_kba_verification( $user->ID, $redirect_to, $session_id );
1348
  } else {
1349
  $mo2f_second_factor = '';
1350
+
1351
  if(MO2F_IS_ONPREM)
1352
  {
1353
+ global $Mo2fdbQueries;
1354
+ $mo2f_second_factor = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user->ID );
 
1355
  if($mo2f_second_factor == 'Security Questions')
1356
  {
1357
  $mo2f_second_factor = 'KBA';
1362
  }
1363
  else if($mo2f_second_factor != 'Email Verification')
1364
  $mo2f_second_factor = 'NONE';
1365
+ }else{
1366
+ $mo2f_second_factor = mo2f_get_user_2ndfactor( $user );
1367
+ }
1368
 
1369
  if ( $mo2f_second_factor == 'MOBILE AUTHENTICATION' ) {
1370
  $this->mo2f_pass2login_mobile_verification( $user, $redirect_to, $session_id );
1434
  update_site_option($txIdGet,1);
1435
  $body = "Transaction has been successfully validated.<br><br>Please continue with the transaction.";
1436
  $head = "TRANSACTION SUCCESSFUL";
1437
+ $color = "green";
1438
+ }
1439
+ else if($accessTokenGet==$otpTokenD)
1440
+ {
1441
+ update_site_option($txIdGet,0);
1442
+ $body = "Transaction has been Canceled.<br><br>Please Try Again.";
1443
+ $head = "TRANSACTION DENIED";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1444
  }
 
1445
  }
1446
+ delete_site_option($userIDGet);
1447
+ delete_site_option($userIDd);
1448
+ delete_site_option($time);
1449
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1450
  }
1451
+
1452
+ $this->display_email_verification($head,$body,$color);
1453
+ exit;
1454
+
1455
+ }
1456
+ elseif (isset($_POST['emailInlineCloud'])) {
1457
+ $nonce = sanitize_text_field($_POST['miniorange_emailChange_nonce']);
1458
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-email-change-nonce' ) ) {
1459
  $error = new WP_Error();
1460
+ $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
1461
  return $error;
1462
+ } else {
1463
+ $email = sanitize_text_field($_POST['emailInlineCloud']);
1464
+ $current_user_id = sanitize_text_field($_POST['current_user_id']);
1465
+ //$session_id = sanitize_text_field($_POST['session_id']);
1466
+ if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
1467
+ global $Mo2fdbQueries;
1468
+ $Mo2fdbQueries->update_user_details( $current_user_id, array( "mo2f_user_email" => $email, "mo2f_configured_2FA_method" => '' ) );
1469
+ prompt_user_to_select_2factor_mthod_inline($current_user_id,'MO_2_FACTOR_INITIALIZE_TWO_FACTOR','','','',null);
1470
+ }
1471
+ }
1472
+ }
1473
+ else if(isset($_POST['txid']))
1474
+ {
1475
+ $txidpost = sanitize_text_field($_POST['txid']);
1476
+ $status = get_site_option($txidpost);
1477
+ update_option('optionVal1',$status); //??
1478
+ if($status ==1 || $status ==0)
1479
+ delete_site_option($txidpost);
1480
+ echo $status;
1481
+ exit();
1482
+ }
1483
+
1484
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1485
 
1486
+ else{
1487
+
1488
+ $value=isset($_POST['option'])?$_POST['option']:false;
1489
+
1490
+ switch ($value) {
1491
+ case 'miniorange_rba_validate':
1492
+ $this->check_rba_validation($_POST);
1493
+ break;
1494
+
1495
+ case 'miniorange_rba_cancle':
1496
+
1497
+ $this->check_rba_cancalation($_POST);
1498
+ break;
1499
+
1500
+ case 'miniorange_forgotphone':
1501
+ $this->check_miniorange_challenge_forgotphone($_POST);
1502
+ break;
1503
+
1504
+ case 'miniorange_alternate_login_kba':
1505
 
1506
+ $this->check_miniorange_alternate_login_kba($_POST);
1507
+ break;
1508
 
1509
+ case 'miniorange_kba_validate':
1510
+ $this->check_kba_validation($_POST);
 
 
 
 
 
 
 
 
 
 
 
 
1511
 
1512
+ break;
1513
 
1514
+ case 'miniorange_mobile_validation':
1515
+ $this->check_miniorange_mobile_validation($_POST);
1516
+ break;
 
1517
 
1518
+ case 'miniorange_mobile_validation_failed':
1519
+ $this->check_miniorange_mobile_validation_failed($_POST);
1520
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1521
 
1522
+ case 'miniorange_softtoken':
1523
+ $this->check_miniorange_softtoken($_POST);
1524
+
1525
+ break;
 
 
 
 
 
 
1526
 
1527
+
1528
+ case 'miniorange_soft_token':
1529
+
1530
+ $this->check_miniorange_soft_token($_POST);
1531
+ break;
1532
+
1533
+ case 'miniorange_inline_skip_registration':
1534
+ $this->check_miniorange_inline_skip_registration($_POST);
1535
+ break;
1536
+
1537
+ case 'miniorange_attribute_collection':
1538
+ $this->check_miniorange_attribute_collection($_POST);
1539
+ break;
1540
+
1541
+ case 'miniorange_inline_save_2factor_method':
1542
+ $this->save_inline_2fa_method();
1543
+ break;
1544
+
1545
+ case 'mo2f_skip_2fa_setup':
1546
+ $this->mo2f_skip_2fa_setup();
1547
+ break;
1548
+
1549
+ case 'miniorange_back_inline':
1550
+ $this->back_to_select_2fa();
1551
+ break;
1552
+
1553
+ case 'miniorange_inline_ga_validate':
1554
+ $this->inline_validate_and_set_ga();
1555
+ break;
1556
+
1557
+ case 'miniorange_inline_show_mobile_config':
1558
+ $this->inline_mobile_configure();
1559
+ break;
1560
+
1561
+ case 'miniorange_inline_complete_mobile':
1562
+ $this->mo2f_inline_validate_mobile_authentication();
1563
+ break;
1564
+
1565
+ case 'mo2f_inline_kba_option':
1566
+ $this->mo2f_inline_validate_kba();
1567
+ break;
1568
+
1569
+ case 'miniorange_inline_complete_otp_over_sms':
1570
+ $this->mo2f_inline_send_otp();
1571
+ break;
1572
+
1573
+ case 'miniorange_inline_complete_otp':
1574
+ $this->mo2f_inline_validate_otp();
1575
+ break;
1576
+
1577
+ case 'miniorange_inline_login':
1578
+ $this->mo2f_inline_login();
1579
+ break;
1580
+ case 'miniorange_inline_register':
1581
+ $this->mo2f_inline_register();
1582
+ break;
1583
+ default:
1584
  $error = new WP_Error();
1585
  $error->add( 'empty_username', __( '<strong>ERROR</strong>: Invalid Request.' ) );
1586
 
1587
  return $error;
1588
+ break;
 
 
 
 
1589
 
1590
 
 
 
 
 
1591
  }
1592
  }
1593
  }
1597
  if(empty($message) && get_option("deniedMessage") )
1598
  {
1599
  delete_option('deniedMessage');
 
1600
  }
1601
  else
1602
  return $message;
1685
  $random_keys = array_rand($challenge_questions,2);
1686
  $challenge_ques1 = $challenge_questions[$random_keys[0]];
1687
  $challenge_ques2 = $challenge_questions[$random_keys[1]];
1688
+ $questions[0] = array('question'=>$challenge_ques1);
1689
+ $questions[1] = array('question'=>$challenge_ques2);
1690
  update_user_meta( $user_id, 'kba_questions_user', $questions );
1691
  $mo2fa_login_message = 'Please answer the following questions:';
1692
  $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_KBA_AUTHENTICATION';
1704
  MO2f_Utility::set_user_values( $session_id,"mo2f_transactionId", $response['txId'] );
1705
  $this->mo2f_transactionid = $response['txId'];
1706
  $questions = array();
1707
+ $questions[0] = $response['questions'][0];
1708
+ $questions[1] = $response['questions'][1];
1709
  MO2f_Utility::set_user_values( $session_id, 'mo_2_factor_kba_questions', $questions );
1710
  $this->mo2f_kbaquestions=$questions;
1711
  $mo2fa_login_message = 'Please answer the following questions:';
1732
 
1733
  $login_status = $mo2fa_login_status;
1734
  $login_message = $mo2fa_login_message;
1735
+ switch ($login_status) {
1736
+ case 'MO_2_FACTOR_CHALLENGE_MOBILE_AUTHENTICATION':
1737
  $transactionid = $this->mo2f_transactionid ? $this->mo2f_transactionid : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_transactionId',$session_id_encrypt );
1738
  mo2f_get_qrcode_authentication_prompt( $login_status, $login_message, $redirect_to, $qrCode, $session_id_encrypt, $transactionid );
1739
  exit;
1740
+ break;
1741
+ case 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN':
1742
+ $user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
1743
+ mo2f_get_otp_authentication_prompt( $login_status, $login_message, $redirect_to, $session_id_encrypt,$user_id );
1744
+ exit;
1745
+ break;
1746
+ case 'MO_2_FACTOR_CHALLENGE_OTP_OVER_EMAIL':
1747
  $user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
1748
  mo2f_get_otp_authentication_prompt( $login_status, $login_message, $redirect_to, $session_id_encrypt,$user_id );
1749
  exit;
1750
+ break;
1751
+ case 'MO_2_FACTOR_CHALLENGE_OTP_OVER_SMS':
1752
+ $user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
1753
+ mo2f_get_otp_authentication_prompt( $login_status, $login_message, $redirect_to, $session_id_encrypt,$user_id );
1754
  exit;
1755
+ break;
1756
+ case 'MO_2_FACTOR_CHALLENGE_PHONE_VERIFICATION':
1757
+ $user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
1758
+ mo2f_get_otp_authentication_prompt( $login_status, $login_message, $redirect_to, $session_id_encrypt,$user_id );
1759
  exit;
1760
+ break;
1761
+ case 'MO_2_FACTOR_CHALLENGE_GOOGLE_AUTHENTICATION':
1762
+ $user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
1763
+ mo2f_get_otp_authentication_prompt( $login_status, $login_message, $redirect_to, $session_id_encrypt,$user_id );
1764
  exit;
1765
+ break;
1766
+ case 'MO_2_FACTOR_CHALLENGE_KBA_AND_OTP_OVER_EMAIL':
1767
+ mo2f_get_forgotphone_form( $login_status, $login_message, $redirect_to, $session_id_encrypt );
1768
  exit;
1769
+ break;
1770
+
1771
+ case 'MO_2_FACTOR_CHALLENGE_PUSH_NOTIFICATIONS':
1772
+ $transactionid = $this->mo2f_transactionid ? $this->mo2f_transactionid : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_transactionId',$session_id_encrypt );
1773
  $user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
1774
+ mo2f_get_push_notification_oobemail_prompt( $user_id, $login_status, $login_message, $redirect_to, $session_id_encrypt, $transactionid );
1775
+ exit;
1776
+ break;
1777
+
1778
+ case 'MO_2_FACTOR_CHALLENGE_OOB_EMAIL':
1779
+ $transactionid = $this->mo2f_transactionid ? $this->mo2f_transactionid : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_transactionId',$session_id_encrypt );
1780
+ $user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
1781
+ mo2f_get_push_notification_oobemail_prompt( $user_id, $login_status, $login_message, $redirect_to, $session_id_encrypt, $transactionid );
1782
+ exit;
1783
+ break;
1784
+
1785
+ case 'MO_2_FACTOR_RECONFIG_GOOGLE':
1786
+ $user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
1787
+ $this->mo2f_redirect_shortcode_addon( $user_id, $login_status, $login_message, 'reconfigure_google' );
1788
+ exit;
1789
+ break;
1790
+
1791
+ case 'MO_2_FACTOR_RECONFIG_KBA':
1792
+ $user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
1793
+ $this->mo2f_redirect_shortcode_addon( $user_id, $login_status, $login_message, 'reconfigure_kba' );
1794
+ exit;
1795
+ break;
1796
+
1797
+ case 'MO_2_FACTOR_SETUP_SUCCESS':
1798
+ $user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
1799
+ $this->mo2f_inline_setup_success($user_id,$redirect_to,$session_id_encrypt);
1800
+ break;
1801
+
1802
+ case 'MO_2_FACTOR_CHALLENGE_KBA_AUTHENTICATION':
1803
+ $kbaquestions = $this->mo2f_kbaquestions ? $this->mo2f_kbaquestions : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo_2_factor_kba_questions',$session_id_encrypt );
1804
+ if(MO2F_IS_ONPREM){
1805
+ $user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
1806
+ $ques = get_user_meta( $user_id, 'kba_questions_user');
1807
+ mo2f_get_kba_authentication_prompt( $login_message, $redirect_to, $session_id_encrypt, $ques[0] );
1808
+ }
1809
+ else{
1810
+ mo2f_get_kba_authentication_prompt( $login_message, $redirect_to, $session_id_encrypt, $kbaquestions );
1811
+ }
1812
+ exit;
1813
+ break;
1814
+
1815
+ case 'MO_2_FACTOR_REMEMBER_TRUSTED_DEVICE':
1816
+ mo2f_get_device_form( $redirect_to, $session_id_encrypt );
1817
  exit;
1818
+ break;
1819
+
1820
+ case 'MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS':
1821
+ $user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
1822
+ prompt_user_to_select_2factor_mthod_inline($user_id, $login_status, $login_message,$redirect_to,$session_id_encrypt,$qrCode);
1823
  exit;
1824
+ break;
1825
+
1826
+ default:
1827
  $this->mo_2_factor_pass2login_show_wp_login_form();
1828
+ if(MO2F_IS_ONPREM){
1829
+ $this->mo_2_factor_pass2login_show_wp_login_form();
1830
+ }
1831
+ break;
1832
  }
1833
  }
1834
 
2010
  $session_id=$this->create_session();
2011
  }
2012
  $challengeMobile = new Customer_Setup();
2013
+ $user_email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $current_user->ID );
2014
+ if(MO2F_IS_ONPREM && $mo2f_second_factor != "PUSH NOTIFICATIONS"){
2015
  include_once dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'api'.DIRECTORY_SEPARATOR.'Mo2f_OnPremRedirect.php';
2016
  $mo2fOnPremRedirect = new Mo2f_OnPremRedirect();
 
2017
  $content = $mo2fOnPremRedirect->mo2f_pass2login_push_email_onpremise($current_user, $redirect_to, $session_id );
2018
 
2019
  }else {
 
2020
  $content = $challengeMobile->send_otp_token( $user_email, $mo2f_second_factor, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) );
2021
  }
2022
  $response = json_decode( $content, true );
2050
  $session_id=$this->create_session();
2051
  }
2052
  $mo2f_external_app_type = get_user_meta( $user->ID, 'mo2f_external_app_type', true );
2053
+ if($mo2f_second_factor == 'EMAIL')
2054
+ {
2055
+ $mo2f_user_phone = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
2056
+ $wdewdeqdqq = get_option(base64_encode("remainingOTP"));
2057
+
2058
+ if($wdewdeqdqq >10 or get_option(base64_encode("limitReached")))
2059
+ {
2060
+ update_option(base64_encode("remainingOTP"),0);
2061
+ }
2062
+ }
2063
+ else
2064
+ $mo2f_user_phone = $Mo2fdbQueries->get_user_detail( 'mo2f_user_phone', $user->ID );
2065
  if ( $mo2f_second_factor == 'SOFT TOKEN' ) {
2066
  $mo2fa_login_message = 'Please enter the one time passcode shown in the miniOrange<b> Authenticator</b> app.';
2067
  $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN';
2072
  $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to, null,$session_id );
2073
  } else {
2074
  $challengeMobile = new Customer_Setup();
2075
+ $content = '';
2076
+ $response = [];
2077
+ $otpLIMiTE = 0;
2078
+ if(get_site_option("cmVtYWluaW5nT1RQ")>0 or $mo2f_second_factor != 'EMAIL')
2079
+ {
2080
+ if($mo2f_second_factor == 'OTP Over SMS')
2081
+ $mo2f_second_factor = 'SMS';
2082
+ $content = $challengeMobile->send_otp_token( $mo2f_user_phone, $mo2f_second_factor, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ,$user);
2083
+ $response = json_decode( $content, true );
2084
+
2085
+ }
2086
+ else
2087
+ {
2088
+ $response['status'] = 'FAILED';
2089
+ $response['message'] = '<p style = "color:red;">OTP limit has been exceeded</p>';
2090
+ $otpLIMiTE = 1;
2091
+ }
2092
  if ( json_last_error() == JSON_ERROR_NONE ) {
2093
  if ( $response['status'] == 'SUCCESS' ) {
2094
+ if($mo2f_second_factor == 'EMAIL')
2095
+ {
2096
+ $cmVtYWluaW5nT1RQ = get_site_option("cmVtYWluaW5nT1RQ");
2097
+ update_site_option("cmVtYWluaW5nT1RQ",$cmVtYWluaW5nT1RQ-1);
2098
+ }
2099
+ elseif($mo2f_second_factor == 'SMS')
2100
+ {
2101
+ update_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z',get_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z')-1);
2102
+ }
2103
+ if(!isset($response['phoneDelivery']['contact']))
2104
+ $response['phoneDelivery']['contact'] = '';
2105
  $message = 'The OTP has been sent to ' . MO2f_Utility::get_hidden_phone( $response['phoneDelivery']['contact'] ) . '. Please enter the OTP you received to Validate.';
2106
  update_option( 'mo2f_number_of_transactions', get_option( 'mo2f_number_of_transactions' ) - 1 );
2107
  MO2f_Utility::set_user_values( $session_id, "mo2f_transactionId", $response['txId'] );
2108
  $this->mo2f_transactionid=$response['txId'];
2109
  $mo2fa_login_message = $message;
2110
+ $currentMethod = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user->ID );
2111
+
2112
+ if($currentMethod == 'OTP Over Email')
2113
+ $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_OTP_OVER_EMAIL';
2114
+ else
2115
+ $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_OTP_OVER_SMS';
2116
  $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null, $session_id );
2117
  } else {
2118
+
2119
+
2120
+ if($response['message'] == 'TEST FAILED.')
2121
+ $response['message'] = 'There is an error in sending the OTP.';
2122
+
2123
+ $last_message = 'Or <a href = " https://login.xecurify.com/moas/login?redirectUrl=https://login.xecurify.com/moas/login?redirectUrl=https://login.xecurify.com/moas/initializepayment&requestOrigin=otp_recharge_plan">puchase trascactions</a>';
2124
+
2125
+ if($otpLIMiTE ==1)
2126
+ $last_message = 'or contact miniOrange';
2127
+
2128
+ else if(MO2F_IS_ONPREM and ($mo2f_second_factor == 'OTP Over Email' or $mo2f_second_factor =='EMAIL' or $mo2f_second_factor == 'Email Verification'))
2129
+ $last_message = 'Or check your SMTP Server and remaining transacions.';
2130
+ else
2131
+ $last_message = 'Or check your remaining transacions';
2132
+
2133
+ $message = $response['message'] . ' You can click on <a href="https://faq.miniorange.com/knowledgebase/i-am-locked-cant-access-my-account-what-do-i-do/">I am locked out</a> to login via alternate method '.$last_message;
2134
+ if(!isset($response['txId']))
2135
+ $response['txId'] = '';
2136
  MO2f_Utility::set_user_values( $session_id, "mo2f_transactionId", $response['txId'] );
2137
  $this->mo2f_transactionid=$response['txId'];
2138
  $mo2fa_login_message = $message;
2180
  }
2181
 
2182
  function miniorange_initiate_2nd_factor( $currentuser, $attributes = null, $redirect_to = null, $otp_token = "",$session_id_encrypt=null ) {
2183
+
2184
  global $Mo2fdbQueries;
2185
  $this->miniorange_pass2login_start_session();
2186
  if(is_null($session_id_encrypt)) {
2193
  $this->mo2f_userID=$currentuser->ID;
2194
  $this->fstfactor='VALIDATE_SUCCESS';
2195
 
2196
+ $is_customer_admin = true;
2197
 
2198
+ $dG90YWxVc2Vyc0Nsb3Vk = get_site_option("dG90YWxVc2Vyc0Nsb3Vk"); //directly added without encoding
2199
+ if($dG90YWxVc2Vyc0Nsb3Vk<3)
2200
  $is_customer_admin = true;
2201
+
2202
+ $roles = ( array ) $currentuser->roles;
2203
+ $twofactor_enabled = 0;
2204
+ foreach ( $roles as $role ) {
2205
+ if(get_option('mo2fa_'.$role)=='1')
2206
+ $twofactor_enabled=1;
2207
  }
2208
+
2209
+ if ( $is_customer_admin && $twofactor_enabled ) {
2210
  $mo_2factor_user_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $currentuser->ID );
2211
  $kba_configuration_status = $Mo2fdbQueries->get_user_detail( 'mo2f_SecurityQuestions_config_status', $currentuser->ID );
2212
 
2217
  }
2218
  update_user_meta( $currentuser->ID, 'mo2f_user_login_attempts', $mo2f_allwed_login_attempts );
2219
 
2220
+ $twofactor_transactions = new Mo2fDB;
2221
+ $exceeded = $twofactor_transactions->check_alluser_limit_exceeded($currentuser->ID);
2222
+
2223
+ if ( $mo_2factor_user_registration_status == 'MO_2_FACTOR_PLUGIN_SETTINGS' ) { //checking if user has configured any 2nd factor method
2224
+ $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $currentuser->ID );
2225
+ try {
 
2226
  $mo2f_rba_status = mo2f_collect_attributes( $email, stripslashes( $attributes ) ); // Rba flow
2227
  MO2f_Utility::set_user_values( $session_id_encrypt, 'mo2f_rba_status', $mo2f_rba_status );
2228
  $this->mo2f_rbastatus=$mo2f_rba_status;
2240
  $this->mo2f_restrict_access( 'Access_denied' );
2241
  exit;
2242
  } else {
2243
+
2244
  $mo2f_second_factor = '';
2245
+
2246
+ if(MO2F_IS_ONPREM)
2247
+ $mo2f_second_factor = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $currentuser->ID );
2248
+ else
2249
+ $mo2f_second_factor = mo2f_get_user_2ndfactor( $currentuser );
2250
+
2251
+ if($mo2f_second_factor == 'miniOrange Soft Token')
2252
+ $mo2f_second_factor = "SOFT TOKEN";
2253
+ else if($mo2f_second_factor == "miniOrange Push Notification")
2254
+ $mo2f_second_factor = "PUSH NOTIFICATIONS";
2255
+ else if($mo2f_second_factor == "miniOrange QR Code Authentication")
2256
+ $mo2f_second_factor = "MOBILE AUTHENTICATION";
2257
+ else if($mo2f_second_factor == 'Security Questions')
 
 
2258
  $mo2f_second_factor = 'KBA';
 
2259
  else if($mo2f_second_factor == 'Google Authenticator')
2260
+ $mo2f_second_factor = 'GOOGLE AUTHENTICATOR';
2261
+ else if($mo2f_second_factor == 'OTP Over SMS')
2262
+ $mo2f_second_factor = 'SMS';
2263
+ else if($mo2f_second_factor == 'OTP Over Email' || $mo2f_second_factor == 'OTP OVER EMAIL' || $mo2f_second_factor == "EMAIL") {
2264
+ $mo2f_second_factor = "EMAIL";
2265
+
2266
+ if(get_site_option("cmVtYWluaW5nT1RQ")<=0)
2267
+ {
2268
+ update_site_option("bGltaXRSZWFjaGVk",1);
2269
+
2270
+ }
2271
+ }
2272
+
2273
+
2274
+
2275
  if((($mo2f_second_factor == 'GOOGLE AUTHENTICATOR') || ($mo2f_second_factor =='SOFT TOKEN') || ($mo2f_second_factor =='AUTHY AUTHENTICATOR')) && get_option('mo2f_enable_2fa_prompt_on_login_page')&& !get_option('mo2f_remember_device') && !isset($_POST['mo_woocommerce_login_prompt']) )
2276
  {
2277
  $error=$this->mo2f_validate_soft_token($currentuser, $redirect_to, $mo2f_second_factor, $otp_token,$session_id_encrypt);
2281
  }
2282
  }
2283
  else{
2284
+
2285
  if ( MO2f_Utility::check_if_request_is_from_mobile_device( $_SERVER['HTTP_USER_AGENT'] ) && $kba_configuration_status ) {
2286
  $this->mo2f_pass2login_kba_verification( $currentuser->ID, $redirect_to, $session_id_encrypt );
2287
  } else {
2288
+
2289
+ if ( $mo2f_second_factor == 'MOBILE AUTHENTICATION' ) {
2290
+ $this->mo2f_pass2login_mobile_verification( $currentuser, $redirect_to, $session_id_encrypt );
2291
+ } else if ( $mo2f_second_factor == 'PUSH NOTIFICATIONS' || $mo2f_second_factor == 'OUT OF BAND EMAIL' || $mo2f_second_factor == 'Email Verification') {
2292
+ $this->mo2f_pass2login_push_oobemail_verification( $currentuser, $mo2f_second_factor, $redirect_to, $session_id_encrypt );
2293
+ } else if ( $mo2f_second_factor == 'SOFT TOKEN' || $mo2f_second_factor == 'SMS' || $mo2f_second_factor == 'PHONE VERIFICATION' || $mo2f_second_factor == 'GOOGLE AUTHENTICATOR' || $mo2f_second_factor == 'EMAIL') {
2294
+ $this->mo2f_pass2login_otp_verification( $currentuser, $mo2f_second_factor, $redirect_to, $session_id_encrypt );
2295
+ } else if ( $mo2f_second_factor == 'KBA' or $mo2f_second_factor == 'Security Questions') {
2296
+ $this->mo2f_pass2login_kba_verification( $currentuser->ID, $redirect_to , $session_id_encrypt );
2297
+ } else if ( $mo2f_second_factor == 'NONE' ) {
2298
+ return $currentuser;
2299
+ } else {
2300
+ $this->remove_current_activity($session_id_encrypt);
2301
+ $error = new WP_Error();
2302
+ $error->add( 'empty_username', __( '<strong>ERROR</strong>: Two Factor method has not been configured.' ) );
2303
+ return $error;
2304
+ }
2305
+ }
 
 
 
2306
  }
2307
 
2308
  }
2309
+ }else if(!$exceeded && get_site_option('mo2f_inline_registration')){
2310
+ $this->mo2fa_inline( $currentuser, $redirect_to, $session_id_encrypt );
2311
+
2312
+ } else {
2313
  return $currentuser;
2314
  }
2315
 
2316
  } else { //plugin is not activated for current role then logged him in without asking 2 factor
 
2317
  return $currentuser;
2318
  }
2319
 
2320
  }
2321
 
2322
+ function mo2fa_inline($currentuser,$redirect_to,$session_id){
2323
+
2324
+ global $Mo2fdbQueries;
2325
+ $currentUserId = $currentuser->ID;
2326
+ $email = $currentuser->user_email;
2327
+ $Mo2fdbQueries->insert_user( $currentUserId, array( 'user_id' => $currentUserId ) );
2328
+ $Mo2fdbQueries->update_user_details( $currentUserId, array(
2329
+ 'user_registration_with_miniorange' =>'SUCCESS',
2330
+ 'mo2f_user_email' =>$email,
2331
+ 'mo_2factor_user_registration_status' =>'MO_2_FACTOR_INITIALIZE_TWO_FACTOR'
2332
+ ) );
2333
+
2334
+ $mo2fa_login_message = '';
2335
+ $mo2fa_login_status = 'MO_2_FACTOR_PROMPT_USER_FOR_2FA_METHODS';
2336
+
2337
+ $this->miniorange_pass2login_form_fields($mo2fa_login_status, $mo2fa_login_message,$redirect_to,null,$session_id);
2338
+ //}
2339
+ }
2340
+
2341
  function mo2f_validate_soft_token($currentuser, $redirect_to = null, $mo2f_second_factor, $softtoken,$session_id_encrypt){
2342
  global $Mo2fdbQueries;
2343
  $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $currentuser->ID );
2408
 
2409
  $redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : null;
2410
  $mo2f_configured_2FA_method = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $currentuser->ID );
2411
+ $cloud_methods = array("MOBILE AUTHENTICATION","PUSH NOTIFICATIONS","SOFT TOKEN");
2412
+ if (MO2F_IS_ONPREM && $mo2f_configured_2FA_method=='Security Questions')
 
 
2413
  {
2414
+ $this->miniorange_initiate_2nd_factor($currentuser, null , $redirect_to , "" , $session_id );
2415
  }
2416
+ else if(MO2F_IS_ONPREM && $mo2f_configured_2FA_method =='Email Verification')
2417
  {
2418
  $this->miniorange_initiate_2nd_factor($currentuser, null , $redirect_to , null ,$session_id );
2419
  }
2444
  $session_id=$this->create_session();
2445
  }
2446
 
 
2447
 
2448
  $error=$this->miniorange_initiate_2nd_factor( $currentuser, $attributes, $redirect_to, $otp_token, $session_id );
2449
 
handler/twofa/two_fa_settings.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
  include 'two_fa_pass2login.php';
 
3
  include dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_setup_notification.php';
4
  include 'class_miniorange_2fa_strong_password.php';
5
 
@@ -9,8 +10,6 @@ class Miniorange_Authentication {
9
  private $defaultApiKey = "fFd2XcvTGDemZvbw1bcUesNJWEqKbbUq";
10
 
11
  function __construct() {
12
- // add_action( 'admin_notices', array( $this, 'get_customer_SMS_transactions' ) );
13
- // add_action( 'admin_notices', array( $this, 'prompt_user_to_setup_two_factor' ) );
14
  add_action( 'admin_init', array( $this, 'miniorange_auth_save_settings' ) );
15
  add_action( 'plugins_loaded', array( $this, 'mo2f_update_db_check' ) );
16
 
@@ -18,8 +17,8 @@ class Miniorange_Authentication {
18
  if ( ! isset( $wp_roles ) ) {
19
  $wp_roles = new WP_Roles();
20
  }
 
21
  if ( get_option( 'mo2f_activate_plugin' ) == 1 ) {
22
-
23
  $mo2f_rba_attributes = new Miniorange_Rba_Attributes();
24
  $pass2fa_login = new Miniorange_Password_2Factor_Login();
25
  $mo2f_2factor_setup = new Two_Factor_Setup();
@@ -47,7 +46,7 @@ class Miniorange_Authentication {
47
  ), 10, 5 );
48
  add_filter( 'mo2f_gauth_service', array( $mo2f_rba_attributes, 'mo2f_google_auth_service' ), 10, 1 );
49
  if ( get_option( 'mo2f_login_option' ) ) { //password + 2nd factor enabled
50
- if ( get_option( 'mo_2factor_admin_registration_status' ) == 'MO_2_FACTOR_CUSTOMER_REGISTERED_SUCCESS' or MO2F_IS_ONPREM ) {
51
 
52
  remove_filter( 'authenticate', 'wp_authenticate_username_password', 20 );
53
 
@@ -151,18 +150,27 @@ class Miniorange_Authentication {
151
  }
152
  if(get_option('mo2f_encryption_key',"not_exits")=="not_exits"){
153
  $get_encryption_key = MO2f_Utility::random_str(16);
154
- update_option('mo2f_encryption_key',$get_encryption_key);
155
 
156
  }
157
  global $Mo2fdbQueries;
158
  $user_id = get_option( 'mo2f_miniorange_admin' );
159
  $current_db_version = get_option( 'mo2f_dbversion' );
160
 
161
- if ( $current_db_version < MoWpnsConstants::DB_VERSION ) {
162
- update_option( 'mo2f_dbversion', MoWpnsConstants::DB_VERSION );
163
- $Mo2fdbQueries->generate_tables();
164
-
165
- }
 
 
 
 
 
 
 
 
 
166
  if ( ! get_option( 'mo2f_existing_user_values_updated' ) ) {
167
 
168
  if ( get_option( 'mo2f_customerKey' ) && ! get_option( 'mo2f_is_NC' ) ) {
@@ -252,16 +260,6 @@ class Miniorange_Authentication {
252
  if ( $check_if_user_column_exists ) {
253
  $selected_2FA_method = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user_id );
254
 
255
- // if ( in_array( $selected_2FA_method, array(
256
- // "Google Authenticator",
257
- // "miniOrange Soft Token",
258
- // "Authy Authenticator",
259
- // "Security Questions",
260
- // "miniOrange Push Notification",
261
- // "miniOrange QR Code Authentication"
262
- // ) ) ) {
263
- // update_option( 'mo2f_enable_2fa_prompt_on_login_page', 1 );
264
- // }
265
  update_option( 'mo2f_login_option_updated', 1 );
266
  }
267
  }
@@ -433,6 +431,12 @@ class Miniorange_Authentication {
433
  }
434
 
435
  function miniorange_auth_save_settings() {
 
 
 
 
 
 
436
  if ( array_key_exists( 'page', $_REQUEST ) && $_REQUEST['page'] == 'mo_2fa_two_fa' ) {
437
  if ( ! session_id() || session_id() == '' || ! isset( $_SESSION ) ) {
438
  session_start();
@@ -475,6 +479,71 @@ class Miniorange_Authentication {
475
  update_option( 'mo2f_register_with_another_email', 1 );
476
  $this->mo_auth_deactivate();
477
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
478
  }else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo2f_save_proxy_settings" ) {
479
  $nonce = $_POST['mo2f_save_proxy_settings_nonce'];
480
  if ( ! wp_verify_nonce( $nonce, 'mo2f-save-proxy-settings-nonce' ) ) {
@@ -549,7 +618,8 @@ class Miniorange_Authentication {
549
  } else { //customer already exists, redirect him to login page
550
 
551
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "ACCOUNT_ALREADY_EXISTS" ) );
552
- $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_VERIFY_CUSTOMER' ) );
 
553
 
554
  }
555
 
@@ -573,7 +643,7 @@ class Miniorange_Authentication {
573
  } else {
574
  $Mo2fdbQueries->insert_user( $user_id, array( 'user_id' => $user_id ) );
575
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "ENTER_YOUR_EMAIL_PASSWORD" ) );
576
- $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_VERIFY_CUSTOMER' ) );
577
  }
578
  }else if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo_2factor_gobackto_registration_page' ) { //back to registration page for admin
579
  $nonce = $_POST['mo_2factor_gobackto_registration_page_nonce'];
@@ -601,9 +671,10 @@ class Miniorange_Authentication {
601
  $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
602
  return $error;
603
  } else {
604
- //$Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => '' ) );
605
- update_option('mo_wpns_upgrade_onprem', 0);
606
  delete_user_meta( $user->ID, 'register_account_popup' );
 
 
 
607
  }
608
  }else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_verify_customer" ) { //register the admin to miniOrange if already exist
609
 
@@ -660,6 +731,7 @@ class Miniorange_Authentication {
660
  'mo2f_EmailVerification_config_status' => $mo2f_emailVerification_config_status,
661
  'mo2f_user_email' => get_option( 'mo2f_email' ),
662
  'user_registration_with_miniorange' => 'SUCCESS',
 
663
  'mo2f_2factor_enable_2fa_byusers' => 1,
664
  ) );
665
  $mo_2factor_user_registration_status = 'MO_2_FACTOR_PLUGIN_SETTINGS';
@@ -721,7 +793,7 @@ class Miniorange_Authentication {
721
  } else {
722
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "INVALID_EMAIL_OR_PASSWORD" ) );
723
  $mo_2factor_user_registration_status = 'MO_2_FACTOR_VERIFY_CUSTOMER';
724
- $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => $mo_2factor_user_registration_status ) );
725
  $this->mo_auth_show_error_message();
726
  }
727
 
@@ -729,7 +801,7 @@ class Miniorange_Authentication {
729
  } else {
730
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "INVALID_EMAIL_OR_PASSWORD" ) );
731
  $mo_2factor_user_registration_status = 'MO_2_FACTOR_VERIFY_CUSTOMER';
732
- $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => $mo_2factor_user_registration_status ) );
733
  $this->mo_auth_show_error_message();
734
  }
735
 
@@ -868,7 +940,6 @@ class Miniorange_Authentication {
868
 
869
  $user_email = get_user_meta( $user->ID, 'user_email', true );
870
 
871
- //if(!MO2f_Utility::check_if_email_is_already_registered($user_email)){
872
  $customer = new Customer_Setup();
873
  $mo2f_transactionId = isset( $_SESSION['mo2f_transactionId'] ) && ! empty( $_SESSION['mo2f_transactionId'] ) ? $_SESSION['mo2f_transactionId'] : get_option( 'mo2f_transactionId' );
874
 
@@ -887,10 +958,7 @@ class Miniorange_Authentication {
887
  $this->mo_auth_show_error_message();
888
  }
889
  }
890
- /*}else{
891
- update_option('mo2f_message','The email is already used by other user. Please register with other email by clicking on Back button.');
892
- $this->mo_auth_show_error_message();
893
- }*/
894
  }
895
  }else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_2factor_send_query" ) { //Help me or support
896
  $nonce = $_POST['mo_2factor_send_query_nonce'];
@@ -1186,6 +1254,7 @@ class Miniorange_Authentication {
1186
  ) );
1187
 
1188
  delete_user_meta( $user->ID, 'configure_2FA' );
 
1189
  mo2f_display_test_2fa_notification($user);
1190
 
1191
  } else {
@@ -1250,7 +1319,17 @@ class Miniorange_Authentication {
1250
 
1251
  return $error;
1252
  } else {
1253
- $mo_2factor_user_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $user->ID );
 
 
 
 
 
 
 
 
 
 
1254
  if ( in_array( $mo_2factor_user_registration_status, array(
1255
  'MO_2_FACTOR_INITIALIZE_TWO_FACTOR',
1256
  'MO_2_FACTOR_INITIALIZE_MOBILE_REGISTRATION',
@@ -1258,6 +1337,7 @@ class Miniorange_Authentication {
1258
  ) ) ) {
1259
  $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
1260
  $this->mo2f_get_qr_code_for_mobile( $email, $user->ID );
 
1261
  } else {
1262
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "REGISTER_WITH_MO" ) );
1263
  $this->mo_auth_show_error_message();
@@ -1413,9 +1493,9 @@ class Miniorange_Authentication {
1413
  //if the php session folder has insufficient permissions, temporary options to be used
1414
  $mo2f_transactionId = isset( $_SESSION['mo2f_transactionId'] ) && ! empty( $_SESSION['mo2f_transactionId'] ) ? $_SESSION['mo2f_transactionId'] : get_option( 'mo2f_transactionId' );
1415
  $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
1416
- $selected_2_2factor_method = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
1417
  $customer = new Customer_Setup();
1418
- $content = json_decode( $customer->validate_otp_token( get_user_meta( $user->ID, 'mo2f_2FA_method_to_configure', true ), $email, $mo2f_transactionId, $otp_token, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
1419
 
1420
  if ( $content['status'] == 'ERROR' ) {
1421
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( $content['message'] ) );
@@ -1450,7 +1530,7 @@ class Miniorange_Authentication {
1450
  $show = 1;
1451
  if(MO2F_IS_ONPREM )
1452
  {
1453
- $txid = $_POST['TxidEmail'];
1454
  $status = get_option($txid);
1455
  if($status != '')
1456
  {
@@ -1552,7 +1632,53 @@ class Miniorange_Authentication {
1552
  $this->mo_auth_show_error_message();
1553
 
1554
  }
1555
- //}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1556
  }
1557
  }else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_google_appname' ) {
1558
  $nonce = $_POST['mo2f_google_appname_nonce'];
@@ -1581,31 +1707,22 @@ class Miniorange_Authentication {
1581
 
1582
  if ( MO2f_Utility::mo2f_check_number_length( $otpToken ) ) {
1583
  $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
1584
- $onprem = MO2F_IS_ONPREM;
1585
- if($onprem)
1586
- {
1587
  $twofactor_transactions = new Mo2fDB;
1588
- $exceeded = $twofactor_transactions->check_user_limit_exceeded($user_id);
1589
 
1590
  if($exceeded){
1591
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "USER_LIMIT_EXCEEDED" ) );
1592
  $this->mo_auth_show_error_message();
1593
  return;
1594
  }
1595
- }
1596
  $google_auth = new Miniorange_Rba_Attributes();
1597
  $google_response = json_decode( $google_auth->mo2f_validate_google_auth( $email, $otpToken, $ga_secret ), true );
1598
 
1599
  if ( json_last_error() == JSON_ERROR_NONE ) {
1600
  if ( $google_response['status'] == 'SUCCESS' ) {
1601
- if($onprem != 1){
1602
  $enduser = new Two_Factor_Setup();
1603
  $response = json_decode( $enduser->mo2f_update_userinfo( $email, "GOOGLE AUTHENTICATOR", null, null, null ), true );
1604
- }else{
1605
- $response = $google_response;
1606
- }
1607
-
1608
- if ( json_last_error() == JSON_ERROR_NONE || MO2F_IS_ONPREM ) {
1609
 
1610
  if ( $response['status'] == 'SUCCESS' ) {
1611
 
@@ -1645,7 +1762,6 @@ class Miniorange_Authentication {
1645
  $this->mo_auth_show_error_message();
1646
 
1647
  }
1648
- //}
1649
  } else {
1650
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "ONLY_DIGITS_ALLOWED" ) );
1651
  $this->mo_auth_show_error_message();
@@ -1745,13 +1861,12 @@ class Miniorange_Authentication {
1745
  return $error;
1746
  }
1747
  $twofactor_transactions = new Mo2fDB;
1748
- $exceeded = $twofactor_transactions->check_user_limit_exceeded($user_id);
1749
-
1750
  if($exceeded){
1751
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "USER_LIMIT_EXCEEDED" ) );
1752
  $this->mo_auth_show_error_message();
1753
  return;
1754
- }
1755
  if ( MO2f_Utility::mo2f_check_empty_or_null( $_POST['mo2f_kbaquestion_1'] ) || MO2f_Utility::mo2f_check_empty_or_null( $_POST['mo2f_kba_ans1'] ) || MO2f_Utility::mo2f_check_empty_or_null( $_POST['mo2f_kbaquestion_2'] ) || MO2f_Utility::mo2f_check_empty_or_null( $_POST['mo2f_kba_ans2'] ) || MO2f_Utility::mo2f_check_empty_or_null( $_POST['mo2f_kbaquestion_3'] ) || MO2f_Utility::mo2f_check_empty_or_null( $_POST['mo2f_kba_ans3'] ) ) {
1756
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "INVALID_ENTRY" ) );
1757
  $this->mo_auth_show_error_message();
@@ -1773,31 +1888,14 @@ class Miniorange_Authentication {
1773
  $kba_q1 = addcslashes( stripslashes( $kba_q1 ), '"\\' );
1774
  $kba_q2 = addcslashes( stripslashes( $kba_q2 ), '"\\' );
1775
  $kba_q3 = addcslashes( stripslashes( $kba_q3 ), '"\\' );
1776
- if(MO2F_IS_ONPREM){
1777
-
1778
- $kba_a1 = md5(addcslashes( stripslashes( $kba_a1 ), '"\\' ));
1779
- $kba_a2 = md5(addcslashes( stripslashes( $kba_a2 ), '"\\' ));
1780
- $kba_a3 = md5(addcslashes( stripslashes( $kba_a3 ), '"\\' ));
1781
-
1782
- $question_answer = array($kba_q1 => $kba_a1 ,$kba_q2 => $kba_a2 , $kba_q3 => $kba_a3 );
1783
- update_user_meta( $user_id , 'mo2f_kba_challenge', $question_answer );
1784
- delete_user_meta( $user_id, 'configure_2FA' );
1785
- $Mo2fdbQueries->update_user_details( $user->ID, array(
1786
- 'mo2f_SecurityQuestions_config_status' => true,
1787
- 'mo2f_configured_2FA_method' => "Security Questions",
1788
- 'mo_2factor_user_registration_status' => "MO_2_FACTOR_PLUGIN_SETTINGS"
1789
- ) );
1790
- update_user_meta($user->ID,'currentMethod','Security Questions');
1791
- mo2f_display_test_2fa_notification($user);
1792
- }
1793
- else{
1794
  $kba_a1 = addcslashes( stripslashes( $kba_a1 ), '"\\' );
1795
  $kba_a2 = addcslashes( stripslashes( $kba_a2 ), '"\\' );
1796
  $kba_a3 = addcslashes( stripslashes( $kba_a3 ), '"\\' );
1797
 
1798
  $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
1799
  $kba_registration = new Two_Factor_Setup();
1800
- $kba_reg_reponse = json_decode( $kba_registration->register_kba_details( $email, $kba_q1, $kba_a1, $kba_q2, $kba_a2, $kba_q3, $kba_a3 ), true );
1801
  if ( json_last_error() == JSON_ERROR_NONE ) {
1802
  if ( $kba_reg_reponse['status'] == 'SUCCESS' ) {
1803
  if ( isset( $_POST['mobile_kba_option'] ) && $_POST['mobile_kba_option'] == 'mo2f_request_for_kba_as_emailbackup' ) {
@@ -1855,7 +1953,7 @@ class Miniorange_Authentication {
1855
  return;
1856
  }
1857
 
1858
- }
1859
  }else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_validate_kba_details' ) {
1860
  $nonce = $_POST['mo2f_validate_kba_details_nonce'];
1861
 
@@ -1880,14 +1978,14 @@ class Miniorange_Authentication {
1880
  $kba_questions = isset( $_SESSION['mo_2_factor_kba_questions'] ) && ! empty( $_SESSION['mo_2_factor_kba_questions'] ) ? $_SESSION['mo_2_factor_kba_questions'] : get_option( 'kba_questions' );
1881
 
1882
  $kbaAns = array();
1883
- $kbaAns[0] = $kba_questions[0];
1884
- $kbaAns[1] = $kba_ans_1;
1885
- $kbaAns[2] = $kba_questions[1];
1886
- $kbaAns[3] = $kba_ans_2;
1887
-
 
1888
  //if the php session folder has insufficient permissions, temporary options to be used
1889
  $mo2f_transactionId = isset( $_SESSION['mo2f_transactionId'] ) && ! empty( $_SESSION['mo2f_transactionId'] ) ? $_SESSION['mo2f_transactionId'] : get_option( 'mo2f_transactionId' );
1890
-
1891
  $kba_validate = new Customer_Setup();
1892
  $kba_validate_response = json_decode( $kba_validate->validate_otp_token( 'KBA', null, $mo2f_transactionId, $kbaAns, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
1893
  if ( json_last_error() == JSON_ERROR_NONE ) {
@@ -1932,16 +2030,17 @@ class Miniorange_Authentication {
1932
  $currentMethod = "SMS";
1933
 
1934
  $content = json_decode( $customer->send_otp_token( $phone, $currentMethod, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
1935
-
1936
  if ( json_last_error() == JSON_ERROR_NONE ) { /* Generate otp token */
1937
  if ( $content['status'] == 'ERROR' ) {
1938
- update_option( 'mo2f_message', Mo2fConstants:: langTranslate( $response['message'] ) );
1939
  $this->mo_auth_show_error_message();
1940
  } else if ( $content['status'] == 'SUCCESS' ) {
1941
  $_SESSION['mo2f_transactionId'] = $content['txId'];
1942
  update_option( 'mo2f_transactionId', $content['txId'] );
1943
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "OTP_SENT" ) . ' ' . $phone . ' .' . Mo2fConstants:: langTranslate( "ENTER_OTP" ) );
1944
  update_option( 'mo2f_number_of_transactions', get_option( 'mo2f_number_of_transactions' ) - 1 );
 
1945
  $this->mo_auth_show_success_message();
1946
  } else {
1947
  update_option( 'mo2f_message', Mo2fConstants::langTranslate( $content['message'] ) );
@@ -1961,7 +2060,16 @@ class Miniorange_Authentication {
1961
  $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
1962
 
1963
  return $error;
1964
- } else {
 
 
 
 
 
 
 
 
 
1965
  $otp_token = '';
1966
  if ( MO2f_Utility::mo2f_check_empty_or_null( $_POST['otp_token'] ) ) {
1967
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "INVALID_ENTRY" ) );
@@ -1975,7 +2083,8 @@ class Miniorange_Authentication {
1975
  //if the php session folder has insufficient permissions, temporary options to be used
1976
  $mo2f_transactionId = isset( $_SESSION['mo2f_transactionId'] ) && ! empty( $_SESSION['mo2f_transactionId'] ) ? $_SESSION['mo2f_transactionId'] : get_option( 'mo2f_transactionId' );
1977
  $user_phone = isset( $_SESSION['user_phone'] ) && $_SESSION['user_phone'] != 'false' ? $_SESSION['user_phone'] : get_option( 'user_phone_temp' );
1978
- $mo2f_configured_2FA_method = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user->ID );
 
1979
  $phone = $Mo2fdbQueries->get_user_detail( 'mo2f_user_phone', $user->ID );
1980
  $customer = new Customer_Setup();
1981
  $content = json_decode( $customer->validate_otp_token( $mo2f_configured_2FA_method, null, $mo2f_transactionId, $otp_token, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
@@ -1995,7 +2104,20 @@ class Miniorange_Authentication {
1995
  $enduser = new Two_Factor_Setup();
1996
  $TwoFA_method_to_configure = get_user_meta( $user->ID, 'mo2f_2FA_method_to_configure', true );
1997
  $current_method = MO2f_Utility::mo2f_decode_2_factor( $TwoFA_method_to_configure, "server" );
1998
- $response = json_decode( $enduser->mo2f_update_userinfo( $email, $current_method, $user_phone, null, null ), true );
 
 
 
 
 
 
 
 
 
 
 
 
 
1999
 
2000
  if ( json_last_error() == JSON_ERROR_NONE ) {
2001
 
@@ -2043,7 +2165,6 @@ class Miniorange_Authentication {
2043
  }
2044
 
2045
  }else if ( ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_save_free_plan_auth_methods' ) ) {// user clicks on Set 2-Factor method
2046
-
2047
  $nonce = $_POST['miniorange_save_form_auth_methods_nonce'];
2048
 
2049
  if ( ! wp_verify_nonce( $nonce, 'miniorange-save-form-auth-methods-nonce' ) ) {
@@ -2053,26 +2174,102 @@ class Miniorange_Authentication {
2053
  } else {
2054
  $configuredMethod = sanitize_text_field($_POST['mo2f_configured_2FA_method_free_plan']);
2055
  $selectedAction = sanitize_text_field($_POST['mo2f_selected_action_free_plan']);
2056
- if(MO2F_IS_ONPREM and $configuredMethod =='EmailVerification')
2057
- {
2058
- update_user_meta($user->ID,'currentMethod','Email Verification');
2059
- mo2f_display_test_2fa_notification($user);
2060
- }
2061
- else if($selectedAction == 'select2factor' and MO2F_IS_ONPREM)
2062
- {
2063
- if($configuredMethod == 'SecurityQuestions')
2064
- update_user_meta($user->ID,'currentMethod','Security Questions');
2065
- else if($configuredMethod == 'GoogleAuthenticator')
2066
- update_user_meta($user->ID,'currentMethod','Google Authenticator');
2067
- else
2068
- update_user_meta($user->ID,'currentMethod',$configuredMethod);
2069
- mo2f_display_test_2fa_notification($user);
2070
- }
2071
- $is_customer_registered = $Mo2fdbQueries->get_user_detail( 'user_registration_with_miniorange', $user->ID ) == 'SUCCESS' ? true : false;
2072
  $selected_2FA_method = MO2f_Utility::mo2f_decode_2_factor( isset( $_POST['mo2f_configured_2FA_method_free_plan'] ) ? $_POST['mo2f_configured_2FA_method_free_plan'] : $_POST['mo2f_selected_action_standard_plan'], "wpdb" );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2073
  update_user_meta( $user->ID, 'mo2f_2FA_method_to_configure', $selected_2FA_method );
2074
  if(MO2F_IS_ONPREM)
 
 
 
 
 
 
 
 
 
2075
  $is_customer_registered = 1;
 
2076
  if ( $is_customer_registered ) {
2077
  $selected_2FA_method = MO2f_Utility::mo2f_decode_2_factor( isset( $_POST['mo2f_configured_2FA_method_free_plan'] ) ? $_POST['mo2f_configured_2FA_method_free_plan'] : $_POST['mo2f_selected_action_standard_plan'], "wpdb" );
2078
  $selected_action = isset( $_POST['mo2f_selected_action_free_plan'] ) ? $_POST['mo2f_selected_action_free_plan'] : $_POST['mo2f_selected_action_standard_plan'];
@@ -2082,6 +2279,7 @@ class Miniorange_Authentication {
2082
  }
2083
 
2084
  // set it as his 2-factor in the WP database and server
 
2085
  if ( $selected_action == "select2factor" ) {
2086
 
2087
  if ( $selected_2FA_method == 'OTP Over SMS' && $user_phone == 'false' ) {
@@ -2089,8 +2287,32 @@ class Miniorange_Authentication {
2089
  $this->mo_auth_show_error_message();
2090
  } else {
2091
  // update in the Wordpress DB
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2092
  $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo2f_configured_2FA_method' => $selected_2FA_method ) );
2093
 
 
2094
  // update the server
2095
  if(!MO2F_IS_ONPREM)
2096
  $this->mo2f_save_2_factor_method( $user, $selected_2FA_method );
@@ -2121,12 +2343,10 @@ class Miniorange_Authentication {
2121
  }
2122
 
2123
  } else {
2124
- $Mo2fdbQueries->insert_user( $user->ID );
2125
- $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => "REGISTRATION_STARTED" ) );
2126
  update_user_meta( $user->ID, 'register_account_popup', 1 );
2127
- update_option( 'mo2f_message', "" );
2128
 
2129
- // display_customer_registration_forms( $user );
2130
  }
2131
  }
2132
  }else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_enable_2FA_for_users_option' ) {
@@ -2202,23 +2422,17 @@ class Miniorange_Authentication {
2202
 
2203
  if ( $selected_2FA_method == 'Security Questions' ) {
2204
 
2205
- if(MO2F_IS_ONPREM){
2206
- $question_answers = get_user_meta($user->ID , 'mo2f_kba_challenge');
2207
- $challenge_questions = array_keys($question_answers[0]);
2208
- $random_keys = array_rand($challenge_questions,2);
2209
- $challenge_ques1 = $challenge_questions[$random_keys[0]];
2210
- $challenge_ques2 = $challenge_questions[$random_keys[1]];
2211
- $questions = array($challenge_ques1,$challenge_ques2);
2212
- update_user_meta( $user->ID, 'kba_questions_user', $questions );
2213
- } else{
2214
  $response = json_decode( $customer->send_otp_token( $email, $selected_2FA_method_server, $customer_key, $api_key ), true );
 
2215
  if ( json_last_error() == JSON_ERROR_NONE ) { /* Generate KBA Questions*/
2216
  if ( $response['status'] == 'SUCCESS' ) {
2217
  $_SESSION['mo2f_transactionId'] = $response['txId'];
2218
  update_option( 'mo2f_transactionId', $response['txId'] );
2219
  $questions = array();
2220
- $questions[0] = $response['questions'][0]['question'];
2221
- $questions[1] = $response['questions'][1]['question'];
 
2222
  $_SESSION['mo_2_factor_kba_questions'] = $questions;
2223
  update_option( 'kba_questions', $questions );
2224
 
@@ -2235,7 +2449,7 @@ class Miniorange_Authentication {
2235
  $this->mo_auth_show_error_message();
2236
 
2237
  }
2238
- }
2239
 
2240
  } else if ( $selected_2FA_method == 'miniOrange Push Notification' ) {
2241
  $response = json_decode( $customer->send_otp_token( $email, $selected_2FA_method_server, $customer_key, $api_key ), true );
@@ -2268,10 +2482,36 @@ class Miniorange_Authentication {
2268
  $this->mo_auth_show_error_message();
2269
 
2270
  }
2271
- } else if ( $selected_2FA_method == 'OTP Over SMS' ) {
 
2272
  $phone = $Mo2fdbQueries->get_user_detail( 'mo2f_user_phone', $user->ID );
2273
- $response = json_decode( $customer->send_otp_token( $phone, $selected_2FA_method_server, $customer_key, $api_key ), true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2274
  if ( strcasecmp( $response['status'], 'SUCCESS' ) == 0 ) {
 
 
 
 
 
 
 
 
 
2275
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "OTP_SENT" ) . ' <b>' . ( $phone ) . '</b>. ' . Mo2fConstants:: langTranslate( "ENTER_OTP" ) );
2276
  update_option( 'mo2f_number_of_transactions', get_option( 'mo2f_number_of_transactions' ) - 1 );
2277
 
@@ -2280,7 +2520,11 @@ class Miniorange_Authentication {
2280
  $this->mo_auth_show_success_message();
2281
 
2282
  } else {
2283
- update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "ERROR_IN_SENDING_OTP" ) );
 
 
 
 
2284
  $this->mo_auth_show_error_message();
2285
 
2286
  }
@@ -2365,8 +2609,7 @@ class Miniorange_Authentication {
2365
  if ( $mo2f_register_with_another_email || $is_EC || $is_NNC ) {
2366
  update_option( 'mo2f_register_with_another_email', 0 );
2367
  $users = get_users( array() );
2368
- $this->mo2f_delete_user_details( $users );
2369
- $this->mo2f_delete_mo_options();
2370
  $url = admin_url( 'plugins.php' );
2371
  wp_redirect( $url );
2372
  }
@@ -2385,6 +2628,41 @@ class Miniorange_Authentication {
2385
  delete_user_meta( $user->ID, 'register_account_popup' );
2386
  }
2387
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2388
  }
2389
 
2390
  function mo2f_delete_mo_options() {
@@ -2424,8 +2702,6 @@ class Miniorange_Authentication {
2424
 
2425
  function mo_auth_show_success_message() {
2426
  do_action('wpns_show_message', get_option( 'mo2f_message' ), 'SUCCESS');
2427
- // remove_action( 'admin_notices', array( $this, 'mo_auth_success_message' ) );
2428
- // add_action( 'admin_notices', array( $this, 'mo_auth_error_message' ) );
2429
  }
2430
 
2431
  function mo2f_create_customer( $user ) {
@@ -2459,12 +2735,9 @@ class Miniorange_Authentication {
2459
  $Mo2fdbQueries->update_user_details( $user->ID, array(
2460
  'mo2f_EmailVerification_config_status' => true,
2461
  'user_registration_with_miniorange' => 'SUCCESS',
2462
- 'mo2f_user_email' => $email
 
2463
  ) );
2464
- $mo_2factor_user_registration_status = 'MO_2_FACTOR_PLUGIN_SETTINGS';
2465
-
2466
-
2467
- $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => $mo_2factor_user_registration_status ) );
2468
 
2469
  update_option( 'mo_2factor_admin_registration_status', 'MO_2_FACTOR_CUSTOMER_REGISTERED_SUCCESS' );
2470
  $enduser = new Two_Factor_Setup();
@@ -2484,8 +2757,7 @@ class Miniorange_Authentication {
2484
  } else {
2485
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "INVALID_EMAIL_OR_PASSWORD" ) );
2486
  $mo_2factor_user_registration_status = 'MO_2_FACTOR_VERIFY_CUSTOMER';
2487
- $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => $mo_2factor_user_registration_status ) );
2488
-
2489
  $this->mo_auth_show_error_message();
2490
  }
2491
 
@@ -2553,7 +2825,7 @@ class Miniorange_Authentication {
2553
  $mo2f_google_auth = array();
2554
  $mo2f_google_auth['ga_qrCode'] = $google_response['qrCodeData'];
2555
  $mo2f_google_auth['ga_secret'] = $google_response['secret'];
2556
- $_SESSION['mo2f_google_auth'] = $mo2f_google_auth;
2557
  }else {
2558
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "ERROR_DURING_USER_REGISTRATION" ) );
2559
  do_action('mo_auth_show_error_message');
@@ -2567,8 +2839,6 @@ class Miniorange_Authentication {
2567
 
2568
  function mo_auth_show_error_message() {
2569
  do_action('wpns_show_message', get_option( 'mo2f_message' ), 'ERROR');
2570
- // remove_action( 'admin_notices', array( $this, 'mo_auth_error_message' ) );
2571
- // add_action( 'admin_notices', array( $this, 'mo_auth_success_message' ) );
2572
  }
2573
 
2574
  function mo2f_create_user( $user, $email ) {
@@ -2644,6 +2914,7 @@ class Miniorange_Authentication {
2644
 
2645
  $registerMobile = new Two_Factor_Setup();
2646
  $content = $registerMobile->register_mobile( $email );
 
2647
  $response = json_decode( $content, true );
2648
  if ( json_last_error() == JSON_ERROR_NONE ) {
2649
  if ( $response['status'] == 'ERROR' ) {
@@ -2696,7 +2967,13 @@ class Miniorange_Authentication {
2696
  'mo_2factor_user_registration_status' => 'MO_2_FACTOR_PLUGIN_SETTINGS'
2697
  ) );
2698
  delete_user_meta( $user->ID, 'configure_2FA' );
2699
- update_option( 'mo2f_message', Mo2fConstants:: langTranslate( $configured_2fa_method ) . ' ' . Mo2fConstants:: langTranslate( "SET_2FA" ) );
 
 
 
 
 
 
2700
 
2701
  $this->mo_auth_show_success_message();
2702
  } else {
@@ -2710,11 +2987,13 @@ class Miniorange_Authentication {
2710
  }
2711
 
2712
  function miniorange_email_verification_call( $current_user ) {
2713
- if(MO2F_IS_ONPREM)
 
 
 
2714
  {
2715
- global $Mo2fdbQueries;
2716
  $challengeMobile = new Customer_Setup();
2717
- $email = get_user_meta($current_user->ID,'email',true);
2718
  $is_flow_driven_setup = ! ( get_user_meta( $current_user->ID, 'current_modal', true ) ) ? 0 : 1;
2719
 
2720
  $subject = '2-Factor Authentication(Email verification)';
@@ -2733,12 +3012,11 @@ class Miniorange_Authentication {
2733
  $_SESSION['txid'] = $txid;
2734
  $_SESSION['otpToken'] = $otpToken;
2735
  $userID = hash('sha512',$current_user->ID);
2736
- //update_site_option('otpTokenEmailV',$otpTokenH);
2737
  update_site_option($userID,$otpTokenH);
2738
  update_site_option($txid,3);
2739
  $userIDd = $userID . 'D';
2740
  update_site_option($userIDd,$otpTokenDH);
2741
- $url = get_site_option('siteurl').'/wp-login.php?';
2742
  $message = '<table cellpadding="25" style="margin:0px auto">
2743
  <tbody>
2744
  <tr>
@@ -2782,7 +3060,6 @@ class Miniorange_Authentication {
2782
  $this->mo_auth_show_success_message();
2783
  }
2784
  }else{
2785
- //unset($_SESSION[ 'mo2f_transactionId' ]);
2786
  update_site_option( 'mo2f_message', Mo2fConstants::langTranslate("ERROR_DURING_PROCESS_EMAIL"));
2787
  $this->mo_auth_show_error_message();
2788
  }
@@ -2820,6 +3097,7 @@ class Miniorange_Authentication {
2820
 
2821
  function mo_auth_activate() {
2822
  error_log(' miniOrange Two Factor Plugin Activated');
 
2823
  $get_encryption_key = MO2f_Utility::random_str(16);
2824
  update_option('mo2f_encryption_key',$get_encryption_key);
2825
 
@@ -2836,6 +3114,8 @@ class Miniorange_Authentication {
2836
  update_option('mo2f_data_storage',null);
2837
  global $Mo2fdbQueries;
2838
  $Mo2fdbQueries->mo_plugin_activate();
 
 
2839
  }
2840
 
2841
  function mo_get_2fa_shorcode( $atts ) {
@@ -2867,4 +3147,4 @@ function mo2f_is_customer_registered() {
2867
  }
2868
  }
2869
  new Miniorange_Authentication;
2870
- ?>
1
  <?php
2
  include 'two_fa_pass2login.php';
3
+ include_once 'two_fa_get_details.php';
4
  include dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_setup_notification.php';
5
  include 'class_miniorange_2fa_strong_password.php';
6
 
10
  private $defaultApiKey = "fFd2XcvTGDemZvbw1bcUesNJWEqKbbUq";
11
 
12
  function __construct() {
 
 
13
  add_action( 'admin_init', array( $this, 'miniorange_auth_save_settings' ) );
14
  add_action( 'plugins_loaded', array( $this, 'mo2f_update_db_check' ) );
15
 
17
  if ( ! isset( $wp_roles ) ) {
18
  $wp_roles = new WP_Roles();
19
  }
20
+
21
  if ( get_option( 'mo2f_activate_plugin' ) == 1 ) {
 
22
  $mo2f_rba_attributes = new Miniorange_Rba_Attributes();
23
  $pass2fa_login = new Miniorange_Password_2Factor_Login();
24
  $mo2f_2factor_setup = new Two_Factor_Setup();
46
  ), 10, 5 );
47
  add_filter( 'mo2f_gauth_service', array( $mo2f_rba_attributes, 'mo2f_google_auth_service' ), 10, 1 );
48
  if ( get_option( 'mo2f_login_option' ) ) { //password + 2nd factor enabled
49
+ if ( get_option( 'mo_2factor_admin_registration_status' ) == 'MO_2_FACTOR_CUSTOMER_REGISTERED_SUCCESS' or MO2F_IS_ONPREM) {
50
 
51
  remove_filter( 'authenticate', 'wp_authenticate_username_password', 20 );
52
 
150
  }
151
  if(get_option('mo2f_encryption_key',"not_exits")=="not_exits"){
152
  $get_encryption_key = MO2f_Utility::random_str(16);
153
+ update_option('mo2f_encryption_key',$get_encryption_key);
154
 
155
  }
156
  global $Mo2fdbQueries;
157
  $user_id = get_option( 'mo2f_miniorange_admin' );
158
  $current_db_version = get_option( 'mo2f_dbversion' );
159
 
160
+ if ( $current_db_version < MoWpnsConstants::DB_VERSION ) {
161
+ update_option( 'mo2f_dbversion', MoWpnsConstants::DB_VERSION );
162
+ $Mo2fdbQueries->generate_tables();
163
+
164
+ }
165
+ if(MO2F_IS_ONPREM){
166
+ $twofactordb = new Mo2fDB;
167
+ $userSync = get_site_option('mo2f_user_sync');
168
+ if($userSync<1){
169
+ update_site_option('mo2f_user_sync',1);
170
+ $twofactordb->get_all_onprem_userids();
171
+ }
172
+ }
173
+
174
  if ( ! get_option( 'mo2f_existing_user_values_updated' ) ) {
175
 
176
  if ( get_option( 'mo2f_customerKey' ) && ! get_option( 'mo2f_is_NC' ) ) {
260
  if ( $check_if_user_column_exists ) {
261
  $selected_2FA_method = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user_id );
262
 
 
 
 
 
 
 
 
 
 
 
263
  update_option( 'mo2f_login_option_updated', 1 );
264
  }
265
  }
431
  }
432
 
433
  function miniorange_auth_save_settings() {
434
+ if (get_option('mo2f_plugin_redirect')) {
435
+ delete_option('mo2f_plugin_redirect');
436
+ wp_redirect(admin_url() . 'admin.php?page=mo_2fa_two_fa');
437
+ exit;
438
+
439
+ }
440
  if ( array_key_exists( 'page', $_REQUEST ) && $_REQUEST['page'] == 'mo_2fa_two_fa' ) {
441
  if ( ! session_id() || session_id() == '' || ! isset( $_SESSION ) ) {
442
  session_start();
479
  update_option( 'mo2f_register_with_another_email', 1 );
480
  $this->mo_auth_deactivate();
481
  }
482
+ }else if(isset($_POST['option']) and $_POST['option'] == 'mo2f_skiplogin'){
483
+ $nonce = $_POST['mo2f_skiplogin_nonce'];
484
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-skiplogin-failed-nonce' ) ) {
485
+ $error = new WP_Error();
486
+ $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
487
+ return $error;
488
+ } else {
489
+ update_option('mo2f_tour_started',2);
490
+ }
491
+ }else if(isset($_POST['option']) and $_POST['option'] == 'mo2f_userlogout'){
492
+ $nonce = $_POST['mo2f_userlogout_nonce'];
493
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-userlogout-failed-nonce' ) ) {
494
+ $error = new WP_Error();
495
+ $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
496
+ return $error;
497
+ } else {
498
+ update_option('mo2f_tour_started',2);
499
+ wp_logout();
500
+ wp_redirect(admin_url());
501
+ }
502
+ }else if(isset($_POST['option']) and $_POST['option'] == 'restart_plugin_tour'){
503
+ $nonce = $_POST['_wpnonce'];
504
+ if ( ! wp_verify_nonce( $nonce, 'restart_plugin_tour' ) ) {
505
+ $error = new WP_Error();
506
+ $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
507
+ return $error;
508
+ } else {
509
+ $page = isset($_POST['page'])? $_POST['page'] : '';
510
+ $page = sanitize_text_field($page);
511
+ update_option('mo2f_two_factor_tour',0);
512
+ update_option('mo2f_tour_firewall',0);
513
+ update_option('mo2f_tour_loginSpam',0);
514
+ update_option('mo2f_tour_backup',0);
515
+ update_option('mo2f_tour_malware_scan',0);
516
+ update_option('mo2f_tour_advance_blocking',0);
517
+ switch ($_REQUEST['page']) {
518
+ case 'mo_2fa_two_fa':
519
+ update_option('mo2f_two_factor_tour',1);
520
+ break;
521
+ case 'mo_2fa_waf':
522
+ update_option('mo2f_tour_firewall',1);
523
+ break;
524
+ case 'mo_2fa_login_and_spam':
525
+ update_option('mo2f_tour_loginSpam',1);
526
+ break;
527
+ case 'mo_2fa_backup':
528
+ update_option('mo2f_tour_backup',1);
529
+ break;
530
+ case 'mo_2fa_malwarescan':
531
+ update_option('mo2f_tour_malware_scan',1);
532
+ break;
533
+ case 'mo_2fa_advancedblocking':
534
+ update_option('mo2f_tour_advance_blocking',1);
535
+ break;
536
+ }
537
+ if($page != '')
538
+ {
539
+ $url = get_option('siteurl').'/wp-admin/admin.php?page='.$page;
540
+ wp_redirect($url);
541
+ exit;
542
+ }
543
+ $redirect=explode('&',htmlentities($_SERVER['REQUEST_URI']))[0];
544
+ header("Location: ".$redirect);
545
+ return;
546
+ }
547
  }else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo2f_save_proxy_settings" ) {
548
  $nonce = $_POST['mo2f_save_proxy_settings_nonce'];
549
  if ( ! wp_verify_nonce( $nonce, 'mo2f-save-proxy-settings-nonce' ) ) {
618
  } else { //customer already exists, redirect him to login page
619
 
620
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "ACCOUNT_ALREADY_EXISTS" ) );
621
+ // $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_VERIFY_CUSTOMER' ) );
622
+ update_option('mo_2factor_user_registration_status','MO_2_FACTOR_VERIFY_CUSTOMER');
623
 
624
  }
625
 
643
  } else {
644
  $Mo2fdbQueries->insert_user( $user_id, array( 'user_id' => $user_id ) );
645
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "ENTER_YOUR_EMAIL_PASSWORD" ) );
646
+ update_option('mo_2factor_user_registration_status','MO_2_FACTOR_VERIFY_CUSTOMER');
647
  }
648
  }else if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo_2factor_gobackto_registration_page' ) { //back to registration page for admin
649
  $nonce = $_POST['mo_2factor_gobackto_registration_page_nonce'];
671
  $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
672
  return $error;
673
  } else {
 
 
674
  delete_user_meta( $user->ID, 'register_account_popup' );
675
+ $mo2f_message = 'Please set up the second-factor by clicking on Configure button.';
676
+ update_option( 'mo2f_message', $mo2f_message );
677
+ $this->mo_auth_show_success_message();
678
  }
679
  }else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_verify_customer" ) { //register the admin to miniOrange if already exist
680
 
731
  'mo2f_EmailVerification_config_status' => $mo2f_emailVerification_config_status,
732
  'mo2f_user_email' => get_option( 'mo2f_email' ),
733
  'user_registration_with_miniorange' => 'SUCCESS',
734
+ 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_PLUGIN_SETTINGS',
735
  'mo2f_2factor_enable_2fa_byusers' => 1,
736
  ) );
737
  $mo_2factor_user_registration_status = 'MO_2_FACTOR_PLUGIN_SETTINGS';
793
  } else {
794
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "INVALID_EMAIL_OR_PASSWORD" ) );
795
  $mo_2factor_user_registration_status = 'MO_2_FACTOR_VERIFY_CUSTOMER';
796
+ update_option('mo_2factor_user_registration_status',$mo_2factor_user_registration_status);
797
  $this->mo_auth_show_error_message();
798
  }
799
 
801
  } else {
802
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "INVALID_EMAIL_OR_PASSWORD" ) );
803
  $mo_2factor_user_registration_status = 'MO_2_FACTOR_VERIFY_CUSTOMER';
804
+ update_option('mo_2factor_user_registration_status',$mo_2factor_user_registration_status);
805
  $this->mo_auth_show_error_message();
806
  }
807
 
940
 
941
  $user_email = get_user_meta( $user->ID, 'user_email', true );
942
 
 
943
  $customer = new Customer_Setup();
944
  $mo2f_transactionId = isset( $_SESSION['mo2f_transactionId'] ) && ! empty( $_SESSION['mo2f_transactionId'] ) ? $_SESSION['mo2f_transactionId'] : get_option( 'mo2f_transactionId' );
945
 
958
  $this->mo_auth_show_error_message();
959
  }
960
  }
961
+
 
 
 
962
  }
963
  }else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_2factor_send_query" ) { //Help me or support
964
  $nonce = $_POST['mo_2factor_send_query_nonce'];
1254
  ) );
1255
 
1256
  delete_user_meta( $user->ID, 'configure_2FA' );
1257
+ //update_user_meta( $user->ID, 'currentMethod' , $selectedMethod);
1258
  mo2f_display_test_2fa_notification($user);
1259
 
1260
  } else {
1319
 
1320
  return $error;
1321
  } else {
1322
+
1323
+ $twofactor_transactions = new Mo2fDB;
1324
+ $exceeded = $twofactor_transactions->check_alluser_limit_exceeded($user_id);
1325
+
1326
+ if($exceeded){
1327
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "USER_LIMIT_EXCEEDED" ) );
1328
+ $this->mo_auth_show_error_message();
1329
+ return;
1330
+ }
1331
+
1332
+ $mo_2factor_user_registration_status = get_option( 'mo_2factor_user_registration_status');
1333
  if ( in_array( $mo_2factor_user_registration_status, array(
1334
  'MO_2_FACTOR_INITIALIZE_TWO_FACTOR',
1335
  'MO_2_FACTOR_INITIALIZE_MOBILE_REGISTRATION',
1337
  ) ) ) {
1338
  $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
1339
  $this->mo2f_get_qr_code_for_mobile( $email, $user->ID );
1340
+
1341
  } else {
1342
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "REGISTER_WITH_MO" ) );
1343
  $this->mo_auth_show_error_message();
1493
  //if the php session folder has insufficient permissions, temporary options to be used
1494
  $mo2f_transactionId = isset( $_SESSION['mo2f_transactionId'] ) && ! empty( $_SESSION['mo2f_transactionId'] ) ? $_SESSION['mo2f_transactionId'] : get_option( 'mo2f_transactionId' );
1495
  $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
1496
+ $selected_2_2factor_method = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user->ID );
1497
  $customer = new Customer_Setup();
1498
+ $content = json_decode( $customer->validate_otp_token($selected_2_2factor_method , $email, $mo2f_transactionId, $otp_token, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
1499
 
1500
  if ( $content['status'] == 'ERROR' ) {
1501
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( $content['message'] ) );
1530
  $show = 1;
1531
  if(MO2F_IS_ONPREM )
1532
  {
1533
+ $txid = isset($_POST['TxidEmail'])?_POST['TxidEmail']:null;
1534
  $status = get_option($txid);
1535
  if($status != '')
1536
  {
1632
  $this->mo_auth_show_error_message();
1633
 
1634
  }
1635
+ }
1636
+ }else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_validate_otp_over_email' ) {
1637
+ $nonce = $_POST['mo2f_validate_otp_over_email_test_nonce'];
1638
+
1639
+ if ( ! wp_verify_nonce( $nonce, 'mo2f-validate-otp-over-email-test-nonce' ) ) {
1640
+ $error = new WP_Error();
1641
+ $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
1642
+
1643
+ return $error;
1644
+ } else {
1645
+ $otp_token = '';
1646
+ if ( MO2f_Utility::mo2f_check_empty_or_null( $_POST['otp_token'] ) ) {
1647
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "ENTER_VALUE" ) );
1648
+ $this->mo_auth_show_error_message();
1649
+
1650
+ return;
1651
+ } else {
1652
+ $otp_token = sanitize_text_field( $_POST['otp_token'] );
1653
+ }
1654
+ $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
1655
+
1656
+ $customer = new Customer_Setup();
1657
+ $content = json_decode( $customer->validate_otp_token( 'OTP_OVER_EMAIL', $email, $_SESSION['mo2f_transactionId'], $otp_token, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
1658
+ if ( json_last_error() == JSON_ERROR_NONE ) {
1659
+
1660
+ if ( strcasecmp( $content['status'], 'SUCCESS' ) == 0 ) { //Google OTP validated
1661
+
1662
+ if ( current_user_can( 'manage_options' ) ) {
1663
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "COMPLETED_TEST" ) );
1664
+ } else {
1665
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "COMPLETED_TEST" ) );
1666
+ }
1667
+
1668
+ delete_user_meta( $user->ID, 'test_2FA' );
1669
+ $this->mo_auth_show_success_message();
1670
+
1671
+
1672
+ } else { // OTP Validation failed.
1673
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "INVALID_OTP" ) );
1674
+ $this->mo_auth_show_error_message();
1675
+
1676
+ }
1677
+ } else {
1678
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "ERROR_WHILE_VALIDATING_OTP" ) );
1679
+ $this->mo_auth_show_error_message();
1680
+
1681
+ }
1682
  }
1683
  }else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_google_appname' ) {
1684
  $nonce = $_POST['mo2f_google_appname_nonce'];
1707
 
1708
  if ( MO2f_Utility::mo2f_check_number_length( $otpToken ) ) {
1709
  $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
 
 
 
1710
  $twofactor_transactions = new Mo2fDB;
1711
+ $exceeded = $twofactor_transactions->check_alluser_limit_exceeded($user_id);
1712
 
1713
  if($exceeded){
1714
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "USER_LIMIT_EXCEEDED" ) );
1715
  $this->mo_auth_show_error_message();
1716
  return;
1717
  }
 
1718
  $google_auth = new Miniorange_Rba_Attributes();
1719
  $google_response = json_decode( $google_auth->mo2f_validate_google_auth( $email, $otpToken, $ga_secret ), true );
1720
 
1721
  if ( json_last_error() == JSON_ERROR_NONE ) {
1722
  if ( $google_response['status'] == 'SUCCESS' ) {
 
1723
  $enduser = new Two_Factor_Setup();
1724
  $response = json_decode( $enduser->mo2f_update_userinfo( $email, "GOOGLE AUTHENTICATOR", null, null, null ), true );
1725
+ if ( json_last_error() == JSON_ERROR_NONE ) {
 
 
 
 
1726
 
1727
  if ( $response['status'] == 'SUCCESS' ) {
1728
 
1762
  $this->mo_auth_show_error_message();
1763
 
1764
  }
 
1765
  } else {
1766
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "ONLY_DIGITS_ALLOWED" ) );
1767
  $this->mo_auth_show_error_message();
1861
  return $error;
1862
  }
1863
  $twofactor_transactions = new Mo2fDB;
1864
+ $exceeded = $twofactor_transactions->check_alluser_limit_exceeded($user_id);
 
1865
  if($exceeded){
1866
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "USER_LIMIT_EXCEEDED" ) );
1867
  $this->mo_auth_show_error_message();
1868
  return;
1869
+ }
1870
  if ( MO2f_Utility::mo2f_check_empty_or_null( $_POST['mo2f_kbaquestion_1'] ) || MO2f_Utility::mo2f_check_empty_or_null( $_POST['mo2f_kba_ans1'] ) || MO2f_Utility::mo2f_check_empty_or_null( $_POST['mo2f_kbaquestion_2'] ) || MO2f_Utility::mo2f_check_empty_or_null( $_POST['mo2f_kba_ans2'] ) || MO2f_Utility::mo2f_check_empty_or_null( $_POST['mo2f_kbaquestion_3'] ) || MO2f_Utility::mo2f_check_empty_or_null( $_POST['mo2f_kba_ans3'] ) ) {
1871
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "INVALID_ENTRY" ) );
1872
  $this->mo_auth_show_error_message();
1888
  $kba_q1 = addcslashes( stripslashes( $kba_q1 ), '"\\' );
1889
  $kba_q2 = addcslashes( stripslashes( $kba_q2 ), '"\\' );
1890
  $kba_q3 = addcslashes( stripslashes( $kba_q3 ), '"\\' );
1891
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1892
  $kba_a1 = addcslashes( stripslashes( $kba_a1 ), '"\\' );
1893
  $kba_a2 = addcslashes( stripslashes( $kba_a2 ), '"\\' );
1894
  $kba_a3 = addcslashes( stripslashes( $kba_a3 ), '"\\' );
1895
 
1896
  $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
1897
  $kba_registration = new Two_Factor_Setup();
1898
+ $kba_reg_reponse = json_decode( $kba_registration->register_kba_details( $email, $kba_q1, $kba_a1, $kba_q2, $kba_a2, $kba_q3, $kba_a3, $user->ID ), true );
1899
  if ( json_last_error() == JSON_ERROR_NONE ) {
1900
  if ( $kba_reg_reponse['status'] == 'SUCCESS' ) {
1901
  if ( isset( $_POST['mobile_kba_option'] ) && $_POST['mobile_kba_option'] == 'mo2f_request_for_kba_as_emailbackup' ) {
1953
  return;
1954
  }
1955
 
1956
+
1957
  }else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_validate_kba_details' ) {
1958
  $nonce = $_POST['mo2f_validate_kba_details_nonce'];
1959
 
1978
  $kba_questions = isset( $_SESSION['mo_2_factor_kba_questions'] ) && ! empty( $_SESSION['mo_2_factor_kba_questions'] ) ? $_SESSION['mo_2_factor_kba_questions'] : get_option( 'kba_questions' );
1979
 
1980
  $kbaAns = array();
1981
+ if(!MO2F_IS_ONPREM){
1982
+ $kbaAns[0] = $kba_questions[0]['question'];
1983
+ $kbaAns[1] = $kba_ans_1;
1984
+ $kbaAns[2] = $kba_questions[1]['question'];
1985
+ $kbaAns[3] = $kba_ans_2;
1986
+ }
1987
  //if the php session folder has insufficient permissions, temporary options to be used
1988
  $mo2f_transactionId = isset( $_SESSION['mo2f_transactionId'] ) && ! empty( $_SESSION['mo2f_transactionId'] ) ? $_SESSION['mo2f_transactionId'] : get_option( 'mo2f_transactionId' );
 
1989
  $kba_validate = new Customer_Setup();
1990
  $kba_validate_response = json_decode( $kba_validate->validate_otp_token( 'KBA', null, $mo2f_transactionId, $kbaAns, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
1991
  if ( json_last_error() == JSON_ERROR_NONE ) {
2030
  $currentMethod = "SMS";
2031
 
2032
  $content = json_decode( $customer->send_otp_token( $phone, $currentMethod, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
2033
+
2034
  if ( json_last_error() == JSON_ERROR_NONE ) { /* Generate otp token */
2035
  if ( $content['status'] == 'ERROR' ) {
2036
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( $content['message'] ) );
2037
  $this->mo_auth_show_error_message();
2038
  } else if ( $content['status'] == 'SUCCESS' ) {
2039
  $_SESSION['mo2f_transactionId'] = $content['txId'];
2040
  update_option( 'mo2f_transactionId', $content['txId'] );
2041
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "OTP_SENT" ) . ' ' . $phone . ' .' . Mo2fConstants:: langTranslate( "ENTER_OTP" ) );
2042
  update_option( 'mo2f_number_of_transactions', get_option( 'mo2f_number_of_transactions' ) - 1 );
2043
+ update_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z',get_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z')-1);
2044
  $this->mo_auth_show_success_message();
2045
  } else {
2046
  update_option( 'mo2f_message', Mo2fConstants::langTranslate( $content['message'] ) );
2060
  $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
2061
 
2062
  return $error;
2063
+ } else {
2064
+
2065
+ $twofactor_transactions = new Mo2fDB;
2066
+ $exceeded = $twofactor_transactions->check_alluser_limit_exceeded($user_id);
2067
+
2068
+ if($exceeded){
2069
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "USER_LIMIT_EXCEEDED" ) );
2070
+ $this->mo_auth_show_error_message();
2071
+ return;
2072
+ }
2073
  $otp_token = '';
2074
  if ( MO2f_Utility::mo2f_check_empty_or_null( $_POST['otp_token'] ) ) {
2075
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "INVALID_ENTRY" ) );
2083
  //if the php session folder has insufficient permissions, temporary options to be used
2084
  $mo2f_transactionId = isset( $_SESSION['mo2f_transactionId'] ) && ! empty( $_SESSION['mo2f_transactionId'] ) ? $_SESSION['mo2f_transactionId'] : get_option( 'mo2f_transactionId' );
2085
  $user_phone = isset( $_SESSION['user_phone'] ) && $_SESSION['user_phone'] != 'false' ? $_SESSION['user_phone'] : get_option( 'user_phone_temp' );
2086
+ //$mo2f_configured_2FA_method = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user->ID );
2087
+ $mo2f_configured_2FA_method = get_user_meta( $user->ID, 'mo2f_2FA_method_to_configure', true );
2088
  $phone = $Mo2fdbQueries->get_user_detail( 'mo2f_user_phone', $user->ID );
2089
  $customer = new Customer_Setup();
2090
  $content = json_decode( $customer->validate_otp_token( $mo2f_configured_2FA_method, null, $mo2f_transactionId, $otp_token, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
2104
  $enduser = new Two_Factor_Setup();
2105
  $TwoFA_method_to_configure = get_user_meta( $user->ID, 'mo2f_2FA_method_to_configure', true );
2106
  $current_method = MO2f_Utility::mo2f_decode_2_factor( $TwoFA_method_to_configure, "server" );
2107
+ $response = array();
2108
+ if(MO2F_IS_ONPREM) {
2109
+ $response['status'] = 'SUCCESS';
2110
+ if ( $current_method == 'SMS' ) {
2111
+ $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo2f_configured_2FA_method' => 'OTP Over SMS' ) );
2112
+ // update_user_meta($user->ID,'currentMethod','OTP Over SMS');
2113
+ } else {
2114
+ $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo2f_configured_2FA_method' => $current_method ) );//why is this needed?
2115
+ // update_user_meta( $user->ID, 'currentMethod', $current_method );
2116
+
2117
+ }
2118
+ }
2119
+ else
2120
+ $response = json_decode( $enduser->mo2f_update_userinfo( $email, $current_method, $user_phone, null, null ), true );
2121
 
2122
  if ( json_last_error() == JSON_ERROR_NONE ) {
2123
 
2165
  }
2166
 
2167
  }else if ( ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_save_free_plan_auth_methods' ) ) {// user clicks on Set 2-Factor method
 
2168
  $nonce = $_POST['miniorange_save_form_auth_methods_nonce'];
2169
 
2170
  if ( ! wp_verify_nonce( $nonce, 'miniorange-save-form-auth-methods-nonce' ) ) {
2174
  } else {
2175
  $configuredMethod = sanitize_text_field($_POST['mo2f_configured_2FA_method_free_plan']);
2176
  $selectedAction = sanitize_text_field($_POST['mo2f_selected_action_free_plan']);
2177
+
2178
+ $cloud_methods = array('OTPOverSMS','miniOrangeQRCodeAuthentication','miniOrangePushNotification','miniOrangeSoftToken');
2179
+
2180
+ if($configuredMethod == 'OTPOverSMS')
2181
+ $configuredMethod = 'OTP Over SMS';
2182
+
2183
+ //limit exceed check
2184
+ $exceeded = $Mo2fdbQueries->check_alluser_limit_exceeded($user_id);
2185
+
2186
+ if($exceeded){
2187
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "USER_LIMIT_EXCEEDED" ) );
2188
+ $this->mo_auth_show_error_message();
2189
+ return;
2190
+ }
 
 
2191
  $selected_2FA_method = MO2f_Utility::mo2f_decode_2_factor( isset( $_POST['mo2f_configured_2FA_method_free_plan'] ) ? $_POST['mo2f_configured_2FA_method_free_plan'] : $_POST['mo2f_selected_action_standard_plan'], "wpdb" );
2192
+ $onprem_methods = array('Google Authenticator','Security Questions');
2193
+ $Mo2fdbQueries->insert_user( $user->ID );
2194
+ if(MO2F_IS_ONPREM && ! in_array($selected_2FA_method, $onprem_methods) ){
2195
+ foreach ($cloud_methods as $cloud_method) {
2196
+ $is_end_user_registered = $Mo2fdbQueries->get_user_detail( 'mo2f_' . $cloud_method. '_config_status', $user->ID );
2197
+ if(!is_null($is_end_user_registered) && $is_end_user_registered == 1)
2198
+ break;
2199
+ }
2200
+ }else{
2201
+ $is_end_user_registered = $Mo2fdbQueries->get_user_detail('user_registration_with_miniorange', $user->ID ) ;
2202
+ }
2203
+ $is_customer_registered= false;
2204
+
2205
+ if(!MO2F_IS_ONPREM or $configuredMethod == 'miniOrangeSoftToken' or $configuredMethod == 'miniOrangeQRCodeAuthentication' or $configuredMethod == 'miniOrangePushNotification' or $configuredMethod == 'OTPOverSMS' or $configuredMethod == 'OTP Over SMS')
2206
+ $is_customer_registered = get_option('mo2f_api_key') ? true : false;
2207
+ $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
2208
+ if(!isset($email) or is_null($email) or $email == '')
2209
+ {
2210
+ $email = $user->user_email;
2211
+ }
2212
+ $is_end_user_registered = $is_end_user_registered ? $is_end_user_registered : false;
2213
+ $allowed = false;
2214
+ if(get_option('mo2f_miniorange_admin'))
2215
+ $allowed = wp_get_current_user()->ID == get_option('mo2f_miniorange_admin');
2216
+
2217
+ if($is_customer_registered && !$is_end_user_registered and !$allowed){
2218
+ $enduser = new Two_Factor_Setup();
2219
+ $check_user = json_decode( $enduser->mo_check_user_already_exist( $email ), true );
2220
+ if(json_last_error() == JSON_ERROR_NONE){
2221
+ if($check_user['status'] == 'ERROR'){
2222
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( $check_user['message'] ) );
2223
+ $this->mo_auth_show_error_message();
2224
+ return;
2225
+ }
2226
+ else if(strcasecmp($check_user['status' ], 'USER_FOUND') == 0){
2227
+
2228
+ $Mo2fdbQueries->update_user_details( $user->ID, array(
2229
+ 'user_registration_with_miniorange' =>'SUCCESS',
2230
+ 'mo2f_user_email' =>$email
2231
+ ) );
2232
+ update_site_option(base64_encode("totalUsersCloud"),get_site_option(base64_encode("totalUsersCloud"))+1);
2233
+
2234
+ }
2235
+ else if(strcasecmp($check_user['status'], 'USER_NOT_FOUND') == 0){
2236
+
2237
+ $content = json_decode($enduser->mo_create_user($user,$email), true);
2238
+ if(json_last_error() == JSON_ERROR_NONE) {
2239
+ if(strcasecmp($content['status'], 'SUCCESS') == 0) {
2240
+ update_site_option(base64_encode("totalUsersCloud"),get_site_option(base64_encode("totalUsersCloud"))+1);
2241
+ $Mo2fdbQueries->update_user_details( $user->ID, array(
2242
+ 'user_registration_with_miniorange' =>'SUCCESS',
2243
+ 'mo2f_user_email' =>$email
2244
+ ) );
2245
+
2246
+ }
2247
+ }
2248
+
2249
+
2250
+ }
2251
+ else if(strcasecmp($check_user['status'], 'USER_FOUND_UNDER_DIFFERENT_CUSTOMER') == 0){
2252
+ $mo2fa_login_message = __('The email associated with your account is already registered in miniOrnage. Please Choose another email or contact miniOrange.','miniorange-2-factor-authentication');
2253
+ update_option('mo2f_message',$mo2fa_login_message);
2254
+ $this->mo_auth_show_error_message();
2255
+ }
2256
+
2257
+ }
2258
+
2259
+ }
2260
  update_user_meta( $user->ID, 'mo2f_2FA_method_to_configure', $selected_2FA_method );
2261
  if(MO2F_IS_ONPREM)
2262
+ {
2263
+ if($selected_2FA_method == 'EmailVerification')
2264
+ $selected_2FA_method = 'Email Verification';
2265
+ if($selected_2FA_method == 'OTPOverEmail')
2266
+ $selected_2FA_method = 'OTP Over Email';
2267
+ if($selected_2FA_method == 'OTPOverSMS')
2268
+ $selected_2FA_method = 'OTP Over SMS';
2269
+ }
2270
+ if(MO2F_IS_ONPREM and ($selected_2FA_method =='Google Authenticator' or $selected_2FA_method == 'Security Questions' or $selected_2FA_method =='OTP Over Email' or $selected_2FA_method == 'Email Verification'))
2271
  $is_customer_registered = 1;
2272
+
2273
  if ( $is_customer_registered ) {
2274
  $selected_2FA_method = MO2f_Utility::mo2f_decode_2_factor( isset( $_POST['mo2f_configured_2FA_method_free_plan'] ) ? $_POST['mo2f_configured_2FA_method_free_plan'] : $_POST['mo2f_selected_action_standard_plan'], "wpdb" );
2275
  $selected_action = isset( $_POST['mo2f_selected_action_free_plan'] ) ? $_POST['mo2f_selected_action_free_plan'] : $_POST['mo2f_selected_action_standard_plan'];
2279
  }
2280
 
2281
  // set it as his 2-factor in the WP database and server
2282
+ $enduser = new Customer_Setup();
2283
  if ( $selected_action == "select2factor" ) {
2284
 
2285
  if ( $selected_2FA_method == 'OTP Over SMS' && $user_phone == 'false' ) {
2287
  $this->mo_auth_show_error_message();
2288
  } else {
2289
  // update in the Wordpress DB
2290
+ $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
2291
+ $customer_key = get_option( 'mo2f_customerKey' );
2292
+ $api_key = get_option( 'mo2f_api_key' );
2293
+
2294
+ $cloud_method1 = array('miniOrange QR Code Authentication','miniOrange Push Notification','miniOrange Soft Token');
2295
+
2296
+ if($selected_2FA_method == "OTP Over Email" or in_array($selected_2FA_method,$cloud_method1))
2297
+ {
2298
+ $TwoF_setup = new Two_Factor_Setup();
2299
+ $current_method = MO2f_Utility::mo2f_decode_2_factor( $selected_2FA_method, "server" );
2300
+
2301
+ if($selected_2FA_method == "OTP Over Email")
2302
+ $response = json_decode($TwoF_setup->mo2f_update_userinfo($email,'EMAIL',null,null,null),true);
2303
+ else
2304
+ $response = json_decode($TwoF_setup->mo2f_update_userinfo($email,$current_method,null,null,null),true);
2305
+ $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo2f_configured_2FA_method' => $selected_2FA_method ) );
2306
+
2307
+ mo2f_display_test_2fa_notification($user);
2308
+ }else if($selected_2FA_method == "Email Verification")
2309
+ {
2310
+ $enduser->send_otp_token($email,'OUT OF BAND EMAIL',$customer_key,$api_key);
2311
+ }
2312
+
2313
  $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo2f_configured_2FA_method' => $selected_2FA_method ) );
2314
 
2315
+
2316
  // update the server
2317
  if(!MO2F_IS_ONPREM)
2318
  $this->mo2f_save_2_factor_method( $user, $selected_2FA_method );
2343
  }
2344
 
2345
  } else {
2346
+ update_option("mo_2factor_user_registration_status","REGISTRATION_STARTED" );
 
2347
  update_user_meta( $user->ID, 'register_account_popup', 1 );
2348
+ update_option( 'mo2f_message', '' );
2349
 
 
2350
  }
2351
  }
2352
  }else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_enable_2FA_for_users_option' ) {
2422
 
2423
  if ( $selected_2FA_method == 'Security Questions' ) {
2424
 
2425
+
 
 
 
 
 
 
 
 
2426
  $response = json_decode( $customer->send_otp_token( $email, $selected_2FA_method_server, $customer_key, $api_key ), true );
2427
+
2428
  if ( json_last_error() == JSON_ERROR_NONE ) { /* Generate KBA Questions*/
2429
  if ( $response['status'] == 'SUCCESS' ) {
2430
  $_SESSION['mo2f_transactionId'] = $response['txId'];
2431
  update_option( 'mo2f_transactionId', $response['txId'] );
2432
  $questions = array();
2433
+
2434
+ $questions[0] = $response['questions'][0];
2435
+ $questions[1] = $response['questions'][1];
2436
  $_SESSION['mo_2_factor_kba_questions'] = $questions;
2437
  update_option( 'kba_questions', $questions );
2438
 
2449
  $this->mo_auth_show_error_message();
2450
 
2451
  }
2452
+
2453
 
2454
  } else if ( $selected_2FA_method == 'miniOrange Push Notification' ) {
2455
  $response = json_decode( $customer->send_otp_token( $email, $selected_2FA_method_server, $customer_key, $api_key ), true );
2482
  $this->mo_auth_show_error_message();
2483
 
2484
  }
2485
+ } else if ( $selected_2FA_method == 'OTP Over SMS' || $selected_2FA_method == 'OTP Over Email') {
2486
+
2487
  $phone = $Mo2fdbQueries->get_user_detail( 'mo2f_user_phone', $user->ID );
2488
+ $check = 1;
2489
+ if($selected_2FA_method == 'OTP Over Email')
2490
+ {
2491
+ $phone = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
2492
+ if(get_site_option("cmVtYWluaW5nT1RQ")<=0)
2493
+ {
2494
+ update_site_option("bGltaXRSZWFjaGVk",1);
2495
+ $check = 0;
2496
+
2497
+ }
2498
+
2499
+ }
2500
+
2501
+ if($check == 1)
2502
+ $response = json_decode( $customer->send_otp_token( $phone, $selected_2FA_method_server, $customer_key, $api_key ), true );
2503
+ else
2504
+ $response['status'] = 'FAILED';
2505
  if ( strcasecmp( $response['status'], 'SUCCESS' ) == 0 ) {
2506
+ if($selected_2FA_method == 'OTP Over Email')
2507
+ {
2508
+ $cmVtYWluaW5nT1RQ = get_option("cmVtYWluaW5nT1RQ");
2509
+ update_option("cmVtYWluaW5nT1RQ",$cmVtYWluaW5nT1RQ-1);
2510
+ }
2511
+ else if($selected_2FA_method == 'OTP Over SMS')
2512
+ {
2513
+ update_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z',get_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z')-1);
2514
+ }
2515
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "OTP_SENT" ) . ' <b>' . ( $phone ) . '</b>. ' . Mo2fConstants:: langTranslate( "ENTER_OTP" ) );
2516
  update_option( 'mo2f_number_of_transactions', get_option( 'mo2f_number_of_transactions' ) - 1 );
2517
 
2520
  $this->mo_auth_show_success_message();
2521
 
2522
  } else {
2523
+ if(!MO2F_IS_ONPREM or $selected_2FA_method == 'OTP Over SMS')
2524
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "ERROR_IN_SENDING_OTP" ) );
2525
+ else
2526
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "ERROR_IN_SENDING_OTP_ONPREM" ) );
2527
+
2528
  $this->mo_auth_show_error_message();
2529
 
2530
  }
2609
  if ( $mo2f_register_with_another_email || $is_EC || $is_NNC ) {
2610
  update_option( 'mo2f_register_with_another_email', 0 );
2611
  $users = get_users( array() );
2612
+ $this->mo2f_delete_user_details( $users );
 
2613
  $url = admin_url( 'plugins.php' );
2614
  wp_redirect( $url );
2615
  }
2628
  delete_user_meta( $user->ID, 'register_account_popup' );
2629
  }
2630
 
2631
+ }
2632
+ function mo2f_show_email_page($email )
2633
+ {
2634
+ ?>
2635
+ <div id="EnterEmailCloudVerification" class="modal">
2636
+ <!-- Modal content -->
2637
+ <div class="modal-content">
2638
+ <div class="modal-header">
2639
+ <h3 class="modal-title" style="text-align: center; font-size: 20px; color: #20b2aa">Email Address for miniOrange</h3><span id="closeEnterEmailCloud" class="modal-span-close">X</span>
2640
+ </div>
2641
+ <div class="modal-body" style="height: auto">
2642
+ <h2><i>Enter your Email:&nbsp;&nbsp;&nbsp; <input type ='email' id='emailEnteredCloud' name='emailEnteredCloud' size= '40' required value="<?php echo $email;?>"/></i></h2>
2643
+ </div>
2644
+ <div class="modal-footer">
2645
+ <button type="button" class="mo_wpns_button mo_wpns_button1 modal-button" id="save_entered_email_cloud">Save</button>
2646
+ </div>
2647
+ </div>
2648
+ </div>
2649
+
2650
+
2651
+ <script type="text/javascript">
2652
+
2653
+ jQuery('#EnterEmailCloudVerification').css('display', 'block');
2654
+
2655
+ jQuery('#closeEnterEmailCloud').click(function(){
2656
+ jQuery('#EnterEmailCloudVerification').css('display', 'none');
2657
+
2658
+ });
2659
+
2660
+
2661
+ </script>
2662
+
2663
+ <?php
2664
+
2665
+
2666
  }
2667
 
2668
  function mo2f_delete_mo_options() {
2702
 
2703
  function mo_auth_show_success_message() {
2704
  do_action('wpns_show_message', get_option( 'mo2f_message' ), 'SUCCESS');
 
 
2705
  }
2706
 
2707
  function mo2f_create_customer( $user ) {
2735
  $Mo2fdbQueries->update_user_details( $user->ID, array(
2736
  'mo2f_EmailVerification_config_status' => true,
2737
  'user_registration_with_miniorange' => 'SUCCESS',
2738
+ 'mo2f_user_email' => $email,
2739
+ 'mo_2factor_user_registration_status' =>'MO_2_FACTOR_PLUGIN_SETTINGS'
2740
  ) );
 
 
 
 
2741
 
2742
  update_option( 'mo_2factor_admin_registration_status', 'MO_2_FACTOR_CUSTOMER_REGISTERED_SUCCESS' );
2743
  $enduser = new Two_Factor_Setup();
2757
  } else {
2758
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "INVALID_EMAIL_OR_PASSWORD" ) );
2759
  $mo_2factor_user_registration_status = 'MO_2_FACTOR_VERIFY_CUSTOMER';
2760
+ update_option('mo_2factor_user_registration_status',$mo_2factor_user_registration_status);
 
2761
  $this->mo_auth_show_error_message();
2762
  }
2763
 
2825
  $mo2f_google_auth = array();
2826
  $mo2f_google_auth['ga_qrCode'] = $google_response['qrCodeData'];
2827
  $mo2f_google_auth['ga_secret'] = $google_response['secret'];
2828
+ $_SESSION['mo2f_google_auth'] = $mo2f_google_auth;
2829
  }else {
2830
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "ERROR_DURING_USER_REGISTRATION" ) );
2831
  do_action('mo_auth_show_error_message');
2839
 
2840
  function mo_auth_show_error_message() {
2841
  do_action('wpns_show_message', get_option( 'mo2f_message' ), 'ERROR');
 
 
2842
  }
2843
 
2844
  function mo2f_create_user( $user, $email ) {
2914
 
2915
  $registerMobile = new Two_Factor_Setup();
2916
  $content = $registerMobile->register_mobile( $email );
2917
+
2918
  $response = json_decode( $content, true );
2919
  if ( json_last_error() == JSON_ERROR_NONE ) {
2920
  if ( $response['status'] == 'ERROR' ) {
2967
  'mo_2factor_user_registration_status' => 'MO_2_FACTOR_PLUGIN_SETTINGS'
2968
  ) );
2969
  delete_user_meta( $user->ID, 'configure_2FA' );
2970
+
2971
+ if($configured_2fa_method == 'OTP Over Email' or $configured_2fa_method=='OTP Over SMS')
2972
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( $configured_2fa_method ) . ' ' . Mo2fConstants:: langTranslate( "SET_2FA_otp" ) );
2973
+
2974
+ else
2975
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( $configured_2fa_method ) . ' ' . Mo2fConstants:: langTranslate( "SET_2FA" ) );
2976
+
2977
 
2978
  $this->mo_auth_show_success_message();
2979
  } else {
2987
  }
2988
 
2989
  function miniorange_email_verification_call( $current_user ) {
2990
+ global $Mo2fdbQueries;
2991
+ $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $current_user->ID );
2992
+
2993
+ if(MO2F_IS_ONPREM)
2994
  {
2995
+
2996
  $challengeMobile = new Customer_Setup();
 
2997
  $is_flow_driven_setup = ! ( get_user_meta( $current_user->ID, 'current_modal', true ) ) ? 0 : 1;
2998
 
2999
  $subject = '2-Factor Authentication(Email verification)';
3012
  $_SESSION['txid'] = $txid;
3013
  $_SESSION['otpToken'] = $otpToken;
3014
  $userID = hash('sha512',$current_user->ID);
 
3015
  update_site_option($userID,$otpTokenH);
3016
  update_site_option($txid,3);
3017
  $userIDd = $userID . 'D';
3018
  update_site_option($userIDd,$otpTokenDH);
3019
+ $url = get_site_option('siteurl').'/wp-login.php?'; //login page can change
3020
  $message = '<table cellpadding="25" style="margin:0px auto">
3021
  <tbody>
3022
  <tr>
3060
  $this->mo_auth_show_success_message();
3061
  }
3062
  }else{
 
3063
  update_site_option( 'mo2f_message', Mo2fConstants::langTranslate("ERROR_DURING_PROCESS_EMAIL"));
3064
  $this->mo_auth_show_error_message();
3065
  }
3097
 
3098
  function mo_auth_activate() {
3099
  error_log(' miniOrange Two Factor Plugin Activated');
3100
+
3101
  $get_encryption_key = MO2f_Utility::random_str(16);
3102
  update_option('mo2f_encryption_key',$get_encryption_key);
3103
 
3114
  update_option('mo2f_data_storage',null);
3115
  global $Mo2fdbQueries;
3116
  $Mo2fdbQueries->mo_plugin_activate();
3117
+
3118
+
3119
  }
3120
 
3121
  function mo_get_2fa_shorcode( $atts ) {
3147
  }
3148
  }
3149
  new Miniorange_Authentication;
3150
+ ?>
handler/twofa/two_fa_utility.php CHANGED
@@ -123,8 +123,8 @@ class MO2f_Utility {
123
  // setting cookie values
124
  if(is_array($value)){
125
  if($variable == 'mo_2_factor_kba_questions'){
126
- MO2f_Utility::mo2f_set_cookie_values( 'kba_question1', $value[0] );
127
- MO2f_Utility::mo2f_set_cookie_values( 'kba_question2', $value[1] );
128
  }else if($variable == 'mo2f_rba_status'){
129
  MO2f_Utility::mo2f_set_cookie_values( 'mo2f_rba_status_status', $value["status"] );
130
  MO2f_Utility::mo2f_set_cookie_values( 'mo2f_rba_status_sessionUuid', $value["sessionUuid"] );
@@ -246,7 +246,6 @@ class MO2f_Utility {
246
  //update_option('mo2f_data_storage',"sessions");
247
  return $_SESSION[ $variable ];
248
  } else {
249
- // $key = get_option( 'mo2f_customer_token' );
250
  $key = get_option( 'mo2f_encryption_key' );
251
  $cookie_value = false;
252
  if ( $variable == 'mo2f_rba_status' ) {
@@ -270,7 +269,6 @@ class MO2f_Utility {
270
  $cookie_value = MO2f_Utility::mo2f_get_cookie_values( $variable );
271
  }
272
  if($cookie_value){
273
- //update_option('mo2f_data_storage', "cookies");
274
  return $cookie_value;
275
  } else {
276
  $session_id = MO2f_Utility::decrypt_data( $session_id, $key );
@@ -278,7 +276,6 @@ class MO2f_Utility {
278
  if ( in_array( $variable, array( "mo2f_rba_status", "mo_2_factor_kba_questions" ) ) ) {
279
  $db_value = unserialize( $db_value );
280
  }
281
- //update_option('mo2f_data_storage',"tables");
282
  return $db_value;
283
  }
284
  }
@@ -478,8 +475,12 @@ class MO2f_Utility {
478
 
479
  if ( $selected_2_factor_method == 'NONE' ) {
480
  return $selected_2_factor_method;
 
 
 
481
  }
482
 
 
483
  $wpdb_2fa_methods = array(
484
  "miniOrangeQRCodeAuthentication" => "miniOrange QR Code Authentication",
485
  "miniOrangeSoftToken" => "miniOrange Soft Token",
@@ -488,7 +489,8 @@ class MO2f_Utility {
488
  "AuthyAuthenticator" => "Authy Authenticator",
489
  "SecurityQuestions" => "Security Questions",
490
  "EmailVerification" => "Email Verification",
491
- "OTPOverSMS" => "OTP Over SMS"
 
492
  );
493
 
494
  $server_2fa_methods = array(
@@ -501,7 +503,7 @@ class MO2f_Utility {
501
  "Email Verification" => "OUT OF BAND EMAIL",
502
  "OTP Over SMS" => "SMS",
503
  "EMAIL" => "OTP Over Email",
504
-
505
  );
506
 
507
  $server_to_wpdb_2fa_methods = array(
@@ -512,16 +514,23 @@ class MO2f_Utility {
512
  "KBA" => "Security Questions",
513
  "OUT OF BAND EMAIL" => "Email Verification",
514
  "SMS" => "OTP Over SMS",
515
- "EMAIL" => "OTP Over Email"
 
 
 
 
 
516
  );
517
 
 
518
  if ( $decode_type == "wpdb" ) {
519
- return $wpdb_2fa_methods[ $selected_2_factor_method ];
520
  } else if ( $decode_type == "server" ) {
521
- return $server_2fa_methods[ $selected_2_factor_method ];
522
  } else {
523
- return $server_to_wpdb_2fa_methods[ $selected_2_factor_method ];
524
  }
 
525
 
526
  }
527
 
123
  // setting cookie values
124
  if(is_array($value)){
125
  if($variable == 'mo_2_factor_kba_questions'){
126
+ MO2f_Utility::mo2f_set_cookie_values( 'kba_question1', $value[0]['question']);
127
+ MO2f_Utility::mo2f_set_cookie_values( 'kba_question2', $value[1]['question'] );
128
  }else if($variable == 'mo2f_rba_status'){
129
  MO2f_Utility::mo2f_set_cookie_values( 'mo2f_rba_status_status', $value["status"] );
130
  MO2f_Utility::mo2f_set_cookie_values( 'mo2f_rba_status_sessionUuid', $value["sessionUuid"] );
246
  //update_option('mo2f_data_storage',"sessions");
247
  return $_SESSION[ $variable ];
248
  } else {
 
249
  $key = get_option( 'mo2f_encryption_key' );
250
  $cookie_value = false;
251
  if ( $variable == 'mo2f_rba_status' ) {
269
  $cookie_value = MO2f_Utility::mo2f_get_cookie_values( $variable );
270
  }
271
  if($cookie_value){
 
272
  return $cookie_value;
273
  } else {
274
  $session_id = MO2f_Utility::decrypt_data( $session_id, $key );
276
  if ( in_array( $variable, array( "mo2f_rba_status", "mo_2_factor_kba_questions" ) ) ) {
277
  $db_value = unserialize( $db_value );
278
  }
 
279
  return $db_value;
280
  }
281
  }
475
 
476
  if ( $selected_2_factor_method == 'NONE' ) {
477
  return $selected_2_factor_method;
478
+ }else if($selected_2_factor_method == "OTP Over Email")
479
+ {
480
+ $selected_2_factor_method = "OTPOverEmail";
481
  }
482
 
483
+
484
  $wpdb_2fa_methods = array(
485
  "miniOrangeQRCodeAuthentication" => "miniOrange QR Code Authentication",
486
  "miniOrangeSoftToken" => "miniOrange Soft Token",
489
  "AuthyAuthenticator" => "Authy Authenticator",
490
  "SecurityQuestions" => "Security Questions",
491
  "EmailVerification" => "Email Verification",
492
+ "OTPOverSMS" => "OTP Over SMS",
493
+ "OTPOverEmail" => "OTP Over Email"
494
  );
495
 
496
  $server_2fa_methods = array(
503
  "Email Verification" => "OUT OF BAND EMAIL",
504
  "OTP Over SMS" => "SMS",
505
  "EMAIL" => "OTP Over Email",
506
+ "OTPOverEmail" => "OTP Over Email"
507
  );
508
 
509
  $server_to_wpdb_2fa_methods = array(
514
  "KBA" => "Security Questions",
515
  "OUT OF BAND EMAIL" => "Email Verification",
516
  "SMS" => "OTP Over SMS",
517
+ "EMAIL" => "OTP Over Email",
518
+ "OTPOverEmail" => "OTP Over Email",
519
+ "OTP OVER EMAIL" => "OTP Over Email",
520
+ "OTP Over SMS" => "OTP Over SMS",
521
+ "Security Questions" => "Security Questions",
522
+ "Google Authenticator" => "Google Authenticator"
523
  );
524
 
525
+ $methodname='';
526
  if ( $decode_type == "wpdb" ) {
527
+ $methodname = isset($wpdb_2fa_methods[ $selected_2_factor_method ])?$wpdb_2fa_methods[ $selected_2_factor_method ]:$selected_2_factor_method;
528
  } else if ( $decode_type == "server" ) {
529
+ $methodname = isset($server_2fa_methods[ $selected_2_factor_method ])?$server_2fa_methods[ $selected_2_factor_method ]:$selected_2_factor_method;
530
  } else {
531
+ $methodname = isset($server_to_wpdb_2fa_methods[ $selected_2_factor_method ])?$server_to_wpdb_2fa_methods[ $selected_2_factor_method ]:$selected_2_factor_method;
532
  }
533
+ return $methodname;
534
 
535
  }
536
 
helper/constants.php CHANGED
@@ -11,7 +11,7 @@
11
  const ERR_403 = "403";
12
  const DEFAULT_CUSTOMER_KEY = "16555";
13
  const DEFAULT_API_KEY = "fFd2XcvTGDemZvbw1bcUesNJWEqKbbUq";
14
- const DB_VERSION = 149;
15
  const SUPPORT_EMAIL = 'info@xecurify.com';
16
  const IP_LOOKUP_TEMPLATE = '<span style="font-size:14px;font-weight:bold">GENERAL INFORMATION</span><table style="margin-left:2%;"><tr><td style="width:100px;">Response</td><td >:</td><td>{{status}}</td></tr><tr><td style="width:100px;">IP Address</td><td>:</td><td>{{ip}}</td></tr><tr><td>HostName</td><td>:</td><td>{{hostname}}</td></tr><tr><td>TimeZone</td><td>:</td><td>{{timezone}}</td></tr><tr><td>Time Difference</td><td>:</td><td>{{offset}}</td></tr></table><hr><span style="font-size:14px;font-weight:bold">LOCATION INFORMATION</span><table style="margin-left:2%;"><tr><td>Latitude</td><td>:</td><td>{{latitude}}</td></tr><tr><td>Longitude</td><td>:</td><td>{{longitude}}</td></tr><tr><td>Region</td><td>:</td><td>{{region}}</td></tr><tr><td>Country</td><td>:</td><td>{{country}}</td></tr><tr><td>City</td><td>:</td><td>{{city}}</td></tr><tr><td>Continent</td><td>:</td><td>{{continent}}</td></tr><tr><td>Curreny Code</td><td>:</td><td>{{curreny_code}}</td></tr><tr><td>Curreny Symbol</td><td>:</td><td>{{curreny_symbol}}</td></tr><tr><td>Per Dollar Value</td><td>:</td><td>{{per_dollar_value}}</td></tr></table>';
17
  const CURRENT_BROWSER = '<span style="font-size:10px;color:red;">( Current Browser )</span>';
@@ -30,7 +30,7 @@
30
  public static $country = array('A1' =>'ANONYMOUS PROXY','A2' =>'SATELLITE PROVIDER','O1' =>'OTHER COUNTRY','AF' => 'AFGHANISTAN','AL' => 'ALBANIA','DZ' => 'ALGERIA','AS' => 'AMERICAN SAMOA','AD' => 'ANDORRA','AO' => 'ANGOLA','AI' => 'ANGUILLA','AQ' => 'ANTARCTICA','AG' => 'ANTIGUA AND BARBUDA','AR' => 'ARGENTINA','AM' => 'ARMENIA','AW' => 'ARUBA','AU' => 'AUSTRALIA','AT' => 'AUSTRIA','AZ' => 'AZERBAIJAN','BS' => 'BAHAMAS','BH' => 'BAHRAIN','BD' => 'BANGLADESH','BB' => 'BARBADOS','BY' => 'BELARUS','BE' => 'BELGIUM','BZ' => 'BELIZE','BJ' => 'BENIN','BM' => 'BERMUDA','BT' => 'BHUTAN','BO' => 'BOLIVIA','BA' => 'BOSNIA AND HERZEGOVINA','BW' => 'BOTSWANA','BV' => 'BOUVET ISLAND','BR' => 'BRAZIL','IO' => 'BRITISH INDIAN OCEAN TERRITORY','BN' => 'BRUNEI DARUSSALAM','BG' => 'BULGARIA','BF' => 'BURKINA FASO','BI' => 'BURUNDI','KH' => 'CAMBODIA','CM' => 'CAMEROON','CA' => 'CANADA','CV' => 'CAPE VERDE','KY' => 'CAYMAN ISLANDS','CF' => 'CENTRAL AFRICAN REPUBLIC','TD' => 'CHAD','CL' => 'CHILE','CN' => 'CHINA','CX' => 'CHRISTMAS ISLAND','CC' => 'COCOS (KEELING) ISLANDS','CO' => 'COLOMBIA','KM' => 'COMOROS','CG' => 'CONGO','CD' => 'CONGO, THE DEMOCRATIC REPUBLIC OF THE','CK' => 'COOK ISLANDS','CR' => 'COSTA RICA','CI' => 'COTE D IVOIRE','HR' => 'CROATIA','CU' => 'CUBA','CY' => 'CYPRUS','CZ' => 'CZECH REPUBLIC','DK' => 'DENMARK','DJ' => 'DJIBOUTI','DM' => 'DOMINICA','DO' => 'DOMINICAN REPUBLIC','TP' => 'EAST TIMOR','EC' => 'ECUADOR','EG' => 'EGYPT','SV' => 'EL SALVADOR','GQ' => 'EQUATORIAL GUINEA','ER' => 'ERITREA','EE' => 'ESTONIA','ET' => 'ETHIOPIA','FK' => 'FALKLAND ISLANDS (MALVINAS)','FO' => 'FAROE ISLANDS','FJ' => 'FIJI','FI' => 'FINLAND','FR' => 'FRANCE','GF' => 'FRENCH GUIANA','PF' => 'FRENCH POLYNESIA','TF' => 'FRENCH SOUTHERN TERRITORIES','GA' => 'GABON','GM' => 'GAMBIA','GE' => 'GEORGIA','DE' => 'GERMANY','GH' => 'GHANA','GI' => 'GIBRALTAR','GR' => 'GREECE','GL' => 'GREENLAND','GD' => 'GRENADA','GP' => 'GUADELOUPE','GU' => 'GUAM','GT' => 'GUATEMALA','GN' => 'GUINEA','GW' => 'GUINEA-BISSAU','GY' => 'GUYANA','HT' => 'HAITI','HM' => 'HEARD ISLAND AND MCDONALD ISLANDS','VA' => 'HOLY SEE (VATICAN CITY STATE)','HN' => 'HONDURAS','HK' => 'HONG KONG','HU' => 'HUNGARY','IS' => 'ICELAND','IN' => 'INDIA','ID' => 'INDONESIA','IR' => 'IRAN, ISLAMIC REPUBLIC OF','IQ' => 'IRAQ','IE' => 'IRELAND','IL' => 'ISRAEL','IT' => 'ITALY','JM' => 'JAMAICA','JP' => 'JAPAN','JO' => 'JORDAN','KZ' => 'KAZAKSTAN','KE' => 'KENYA','KI' => 'KIRIBATI','KP' => 'KOREA DEMOCRATIC PEOPLES REPUBLIC OF','KR' => 'KOREA REPUBLIC OF','KW' => 'KUWAIT','KG' => 'KYRGYZSTAN','LA' => 'LAO PEOPLES DEMOCRATIC REPUBLIC','LV' => 'LATVIA','LB' => 'LEBANON','LS' => 'LESOTHO','LR' => 'LIBERIA','LY' => 'LIBYAN ARAB JAMAHIRIYA','LI' => 'LIECHTENSTEIN','LT' => 'LITHUANIA','LU' => 'LUXEMBOURG','MO' => 'MACAU','MK' => 'MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF','MG' => 'MADAGASCAR','MW' => 'MALAWI','MY' => 'MALAYSIA','MV' => 'MALDIVES','ML' => 'MALI','MT' => 'MALTA','MH' => 'MARSHALL ISLANDS','MQ' => 'MARTINIQUE','MR' => 'MAURITANIA','MU' => 'MAURITIUS','YT' => 'MAYOTTE','MX' => 'MEXICO','FM' => 'MICRONESIA, FEDERATED STATES OF','MD' => 'MOLDOVA, REPUBLIC OF','MC' => 'MONACO','MN' => 'MONGOLIA','MS' => 'MONTSERRAT','MA' => 'MOROCCO','MZ' => 'MOZAMBIQUE','MM' => 'MYANMAR','NA' => 'NAMIBIA','NR' => 'NAURU','NP' => 'NEPAL','NL' => 'NETHERLANDS','AN' => 'NETHERLANDS ANTILLES','NC' => 'NEW CALEDONIA','NZ' => 'NEW ZEALAND','NI' => 'NICARAGUA','NE' => 'NIGER','NG' => 'NIGERIA','NU' => 'NIUE','NF' => 'NORFOLK ISLAND','MP' => 'NORTHERN MARIANA ISLANDS','NO' => 'NORWAY','OM' => 'OMAN','PK' => 'PAKISTAN','PW' => 'PALAU','PS' => 'PALESTINIAN TERRITORY, OCCUPIED','PA' => 'PANAMA','PG' => 'PAPUA NEW GUINEA','PY' => 'PARAGUAY','PE' => 'PERU','PH' => 'PHILIPPINES','PN' => 'PITCAIRN','PL' => 'POLAND','PT' => 'PORTUGAL','PR' => 'PUERTO RICO','QA' => 'QATAR','RE' => 'REUNION','RO' => 'ROMANIA','RU' => 'RUSSIAN FEDERATION','RW' => 'RWANDA','SH' => 'SAINT HELENA','KN' => 'SAINT KITTS AND NEVIS','LC' => 'SAINT LUCIA','PM' => 'SAINT PIERRE AND MIQUELON','VC' => 'SAINT VINCENT AND THE GRENADINES','WS' => 'SAMOA','SM' => 'SAN MARINO','ST' => 'SAO TOME AND PRINCIPE','SA' => 'SAUDI ARABIA','SN' => 'SENEGAL','SC' => 'SEYCHELLES','SL' => 'SIERRA LEONE','SG' => 'SINGAPORE','SK' => 'SLOVAKIA','SI' => 'SLOVENIA','SB' => 'SOLOMON ISLANDS','SO' => 'SOMALIA','ZA' => 'SOUTH AFRICA','GS' => 'SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS','ES' => 'SPAIN','LK' => 'SRI LANKA','SD' => 'SUDAN','SR' => 'SURINAME','SJ' => 'SVALBARD AND JAN MAYEN','SZ' => 'SWAZILAND','SE' => 'SWEDEN','CH' => 'SWITZERLAND','SY' => 'SYRIAN ARAB REPUBLIC','TW' => 'TAIWAN, PROVINCE OF CHINA','TJ' => 'TAJIKISTAN','TZ' => 'TANZANIA, UNITED REPUBLIC OF','TH' => 'THAILAND','TG' => 'TOGO','TK' => 'TOKELAU','TO' => 'TONGA','TT' => 'TRINIDAD AND TOBAGO','TN' => 'TUNISIA','TR' => 'TURKEY','TM' => 'TURKMENISTAN','TC' => 'TURKS AND CAICOS ISLANDS','TV' => 'TUVALU','UG' => 'UGANDA','UA' => 'UKRAINE','AE' => 'UNITED ARAB EMIRATES','GB' => 'UNITED KINGDOM','US' => 'UNITED STATES','UM' => 'UNITED STATES MINOR OUTLYING ISLANDS','UY' => 'URUGUAY','UZ' => 'UZBEKISTAN','VU' => 'VANUATU','VE' => 'VENEZUELA','VN' => 'VIET NAM','VG' => 'VIRGIN ISLANDS, BRITISH','VI' => 'VIRGIN ISLANDS, U.S.','WF' => 'WALLIS AND FUTUNA','EH' => 'WESTERN SAHARA','YE' => 'YEMEN','YU' => 'YUGOSLAVIA','ZM' => 'ZAMBIA','ZW' => 'ZIMBABWE');
31
 
32
  const RECAPTCHA_VERIFY = 'https://www.google.com/recaptcha/api/siteverify';
33
-
34
  const LOGIN_ATTEMPTS_EXCEEDED = "User exceeded allowed login attempts.";
35
  const BLOCKED_BY_ADMIN = "Blocked by Admin";
36
  const IP_RANGE_BLOCKING = "IP Range Blocking";
11
  const ERR_403 = "403";
12
  const DEFAULT_CUSTOMER_KEY = "16555";
13
  const DEFAULT_API_KEY = "fFd2XcvTGDemZvbw1bcUesNJWEqKbbUq";
14
+ const DB_VERSION = 150;
15
  const SUPPORT_EMAIL = 'info@xecurify.com';
16
  const IP_LOOKUP_TEMPLATE = '<span style="font-size:14px;font-weight:bold">GENERAL INFORMATION</span><table style="margin-left:2%;"><tr><td style="width:100px;">Response</td><td >:</td><td>{{status}}</td></tr><tr><td style="width:100px;">IP Address</td><td>:</td><td>{{ip}}</td></tr><tr><td>HostName</td><td>:</td><td>{{hostname}}</td></tr><tr><td>TimeZone</td><td>:</td><td>{{timezone}}</td></tr><tr><td>Time Difference</td><td>:</td><td>{{offset}}</td></tr></table><hr><span style="font-size:14px;font-weight:bold">LOCATION INFORMATION</span><table style="margin-left:2%;"><tr><td>Latitude</td><td>:</td><td>{{latitude}}</td></tr><tr><td>Longitude</td><td>:</td><td>{{longitude}}</td></tr><tr><td>Region</td><td>:</td><td>{{region}}</td></tr><tr><td>Country</td><td>:</td><td>{{country}}</td></tr><tr><td>City</td><td>:</td><td>{{city}}</td></tr><tr><td>Continent</td><td>:</td><td>{{continent}}</td></tr><tr><td>Curreny Code</td><td>:</td><td>{{curreny_code}}</td></tr><tr><td>Curreny Symbol</td><td>:</td><td>{{curreny_symbol}}</td></tr><tr><td>Per Dollar Value</td><td>:</td><td>{{per_dollar_value}}</td></tr></table>';
17
  const CURRENT_BROWSER = '<span style="font-size:10px;color:red;">( Current Browser )</span>';
30
  public static $country = array('A1' =>'ANONYMOUS PROXY','A2' =>'SATELLITE PROVIDER','O1' =>'OTHER COUNTRY','AF' => 'AFGHANISTAN','AL' => 'ALBANIA','DZ' => 'ALGERIA','AS' => 'AMERICAN SAMOA','AD' => 'ANDORRA','AO' => 'ANGOLA','AI' => 'ANGUILLA','AQ' => 'ANTARCTICA','AG' => 'ANTIGUA AND BARBUDA','AR' => 'ARGENTINA','AM' => 'ARMENIA','AW' => 'ARUBA','AU' => 'AUSTRALIA','AT' => 'AUSTRIA','AZ' => 'AZERBAIJAN','BS' => 'BAHAMAS','BH' => 'BAHRAIN','BD' => 'BANGLADESH','BB' => 'BARBADOS','BY' => 'BELARUS','BE' => 'BELGIUM','BZ' => 'BELIZE','BJ' => 'BENIN','BM' => 'BERMUDA','BT' => 'BHUTAN','BO' => 'BOLIVIA','BA' => 'BOSNIA AND HERZEGOVINA','BW' => 'BOTSWANA','BV' => 'BOUVET ISLAND','BR' => 'BRAZIL','IO' => 'BRITISH INDIAN OCEAN TERRITORY','BN' => 'BRUNEI DARUSSALAM','BG' => 'BULGARIA','BF' => 'BURKINA FASO','BI' => 'BURUNDI','KH' => 'CAMBODIA','CM' => 'CAMEROON','CA' => 'CANADA','CV' => 'CAPE VERDE','KY' => 'CAYMAN ISLANDS','CF' => 'CENTRAL AFRICAN REPUBLIC','TD' => 'CHAD','CL' => 'CHILE','CN' => 'CHINA','CX' => 'CHRISTMAS ISLAND','CC' => 'COCOS (KEELING) ISLANDS','CO' => 'COLOMBIA','KM' => 'COMOROS','CG' => 'CONGO','CD' => 'CONGO, THE DEMOCRATIC REPUBLIC OF THE','CK' => 'COOK ISLANDS','CR' => 'COSTA RICA','CI' => 'COTE D IVOIRE','HR' => 'CROATIA','CU' => 'CUBA','CY' => 'CYPRUS','CZ' => 'CZECH REPUBLIC','DK' => 'DENMARK','DJ' => 'DJIBOUTI','DM' => 'DOMINICA','DO' => 'DOMINICAN REPUBLIC','TP' => 'EAST TIMOR','EC' => 'ECUADOR','EG' => 'EGYPT','SV' => 'EL SALVADOR','GQ' => 'EQUATORIAL GUINEA','ER' => 'ERITREA','EE' => 'ESTONIA','ET' => 'ETHIOPIA','FK' => 'FALKLAND ISLANDS (MALVINAS)','FO' => 'FAROE ISLANDS','FJ' => 'FIJI','FI' => 'FINLAND','FR' => 'FRANCE','GF' => 'FRENCH GUIANA','PF' => 'FRENCH POLYNESIA','TF' => 'FRENCH SOUTHERN TERRITORIES','GA' => 'GABON','GM' => 'GAMBIA','GE' => 'GEORGIA','DE' => 'GERMANY','GH' => 'GHANA','GI' => 'GIBRALTAR','GR' => 'GREECE','GL' => 'GREENLAND','GD' => 'GRENADA','GP' => 'GUADELOUPE','GU' => 'GUAM','GT' => 'GUATEMALA','GN' => 'GUINEA','GW' => 'GUINEA-BISSAU','GY' => 'GUYANA','HT' => 'HAITI','HM' => 'HEARD ISLAND AND MCDONALD ISLANDS','VA' => 'HOLY SEE (VATICAN CITY STATE)','HN' => 'HONDURAS','HK' => 'HONG KONG','HU' => 'HUNGARY','IS' => 'ICELAND','IN' => 'INDIA','ID' => 'INDONESIA','IR' => 'IRAN, ISLAMIC REPUBLIC OF','IQ' => 'IRAQ','IE' => 'IRELAND','IL' => 'ISRAEL','IT' => 'ITALY','JM' => 'JAMAICA','JP' => 'JAPAN','JO' => 'JORDAN','KZ' => 'KAZAKSTAN','KE' => 'KENYA','KI' => 'KIRIBATI','KP' => 'KOREA DEMOCRATIC PEOPLES REPUBLIC OF','KR' => 'KOREA REPUBLIC OF','KW' => 'KUWAIT','KG' => 'KYRGYZSTAN','LA' => 'LAO PEOPLES DEMOCRATIC REPUBLIC','LV' => 'LATVIA','LB' => 'LEBANON','LS' => 'LESOTHO','LR' => 'LIBERIA','LY' => 'LIBYAN ARAB JAMAHIRIYA','LI' => 'LIECHTENSTEIN','LT' => 'LITHUANIA','LU' => 'LUXEMBOURG','MO' => 'MACAU','MK' => 'MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF','MG' => 'MADAGASCAR','MW' => 'MALAWI','MY' => 'MALAYSIA','MV' => 'MALDIVES','ML' => 'MALI','MT' => 'MALTA','MH' => 'MARSHALL ISLANDS','MQ' => 'MARTINIQUE','MR' => 'MAURITANIA','MU' => 'MAURITIUS','YT' => 'MAYOTTE','MX' => 'MEXICO','FM' => 'MICRONESIA, FEDERATED STATES OF','MD' => 'MOLDOVA, REPUBLIC OF','MC' => 'MONACO','MN' => 'MONGOLIA','MS' => 'MONTSERRAT','MA' => 'MOROCCO','MZ' => 'MOZAMBIQUE','MM' => 'MYANMAR','NA' => 'NAMIBIA','NR' => 'NAURU','NP' => 'NEPAL','NL' => 'NETHERLANDS','AN' => 'NETHERLANDS ANTILLES','NC' => 'NEW CALEDONIA','NZ' => 'NEW ZEALAND','NI' => 'NICARAGUA','NE' => 'NIGER','NG' => 'NIGERIA','NU' => 'NIUE','NF' => 'NORFOLK ISLAND','MP' => 'NORTHERN MARIANA ISLANDS','NO' => 'NORWAY','OM' => 'OMAN','PK' => 'PAKISTAN','PW' => 'PALAU','PS' => 'PALESTINIAN TERRITORY, OCCUPIED','PA' => 'PANAMA','PG' => 'PAPUA NEW GUINEA','PY' => 'PARAGUAY','PE' => 'PERU','PH' => 'PHILIPPINES','PN' => 'PITCAIRN','PL' => 'POLAND','PT' => 'PORTUGAL','PR' => 'PUERTO RICO','QA' => 'QATAR','RE' => 'REUNION','RO' => 'ROMANIA','RU' => 'RUSSIAN FEDERATION','RW' => 'RWANDA','SH' => 'SAINT HELENA','KN' => 'SAINT KITTS AND NEVIS','LC' => 'SAINT LUCIA','PM' => 'SAINT PIERRE AND MIQUELON','VC' => 'SAINT VINCENT AND THE GRENADINES','WS' => 'SAMOA','SM' => 'SAN MARINO','ST' => 'SAO TOME AND PRINCIPE','SA' => 'SAUDI ARABIA','SN' => 'SENEGAL','SC' => 'SEYCHELLES','SL' => 'SIERRA LEONE','SG' => 'SINGAPORE','SK' => 'SLOVAKIA','SI' => 'SLOVENIA','SB' => 'SOLOMON ISLANDS','SO' => 'SOMALIA','ZA' => 'SOUTH AFRICA','GS' => 'SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS','ES' => 'SPAIN','LK' => 'SRI LANKA','SD' => 'SUDAN','SR' => 'SURINAME','SJ' => 'SVALBARD AND JAN MAYEN','SZ' => 'SWAZILAND','SE' => 'SWEDEN','CH' => 'SWITZERLAND','SY' => 'SYRIAN ARAB REPUBLIC','TW' => 'TAIWAN, PROVINCE OF CHINA','TJ' => 'TAJIKISTAN','TZ' => 'TANZANIA, UNITED REPUBLIC OF','TH' => 'THAILAND','TG' => 'TOGO','TK' => 'TOKELAU','TO' => 'TONGA','TT' => 'TRINIDAD AND TOBAGO','TN' => 'TUNISIA','TR' => 'TURKEY','TM' => 'TURKMENISTAN','TC' => 'TURKS AND CAICOS ISLANDS','TV' => 'TUVALU','UG' => 'UGANDA','UA' => 'UKRAINE','AE' => 'UNITED ARAB EMIRATES','GB' => 'UNITED KINGDOM','US' => 'UNITED STATES','UM' => 'UNITED STATES MINOR OUTLYING ISLANDS','UY' => 'URUGUAY','UZ' => 'UZBEKISTAN','VU' => 'VANUATU','VE' => 'VENEZUELA','VN' => 'VIET NAM','VG' => 'VIRGIN ISLANDS, BRITISH','VI' => 'VIRGIN ISLANDS, U.S.','WF' => 'WALLIS AND FUTUNA','EH' => 'WESTERN SAHARA','YE' => 'YEMEN','YU' => 'YUGOSLAVIA','ZM' => 'ZAMBIA','ZW' => 'ZIMBABWE');
31
 
32
  const RECAPTCHA_VERIFY = 'https://www.google.com/recaptcha/api/siteverify';
33
+ const FAQ_PAYMENT_URL = 'https://faq.miniorange.com/knowledgebase/all-i-want-to-do-is-upgrade-to-a-premium-licence/';
34
  const LOGIN_ATTEMPTS_EXCEEDED = "User exceeded allowed login attempts.";
35
  const BLOCKED_BY_ADMIN = "Blocked by Admin";
36
  const IP_RANGE_BLOCKING = "IP Range Blocking";
helper/curl.php CHANGED
@@ -9,6 +9,7 @@ class MocURL
9
  $fields = array (
10
  'companyName' => $company,
11
  'areaOfInterest' => 'WordPress 2 Factor Authentication Plugin',
 
12
  'firstname' => $first_name,
13
  'lastname' => $last_name,
14
  'email' => $email,
@@ -187,6 +188,10 @@ class MocURL
187
  {
188
  $subject = "Feedback: WordPress miniOrange 2-Factor Plugin - ". $email;;
189
  }
 
 
 
 
190
 
191
  $user = wp_get_current_user();
192
 
@@ -216,8 +221,8 @@ class MocURL
216
  'customerKey' => $customerKey,
217
  'fromEmail' => $fromEmail,
218
  'fromName' => 'Xecurify',
219
- 'toEmail' => '2fasupport@xecurify.com',
220
- 'toName' => '2fasupport@xecurify.com',
221
  'subject' => $subject,
222
  'content' => $content
223
  ),
9
  $fields = array (
10
  'companyName' => $company,
11
  'areaOfInterest' => 'WordPress 2 Factor Authentication Plugin',
12
+ 'productInterest' => 'API_2FA',
13
  'firstname' => $first_name,
14
  'lastname' => $last_name,
15
  'email' => $email,
188
  {
189
  $subject = "Feedback: WordPress miniOrange 2-Factor Plugin - ". $email;;
190
  }
191
+ elseif ($feedback_option == 'mo_wpns_rating')
192
+ {
193
+ $subject = "Feedback: WordPress miniOrange 2-Factor Plugin - ". $email;;
194
+ }
195
 
196
  $user = wp_get_current_user();
197
 
221
  'customerKey' => $customerKey,
222
  'fromEmail' => $fromEmail,
223
  'fromName' => 'Xecurify',
224
+ 'toEmail' => 'akansha@xecurify.com',
225
+ 'toName' => 'akansha@xecurify.com',
226
  'subject' => $subject,
227
  'content' => $content
228
  ),
helper/dashboard_security_notification.php CHANGED
@@ -10,6 +10,7 @@ class miniorange_security_notification{
10
  }
11
 
12
  function custom_dashboard_help() {
 
13
  global $wpdb,$type_of_scan,$total_scanned_files, $wpnsDbQueries;
14
 
15
 
@@ -64,17 +65,53 @@ class miniorange_security_notification{
64
 
65
  if(current_user_can('administrator'))
66
  {
 
 
 
 
67
 
68
- echo "<html>
69
- <head>
70
- <style>
71
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
 
73
- p{
74
- margin:0px;
75
-
76
- </style>
77
- </head>
 
 
 
 
 
 
 
 
78
 
79
  <div style='width:100%;background-color:#555f5f;padding-top:10px;''>
80
  <div style='font-size:25px;color:white;text-align:center'>
@@ -214,7 +251,7 @@ class miniorange_security_notification{
214
  </div>";
215
 
216
 
217
-
218
 
219
  }
220
 
10
  }
11
 
12
  function custom_dashboard_help() {
13
+
14
  global $wpdb,$type_of_scan,$total_scanned_files, $wpnsDbQueries;
15
 
16
 
65
 
66
  if(current_user_can('administrator'))
67
  {
68
+ echo "<html>
69
+ <head>
70
+ <style>
71
+
72
 
73
+ p{
74
+ margin:0px;
75
+
76
+ </style>
77
+ </head>
78
+
79
+ <div style='width:100%;background-color:#555f5f;padding-top:10px;''>
80
+ <div style='font-size:25px;color:white;text-align:center'>
81
+ <strong style='font-weight:300;color:red;'>Remaining Transactions</strong>
82
+ </div>";
83
+
84
+ $EmailTransactions = get_site_option('cmVtYWluaW5nT1RQ')? get_site_option('cmVtYWluaW5nT1RQ') : 0;
85
+ $SMSTransactions = get_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z')?get_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z'):0;
86
+ // $color_tras_sms = $SMSTransactions <= 2 ? 'red' : '#17ede9';
87
+ // $color_tras_email = $EmailTransactions <= 2 ? 'red' : '#17ede9';
88
+
89
+ $color_tras_sms = 'white';
90
+ $color_tras_email = 'white';
91
+
92
+ echo '<table border="1" style="background-color:#FFFFFF; border:1px solid #CCCCCC; border-collapse: collapse; padding:0px 0px 0px 10px; margin:2px; width:99%">
93
+ <tr>
94
+ <td style="width:45%; padding: 10px;background-color:white">Remaining SMS transactions</td>
95
+ <td style="width:15%; padding: 10px;background-color:'.$color_tras_sms.'">'.$SMSTransactions.'</td>
96
+ </tr>
97
+ <tr>
98
+ <td style="width:45%; padding: 10px;background-color:white">Remaining Email transactions</td>
99
+ <td style="width:15%; padding: 10px;background-color:'.$color_tras_email.'">'.$EmailTransactions.'</td>
100
+ </tr>
101
 
102
+ </table><br>';
103
+
104
+
105
+
106
+ echo "</div>
107
+
108
+ <br><br>
109
+ ";
110
+
111
+ if(get_option("mo_wpns_2fa_with_network_security"))
112
+ {
113
+
114
+ echo "
115
 
116
  <div style='width:100%;background-color:#555f5f;padding-top:10px;''>
117
  <div style='font-size:25px;color:white;text-align:center'>
251
  </div>";
252
 
253
 
254
+ }
255
 
256
  }
257
 
helper/messages.php CHANGED
@@ -78,6 +78,8 @@
78
  const FEEDBACK = "<div class='custom-notice notice notice-warning feedback-notice'><p><p class='notice-message'>Looking for a feature? Help us make the plugin better. Send us your feedback using the Support Form below.</p><button class='feedback notice-button'><i>Dismiss</i></button></p></div>";
79
  const WHITELIST_SELF = "<div class='custom-notice notice notice-warning whitelistself-notice'><p><p class='notice-message'>It looks like you have not whitelisted your IP. Whitelist your IP as you can get blocked from your site.</p><button class='whitelist_self notice-button'><i>WhiteList</i></button></p></div>";
80
 
 
 
81
  //registration messages
82
  const PASS_LENGTH = "Choose a password with minimum length 6.";
83
  const ERR_OTP_EMAIL = "There was an error in sending email. Please click on Resend OTP to try again.";
@@ -125,6 +127,9 @@
125
  const INFECTED_FILE = "<div class='custom-notice notice notice-warning file_infected-notice'><p><p class='notice-message'>Your last scan found infections/warnings on your website. Kindly fix them to avoid any threats.</p><a class='notice-button' href='admin.php?page=mo_2fa_malwarescan' style='margin-right: 15px;'>SCAN</a><button class='infected_file_dismiss notice-button' style='margin-right: 15px;'><i>DISMISS</i></button><button class='infected_file_dismiss_always notice-button'><i>NEVER SHOW AGAIN</i></button></p></div>";
126
  const WEEKLY_SCAN_CHECK = "<div class='custom-notice notice notice-warning weekly_notice-notice'><p><p class='notice-message'>You last scanned your website a week ago. Scan now to imrove security.</p><a class='notice-button' href='admin.php?page=mo_2fa_malwarescan' style='margin-right: 15px;'>SCAN</a><button class='weekly_dismiss notice-button' style='margin-right: 15px;'><i>DISMISS</i></button><button class='weekly_dismiss_always notice-button'><i>NEVER SHOW AGAIN</i></button></p></div>";
127
 
 
 
 
128
 
129
 
130
  public static function showMessage($message , $data=array())
78
  const FEEDBACK = "<div class='custom-notice notice notice-warning feedback-notice'><p><p class='notice-message'>Looking for a feature? Help us make the plugin better. Send us your feedback using the Support Form below.</p><button class='feedback notice-button'><i>Dismiss</i></button></p></div>";
79
  const WHITELIST_SELF = "<div class='custom-notice notice notice-warning whitelistself-notice'><p><p class='notice-message'>It looks like you have not whitelisted your IP. Whitelist your IP as you can get blocked from your site.</p><button class='whitelist_self notice-button'><i>WhiteList</i></button></p></div>";
80
 
81
+ const CLOUD2FA_SINGLEUSER = "<div class='custom-notice notice notice-warning whitelistself-notice'><p><p class='notice-message'>The current solution is cloud which supports 2-factor for only one user. Either upgrade your plan or contact your administrator.</p></p></div>";
82
+
83
  //registration messages
84
  const PASS_LENGTH = "Choose a password with minimum length 6.";
85
  const ERR_OTP_EMAIL = "There was an error in sending email. Please click on Resend OTP to try again.";
127
  const INFECTED_FILE = "<div class='custom-notice notice notice-warning file_infected-notice'><p><p class='notice-message'>Your last scan found infections/warnings on your website. Kindly fix them to avoid any threats.</p><a class='notice-button' href='admin.php?page=mo_2fa_malwarescan' style='margin-right: 15px;'>SCAN</a><button class='infected_file_dismiss notice-button' style='margin-right: 15px;'><i>DISMISS</i></button><button class='infected_file_dismiss_always notice-button'><i>NEVER SHOW AGAIN</i></button></p></div>";
128
  const WEEKLY_SCAN_CHECK = "<div class='custom-notice notice notice-warning weekly_notice-notice'><p><p class='notice-message'>You last scanned your website a week ago. Scan now to imrove security.</p><a class='notice-button' href='admin.php?page=mo_2fa_malwarescan' style='margin-right: 15px;'>SCAN</a><button class='weekly_dismiss notice-button' style='margin-right: 15px;'><i>DISMISS</i></button><button class='weekly_dismiss_always notice-button'><i>NEVER SHOW AGAIN</i></button></p></div>";
129
 
130
+ const LOW_SMS_TRANSACTIONS = "<div class='custom-notice notice notice-warning new_plugin_theme-notice'><p><p class='notice-message'>You have left very few SMS transaction. Please upgrade to premium plan for non stop usage.</p><button class='new_plugin_dismiss notice-button' style='margin-right: 15px;'><i>DISMISS</i></button><button class='new_plugin_dismiss_always notice-button'><i>NEVER SHOW AGAIN</i></button></p></div>";
131
+
132
+ const LOW_EMAIL_TRANSACTIONS = "<div class='custom-notice notice notice-warning new_plugin_theme-notice'><p><p class='notice-message'>You have left very few Email transaction. Please upgrade to premium plan for non stop usage.</p><button class='new_plugin_dismiss notice-button' style='margin-right: 15px;'><i>DISMISS</i></button><button class='new_plugin_dismiss_always notice-button'><i>NEVER SHOW AGAIN</i></button></p></div>";
133
 
134
 
135
  public static function showMessage($message , $data=array())
helper/pluginUtility.php CHANGED
@@ -375,8 +375,8 @@ class MoWpnsHandler
375
  function move_failed_transactions_to_past_failed($ipAddress)
376
  {
377
  global $wpnsDbQueries;
378
- $wpnsDbQueries->update_transaction_table(array('status'=>MoWpnsConstants::FAILED),
379
- array('ip_address'=>$ipAddress,'status'=>MoWpnsConstants::PAST_FAILED));
380
  }
381
 
382
  function remove_failed_transactions($ipAddress)
375
  function move_failed_transactions_to_past_failed($ipAddress)
376
  {
377
  global $wpnsDbQueries;
378
+ $wpnsDbQueries->update_transaction_table(array('status'=>MoWpnsConstants::FAILED,'ip_address'=>$ipAddress),
379
+ array('status'=>MoWpnsConstants::PAST_FAILED));
380
  }
381
 
382
  function remove_failed_transactions($ipAddress)
includes/css/bootstrap.min.css CHANGED
@@ -1,1875 +1,5735 @@
1
  .mo2f_carousel {
 
 
2
  position: relative;
 
 
3
  padding-bottom: 18px !important;
4
 
 
 
 
 
5
  }
6
 
 
 
 
 
7
  .mo2f_carousel-inner {
 
 
8
  position: relative;
 
 
9
  width: 100%;
 
 
10
  overflow: hidden;
11
 
 
 
 
 
12
  }
13
 
 
 
 
 
14
  .mo2f_carousel-inner > .item {
 
 
15
  position: relative;
 
 
16
  display: none;
 
 
17
  -webkit-transition: .6s ease-in-out left;
 
 
18
  -o-transition: .6s ease-in-out left;
 
 
19
  transition: .6s ease-in-out left;
 
 
20
  height: 300px !important;
21
 
 
 
 
 
22
  }
23
 
 
 
 
 
24
  .mo2f_carousel-inner > .item > img, .mo2f_carousel-inner > .item > a > img {
 
 
25
  line-height: 1;
26
 
 
 
 
 
27
  max-height: 300px !important;
 
 
28
  max-width: 600px !important;
 
 
29
  }
30
 
 
 
 
 
31
  @media all and (transform-3d) , ( -webkit-transform-3d ) {
 
 
32
  .mo2f_carousel-inner > .item {
 
 
33
  -webkit-transition: -webkit-transform .6s ease-in-out;
 
 
34
  -o-transition: -o-transform .6s ease-in-out;
 
 
35
  transition: transform .6s ease-in-out;
 
 
36
  -webkit-backface-visibility: hidden;
 
 
37
  backface-visibility: hidden;
 
 
38
  -webkit-perspective: 1000;
 
 
39
  perspective: 1000
 
 
40
  }
41
 
 
 
 
 
42
  .mo2f_carousel-inner > .item.next, .mo2f_carousel-inner > .item.active.right {
 
 
43
  left: 0;
 
 
44
  -webkit-transform: translate3d(100%, 0, 0);
 
 
45
  transform: translate3d(100%, 0, 0)
 
 
46
  }
47
 
 
 
 
 
48
  .mo2f_carousel-inner > .item.prev, .mo2f_carousel-inner > .item.active.left {
 
 
49
  left: 0;
 
 
50
  -webkit-transform: translate3d(-100%, 0, 0);
 
 
51
  transform: translate3d(-100%, 0, 0)
 
 
52
  }
53
 
 
 
 
 
54
  .mo2f_carousel-inner > .item.next.left, .mo2f_carousel-inner > .item.prev.right, .mo2f_carousel-inner > .item.active {
 
 
55
  left: 0;
 
 
56
  -webkit-transform: translate3d(0, 0, 0);
 
 
57
  transform: translate3d(0, 0, 0)
 
 
58
  }
 
 
59
  }
60
 
 
 
 
 
61
  .mo2f_carousel-inner > .active, .mo2f_carousel-inner > .next, .mo2f_carousel-inner > .prev {
 
 
62
  display: block
 
 
63
  }
64
 
 
 
 
 
65
  .mo2f_carousel-inner > .active {
 
 
66
  left: 0
 
 
67
  }
68
 
 
 
 
 
69
  .mo2f_carousel-inner > .next, .mo2f_carousel-inner > .prev {
 
 
70
  position: absolute;
 
 
71
  top: 0;
 
 
72
  width: 100%
 
 
73
  }
74
 
 
 
 
 
75
  .mo2f_carousel-inner > .next {
 
 
76
  left: 100%
 
 
77
  }
78
 
 
 
 
 
79
  .mo2f_carousel-inner > .prev {
 
 
80
  left: -100%
 
 
81
  }
82
 
 
 
 
 
83
  .mo2f_carousel-inner > .next.left, .mo2f_carousel-inner > .prev.right {
 
 
84
  left: 0
 
 
85
  }
86
 
 
 
 
 
87
  .mo2f_carousel-inner > .active.left {
 
 
88
  left: -100%
 
 
89
  }
90
 
 
 
 
 
91
  .mo2f_carousel-inner > .active.right {
 
 
92
  left: 100%
 
 
93
  }
94
 
 
 
 
 
95
  .mo2f_carousel-control {
 
 
96
  position: absolute;
 
 
97
  top: 0;
 
 
98
  bottom: 0;
 
 
99
  left: 0;
 
 
100
  width: 15%;
 
 
101
  font-size: 20px;
 
 
102
  color: #fff;
 
 
103
  text-align: center;
 
 
104
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
 
 
105
  filter: alpha(opacity=50);
 
 
106
  opacity: .5
 
 
107
  }
108
 
 
 
 
 
109
  .mo2f_carousel-control.left {
 
 
110
  background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .5) 0,
 
 
111
  rgba(0, 0, 0, .0001) 100%);
 
 
112
  background-image: -o-linear-gradient(left, rgba(0, 0, 0, .5) 0,
 
 
113
  rgba(0, 0, 0, .0001) 100%);
 
 
114
  background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .5)),
 
 
115
  to(rgba(0, 0, 0, .0001)));
 
 
116
  background-image: linear-gradient(to right, rgba(0, 0, 0, .5) 0,
 
 
117
  rgba(0, 0, 0, .0001) 100%);
 
 
118
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000',
 
 
119
  endColorstr='#00000000', GradientType=1);
 
 
120
  background-repeat: repeat-x
 
 
121
  }
122
 
 
 
 
 
123
  .mo2f_carousel-control.right {
 
 
124
  right: 0;
 
 
125
  left: auto;
 
 
126
  background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .0001) 0,
 
 
127
  rgba(0, 0, 0, .5) 100%);
 
 
128
  background-image: -o-linear-gradient(left, rgba(0, 0, 0, .0001) 0,
 
 
129
  rgba(0, 0, 0, .5) 100%);
 
 
130
  background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .0001)),
 
 
131
  to(rgba(0, 0, 0, .5)));
 
 
132
  background-image: linear-gradient(to right, rgba(0, 0, 0, .0001) 0,
 
 
133
  rgba(0, 0, 0, .5) 100%);
 
 
134
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000',
 
 
135
  endColorstr='#80000000', GradientType=1);
 
 
136
  background-repeat: repeat-x
 
 
137
  }
138
 
 
 
 
 
139
  .mo2f_carousel-control:hover, .mo2f_carousel-control:focus {
 
 
140
  color: #fff;
 
 
141
  text-decoration: none;
 
 
142
  filter: alpha(opacity=90);
 
 
143
  outline: 0;
 
 
144
  opacity: .9
 
 
145
  }
146
 
 
 
 
 
147
  .mo2f_carousel-control .icon-prev, .mo2f_carousel-control .icon-next, .mo2f_carousel-control .glyphicon-chevron-left, .mo2f_carousel-control .glyphicon-chevron-right {
 
 
148
  position: absolute;
 
 
149
  top: 50%;
 
 
150
  z-index: 5;
 
 
151
  display: inline-block
 
 
152
  }
153
 
 
 
 
 
154
  .mo2f_carousel-control .icon-prev, .mo2f_carousel-control .glyphicon-chevron-left {
 
 
155
  left: 50%;
 
 
156
  margin-left: -10px
 
 
157
  }
158
 
 
 
 
 
159
  .mo2f_carousel-control .icon-next, .mo2f_carousel-control .glyphicon-chevron-right {
 
 
160
  right: 50%;
 
 
161
  margin-right: -10px
 
 
162
  }
163
 
 
 
 
 
164
  .mo2f_carousel-control .icon-prev, .mo2f_carousel-control .icon-next {
 
 
165
  width: 20px;
 
 
166
  height: 20px;
 
 
167
  margin-top: -10px;
 
 
168
  font-family: serif
 
 
169
  }
170
 
 
 
 
 
171
  .mo2f_carousel-control .icon-prev:before {
 
 
172
  content: '\2039'
 
 
173
  }
174
 
 
 
 
 
175
  .mo2f_carousel-control .icon-next:before {
 
 
176
  content: '\203a'
 
 
177
  }
178
 
 
 
 
 
179
  .mo2f_carousel-indicators {
 
 
180
  position: absolute;
 
 
181
  bottom: -25px;
 
 
182
  left: 50%;
 
 
183
  z-index: 15;
 
 
184
  width: 60%;
 
 
185
  padding-left: 0;
 
 
186
  margin-left: -30%;
 
 
187
  text-align: center;
 
 
188
  list-style: none
 
 
189
  }
190
 
 
 
 
 
191
  .mo2f_carousel-indicators li {
 
 
192
  display: inline-block;
 
 
193
  width: 10px;
 
 
194
  height: 10px;
 
 
195
  margin: 1px;
 
 
196
  text-indent: -999px;
 
 
197
  cursor: pointer;
 
 
198
  background-color: #0 \9;
 
 
199
  background-color: rgba(0, 0, 0, 0);
 
 
200
  border: 1px solid #0073aa;
 
 
201
  border-radius: 10px
 
 
202
  }
203
 
 
 
 
 
204
  .mo2f_carousel-indicators .active {
 
 
205
  width: 12px;
 
 
206
  height: 12px;
 
 
207
  margin: 0;
 
 
208
  background-color: #0073aa;
 
 
209
  }
210
 
 
 
 
 
211
  .mo2f_carousel-caption {
 
 
212
  position: absolute;
 
 
213
  right: 15%;
 
 
214
  bottom: 20px;
 
 
215
  left: 15%;
 
 
216
  z-index: 10;
 
 
217
  padding-top: 20px;
 
 
218
  padding-bottom: 20px;
 
 
219
  color: #fff;
 
 
220
  text-align: center;
 
 
221
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6)
 
 
222
  }
223
 
 
 
 
 
224
  .mo2f_carousel-caption .btn {
 
 
225
  text-shadow: none
 
 
226
  }
227
 
 
 
 
 
228
  @media screen and (min-width: 768px) {
 
 
229
  .mo2f_carousel-control .glyphicon-chevron-left, .mo2f_carousel-control .glyphicon-chevron-right, .mo2f_carousel-control .icon-prev, .mo2f_carousel-control .icon-next {
 
 
230
  width: 30px;
 
 
231
  height: 30px;
 
 
232
  margin-top: -15px;
 
 
233
  font-size: 30px
 
 
234
  }
235
 
 
 
 
 
236
  .mo2f_carousel-control .glyphicon-chevron-left, .mo2f_carousel-control .icon-prev {
 
 
237
  margin-left: -15px
 
 
238
  }
239
 
 
 
 
 
240
  .mo2f_carousel-control .glyphicon-chevron-right, .mo2f_carousel-control .icon-next {
 
 
241
  margin-right: -15px
 
 
242
  }
243
 
 
 
 
 
244
  .mo2f_carousel-caption {
 
 
245
  right: 20%;
 
 
246
  left: 20%;
 
 
247
  padding-bottom: 30px
 
 
248
  }
249
 
 
 
 
 
250
  .mo2f_carousel-indicators {
 
 
251
  bottom: -14px
 
 
252
  }
 
 
253
  }
254
 
 
 
 
 
255
  .hidden {
 
 
256
  display: none;
 
 
257
  }
258
 
 
 
 
 
259
  .float-right {
 
 
260
  text-align: right;
 
 
261
  }
262
 
 
 
 
 
263
  .mo2f_collapse {
 
 
264
  display: none;
 
 
265
  / / visibility: hidden;
 
 
266
  font-size: 14px !important;
267
 
 
 
 
 
268
  }
269
 
 
 
 
 
270
  .mo2f_collapse.in {
 
 
271
  display: block;
 
 
272
  visibility: visible;
273
 
 
 
 
 
274
  }
275
 
 
 
 
 
276
  .mo2f_collapsing {
 
 
277
  position: relative;
 
 
278
  font-size: 14px !important;
 
 
279
  height: 0;
 
 
280
  overflow: hidden;
 
 
281
  -webkit-transition-timing-function: ease;
 
 
282
  -o-transition-timing-function: ease;
 
 
283
  transition-timing-function: ease;
 
 
284
  -webkit-transition-duration: .20s;
 
 
285
  -o-transition-duration: .20s;
 
 
286
  transition-duration: .20s;
 
 
287
  -webkit-transition-property: height, visibility;
 
 
288
  -o-transition-property: height, visibility;
 
 
289
  transition-property: height, visibility
 
 
290
  }
291
 
 
 
 
 
292
  .mo2f_thumbnail {
 
 
293
  width: 315px;
 
 
294
  margin-bottom: 10px;
 
 
295
  position: relative;
 
 
296
  background-color: #fff;
 
 
297
  border: 1px solid #ddd;
 
 
298
  -webkit-transition: border .2s ease-in-out;
 
 
299
  -o-transition: border .2s ease-in-out;
 
 
300
  transition: border .2s ease-in-out
 
 
301
  }
302
 
 
 
 
 
303
  .mo2f_thumbnail > img, .mo2f_thumbnail a > img {
 
 
304
  margin-right: auto;
 
 
305
  margin-left: auto
 
 
306
  }
307
 
 
 
 
 
308
  a.mo2f_thumbnail:hover, a.mo2f_thumbnail:focus, a.mo2f_thumbnail.active {
 
 
309
  border-color: #337ab7
 
 
310
  }
311
 
 
 
 
 
312
  .mo2f_thumbnail .caption {
 
 
313
  padding: 9px;
 
 
314
  color: #333
 
 
315
  }
316
 
 
 
 
 
317
  .mo2f_thumbnail label {
 
 
318
  font-weight: bold;
319
 
 
 
 
 
320
  }
321
 
 
 
 
 
322
  .mo2f_close {
 
 
323
  float: right;
 
 
324
  font-size: 21px;
 
 
325
  font-weight: 700;
 
 
326
  line-height: 1;
 
 
327
  color: #000;
 
 
328
  text-shadow: 0 1px 0 #fff;
 
 
329
  filter: alpha(opacity=20);
 
 
330
  opacity: .2
 
 
331
  }
332
 
 
 
 
 
333
  .mo2f_close:hover, .mo2f_close:focus {
 
 
334
  color: #000;
 
 
335
  text-decoration: none;
 
 
336
  cursor: pointer;
 
 
337
  filter: alpha(opacity=50);
 
 
338
  opacity: .5
 
 
339
  }
340
 
 
 
 
 
341
  button.mo2f_close {
 
 
342
  -webkit-appearance: none;
 
 
343
  padding: 0;
 
 
344
  cursor: pointer;
 
 
345
  background: 0 0;
 
 
346
  border: 0
 
 
347
  }
348
 
 
 
 
 
349
  .mo2f_modal-open {
 
 
350
  overflow: hidden !important;
 
 
351
  position: fixed !important;
 
 
352
  width: 100% !important;
353
 
 
 
 
 
354
  }
355
 
 
 
 
 
356
  .mo2f_modal {
 
 
357
  position: fixed !important;
 
 
358
  top: 0;
 
 
359
  right: 0;
 
 
360
  bottom: 0;
 
 
361
  left: 0;
 
 
362
  z-index: 100000 !important;
363
 
 
 
 
 
364
  overflow: hidden !important;
 
 
365
  -webkit-overflow-scrolling: touch;
 
 
366
  outline: 0;
367
 
 
 
 
 
368
  }
369
 
 
 
 
 
370
  .mo2f_modal_inner {
 
 
371
  display: none;
 
 
372
  }
373
 
 
 
 
 
374
  .mo2f_modal.fade .mo2f_modal-dialog {
 
 
375
  -webkit-transition: -webkit-transform .3s ease-out;
 
 
376
  -o-transition: -o-transform .3s ease-out;
 
 
377
  transition: transform .3s ease-out;
 
 
378
  -webkit-transform: translate(0, -25%);
 
 
379
  -ms-transform: translate(0, -25%);
 
 
380
  -o-transform: translate(0, -25%);
 
 
381
  transform: translate(0, -25%)
382
- }
383
 
384
- .mo2f_modal.in .mo2f_modal-dialog {
385
- -webkit-transform: translate(0, 80px) !important;
386
- -ms-transform: translate(0, 80px) !important;
387
- -o-transform: translate(0, 80px) !important;
388
- transform: translate(0, 80px) !important;
389
 
390
  }
391
 
392
- .mo2f_modal-open .mo2f_modal {
393
- overflow-x: hidden;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
394
  overflow-y: hidden;
 
 
395
  }
396
 
 
 
 
 
397
  .mo2f_modal-dialog {
 
 
398
  position: relative;
 
 
399
  width: auto;
 
 
400
  margin: 10px;
401
 
 
 
 
 
402
  }
403
 
 
 
 
 
404
  .login mo_customer_validation-modal-content {
 
 
405
  position: relative !important;
 
 
406
  background-color: #fff !important;
 
 
407
  -webkit-background-clip: padding-box !important;
 
 
408
  background-clip: padding-box !important;
 
 
409
  border: 1px solid #999 !important;
 
 
410
  border: 1px solid rgba(0, 0, 0, .2) !important;
 
 
411
  border-radius: 6px !important;
 
 
412
  outline: 0 !important;
413
 
 
 
 
 
414
  -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5) !important;
 
 
415
  box-shadow: 0 3px 9px rgba(0, 0, 0, .5) !important;
 
 
416
  }
417
 
 
 
 
 
418
  .mo2f-modal-backdrop {
 
 
419
  position: absolute;
 
 
420
  top: 0;
 
 
421
  right: 0;
 
 
422
  left: 0;
 
 
423
  background-color: #f1f1f1 !important;
 
 
424
  filter: alpha(opacity=50) !important;
 
 
425
  opacity: 0.8 !important;
 
 
426
  height: 100% !important;
 
 
427
  }
428
 
 
 
 
 
429
  #smsAlertModal {
430
- background-color: black !important;
431
- opacity: 0.8 !important;
432
- font-family: Roboto;
433
- }
434
 
435
- #twoFAtestAlertModal {
436
  background-color: black !important;
 
 
437
  opacity: 0.8 !important;
 
 
438
  filter: alpha(opacity=50) !important;
 
 
439
  }
440
 
 
 
 
 
441
  .mo2f_modal-header {
 
 
442
  min-height: 14px;
 
 
443
  padding: 10px;
 
 
444
  border-bottom: 1px solid #e5e5e5
 
 
445
  }
446
 
 
 
 
 
447
  .mo2f_modal-title {
 
 
448
  margin: 0 !important;
 
 
449
  line-height: 1.0 !important;
450
- font-size: 1rem;
 
451
  }
452
 
 
 
 
 
453
  .mo2f_modal-body {
 
 
454
  / / width: 96 % !important;
 
 
455
  position: relative !important;
 
 
456
  padding: 15px !important;
 
 
457
  overflow-y: auto !important;
 
 
458
  max-height: 550px !important;
 
 
459
  }
460
 
 
 
 
 
461
  .mo2f_modal-footer {
 
 
462
  padding: 15px;
 
 
463
  text-align: right;
 
 
464
  border-top: 1px solid #e5e5e5
 
 
465
  }
466
 
 
 
 
 
467
  .mo2f_modal-footer .btn + .btn {
 
 
468
  margin-bottom: 0;
 
 
469
  margin-left: 5px
 
 
470
  }
471
 
 
 
 
 
472
  .mo2f_modal-footer .btn-group .btn + .btn {
 
 
473
  margin-left: -1px
 
 
474
  }
475
 
 
 
 
 
476
  .mo2f_modal-footer .btn-block + .btn-block {
 
 
477
  margin-left: 0
 
 
478
  }
479
 
 
 
 
 
480
  .mo2f_modal-scrollbar-measure {
 
 
481
  position: absolute;
 
 
482
  top: -9999px;
 
 
483
  width: 50px;
 
 
484
  height: 50px;
 
 
485
  overflow: scroll
 
 
486
  }
487
 
 
 
 
 
488
  @media ( min-width: 768px) {
 
 
489
  .mo2f_modal-dialog {
490
- width: 373px;
491
- margin: 0px auto
 
 
 
492
  }
493
 
 
 
 
 
494
  .login mo_customer_validation-modal-content {
 
 
495
  -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
 
 
496
  box-shadow: 0 5px 15px rgba(0, 0, 0, .5)
 
 
497
  }
498
 
 
 
 
 
499
  .mo2f_modal-sm {
 
 
500
  width: 300px
 
 
501
  }
502
 
 
 
 
 
503
  .mo2f_modal-md {
 
 
504
  width: 550px
 
 
505
  }
 
 
506
  }
507
 
 
 
 
 
508
  @media ( min-width: 992px) {
 
 
509
  .mo2f_modal-lg {
 
 
510
  width: 900px;
511
- }
512
 
513
- .mo2f_modal-md {
514
- width: 550px
515
  }
516
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
517
 
518
  .center{
519
 
520
- text-align: center !important;
 
 
 
 
 
 
521
  }
522
 
 
 
 
 
523
  #otpMessage {
 
 
524
  border-radius: 1px;
 
 
525
  padding: 1px 5px;
 
 
526
  background: #f1f1f1;
 
 
527
  }
528
 
 
 
 
 
529
  .mo2f_carousel-indicators {
 
 
530
  position: absolute;
 
 
531
  bottom: -20px;
 
 
532
  z-index: 15;
 
 
533
  width: 60%;
 
 
534
  list-style: none;
 
 
535
  text-align: center;
 
 
536
  }
537
 
538
- .miniorange_kba_validate:hover, .miniorange_validate_otp:hover, .miniorange_login_forgotphone:hover,
539
- .miniorange_login_offline:hover, .miniorange_login_forgotphone:hover, .miniorange_otp_token_submit:hover {
540
- background-color: #0073AA !important
 
 
 
 
 
 
 
 
 
 
 
 
 
541
  }
542
 
543
- .miniorange_kba_validate, .miniorange_validate_otp, .miniorange_login_forgotphone,
544
- .miniorange_login_offline, .miniorange_login_forgotphone, .miniorange_otp_token_submit {
545
- background: #00A0D2 !important;
546
- border-color: #0073AA !important;
547
- box-shadow: 0 1px 0 rgba(120, 200, 230, .5) inset, 0 1px 0 rgba(0, 0, 0, .15) !important;
548
- color: #FFF !important;
549
- text-decoration: none !important;
550
- cursor: pointer !important;
551
- border-width: 1px !important;
552
- border-style: solid !important;
553
- border-radius: 3px !important;
554
- white-space: nowrap !important;
555
- box-sizing: border-box !important;
556
- line-height: 28px !important;
557
- padding: 0 12px !important;
558
- font-size: 13px !important
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
559
  }
560
 
 
 
 
 
561
  .mo_customer_validation-modal.fade .mo_customer_validation-modal-dialog {
 
 
562
  -webkit-transition: -webkit-transform .3s ease-out;
 
 
563
  -o-transition: -o-transform .3s ease-out;
 
 
564
  transition: transform .3s ease-out;
 
 
565
  -webkit-transform: translate(0, -25%);
 
 
566
  -ms-transform: translate(0, -25%);
 
 
567
  -o-transform: translate(0, -25%);
 
 
568
  transform: translate(0, -25%)
 
 
569
  }
570
 
 
 
 
 
571
  .mo_customer_validation-modal.in .mo_customer_validation-modal-dialog {
 
 
572
  -webkit-transform: translate(0, 80px) !important;
 
 
573
  -ms-transform: translate(0, 80px) !important;
 
 
574
  -o-transform: translate(0, 80px) !important;
 
 
575
  transform: translate(0, 80px) !important
 
 
576
  }
577
 
 
 
 
 
578
  .mo_customer_validation-modal-open .mo_customer_validation-modal {
 
 
579
  overflow-x: hidden;
 
 
580
  overflow-y: hidden
 
 
581
  }
582
 
 
 
 
 
583
  .mo_customer_validation-modal-dialog {
 
 
584
  position: relative;
 
 
585
  width: auto;
 
 
586
  margin: 10px
 
 
587
  }
588
 
 
 
 
 
589
  .mo_customer_validation-modal-content {
 
 
590
  position: relative;
 
 
591
  -webkit-background-clip: padding-box;
 
 
592
  border: 1px solid #999;
 
 
593
  border: 1px solid rgba(0, 0, 0, .2);
 
 
594
  outline: 0;
 
 
595
  margin-top: 8%;
 
 
596
  margin-left: 0;
 
 
597
  padding: 15px 20px 0;
 
 
598
  font-family: "Open Sans", sans-serif;
599
- color: #777;
 
 
600
  font-size: 14px;
 
 
601
  line-height: 1.4em;
 
 
602
  background: #FFF;
 
 
603
  box-shadow: 0 1px 3px rgba(0, 0, 0, .13)
 
 
604
  }
605
 
 
 
 
 
606
  .mo_customer_validation-modal-backdrop {
 
 
607
  position: absolute;
 
 
608
  top: 0;
 
 
609
  right: 0;
 
 
610
  left: 0;
 
 
611
  background-color: #000 !important;
 
 
612
  filter: alpha(opacity=50) !important;
 
 
613
  opacity: .9 !important;
 
 
614
  height: 100% !important
 
 
615
  }
616
 
 
 
 
 
617
  .mo_customer_validation-modal-header {
 
 
618
  min-height: 14px;
 
 
619
  padding: 10px 10px 20px;
 
 
620
  border-bottom: 1px solid #e5e5e5
 
 
621
  }
622
 
 
 
 
 
623
  .mo_customer_validation-modal-title {
 
 
624
  margin: 0 !important;
 
 
625
  line-height: 1 !important
 
 
626
  }
627
 
 
 
 
 
628
  .mo_customer_validation-modal-body {
 
 
629
  position: relative;
 
 
630
  padding: 5%;
 
 
631
  overflow: hidden !important;
 
 
632
  max-height: 550px !important
 
 
633
  }
634
 
635
- .mo_customer_validation-modal-footer {
636
- padding: 15px;
637
- text-align: right;
 
 
 
 
 
 
 
 
 
 
638
  border-top: 1px solid #e5e5e5
 
 
639
  }
640
 
 
 
 
 
641
  .mo_customer_validation-modal-footer .btn + .btn {
 
 
642
  margin-bottom: 0;
 
 
643
  margin-left: 5px
 
 
644
  }
645
 
 
 
 
 
646
  .mo_customer_validation-modal-footer .btn-group .btn + .btn {
 
 
647
  margin-left: -1px
 
 
648
  }
649
 
 
 
 
 
650
  .mo_customer_validation-modal-footer .btn-block + .btn-block {
 
 
651
  margin-left: 0
 
 
652
  }
653
 
 
 
 
 
654
  .mo_customer_validation-modal-scrollbar-measure {
 
 
655
  position: absolute;
 
 
656
  top: -9999px;
 
 
657
  width: 50px;
 
 
658
  height: 50px;
 
 
659
  overflow: scroll
 
 
660
  }
661
 
 
 
 
 
662
  @media (min-width: 768px) {
 
 
663
  .mo_customer_validation-modal-dialog {
 
 
664
  width: auto;
 
 
665
  margin: 0 auto
 
 
666
  }
667
 
 
 
 
 
668
  .mo_customer_validation-modal-content {
 
 
669
  -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
 
 
670
  box-shadow: 0 5px 15px rgba(0, 0, 0, .5)
 
 
671
  }
672
 
 
 
 
 
673
  .mo_customer_validation-modal-sm {
 
 
674
  width: 300px
 
 
675
  }
676
 
 
 
 
 
677
  .mo_customer_validation-modal-md {
 
 
678
  width: 532px
 
 
679
  }
680
 
 
 
 
 
681
  .mo_customer_validation-modal-lg {
 
 
682
  width: 50%
 
 
683
  }
 
 
684
  }
685
 
 
 
 
 
686
  @media (min-width: 992px) {
 
 
687
  .mo_customer_validation-modal-dialog {
 
 
688
  width: auto;
 
 
689
  margin: 0 auto
 
 
690
  }
691
 
 
 
 
 
692
  .mo_customer_validation-modal-lg {
 
 
693
  width: 490px
 
 
694
  }
695
 
 
 
 
 
696
  .mo_customer_validation-modal-md {
 
 
697
  width: 532px
 
 
698
  }
 
 
699
  }
700
 
 
 
 
 
701
  .mo_customer_validation-textbox {
 
 
702
  background: #FBFBFB;
 
 
703
  font-family: "Open Sans", sans-serif;
 
 
704
  font-size: 24px;
 
 
705
  width: 100%;
 
 
706
  border: 1px solid #DDD;
 
 
707
  padding: 3px;
 
 
708
  margin: 2px 6px 16px 0
 
 
709
  }
710
 
 
 
 
 
711
  .mo_customer_validation-textbox:focus {
 
 
712
  border-color: #5B9DD9;
 
 
713
  box-shadow: 0 0 2px rgba(30, 140, 190, .8)
 
 
714
  }
715
 
 
 
 
 
716
  .button-primary,
 
 
717
  .button-secondary {
 
 
718
  background: #00A0D2;
 
 
719
  border-color: #0073AA;
 
 
720
  box-shadow: 0 1px 0 rgba(120, 200, 230, .5) inset, 0 1px 0 rgba(0, 0, 0, .15);
 
 
721
  color: #FFF;
 
 
722
  text-decoration: none;
 
 
723
  cursor: pointer;
 
 
724
  border-width: 1px;
 
 
725
  border-style: solid;
 
 
726
  border-radius: 3px;
 
 
727
  white-space: nowrap;
 
 
728
  box-sizing: border-box;
 
 
729
  line-height: 28px;
 
 
730
  padding: 0 12px;
 
 
731
  font-size: 13px
 
 
732
  }
733
 
 
 
 
 
734
  .button:hover {
 
 
735
  background-color: #0073AA
 
 
736
  }
737
 
 
 
 
 
738
  .close {
 
 
739
  float: right;
 
 
740
  transition: color .1s ease-in-out, background .1s ease-in-out;
 
 
741
  text-decoration: none;
 
 
742
  color: #999;
 
 
743
  font-size: 13px
 
 
744
  }
745
 
 
 
 
 
746
  .mo_validate_close:focus,
 
 
747
  .mo_validate_close:hover {
 
 
748
  color: #0085ba
 
 
749
  }
750
 
 
 
 
 
751
  .mo_registration_pricing_text {
 
 
752
  font-size: 13px;
 
 
753
  color: darkblue;
 
 
754
  }
755
 
 
 
 
 
756
  .mo_otp_token {
 
 
757
  font-size: 15px;
 
 
758
  color: #212F3C;
 
 
759
  border: none;
760
- display: block;
 
 
 
 
761
  border-bottom-style: solid;
 
 
762
  border-width: 2px;
 
 
763
  border-color: #D0D3D4;
 
 
764
  border-radius: 0px;
 
 
765
  outline: none;
 
 
766
  width: 140px;
 
 
767
  text-align: center;
 
 
768
  }
769
 
 
 
 
 
770
  .container {
 
 
771
  max-width: 960px
 
 
772
  }
773
 
 
 
 
 
774
  }
 
 
775
  @media (min-width: 1200px) {
 
 
776
  .container {
 
 
777
  max-width: 1140px
 
 
778
  }
 
 
779
  }
780
 
 
 
 
 
781
  .container-fluid {
 
 
782
  width: 100%;
 
 
783
  padding-right: 15px;
 
 
784
  padding-left: 15px;
 
 
785
  margin-right: auto;
 
 
786
  margin-left: auto
 
 
787
  }
788
 
 
 
 
 
789
  .row {
 
 
790
  display: -webkit-box;
 
 
791
  display: -ms-flexbox;
 
 
792
  display: flex;
 
 
793
  -ms-flex-wrap: wrap;
 
 
794
  flex-wrap: wrap;
 
 
795
  margin-right: -15px;
 
 
796
  margin-left: -15px
 
 
797
  }
798
 
 
 
 
 
 
 
 
799
  .no-gutters {
 
 
800
  margin-right: 0;
 
 
801
  margin-left: 0
 
 
802
  }
803
 
 
 
 
 
804
  .no-gutters > .col, .no-gutters > [class*=col-] {
 
 
805
  padding-right: 0;
 
 
806
  padding-left: 0
 
 
807
  }
808
 
 
 
 
 
809
  .col, .col-1, .col-10, .col-11, .col-12, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-auto, .col-lg, .col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-auto, .col-md, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-auto, .col-sm, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-auto, .col-xl, .col-xl-1, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-auto {
 
 
810
  position: relative;
 
 
811
  width: 100%;
 
 
812
  min-height: 1px;
 
 
813
  padding-right: 15px;
 
 
814
  padding-left: 15px
 
 
815
  }
816
 
 
 
 
 
817
  .col {
 
 
818
  -ms-flex-preferred-size: 0;
 
 
819
  flex-basis: 0;
 
 
820
  -webkit-box-flex: 1;
 
 
821
  -ms-flex-positive: 1;
 
 
822
  flex-grow: 1;
 
 
823
  max-width: 100%
 
 
824
  }
825
 
 
 
 
 
826
  .col-auto {
 
 
827
  -webkit-box-flex: 0;
 
 
828
  -ms-flex: 0 0 auto;
 
 
829
  flex: 0 0 auto;
 
 
830
  width: auto;
 
 
831
  max-width: none
 
 
832
  }
833
 
 
 
 
 
834
  .col-1 {
 
 
835
  -webkit-box-flex: 0;
 
 
836
  -ms-flex: 0 0 8.333333%;
 
 
837
  flex: 0 0 8.333333%;
 
 
838
  max-width: 8.333333%
 
 
839
  }
840
 
 
 
 
 
841
  .col-2 {
 
 
842
  -webkit-box-flex: 0;
 
 
843
  -ms-flex: 0 0 16.666667%;
 
 
844
  flex: 0 0 16.666667%;
 
 
845
  max-width: 16.666667%
 
 
846
  }
847
 
 
 
 
 
848
  .col-3 {
 
 
849
  -webkit-box-flex: 0;
 
 
850
  -ms-flex: 0 0 25%;
 
 
851
  flex: 0 0 25%;
 
 
852
  max-width: 25%
 
 
853
  }
854
 
 
 
 
 
855
  .col-4 {
 
 
856
  -webkit-box-flex: 0;
 
 
857
  -ms-flex: 0 0 33.333333%;
 
 
858
  flex: 0 0 33.333333%;
 
 
859
  max-width: 33.333333%
 
 
860
  }
861
 
 
 
 
 
862
  .col-5 {
 
 
863
  -webkit-box-flex: 0;
 
 
864
  -ms-flex: 0 0 41.666667%;
 
 
865
  flex: 0 0 41.666667%;
 
 
866
  max-width: 41.666667%
 
 
867
  }
868
 
 
 
 
 
869
  .col-6 {
 
 
870
  -webkit-box-flex: 0;
 
 
871
  -ms-flex: 0 0 50%;
 
 
872
  flex: 0 0 50%;
 
 
873
  max-width: 50%
 
 
874
  }
875
 
 
 
 
 
876
  .col-7 {
 
 
877
  -webkit-box-flex: 0;
 
 
878
  -ms-flex: 0 0 58.333333%;
 
 
879
  flex: 0 0 58.333333%;
 
 
880
  max-width: 58.333333%
 
 
881
  }
882
 
 
 
 
 
883
  .col-8 {
 
 
884
  -webkit-box-flex: 0;
 
 
885
  -ms-flex: 0 0 66.666667%;
 
 
886
  flex: 0 0 66.666667%;
 
 
887
  max-width: 66.666667%
 
 
888
  }
889
 
 
 
 
 
890
  .col-9 {
 
 
891
  -webkit-box-flex: 0;
 
 
892
  -ms-flex: 0 0 75%;
 
 
893
  flex: 0 0 75%;
 
 
894
  max-width: 75%
 
 
895
  }
896
 
 
 
 
 
897
  .col-10 {
 
 
898
  -webkit-box-flex: 0;
 
 
899
  -ms-flex: 0 0 83.333333%;
 
 
900
  flex: 0 0 83.333333%;
 
 
901
  max-width: 83.333333%
 
 
902
  }
903
 
 
 
 
 
904
  .col-11 {
 
 
905
  -webkit-box-flex: 0;
 
 
906
  -ms-flex: 0 0 91.666667%;
 
 
907
  flex: 0 0 91.666667%;
 
 
908
  max-width: 91.666667%
 
 
909
  }
910
 
 
 
 
 
911
  .col-12 {
 
 
912
  -webkit-box-flex: 0;
 
 
913
  -ms-flex: 0 0 100%;
 
 
914
  flex: 0 0 100%;
 
 
915
  max-width: 100%
 
 
916
  }
917
 
 
 
 
 
918
  .order-first {
 
 
919
  -webkit-box-ordinal-group: 0;
 
 
920
  -ms-flex-order: -1;
 
 
921
  order: -1
 
 
922
  }
923
 
 
 
 
 
924
  .order-last {
 
 
925
  -webkit-box-ordinal-group: 14;
 
 
926
  -ms-flex-order: 13;
 
 
927
  order: 13
 
 
928
  }
929
 
 
 
 
 
930
  .order-0 {
 
 
931
  -webkit-box-ordinal-group: 1;
 
 
932
  -ms-flex-order: 0;
 
 
933
  order: 0
 
 
934
  }
935
 
 
 
 
 
936
  .order-1 {
 
 
937
  -webkit-box-ordinal-group: 2;
 
 
938
  -ms-flex-order: 1;
 
 
939
  order: 1
 
 
940
  }
941
 
 
 
 
 
942
  .order-2 {
 
 
943
  -webkit-box-ordinal-group: 3;
 
 
944
  -ms-flex-order: 2;
 
 
945
  order: 2
 
 
946
  }
947
 
 
 
 
 
948
  .order-3 {
 
 
949
  -webkit-box-ordinal-group: 4;
 
 
950
  -ms-flex-order: 3;
 
 
951
  order: 3
 
 
952
  }
953
 
 
 
 
 
954
  .order-4 {
 
 
955
  -webkit-box-ordinal-group: 5;
 
 
956
  -ms-flex-order: 4;
 
 
957
  order: 4
 
 
958
  }
959
 
 
 
 
 
960
  .order-5 {
 
 
961
  -webkit-box-ordinal-group: 6;
 
 
962
  -ms-flex-order: 5;
 
 
963
  order: 5
 
 
964
  }
965
 
 
 
 
 
966
  .order-6 {
 
 
967
  -webkit-box-ordinal-group: 7;
 
 
968
  -ms-flex-order: 6;
 
 
969
  order: 6
 
 
970
  }
971
 
 
 
 
 
972
  .order-7 {
 
 
973
  -webkit-box-ordinal-group: 8;
 
 
974
  -ms-flex-order: 7;
 
 
975
  order: 7
 
 
976
  }
977
 
 
 
 
 
978
  .order-8 {
 
 
979
  -webkit-box-ordinal-group: 9;
 
 
980
  -ms-flex-order: 8;
 
 
981
  order: 8
 
 
982
  }
983
 
 
 
 
 
984
  .order-9 {
 
 
985
  -webkit-box-ordinal-group: 10;
 
 
986
  -ms-flex-order: 9;
 
 
987
  order: 9
 
 
988
  }
989
 
 
 
 
 
990
  .order-10 {
 
 
991
  -webkit-box-ordinal-group: 11;
 
 
992
  -ms-flex-order: 10;
 
 
993
  order: 10
 
 
994
  }
995
 
 
 
 
 
996
  .order-11 {
 
 
997
  -webkit-box-ordinal-group: 12;
 
 
998
  -ms-flex-order: 11;
 
 
999
  order: 11
 
 
1000
  }
1001
 
 
 
 
 
1002
  .order-12 {
 
 
1003
  -webkit-box-ordinal-group: 13;
 
 
1004
  -ms-flex-order: 12;
 
 
1005
  order: 12
 
 
1006
  }
1007
 
 
 
 
 
1008
  .offset-1 {
 
 
1009
  margin-left: 8.333333%
1010
- }
1011
 
1012
- .offset-2 {
1013
- margin-left: 16.666667%
1014
- }
1015
 
1016
- .offset-3 {
1017
- margin-left: 25%
1018
  }
1019
 
1020
- .offset-4 {
1021
- margin-left: 33.333333%
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1022
  }
1023
 
 
 
 
 
1024
  .offset-5 {
 
 
1025
  margin-left: 41.666667%
 
 
1026
  }
1027
 
 
 
 
 
1028
  .offset-6 {
 
 
1029
  margin-left: 50%
 
 
1030
  }
1031
 
 
 
 
 
1032
  .offset-7 {
 
 
1033
  margin-left: 58.333333%
 
 
1034
  }
1035
 
 
 
 
 
1036
  .offset-8 {
 
 
1037
  margin-left: 66.666667%
 
 
1038
  }
1039
 
 
 
 
 
1040
  .offset-9 {
 
 
1041
  margin-left: 75%
 
 
1042
  }
1043
 
 
 
 
 
1044
  .offset-10 {
 
 
1045
  margin-left: 83.333333%
 
 
1046
  }
1047
 
 
 
 
 
1048
  .offset-11 {
 
 
1049
  margin-left: 91.666667%
 
 
1050
  }
1051
 
 
 
 
 
1052
  @media (min-width: 576px) {
 
 
1053
  .col-sm {
 
 
1054
  -ms-flex-preferred-size: 0;
 
 
1055
  flex-basis: 0;
 
 
1056
  -webkit-box-flex: 1;
 
 
1057
  -ms-flex-positive: 1;
 
 
1058
  flex-grow: 1;
 
 
1059
  max-width: 100%
 
 
1060
  }
1061
 
 
 
 
 
1062
  .col-sm-auto {
 
 
1063
  -webkit-box-flex: 0;
 
 
1064
  -ms-flex: 0 0 auto;
 
 
1065
  flex: 0 0 auto;
 
 
1066
  width: auto;
 
 
1067
  max-width: none
 
 
1068
  }
1069
 
 
 
 
 
1070
  .col-sm-1 {
 
 
1071
  -webkit-box-flex: 0;
 
 
1072
  -ms-flex: 0 0 8.333333%;
 
 
1073
  flex: 0 0 8.333333%;
 
 
1074
  max-width: 8.333333%
 
 
1075
  }
1076
 
 
 
 
 
1077
  .col-sm-2 {
 
 
1078
  -webkit-box-flex: 0;
 
 
1079
  -ms-flex: 0 0 16.666667%;
 
 
1080
  flex: 0 0 16.666667%;
 
 
1081
  max-width: 16.666667%
 
 
1082
  }
1083
 
 
 
 
 
1084
  .col-sm-3 {
 
 
1085
  -webkit-box-flex: 0;
 
 
1086
  -ms-flex: 0 0 25%;
 
 
1087
  flex: 0 0 25%;
 
 
1088
  max-width: 25%
 
 
1089
  }
1090
 
 
 
 
 
1091
  .col-sm-4 {
 
 
1092
  -webkit-box-flex: 0;
 
 
1093
  -ms-flex: 0 0 33.333333%;
 
 
1094
  flex: 0 0 33.333333%;
 
 
1095
  max-width: 33.333333%
 
 
1096
  }
1097
 
 
 
 
 
1098
  .col-sm-5 {
 
 
1099
  -webkit-box-flex: 0;
 
 
1100
  -ms-flex: 0 0 41.666667%;
 
 
1101
  flex: 0 0 41.666667%;
 
 
1102
  max-width: 41.666667%
 
 
1103
  }
1104
 
 
 
 
 
1105
  .col-sm-6 {
 
 
1106
  -webkit-box-flex: 0;
 
 
1107
  -ms-flex: 0 0 50%;
 
 
1108
  flex: 0 0 50%;
 
 
1109
  max-width: 50%
 
 
1110
  }
1111
 
 
 
 
 
1112
  .col-sm-7 {
 
 
1113
  -webkit-box-flex: 0;
 
 
1114
  -ms-flex: 0 0 58.333333%;
 
 
1115
  flex: 0 0 58.333333%;
 
 
1116
  max-width: 58.333333%
 
 
1117
  }
1118
 
 
 
 
 
1119
  .col-sm-8 {
 
 
1120
  -webkit-box-flex: 0;
 
 
1121
  -ms-flex: 0 0 66.666667%;
 
 
1122
  flex: 0 0 66.666667%;
 
 
1123
  max-width: 66.666667%
 
 
1124
  }
1125
 
 
 
 
 
1126
  .col-sm-9 {
 
 
1127
  -webkit-box-flex: 0;
 
 
1128
  -ms-flex: 0 0 75%;
 
 
1129
  flex: 0 0 75%;
 
 
1130
  max-width: 75%
 
 
1131
  }
1132
 
 
 
 
 
1133
  .col-sm-10 {
 
 
1134
  -webkit-box-flex: 0;
 
 
1135
  -ms-flex: 0 0 83.333333%;
 
 
1136
  flex: 0 0 83.333333%;
 
 
1137
  max-width: 83.333333%
 
 
1138
  }
1139
 
 
 
 
 
1140
  .col-sm-11 {
 
 
1141
  -webkit-box-flex: 0;
 
 
1142
  -ms-flex: 0 0 91.666667%;
 
 
1143
  flex: 0 0 91.666667%;
 
 
1144
  max-width: 91.666667%
 
 
1145
  }
1146
 
 
 
 
 
1147
  .col-sm-12 {
 
 
1148
  -webkit-box-flex: 0;
 
 
1149
  -ms-flex: 0 0 100%;
 
 
1150
  flex: 0 0 100%;
 
 
1151
  max-width: 100%
 
 
1152
  }
1153
 
 
 
 
 
1154
  .order-sm-first {
 
 
1155
  -webkit-box-ordinal-group: 0;
 
 
1156
  -ms-flex-order: -1;
 
 
1157
  order: -1
 
 
1158
  }
1159
 
 
 
 
 
1160
  .order-sm-last {
 
 
1161
  -webkit-box-ordinal-group: 14;
 
 
1162
  -ms-flex-order: 13;
 
 
1163
  order: 13
 
 
1164
  }
1165
 
 
 
 
 
1166
  .order-sm-0 {
 
 
1167
  -webkit-box-ordinal-group: 1;
 
 
1168
  -ms-flex-order: 0;
 
 
1169
  order: 0
 
 
1170
  }
1171
 
 
 
 
 
1172
  .order-sm-1 {
 
 
1173
  -webkit-box-ordinal-group: 2;
 
 
1174
  -ms-flex-order: 1;
 
 
1175
  order: 1
 
 
1176
  }
1177
 
 
 
 
 
1178
  .order-sm-2 {
 
 
1179
  -webkit-box-ordinal-group: 3;
 
 
1180
  -ms-flex-order: 2;
 
 
1181
  order: 2
 
 
1182
  }
1183
 
 
 
 
 
1184
  .order-sm-3 {
 
 
1185
  -webkit-box-ordinal-group: 4;
 
 
1186
  -ms-flex-order: 3;
 
 
1187
  order: 3
 
 
1188
  }
1189
 
 
 
 
 
1190
  .order-sm-4 {
 
 
1191
  -webkit-box-ordinal-group: 5;
 
 
1192
  -ms-flex-order: 4;
 
 
1193
  order: 4
 
 
1194
  }
1195
 
 
 
 
 
1196
  .order-sm-5 {
 
 
1197
  -webkit-box-ordinal-group: 6;
 
 
1198
  -ms-flex-order: 5;
 
 
1199
  order: 5
 
 
1200
  }
1201
 
 
 
 
 
1202
  .order-sm-6 {
 
 
1203
  -webkit-box-ordinal-group: 7;
 
 
1204
  -ms-flex-order: 6;
 
 
1205
  order: 6
 
 
1206
  }
1207
 
 
 
 
 
1208
  .order-sm-7 {
 
 
1209
  -webkit-box-ordinal-group: 8;
 
 
1210
  -ms-flex-order: 7;
 
 
1211
  order: 7
 
 
1212
  }
1213
 
 
 
 
 
1214
  .order-sm-8 {
 
 
1215
  -webkit-box-ordinal-group: 9;
 
 
1216
  -ms-flex-order: 8;
 
 
1217
  order: 8
 
 
1218
  }
1219
 
 
 
 
 
1220
  .order-sm-9 {
 
 
1221
  -webkit-box-ordinal-group: 10;
 
 
1222
  -ms-flex-order: 9;
 
 
1223
  order: 9
 
 
1224
  }
1225
 
 
 
 
 
1226
  .order-sm-10 {
 
 
1227
  -webkit-box-ordinal-group: 11;
 
 
1228
  -ms-flex-order: 10;
 
 
1229
  order: 10
 
 
1230
  }
1231
 
 
 
 
 
1232
  .order-sm-11 {
 
 
1233
  -webkit-box-ordinal-group: 12;
 
 
1234
  -ms-flex-order: 11;
 
 
1235
  order: 11
 
 
1236
  }
1237
 
 
 
 
 
1238
  .order-sm-12 {
 
 
1239
  -webkit-box-ordinal-group: 13;
 
 
1240
  -ms-flex-order: 12;
 
 
1241
  order: 12
 
 
1242
  }
1243
 
 
 
 
 
1244
  .offset-sm-0 {
 
 
1245
  margin-left: 0
 
 
1246
  }
1247
 
 
 
 
 
1248
  .offset-sm-1 {
 
 
1249
  margin-left: 8.333333%
 
 
1250
  }
1251
 
 
 
 
 
1252
  .offset-sm-2 {
 
 
1253
  margin-left: 16.666667%
 
 
1254
  }
1255
 
 
 
 
 
1256
  .offset-sm-3 {
 
 
1257
  margin-left: 25%
1258
- }
1259
 
1260
- .offset-sm-4 {
1261
- margin-left: 33.333333%
1262
- }
1263
 
1264
- .offset-sm-5 {
1265
- margin-left: 41.666667%
1266
  }
1267
 
1268
- .offset-sm-6 {
1269
- margin-left: 50%
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1270
  }
1271
 
 
 
 
 
1272
  .offset-sm-7 {
 
 
1273
  margin-left: 58.333333%
 
 
1274
  }
1275
 
 
 
 
 
1276
  .offset-sm-8 {
 
 
1277
  margin-left: 66.666667%
 
 
1278
  }
1279
 
 
 
 
 
1280
  .offset-sm-9 {
 
 
1281
  margin-left: 75%
 
 
1282
  }
1283
 
 
 
 
 
1284
  .offset-sm-10 {
 
 
1285
  margin-left: 83.333333%
 
 
1286
  }
1287
 
 
 
 
 
1288
  .offset-sm-11 {
 
 
1289
  margin-left: 91.666667%
 
 
1290
  }
 
 
1291
  }
1292
 
 
 
 
 
1293
  @media (min-width: 768px) {
 
 
1294
  .col-md {
 
 
1295
  -ms-flex-preferred-size: 0;
 
 
1296
  flex-basis: 0;
 
 
1297
  -webkit-box-flex: 1;
 
 
1298
  -ms-flex-positive: 1;
 
 
1299
  flex-grow: 1;
 
 
1300
  max-width: 100%
 
 
1301
  }
1302
 
 
 
 
 
1303
  .col-md-auto {
 
 
1304
  -webkit-box-flex: 0;
 
 
1305
  -ms-flex: 0 0 auto;
 
 
1306
  flex: 0 0 auto;
 
 
1307
  width: auto;
 
 
1308
  max-width: none
 
 
1309
  }
1310
 
 
 
 
 
1311
  .col-md-1 {
 
 
1312
  -webkit-box-flex: 0;
 
 
1313
  -ms-flex: 0 0 8.333333%;
 
 
1314
  flex: 0 0 8.333333%;
 
 
1315
  max-width: 8.333333%
 
 
1316
  }
1317
 
 
 
 
 
1318
  .col-md-2 {
 
 
1319
  -webkit-box-flex: 0;
 
 
1320
  -ms-flex: 0 0 16.666667%;
 
 
1321
  flex: 0 0 16.666667%;
 
 
1322
  max-width: 16.666667%
 
 
1323
  }
1324
 
 
 
 
 
1325
  .col-md-3 {
 
 
1326
  -webkit-box-flex: 0;
 
 
1327
  -ms-flex: 0 0 25%;
 
 
1328
  flex: 0 0 25%;
 
 
1329
  max-width: 25%
 
 
1330
  }
1331
 
 
 
 
 
1332
  .col-md-4 {
 
 
1333
  -webkit-box-flex: 0;
 
 
1334
  -ms-flex: 0 0 33.333333%;
 
 
1335
  flex: 0 0 33.333333%;
 
 
1336
  max-width: 33.333333%
 
 
1337
  }
1338
 
 
 
 
 
1339
  .col-md-5 {
 
 
1340
  -webkit-box-flex: 0;
 
 
1341
  -ms-flex: 0 0 41.666667%;
 
 
1342
  flex: 0 0 41.666667%;
 
 
1343
  max-width: 41.666667%
 
 
1344
  }
1345
 
 
 
 
 
1346
  .col-md-6 {
 
 
1347
  -webkit-box-flex: 0;
 
 
1348
  -ms-flex: 0 0 50%;
 
 
1349
  flex: 0 0 50%;
 
 
1350
  max-width: 50%
 
 
1351
  }
1352
 
 
 
 
 
1353
  .col-md-7 {
 
 
1354
  -webkit-box-flex: 0;
 
 
1355
  -ms-flex: 0 0 58.333333%;
 
 
1356
  flex: 0 0 58.333333%;
 
 
1357
  max-width: 58.333333%
 
 
1358
  }
1359
 
 
 
 
 
1360
  .col-md-8 {
 
 
1361
  -webkit-box-flex: 0;
 
 
1362
  -ms-flex: 0 0 66.666667%;
 
 
1363
  flex: 0 0 66.666667%;
 
 
1364
  max-width: 66.666667%
 
 
1365
  }
1366
 
 
 
 
 
1367
  .col-md-9 {
 
 
1368
  -webkit-box-flex: 0;
 
 
1369
  -ms-flex: 0 0 75%;
 
 
1370
  flex: 0 0 75%;
 
 
1371
  max-width: 75%
 
 
1372
  }
1373
 
 
 
 
 
1374
  .col-md-10 {
 
 
1375
  -webkit-box-flex: 0;
 
 
1376
  -ms-flex: 0 0 83.333333%;
 
 
1377
  flex: 0 0 83.333333%;
 
 
1378
  max-width: 83.333333%
 
 
1379
  }
1380
 
 
 
 
 
1381
  .col-md-11 {
 
 
1382
  -webkit-box-flex: 0;
 
 
1383
  -ms-flex: 0 0 91.666667%;
 
 
1384
  flex: 0 0 91.666667%;
 
 
1385
  max-width: 91.666667%
 
 
1386
  }
1387
 
 
 
 
 
1388
  .col-md-12 {
 
 
1389
  -webkit-box-flex: 0;
 
 
1390
  -ms-flex: 0 0 100%;
 
 
1391
  flex: 0 0 100%;
 
 
1392
  max-width: 100%
 
 
1393
  }
1394
 
 
 
 
 
1395
  .order-md-first {
 
 
1396
  -webkit-box-ordinal-group: 0;
 
 
1397
  -ms-flex-order: -1;
 
 
1398
  order: -1
 
 
1399
  }
1400
 
 
 
 
 
1401
  .order-md-last {
 
 
1402
  -webkit-box-ordinal-group: 14;
 
 
1403
  -ms-flex-order: 13;
 
 
1404
  order: 13
 
 
1405
  }
1406
 
 
 
 
 
1407
  .order-md-0 {
 
 
1408
  -webkit-box-ordinal-group: 1;
 
 
1409
  -ms-flex-order: 0;
 
 
1410
  order: 0
 
 
1411
  }
1412
 
 
 
 
 
1413
  .order-md-1 {
 
 
1414
  -webkit-box-ordinal-group: 2;
 
 
1415
  -ms-flex-order: 1;
 
 
1416
  order: 1
 
 
1417
  }
1418
 
 
 
 
 
1419
  .order-md-2 {
 
 
1420
  -webkit-box-ordinal-group: 3;
 
 
1421
  -ms-flex-order: 2;
 
 
1422
  order: 2
 
 
1423
  }
1424
 
 
 
 
 
1425
  .order-md-3 {
 
 
1426
  -webkit-box-ordinal-group: 4;
 
 
1427
  -ms-flex-order: 3;
 
 
1428
  order: 3
 
 
1429
  }
1430
 
 
 
 
 
1431
  .order-md-4 {
 
 
1432
  -webkit-box-ordinal-group: 5;
 
 
1433
  -ms-flex-order: 4;
 
 
1434
  order: 4
 
 
1435
  }
1436
 
 
 
 
 
1437
  .order-md-5 {
 
 
1438
  -webkit-box-ordinal-group: 6;
 
 
1439
  -ms-flex-order: 5;
 
 
1440
  order: 5
 
 
1441
  }
1442
 
 
 
 
 
1443
  .order-md-6 {
 
 
1444
  -webkit-box-ordinal-group: 7;
 
 
1445
  -ms-flex-order: 6;
 
 
1446
  order: 6
 
 
1447
  }
1448
 
 
 
 
 
1449
  .order-md-7 {
 
 
1450
  -webkit-box-ordinal-group: 8;
 
 
1451
  -ms-flex-order: 7;
 
 
1452
  order: 7
 
 
1453
  }
1454
 
 
 
 
 
1455
  .order-md-8 {
 
 
1456
  -webkit-box-ordinal-group: 9;
 
 
1457
  -ms-flex-order: 8;
 
 
1458
  order: 8
 
 
1459
  }
1460
 
 
 
 
 
1461
  .order-md-9 {
 
 
1462
  -webkit-box-ordinal-group: 10;
 
 
1463
  -ms-flex-order: 9;
 
 
1464
  order: 9
 
 
1465
  }
1466
 
 
 
 
 
1467
  .order-md-10 {
 
 
1468
  -webkit-box-ordinal-group: 11;
 
 
1469
  -ms-flex-order: 10;
 
 
1470
  order: 10
 
 
1471
  }
1472
 
 
 
 
 
1473
  .order-md-11 {
 
 
1474
  -webkit-box-ordinal-group: 12;
 
 
1475
  -ms-flex-order: 11;
 
 
1476
  order: 11
 
 
1477
  }
1478
 
 
 
 
 
1479
  .order-md-12 {
 
 
1480
  -webkit-box-ordinal-group: 13;
 
 
1481
  -ms-flex-order: 12;
 
 
1482
  order: 12
 
 
1483
  }
1484
 
 
 
 
 
1485
  .offset-md-0 {
 
 
1486
  margin-left: 0
 
 
1487
  }
1488
 
 
 
 
 
1489
  .offset-md-1 {
 
 
1490
  margin-left: 8.333333%
 
 
1491
  }
1492
 
 
 
 
 
1493
  .offset-md-2 {
 
 
1494
  margin-left: 16.666667%
 
 
1495
  }
1496
 
 
 
 
 
1497
  .offset-md-3 {
 
 
1498
  margin-left: 25%
 
 
1499
  }
1500
 
 
 
 
 
1501
  .offset-md-4 {
 
 
1502
  margin-left: 33.333333%
 
 
1503
  }
1504
 
 
 
 
 
1505
  .offset-md-5 {
 
 
1506
  margin-left: 41.666667%
1507
- }
1508
 
1509
- .offset-md-6 {
1510
- margin-left: 50%
1511
- }
1512
 
1513
- .offset-md-7 {
1514
- margin-left: 58.333333%
1515
  }
1516
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1517
  .offset-md-8 {
 
 
1518
  margin-left: 66.666667%
 
 
1519
  }
1520
 
 
 
 
 
1521
  .offset-md-9 {
 
 
1522
  margin-left: 75%
 
 
1523
  }
1524
 
 
 
 
 
1525
  .offset-md-10 {
 
 
1526
  margin-left: 83.333333%
 
 
1527
  }
1528
 
 
 
 
 
1529
  .offset-md-11 {
 
 
1530
  margin-left: 91.666667%
 
 
1531
  }
 
 
1532
  }
1533
 
 
 
 
 
1534
  @media (min-width: 992px) {
 
 
1535
  .col-lg {
 
 
1536
  -ms-flex-preferred-size: 0;
 
 
1537
  flex-basis: 0;
 
 
1538
  -webkit-box-flex: 1;
 
 
1539
  -ms-flex-positive: 1;
 
 
1540
  flex-grow: 1;
 
 
1541
  max-width: 100%
 
 
1542
  }
1543
 
 
 
 
 
1544
  .col-lg-auto {
 
 
1545
  -webkit-box-flex: 0;
 
 
1546
  -ms-flex: 0 0 auto;
 
 
1547
  flex: 0 0 auto;
 
 
1548
  width: auto;
 
 
1549
  max-width: none
 
 
1550
  }
1551
 
 
 
 
 
1552
  .col-lg-1 {
 
 
1553
  -webkit-box-flex: 0;
 
 
1554
  -ms-flex: 0 0 8.333333%;
 
 
1555
  flex: 0 0 8.333333%;
 
 
1556
  max-width: 8.333333%
 
 
1557
  }
1558
 
 
 
 
 
1559
  .col-lg-2 {
 
 
1560
  -webkit-box-flex: 0;
 
 
1561
  -ms-flex: 0 0 16.666667%;
 
 
1562
  flex: 0 0 16.666667%;
 
 
1563
  max-width: 16.666667%
 
 
1564
  }
1565
 
 
 
 
 
1566
  .col-lg-3 {
 
 
1567
  -webkit-box-flex: 0;
 
 
1568
  -ms-flex: 0 0 25%;
 
 
1569
  flex: 0 0 25%;
 
 
1570
  max-width: 25%
 
 
1571
  }
1572
 
 
 
 
 
1573
  .col-lg-4 {
 
 
1574
  -webkit-box-flex: 0;
 
 
1575
  -ms-flex: 0 0 33.333333%;
 
 
1576
  flex: 0 0 33.333333%;
 
 
1577
  max-width: 33.333333%
 
 
1578
  }
1579
 
 
 
 
 
1580
  .col-lg-5 {
 
 
1581
  -webkit-box-flex: 0;
 
 
1582
  -ms-flex: 0 0 41.666667%;
 
 
1583
  flex: 0 0 41.666667%;
 
 
1584
  max-width: 41.666667%
 
 
1585
  }
1586
 
 
 
 
 
1587
  .col-lg-6 {
 
 
1588
  -webkit-box-flex: 0;
 
 
1589
  -ms-flex: 0 0 50%;
 
 
1590
  flex: 0 0 50%;
 
 
1591
  max-width: 50%
 
 
1592
  }
1593
 
 
 
 
 
1594
  .col-lg-7 {
 
 
1595
  -webkit-box-flex: 0;
 
 
1596
  -ms-flex: 0 0 58.333333%;
 
 
1597
  flex: 0 0 58.333333%;
 
 
1598
  max-width: 58.333333%
 
 
1599
  }
1600
 
 
 
 
 
1601
  .col-lg-8 {
 
 
1602
  -webkit-box-flex: 0;
 
 
1603
  -ms-flex: 0 0 66.666667%;
 
 
1604
  flex: 0 0 66.666667%;
 
 
1605
  max-width: 66.666667%
 
 
1606
  }
1607
 
 
 
 
 
1608
  .col-lg-9 {
 
 
1609
  -webkit-box-flex: 0;
 
 
1610
  -ms-flex: 0 0 75%;
 
 
1611
  flex: 0 0 75%;
 
 
1612
  max-width: 75%
 
 
1613
  }
1614
 
 
 
 
 
1615
  .col-lg-10 {
 
 
1616
  -webkit-box-flex: 0;
 
 
1617
  -ms-flex: 0 0 83.333333%;
 
 
1618
  flex: 0 0 83.333333%;
 
 
1619
  max-width: 83.333333%
 
 
1620
  }
1621
 
 
 
 
 
1622
  .col-lg-11 {
 
 
1623
  -webkit-box-flex: 0;
 
 
1624
  -ms-flex: 0 0 91.666667%;
 
 
1625
  flex: 0 0 91.666667%;
 
 
1626
  max-width: 91.666667%
 
 
1627
  }
1628
 
 
 
 
 
1629
  .col-lg-12 {
 
 
1630
  -webkit-box-flex: 0;
 
 
1631
  -ms-flex: 0 0 100%;
 
 
1632
  flex: 0 0 100%;
 
 
1633
  max-width: 100%
 
 
1634
  }
1635
 
 
 
 
 
1636
  .order-lg-first {
 
 
1637
  -webkit-box-ordinal-group: 0;
 
 
1638
  -ms-flex-order: -1;
 
 
1639
  order: -1
 
 
1640
  }
1641
 
 
 
 
 
1642
  .order-lg-last {
 
 
1643
  -webkit-box-ordinal-group: 14;
 
 
1644
  -ms-flex-order: 13;
 
 
1645
  order: 13
 
 
1646
  }
1647
 
 
 
 
 
1648
  .order-lg-0 {
 
 
1649
  -webkit-box-ordinal-group: 1;
 
 
1650
  -ms-flex-order: 0;
 
 
1651
  order: 0
 
 
1652
  }
1653
 
 
 
 
 
1654
  .order-lg-1 {
 
 
1655
  -webkit-box-ordinal-group: 2;
 
 
1656
  -ms-flex-order: 1;
 
 
1657
  order: 1
 
 
1658
  }
1659
 
 
 
 
 
1660
  .order-lg-2 {
 
 
1661
  -webkit-box-ordinal-group: 3;
 
 
1662
  -ms-flex-order: 2;
 
 
1663
  order: 2
 
 
1664
  }
1665
 
 
 
 
 
1666
  .order-lg-3 {
 
 
1667
  -webkit-box-ordinal-group: 4;
 
 
1668
  -ms-flex-order: 3;
 
 
1669
  order: 3
 
 
1670
  }
1671
 
 
 
 
 
1672
  .order-lg-4 {
 
 
1673
  -webkit-box-ordinal-group: 5;
 
 
1674
  -ms-flex-order: 4;
 
 
1675
  order: 4
 
 
1676
  }
1677
 
 
 
 
 
1678
  .order-lg-5 {
 
 
1679
  -webkit-box-ordinal-group: 6;
 
 
1680
  -ms-flex-order: 5;
 
 
1681
  order: 5
 
 
1682
  }
1683
 
 
 
 
 
1684
  .order-lg-6 {
 
 
1685
  -webkit-box-ordinal-group: 7;
 
 
1686
  -ms-flex-order: 6;
 
 
1687
  order: 6
 
 
1688
  }
1689
 
 
 
 
 
1690
  .order-lg-7 {
 
 
1691
  -webkit-box-ordinal-group: 8;
 
 
1692
  -ms-flex-order: 7;
 
 
1693
  order: 7
 
 
1694
  }
1695
 
 
 
 
 
1696
  .order-lg-8 {
 
 
1697
  -webkit-box-ordinal-group: 9;
 
 
1698
  -ms-flex-order: 8;
 
 
1699
  order: 8
 
 
1700
  }
1701
 
 
 
 
 
1702
  .order-lg-9 {
 
 
1703
  -webkit-box-ordinal-group: 10;
 
 
1704
  -ms-flex-order: 9;
 
 
1705
  order: 9
 
 
1706
  }
1707
 
 
 
 
 
1708
  .order-lg-10 {
 
 
1709
  -webkit-box-ordinal-group: 11;
 
 
1710
  -ms-flex-order: 10;
 
 
1711
  order: 10
 
 
1712
  }
1713
 
 
 
 
 
1714
  .order-lg-11 {
 
 
1715
  -webkit-box-ordinal-group: 12;
 
 
1716
  -ms-flex-order: 11;
 
 
1717
  order: 11
 
 
1718
  }
1719
 
 
 
 
 
1720
  .order-lg-12 {
 
 
1721
  -webkit-box-ordinal-group: 13;
 
 
1722
  -ms-flex-order: 12;
 
 
1723
  order: 12
 
 
1724
  }
1725
 
 
 
 
 
1726
  .offset-lg-0 {
 
 
1727
  margin-left: 0
 
 
1728
  }
1729
 
 
 
 
 
1730
  .offset-lg-1 {
 
 
1731
  margin-left: 8.333333%
 
 
1732
  }
1733
 
 
 
 
 
1734
  .offset-lg-2 {
 
 
1735
  margin-left: 16.666667%
 
 
1736
  }
1737
 
 
 
 
 
1738
  .offset-lg-3 {
 
 
1739
  margin-left: 25%
 
 
1740
  }
1741
 
 
 
 
 
1742
  .offset-lg-4 {
 
 
1743
  margin-left: 33.333333%
 
 
1744
  }
1745
 
 
 
 
 
1746
  .offset-lg-5 {
 
 
1747
  margin-left: 41.666667%
 
 
1748
  }
1749
 
 
 
 
 
1750
  .offset-lg-6 {
 
 
1751
  margin-left: 50%
 
 
1752
  }
1753
 
 
 
 
 
1754
  .offset-lg-7 {
 
 
1755
  margin-left: 58.333333%
1756
- }
1757
 
1758
- .offset-lg-8 {
1759
- margin-left: 66.666667%
1760
- }
1761
 
1762
- .offset-lg-9 {
1763
- margin-left: 75%
1764
  }
1765
 
1766
- .offset-lg-10 {
1767
- margin-left: 83.333333%
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1768
  }
1769
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1770
  .offset-lg-11 {
 
 
1771
  margin-left: 91.666667%
 
 
1772
  }
 
 
1773
  }
1774
 
 
 
 
 
1775
  @media (min-width: 1200px) {
 
 
1776
  .col-xl {
 
 
1777
  -ms-flex-preferred-size: 0;
 
 
1778
  flex-basis: 0;
 
 
1779
  -webkit-box-flex: 1;
 
 
1780
  -ms-flex-positive: 1;
 
 
1781
  flex-grow: 1;
 
 
1782
  max-width: 100%
 
 
1783
  }
1784
 
 
 
 
 
1785
  .col-xl-auto {
 
 
1786
  -webkit-box-flex: 0;
 
 
1787
  -ms-flex: 0 0 auto;
 
 
1788
  flex: 0 0 auto;
 
 
1789
  width: auto;
 
 
1790
  max-width: none
 
 
1791
  }
1792
 
 
 
 
 
1793
  .col-xl-1 {
 
 
1794
  -webkit-box-flex: 0;
 
 
1795
  -ms-flex: 0 0 8.333333%;
 
 
1796
  flex: 0 0 8.333333%;
 
 
1797
  max-width: 8.333333%
 
 
1798
  }
1799
 
 
 
 
 
1800
  .col-xl-2 {
 
 
1801
  -webkit-box-flex: 0;
 
 
1802
  -ms-flex: 0 0 16.666667%;
 
 
1803
  flex: 0 0 16.666667%;
 
 
1804
  max-width: 16.666667%
 
 
1805
  }
1806
 
 
 
 
 
1807
  .col-xl-3 {
 
 
1808
  -webkit-box-flex: 0;
 
 
1809
  -ms-flex: 0 0 25%;
 
 
1810
  flex: 0 0 25%;
 
 
1811
  max-width: 25%
 
 
1812
  }
1813
 
 
 
 
 
1814
  .col-xl-4 {
 
 
1815
  -webkit-box-flex: 0;
 
 
1816
  -ms-flex: 0 0 33.333333%;
 
 
1817
  flex: 0 0 33.333333%;
 
 
1818
  max-width: 33.333333%
 
 
1819
  }
1820
 
 
 
 
 
1821
  .col-xl-5 {
 
 
1822
  -webkit-box-flex: 0;
 
 
1823
  -ms-flex: 0 0 41.666667%;
 
 
1824
  flex: 0 0 41.666667%;
 
 
1825
  max-width: 41.666667%
 
 
1826
  }
1827
 
 
 
 
 
1828
  .col-xl-6 {
 
 
1829
  -webkit-box-flex: 0;
 
 
1830
  -ms-flex: 0 0 50%;
 
 
1831
  flex: 0 0 50%;
 
 
1832
  max-width: 50%
 
 
1833
  }
1834
 
 
 
 
 
1835
  .col-xl-7 {
 
 
1836
  -webkit-box-flex: 0;
 
 
1837
  -ms-flex: 0 0 58.333333%;
 
 
1838
  flex: 0 0 58.333333%;
 
 
1839
  max-width: 58.333333%
 
 
1840
  }
1841
 
 
 
 
 
1842
  .col-xl-8 {
 
 
1843
  -webkit-box-flex: 0;
 
 
1844
  -ms-flex: 0 0 66.666667%;
 
 
1845
  flex: 0 0 66.666667%;
 
 
1846
  max-width: 66.666667%
 
 
1847
  }
1848
 
 
 
 
 
1849
  .col-xl-9 {
 
 
1850
  -webkit-box-flex: 0;
 
 
1851
  -ms-flex: 0 0 75%;
 
 
1852
  flex: 0 0 75%;
 
 
1853
  max-width: 75%
 
 
1854
  }
1855
 
 
 
 
 
1856
  .col-xl-10 {
 
 
1857
  -webkit-box-flex: 0;
 
 
1858
  -ms-flex: 0 0 83.333333%;
 
 
1859
  flex: 0 0 83.333333%;
 
 
1860
  max-width: 83.333333%
 
 
1861
  }
1862
 
 
 
 
 
1863
  .col-xl-11 {
 
 
1864
  -webkit-box-flex: 0;
 
 
1865
  -ms-flex: 0 0 91.666667%;
 
 
1866
  flex: 0 0 91.666667%;
 
 
1867
  max-width: 91.666667%
 
 
1868
  }
1869
 
 
 
 
 
1870
  .col-xl-12 {
 
 
1871
  -webkit-box-flex: 0;
 
 
1872
  -ms-flex: 0 0 100%;
 
 
1873
  flex: 0 0 100%;
 
 
1874
  max-width: 100%
1875
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  .mo2f_carousel {
2
+
3
+
4
  position: relative;
5
+
6
+
7
  padding-bottom: 18px !important;
8
 
9
+
10
+
11
+
12
+
13
  }
14
 
15
+
16
+
17
+
18
+
19
  .mo2f_carousel-inner {
20
+
21
+
22
  position: relative;
23
+
24
+
25
  width: 100%;
26
+
27
+
28
  overflow: hidden;
29
 
30
+
31
+
32
+
33
+
34
  }
35
 
36
+
37
+
38
+
39
+
40
  .mo2f_carousel-inner > .item {
41
+
42
+
43
  position: relative;
44
+
45
+
46
  display: none;
47
+
48
+
49
  -webkit-transition: .6s ease-in-out left;
50
+
51
+
52
  -o-transition: .6s ease-in-out left;
53
+
54
+
55
  transition: .6s ease-in-out left;
56
+
57
+
58
  height: 300px !important;
59
 
60
+
61
+
62
+
63
+
64
  }
65
 
66
+
67
+
68
+
69
+
70
  .mo2f_carousel-inner > .item > img, .mo2f_carousel-inner > .item > a > img {
71
+
72
+
73
  line-height: 1;
74
 
75
+
76
+
77
+
78
+
79
  max-height: 300px !important;
80
+
81
+
82
  max-width: 600px !important;
83
+
84
+
85
  }
86
 
87
+
88
+
89
+
90
+
91
  @media all and (transform-3d) , ( -webkit-transform-3d ) {
92
+
93
+
94
  .mo2f_carousel-inner > .item {
95
+
96
+
97
  -webkit-transition: -webkit-transform .6s ease-in-out;
98
+
99
+
100
  -o-transition: -o-transform .6s ease-in-out;
101
+
102
+
103
  transition: transform .6s ease-in-out;
104
+
105
+
106
  -webkit-backface-visibility: hidden;
107
+
108
+
109
  backface-visibility: hidden;
110
+
111
+
112
  -webkit-perspective: 1000;
113
+
114
+
115
  perspective: 1000
116
+
117
+
118
  }
119
 
120
+
121
+
122
+
123
+
124
  .mo2f_carousel-inner > .item.next, .mo2f_carousel-inner > .item.active.right {
125
+
126
+
127
  left: 0;
128
+
129
+
130
  -webkit-transform: translate3d(100%, 0, 0);
131
+
132
+
133
  transform: translate3d(100%, 0, 0)
134
+
135
+
136
  }
137
 
138
+
139
+
140
+
141
+
142
  .mo2f_carousel-inner > .item.prev, .mo2f_carousel-inner > .item.active.left {
143
+
144
+
145
  left: 0;
146
+
147
+
148
  -webkit-transform: translate3d(-100%, 0, 0);
149
+
150
+
151
  transform: translate3d(-100%, 0, 0)
152
+
153
+
154
  }
155
 
156
+
157
+
158
+
159
+
160
  .mo2f_carousel-inner > .item.next.left, .mo2f_carousel-inner > .item.prev.right, .mo2f_carousel-inner > .item.active {
161
+
162
+
163
  left: 0;
164
+
165
+
166
  -webkit-transform: translate3d(0, 0, 0);
167
+
168
+
169
  transform: translate3d(0, 0, 0)
170
+
171
+
172
  }
173
+
174
+
175
  }
176
 
177
+
178
+
179
+
180
+
181
  .mo2f_carousel-inner > .active, .mo2f_carousel-inner > .next, .mo2f_carousel-inner > .prev {
182
+
183
+
184
  display: block
185
+
186
+
187
  }
188
 
189
+
190
+
191
+
192
+
193
  .mo2f_carousel-inner > .active {
194
+
195
+
196
  left: 0
197
+
198
+
199
  }
200
 
201
+
202
+
203
+
204
+
205
  .mo2f_carousel-inner > .next, .mo2f_carousel-inner > .prev {
206
+
207
+
208
  position: absolute;
209
+
210
+
211
  top: 0;
212
+
213
+
214
  width: 100%
215
+
216
+
217
  }
218
 
219
+
220
+
221
+
222
+
223
  .mo2f_carousel-inner > .next {
224
+
225
+
226
  left: 100%
227
+
228
+
229
  }
230
 
231
+
232
+
233
+
234
+
235
  .mo2f_carousel-inner > .prev {
236
+
237
+
238
  left: -100%
239
+
240
+
241
  }
242
 
243
+
244
+
245
+
246
+
247
  .mo2f_carousel-inner > .next.left, .mo2f_carousel-inner > .prev.right {
248
+
249
+
250
  left: 0
251
+
252
+
253
  }
254
 
255
+
256
+
257
+
258
+
259
  .mo2f_carousel-inner > .active.left {
260
+
261
+
262
  left: -100%
263
+
264
+
265
  }
266
 
267
+
268
+
269
+
270
+
271
  .mo2f_carousel-inner > .active.right {
272
+
273
+
274
  left: 100%
275
+
276
+
277
  }
278
 
279
+
280
+
281
+
282
+
283
  .mo2f_carousel-control {
284
+
285
+
286
  position: absolute;
287
+
288
+
289
  top: 0;
290
+
291
+
292
  bottom: 0;
293
+
294
+
295
  left: 0;
296
+
297
+
298
  width: 15%;
299
+
300
+
301
  font-size: 20px;
302
+
303
+
304
  color: #fff;
305
+
306
+
307
  text-align: center;
308
+
309
+
310
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
311
+
312
+
313
  filter: alpha(opacity=50);
314
+
315
+
316
  opacity: .5
317
+
318
+
319
  }
320
 
321
+
322
+
323
+
324
+
325
  .mo2f_carousel-control.left {
326
+
327
+
328
  background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .5) 0,
329
+
330
+
331
  rgba(0, 0, 0, .0001) 100%);
332
+
333
+
334
  background-image: -o-linear-gradient(left, rgba(0, 0, 0, .5) 0,
335
+
336
+
337
  rgba(0, 0, 0, .0001) 100%);
338
+
339
+
340
  background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .5)),
341
+
342
+
343
  to(rgba(0, 0, 0, .0001)));
344
+
345
+
346
  background-image: linear-gradient(to right, rgba(0, 0, 0, .5) 0,
347
+
348
+
349
  rgba(0, 0, 0, .0001) 100%);
350
+
351
+
352
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000',
353
+
354
+
355
  endColorstr='#00000000', GradientType=1);
356
+
357
+
358
  background-repeat: repeat-x
359
+
360
+
361
  }
362
 
363
+
364
+
365
+
366
+
367
  .mo2f_carousel-control.right {
368
+
369
+
370
  right: 0;
371
+
372
+
373
  left: auto;
374
+
375
+
376
  background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .0001) 0,
377
+
378
+
379
  rgba(0, 0, 0, .5) 100%);
380
+
381
+
382
  background-image: -o-linear-gradient(left, rgba(0, 0, 0, .0001) 0,
383
+
384
+
385
  rgba(0, 0, 0, .5) 100%);
386
+
387
+
388
  background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .0001)),
389
+
390
+
391
  to(rgba(0, 0, 0, .5)));
392
+
393
+
394
  background-image: linear-gradient(to right, rgba(0, 0, 0, .0001) 0,
395
+
396
+
397
  rgba(0, 0, 0, .5) 100%);
398
+
399
+
400
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000',
401
+
402
+
403
  endColorstr='#80000000', GradientType=1);
404
+
405
+
406
  background-repeat: repeat-x
407
+
408
+
409
  }
410
 
411
+
412
+
413
+
414
+
415
  .mo2f_carousel-control:hover, .mo2f_carousel-control:focus {
416
+
417
+
418
  color: #fff;
419
+
420
+
421
  text-decoration: none;
422
+
423
+
424
  filter: alpha(opacity=90);
425
+
426
+
427
  outline: 0;
428
+
429
+
430
  opacity: .9
431
+
432
+
433
  }
434
 
435
+
436
+
437
+
438
+
439
  .mo2f_carousel-control .icon-prev, .mo2f_carousel-control .icon-next, .mo2f_carousel-control .glyphicon-chevron-left, .mo2f_carousel-control .glyphicon-chevron-right {
440
+
441
+
442
  position: absolute;
443
+
444
+
445
  top: 50%;
446
+
447
+
448
  z-index: 5;
449
+
450
+
451
  display: inline-block
452
+
453
+
454
  }
455
 
456
+
457
+
458
+
459
+
460
  .mo2f_carousel-control .icon-prev, .mo2f_carousel-control .glyphicon-chevron-left {
461
+
462
+
463
  left: 50%;
464
+
465
+
466
  margin-left: -10px
467
+
468
+
469
  }
470
 
471
+
472
+
473
+
474
+
475
  .mo2f_carousel-control .icon-next, .mo2f_carousel-control .glyphicon-chevron-right {
476
+
477
+
478
  right: 50%;
479
+
480
+
481
  margin-right: -10px
482
+
483
+
484
  }
485
 
486
+
487
+
488
+
489
+
490
  .mo2f_carousel-control .icon-prev, .mo2f_carousel-control .icon-next {
491
+
492
+
493
  width: 20px;
494
+
495
+
496
  height: 20px;
497
+
498
+
499
  margin-top: -10px;
500
+
501
+
502
  font-family: serif
503
+
504
+
505
  }
506
 
507
+
508
+
509
+
510
+
511
  .mo2f_carousel-control .icon-prev:before {
512
+
513
+
514
  content: '\2039'
515
+
516
+
517
  }
518
 
519
+
520
+
521
+
522
+
523
  .mo2f_carousel-control .icon-next:before {
524
+
525
+
526
  content: '\203a'
527
+
528
+
529
  }
530
 
531
+
532
+
533
+
534
+
535
  .mo2f_carousel-indicators {
536
+
537
+
538
  position: absolute;
539
+
540
+
541
  bottom: -25px;
542
+
543
+
544
  left: 50%;
545
+
546
+
547
  z-index: 15;
548
+
549
+
550
  width: 60%;
551
+
552
+
553
  padding-left: 0;
554
+
555
+
556
  margin-left: -30%;
557
+
558
+
559
  text-align: center;
560
+
561
+
562
  list-style: none
563
+
564
+
565
  }
566
 
567
+
568
+
569
+
570
+
571
  .mo2f_carousel-indicators li {
572
+
573
+
574
  display: inline-block;
575
+
576
+
577
  width: 10px;
578
+
579
+
580
  height: 10px;
581
+
582
+
583
  margin: 1px;
584
+
585
+
586
  text-indent: -999px;
587
+
588
+
589
  cursor: pointer;
590
+
591
+
592
  background-color: #0 \9;
593
+
594
+
595
  background-color: rgba(0, 0, 0, 0);
596
+
597
+
598
  border: 1px solid #0073aa;
599
+
600
+
601
  border-radius: 10px
602
+
603
+
604
  }
605
 
606
+
607
+
608
+
609
+
610
  .mo2f_carousel-indicators .active {
611
+
612
+
613
  width: 12px;
614
+
615
+
616
  height: 12px;
617
+
618
+
619
  margin: 0;
620
+
621
+
622
  background-color: #0073aa;
623
+
624
+
625
  }
626
 
627
+
628
+
629
+
630
+
631
  .mo2f_carousel-caption {
632
+
633
+
634
  position: absolute;
635
+
636
+
637
  right: 15%;
638
+
639
+
640
  bottom: 20px;
641
+
642
+
643
  left: 15%;
644
+
645
+
646
  z-index: 10;
647
+
648
+
649
  padding-top: 20px;
650
+
651
+
652
  padding-bottom: 20px;
653
+
654
+
655
  color: #fff;
656
+
657
+
658
  text-align: center;
659
+
660
+
661
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6)
662
+
663
+
664
  }
665
 
666
+
667
+
668
+
669
+
670
  .mo2f_carousel-caption .btn {
671
+
672
+
673
  text-shadow: none
674
+
675
+
676
  }
677
 
678
+
679
+
680
+
681
+
682
  @media screen and (min-width: 768px) {
683
+
684
+
685
  .mo2f_carousel-control .glyphicon-chevron-left, .mo2f_carousel-control .glyphicon-chevron-right, .mo2f_carousel-control .icon-prev, .mo2f_carousel-control .icon-next {
686
+
687
+
688
  width: 30px;
689
+
690
+
691
  height: 30px;
692
+
693
+
694
  margin-top: -15px;
695
+
696
+
697
  font-size: 30px
698
+
699
+
700
  }
701
 
702
+
703
+
704
+
705
+
706
  .mo2f_carousel-control .glyphicon-chevron-left, .mo2f_carousel-control .icon-prev {
707
+
708
+
709
  margin-left: -15px
710
+
711
+
712
  }
713
 
714
+
715
+
716
+
717
+
718
  .mo2f_carousel-control .glyphicon-chevron-right, .mo2f_carousel-control .icon-next {
719
+
720
+
721
  margin-right: -15px
722
+
723
+
724
  }
725
 
726
+
727
+
728
+
729
+
730
  .mo2f_carousel-caption {
731
+
732
+
733
  right: 20%;
734
+
735
+
736
  left: 20%;
737
+
738
+
739
  padding-bottom: 30px
740
+
741
+
742
  }
743
 
744
+
745
+
746
+
747
+
748
  .mo2f_carousel-indicators {
749
+
750
+
751
  bottom: -14px
752
+
753
+
754
  }
755
+
756
+
757
  }
758
 
759
+
760
+
761
+
762
+
763
  .hidden {
764
+
765
+
766
  display: none;
767
+
768
+
769
  }
770
 
771
+
772
+
773
+
774
+
775
  .float-right {
776
+
777
+
778
  text-align: right;
779
+
780
+
781
  }
782
 
783
+
784
+
785
+
786
+
787
  .mo2f_collapse {
788
+
789
+
790
  display: none;
791
+
792
+
793
  / / visibility: hidden;
794
+
795
+
796
  font-size: 14px !important;
797
 
798
+
799
+
800
+
801
+
802
  }
803
 
804
+
805
+
806
+
807
+
808
  .mo2f_collapse.in {
809
+
810
+
811
  display: block;
812
+
813
+
814
  visibility: visible;
815
 
816
+
817
+
818
+
819
+
820
  }
821
 
822
+
823
+
824
+
825
+
826
  .mo2f_collapsing {
827
+
828
+
829
  position: relative;
830
+
831
+
832
  font-size: 14px !important;
833
+
834
+
835
  height: 0;
836
+
837
+
838
  overflow: hidden;
839
+
840
+
841
  -webkit-transition-timing-function: ease;
842
+
843
+
844
  -o-transition-timing-function: ease;
845
+
846
+
847
  transition-timing-function: ease;
848
+
849
+
850
  -webkit-transition-duration: .20s;
851
+
852
+
853
  -o-transition-duration: .20s;
854
+
855
+
856
  transition-duration: .20s;
857
+
858
+
859
  -webkit-transition-property: height, visibility;
860
+
861
+
862
  -o-transition-property: height, visibility;
863
+
864
+
865
  transition-property: height, visibility
866
+
867
+
868
  }
869
 
870
+
871
+
872
+
873
+
874
  .mo2f_thumbnail {
875
+
876
+
877
  width: 315px;
878
+
879
+
880
  margin-bottom: 10px;
881
+
882
+
883
  position: relative;
884
+
885
+
886
  background-color: #fff;
887
+
888
+
889
  border: 1px solid #ddd;
890
+
891
+
892
  -webkit-transition: border .2s ease-in-out;
893
+
894
+
895
  -o-transition: border .2s ease-in-out;
896
+
897
+
898
  transition: border .2s ease-in-out
899
+
900
+
901
  }
902
 
903
+
904
+
905
+
906
+
907
  .mo2f_thumbnail > img, .mo2f_thumbnail a > img {
908
+
909
+
910
  margin-right: auto;
911
+
912
+
913
  margin-left: auto
914
+
915
+
916
  }
917
 
918
+
919
+
920
+
921
+
922
  a.mo2f_thumbnail:hover, a.mo2f_thumbnail:focus, a.mo2f_thumbnail.active {
923
+
924
+
925
  border-color: #337ab7
926
+
927
+
928
  }
929
 
930
+
931
+
932
+
933
+
934
  .mo2f_thumbnail .caption {
935
+
936
+
937
  padding: 9px;
938
+
939
+
940
  color: #333
941
+
942
+
943
  }
944
 
945
+
946
+
947
+
948
+
949
  .mo2f_thumbnail label {
950
+
951
+
952
  font-weight: bold;
953
 
954
+
955
+
956
+
957
+
958
  }
959
 
960
+
961
+
962
+
963
+
964
  .mo2f_close {
965
+
966
+
967
  float: right;
968
+
969
+
970
  font-size: 21px;
971
+
972
+
973
  font-weight: 700;
974
+
975
+
976
  line-height: 1;
977
+
978
+
979
  color: #000;
980
+
981
+
982
  text-shadow: 0 1px 0 #fff;
983
+
984
+
985
  filter: alpha(opacity=20);
986
+
987
+
988
  opacity: .2
989
+
990
+
991
  }
992
 
993
+
994
+
995
+
996
+
997
  .mo2f_close:hover, .mo2f_close:focus {
998
+
999
+
1000
  color: #000;
1001
+
1002
+
1003
  text-decoration: none;
1004
+
1005
+
1006
  cursor: pointer;
1007
+
1008
+
1009
  filter: alpha(opacity=50);
1010
+
1011
+
1012
  opacity: .5
1013
+
1014
+
1015
  }
1016
 
1017
+
1018
+
1019
+
1020
+
1021
  button.mo2f_close {
1022
+
1023
+
1024
  -webkit-appearance: none;
1025
+
1026
+
1027
  padding: 0;
1028
+
1029
+
1030
  cursor: pointer;
1031
+
1032
+
1033
  background: 0 0;
1034
+
1035
+
1036
  border: 0
1037
+
1038
+
1039
  }
1040
 
1041
+
1042
+
1043
+
1044
+
1045
  .mo2f_modal-open {
1046
+
1047
+
1048
  overflow: hidden !important;
1049
+
1050
+
1051
  position: fixed !important;
1052
+
1053
+
1054
  width: 100% !important;
1055
 
1056
+
1057
+
1058
+
1059
+
1060
  }
1061
 
1062
+
1063
+
1064
+
1065
+
1066
  .mo2f_modal {
1067
+
1068
+
1069
  position: fixed !important;
1070
+
1071
+
1072
  top: 0;
1073
+
1074
+
1075
  right: 0;
1076
+
1077
+
1078
  bottom: 0;
1079
+
1080
+
1081
  left: 0;
1082
+
1083
+
1084
  z-index: 100000 !important;
1085
 
1086
+
1087
+
1088
+
1089
+
1090
  overflow: hidden !important;
1091
+
1092
+
1093
  -webkit-overflow-scrolling: touch;
1094
+
1095
+
1096
  outline: 0;
1097
 
1098
+
1099
+
1100
+
1101
+
1102
  }
1103
 
1104
+
1105
+
1106
+
1107
+
1108
  .mo2f_modal_inner {
1109
+
1110
+
1111
  display: none;
1112
+
1113
+
1114
  }
1115
 
1116
+
1117
+
1118
+
1119
+
1120
  .mo2f_modal.fade .mo2f_modal-dialog {
1121
+
1122
+
1123
  -webkit-transition: -webkit-transform .3s ease-out;
1124
+
1125
+
1126
  -o-transition: -o-transform .3s ease-out;
1127
+
1128
+
1129
  transition: transform .3s ease-out;
1130
+
1131
+
1132
  -webkit-transform: translate(0, -25%);
1133
+
1134
+
1135
  -ms-transform: translate(0, -25%);
1136
+
1137
+
1138
  -o-transform: translate(0, -25%);
1139
+
1140
+
1141
  transform: translate(0, -25%)
 
1142
 
 
 
 
 
 
1143
 
1144
  }
1145
 
1146
+
1147
+
1148
+
1149
+
1150
+ .mo2f_modal.in .mo2f_modal-dialog {
1151
+
1152
+
1153
+ -webkit-transform: translate(0, 80px) !important;
1154
+
1155
+
1156
+ -ms-transform: translate(0, 80px) !important;
1157
+
1158
+
1159
+ -o-transform: translate(0, 80px) !important;
1160
+
1161
+
1162
+ transform: translate(0, 80px) !important;
1163
+
1164
+
1165
+
1166
+
1167
+
1168
+ }
1169
+
1170
+
1171
+
1172
+
1173
+
1174
+ .mo2f_modal-open .mo2f_modal {
1175
+
1176
+
1177
+ overflow-x: hidden;
1178
+
1179
+
1180
  overflow-y: hidden;
1181
+
1182
+
1183
  }
1184
 
1185
+
1186
+
1187
+
1188
+
1189
  .mo2f_modal-dialog {
1190
+
1191
+
1192
  position: relative;
1193
+
1194
+
1195
  width: auto;
1196
+
1197
+
1198
  margin: 10px;
1199
 
1200
+
1201
+
1202
+
1203
+
1204
  }
1205
 
1206
+
1207
+
1208
+
1209
+
1210
  .login mo_customer_validation-modal-content {
1211
+
1212
+
1213
  position: relative !important;
1214
+
1215
+
1216
  background-color: #fff !important;
1217
+
1218
+
1219
  -webkit-background-clip: padding-box !important;
1220
+
1221
+
1222
  background-clip: padding-box !important;
1223
+
1224
+
1225
  border: 1px solid #999 !important;
1226
+
1227
+
1228
  border: 1px solid rgba(0, 0, 0, .2) !important;
1229
+
1230
+
1231
  border-radius: 6px !important;
1232
+
1233
+
1234
  outline: 0 !important;
1235
 
1236
+
1237
+
1238
+
1239
+
1240
  -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5) !important;
1241
+
1242
+
1243
  box-shadow: 0 3px 9px rgba(0, 0, 0, .5) !important;
1244
+
1245
+
1246
  }
1247
 
1248
+
1249
+
1250
+
1251
+
1252
  .mo2f-modal-backdrop {
1253
+
1254
+
1255
  position: absolute;
1256
+
1257
+
1258
  top: 0;
1259
+
1260
+
1261
  right: 0;
1262
+
1263
+
1264
  left: 0;
1265
+
1266
+
1267
  background-color: #f1f1f1 !important;
1268
+
1269
+
1270
  filter: alpha(opacity=50) !important;
1271
+
1272
+
1273
  opacity: 0.8 !important;
1274
+
1275
+
1276
  height: 100% !important;
1277
+
1278
+
1279
  }
1280
 
1281
+
1282
+
1283
+
1284
+
1285
  #smsAlertModal {
 
 
 
 
1286
 
1287
+
1288
  background-color: black !important;
1289
+
1290
+
1291
  opacity: 0.8 !important;
1292
+
1293
+
1294
  filter: alpha(opacity=50) !important;
1295
+
1296
+
1297
  }
1298
 
1299
+
1300
+
1301
+
1302
+
1303
  .mo2f_modal-header {
1304
+
1305
+
1306
  min-height: 14px;
1307
+
1308
+
1309
  padding: 10px;
1310
+
1311
+
1312
  border-bottom: 1px solid #e5e5e5
1313
+
1314
+
1315
  }
1316
 
1317
+
1318
+
1319
+
1320
+
1321
  .mo2f_modal-title {
1322
+
1323
+
1324
  margin: 0 !important;
1325
+
1326
+
1327
  line-height: 1.0 !important;
1328
+
1329
+
1330
  }
1331
 
1332
+
1333
+
1334
+
1335
+
1336
  .mo2f_modal-body {
1337
+
1338
+
1339
  / / width: 96 % !important;
1340
+
1341
+
1342
  position: relative !important;
1343
+
1344
+
1345
  padding: 15px !important;
1346
+
1347
+
1348
  overflow-y: auto !important;
1349
+
1350
+
1351
  max-height: 550px !important;
1352
+
1353
+
1354
  }
1355
 
1356
+
1357
+
1358
+
1359
+
1360
  .mo2f_modal-footer {
1361
+
1362
+
1363
  padding: 15px;
1364
+
1365
+
1366
  text-align: right;
1367
+
1368
+
1369
  border-top: 1px solid #e5e5e5
1370
+
1371
+
1372
  }
1373
 
1374
+
1375
+
1376
+
1377
+
1378
  .mo2f_modal-footer .btn + .btn {
1379
+
1380
+
1381
  margin-bottom: 0;
1382
+
1383
+
1384
  margin-left: 5px
1385
+
1386
+
1387
  }
1388
 
1389
+
1390
+
1391
+
1392
+
1393
  .mo2f_modal-footer .btn-group .btn + .btn {
1394
+
1395
+
1396
  margin-left: -1px
1397
+
1398
+
1399
  }
1400
 
1401
+
1402
+
1403
+
1404
+
1405
  .mo2f_modal-footer .btn-block + .btn-block {
1406
+
1407
+
1408
  margin-left: 0
1409
+
1410
+
1411
  }
1412
 
1413
+
1414
+
1415
+
1416
+
1417
  .mo2f_modal-scrollbar-measure {
1418
+
1419
+
1420
  position: absolute;
1421
+
1422
+
1423
  top: -9999px;
1424
+
1425
+
1426
  width: 50px;
1427
+
1428
+
1429
  height: 50px;
1430
+
1431
+
1432
  overflow: scroll
1433
+
1434
+
1435
  }
1436
 
1437
+
1438
+
1439
+
1440
+
1441
  @media ( min-width: 768px) {
1442
+
1443
+
1444
  .mo2f_modal-dialog {
1445
+
1446
+ width: auto;
1447
+ margin: 0px auto
1448
+
1449
+
1450
  }
1451
 
1452
+
1453
+
1454
+
1455
+
1456
  .login mo_customer_validation-modal-content {
1457
+
1458
+
1459
  -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
1460
+
1461
+
1462
  box-shadow: 0 5px 15px rgba(0, 0, 0, .5)
1463
+
1464
+
1465
  }
1466
 
1467
+
1468
+
1469
+
1470
+
1471
  .mo2f_modal-sm {
1472
+
1473
+
1474
  width: 300px
1475
+
1476
+
1477
  }
1478
 
1479
+
1480
+
1481
+
1482
+
1483
  .mo2f_modal-md {
1484
+
1485
+
1486
  width: 550px
1487
+
1488
+
1489
  }
1490
+
1491
+
1492
  }
1493
 
1494
+
1495
+
1496
+
1497
+
1498
  @media ( min-width: 992px) {
1499
+
1500
+
1501
  .mo2f_modal-lg {
1502
+
1503
+
1504
  width: 900px;
 
1505
 
1506
+
 
1507
  }
1508
+
1509
+
1510
+
1511
+
1512
+
1513
+ .mo2f_modal-md {
1514
+
1515
+
1516
+ width: 550px
1517
+
1518
+
1519
+ }
1520
+
1521
+
1522
+ }
1523
+
1524
+
1525
+
1526
+
1527
 
1528
  .center{
1529
 
1530
+
1531
+
1532
+
1533
+
1534
+ text-align: center !important;
1535
+
1536
+
1537
  }
1538
 
1539
+
1540
+
1541
+
1542
+
1543
  #otpMessage {
1544
+
1545
+
1546
  border-radius: 1px;
1547
+
1548
+
1549
  padding: 1px 5px;
1550
+
1551
+
1552
  background: #f1f1f1;
1553
+
1554
+
1555
  }
1556
 
1557
+
1558
+
1559
+
1560
+
1561
  .mo2f_carousel-indicators {
1562
+
1563
+
1564
  position: absolute;
1565
+
1566
+
1567
  bottom: -20px;
1568
+
1569
+
1570
  z-index: 15;
1571
+
1572
+
1573
  width: 60%;
1574
+
1575
+
1576
  list-style: none;
1577
+
1578
+
1579
  text-align: center;
1580
+
1581
+
1582
  }
1583
 
1584
+
1585
+
1586
+
1587
+
1588
+ .miniorange_kba_validate:hover, .miniorange_validate_otp:hover, .miniorange_login_forgotphone:hover,
1589
+
1590
+
1591
+ .miniorange_login_offline:hover, .miniorange_login_forgotphone:hover, .miniorange_otp_token_submit:hover, .miniorange_button:hover
1592
+
1593
+
1594
+ {
1595
+
1596
+
1597
+ background-color:#0073AA!important
1598
+
1599
+
1600
  }
1601
 
1602
+
1603
+
1604
+
1605
+
1606
+ .miniorange_kba_validate, .miniorange_validate_otp, .miniorange_login_forgotphone,
1607
+
1608
+
1609
+ .miniorange_login_offline, .miniorange_login_forgotphone , .miniorange_otp_token_submit,
1610
+
1611
+
1612
+ .miniorange_button
1613
+
1614
+
1615
+ {
1616
+
1617
+
1618
+ background:#00A0D2!important;
1619
+
1620
+
1621
+ border-color:#0073AA!important;
1622
+
1623
+
1624
+ box-shadow:0 1px 0 rgba(120,200,230,.5) inset,0 1px 0 rgba(0,0,0,.15)!important;
1625
+
1626
+
1627
+ color:#FFF!important;
1628
+
1629
+
1630
+ text-decoration:none!important;
1631
+
1632
+
1633
+ cursor:pointer!important;
1634
+
1635
+
1636
+ border-width:1px!important;
1637
+
1638
+
1639
+ border-style:solid!important;
1640
+
1641
+
1642
+ border-radius:3px!important;
1643
+
1644
+
1645
+ white-space:nowrap!important;
1646
+
1647
+
1648
+ box-sizing:border-box!important;
1649
+
1650
+
1651
+ line-height:28px!important;
1652
+
1653
+
1654
+ padding:0 12px!important;
1655
+
1656
+
1657
+ font-size:13px!important;
1658
+
1659
+
1660
  }
1661
 
1662
+
1663
+
1664
+
1665
+
1666
  .mo_customer_validation-modal.fade .mo_customer_validation-modal-dialog {
1667
+
1668
+
1669
  -webkit-transition: -webkit-transform .3s ease-out;
1670
+
1671
+
1672
  -o-transition: -o-transform .3s ease-out;
1673
+
1674
+
1675
  transition: transform .3s ease-out;
1676
+
1677
+
1678
  -webkit-transform: translate(0, -25%);
1679
+
1680
+
1681
  -ms-transform: translate(0, -25%);
1682
+
1683
+
1684
  -o-transform: translate(0, -25%);
1685
+
1686
+
1687
  transform: translate(0, -25%)
1688
+
1689
+
1690
  }
1691
 
1692
+
1693
+
1694
+
1695
+
1696
  .mo_customer_validation-modal.in .mo_customer_validation-modal-dialog {
1697
+
1698
+
1699
  -webkit-transform: translate(0, 80px) !important;
1700
+
1701
+
1702
  -ms-transform: translate(0, 80px) !important;
1703
+
1704
+
1705
  -o-transform: translate(0, 80px) !important;
1706
+
1707
+
1708
  transform: translate(0, 80px) !important
1709
+
1710
+
1711
  }
1712
 
1713
+
1714
+
1715
+
1716
+
1717
  .mo_customer_validation-modal-open .mo_customer_validation-modal {
1718
+
1719
+
1720
  overflow-x: hidden;
1721
+
1722
+
1723
  overflow-y: hidden
1724
+
1725
+
1726
  }
1727
 
1728
+
1729
+
1730
+
1731
+
1732
  .mo_customer_validation-modal-dialog {
1733
+
1734
+
1735
  position: relative;
1736
+
1737
+
1738
  width: auto;
1739
+
1740
+
1741
  margin: 10px
1742
+
1743
+
1744
  }
1745
 
1746
+
1747
+
1748
+
1749
+
1750
  .mo_customer_validation-modal-content {
1751
+
1752
+
1753
  position: relative;
1754
+
1755
+
1756
  -webkit-background-clip: padding-box;
1757
+
1758
+
1759
  border: 1px solid #999;
1760
+
1761
+
1762
  border: 1px solid rgba(0, 0, 0, .2);
1763
+
1764
+
1765
  outline: 0;
1766
+
1767
+
1768
  margin-top: 8%;
1769
+
1770
+
1771
  margin-left: 0;
1772
+
1773
+
1774
  padding: 15px 20px 0;
1775
+
1776
+
1777
  font-family: "Open Sans", sans-serif;
1778
+
1779
+
1780
+
1781
  font-size: 14px;
1782
+
1783
+
1784
  line-height: 1.4em;
1785
+
1786
+
1787
  background: #FFF;
1788
+
1789
+
1790
  box-shadow: 0 1px 3px rgba(0, 0, 0, .13)
1791
+
1792
+
1793
  }
1794
 
1795
+
1796
+
1797
+
1798
+
1799
  .mo_customer_validation-modal-backdrop {
1800
+
1801
+
1802
  position: absolute;
1803
+
1804
+
1805
  top: 0;
1806
+
1807
+
1808
  right: 0;
1809
+
1810
+
1811
  left: 0;
1812
+
1813
+
1814
  background-color: #000 !important;
1815
+
1816
+
1817
  filter: alpha(opacity=50) !important;
1818
+
1819
+
1820
  opacity: .9 !important;
1821
+
1822
+
1823
  height: 100% !important
1824
+
1825
+
1826
  }
1827
 
1828
+
1829
+
1830
+
1831
+
1832
  .mo_customer_validation-modal-header {
1833
+
1834
+
1835
  min-height: 14px;
1836
+
1837
+
1838
  padding: 10px 10px 20px;
1839
+
1840
+
1841
  border-bottom: 1px solid #e5e5e5
1842
+
1843
+
1844
  }
1845
 
1846
+
1847
+
1848
+
1849
+
1850
  .mo_customer_validation-modal-title {
1851
+
1852
+
1853
  margin: 0 !important;
1854
+
1855
+
1856
  line-height: 1 !important
1857
+
1858
+
1859
  }
1860
 
1861
+
1862
+
1863
+
1864
+
1865
  .mo_customer_validation-modal-body {
1866
+
1867
+
1868
  position: relative;
1869
+
1870
+
1871
  padding: 5%;
1872
+
1873
+
1874
  overflow: hidden !important;
1875
+
1876
+
1877
  max-height: 550px !important
1878
+
1879
+
1880
  }
1881
 
1882
+
1883
+
1884
+
1885
+
1886
+ .mo_customer_validation-modal-footer {
1887
+
1888
+
1889
+ padding: 15px;
1890
+
1891
+
1892
+ text-align: right;
1893
+
1894
+
1895
  border-top: 1px solid #e5e5e5
1896
+
1897
+
1898
  }
1899
 
1900
+
1901
+
1902
+
1903
+
1904
  .mo_customer_validation-modal-footer .btn + .btn {
1905
+
1906
+
1907
  margin-bottom: 0;
1908
+
1909
+
1910
  margin-left: 5px
1911
+
1912
+
1913
  }
1914
 
1915
+
1916
+
1917
+
1918
+
1919
  .mo_customer_validation-modal-footer .btn-group .btn + .btn {
1920
+
1921
+
1922
  margin-left: -1px
1923
+
1924
+
1925
  }
1926
 
1927
+
1928
+
1929
+
1930
+
1931
  .mo_customer_validation-modal-footer .btn-block + .btn-block {
1932
+
1933
+
1934
  margin-left: 0
1935
+
1936
+
1937
  }
1938
 
1939
+
1940
+
1941
+
1942
+
1943
  .mo_customer_validation-modal-scrollbar-measure {
1944
+
1945
+
1946
  position: absolute;
1947
+
1948
+
1949
  top: -9999px;
1950
+
1951
+
1952
  width: 50px;
1953
+
1954
+
1955
  height: 50px;
1956
+
1957
+
1958
  overflow: scroll
1959
+
1960
+
1961
  }
1962
 
1963
+
1964
+
1965
+
1966
+
1967
  @media (min-width: 768px) {
1968
+
1969
+
1970
  .mo_customer_validation-modal-dialog {
1971
+
1972
+
1973
  width: auto;
1974
+
1975
+
1976
  margin: 0 auto
1977
+
1978
+
1979
  }
1980
 
1981
+
1982
+
1983
+
1984
+
1985
  .mo_customer_validation-modal-content {
1986
+
1987
+
1988
  -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
1989
+
1990
+
1991
  box-shadow: 0 5px 15px rgba(0, 0, 0, .5)
1992
+
1993
+
1994
  }
1995
 
1996
+
1997
+
1998
+
1999
+
2000
  .mo_customer_validation-modal-sm {
2001
+
2002
+
2003
  width: 300px
2004
+
2005
+
2006
  }
2007
 
2008
+
2009
+
2010
+
2011
+
2012
  .mo_customer_validation-modal-md {
2013
+
2014
+
2015
  width: 532px
2016
+
2017
+
2018
  }
2019
 
2020
+
2021
+
2022
+
2023
+
2024
  .mo_customer_validation-modal-lg {
2025
+
2026
+
2027
  width: 50%
2028
+
2029
+
2030
  }
2031
+
2032
+
2033
  }
2034
 
2035
+
2036
+
2037
+
2038
+
2039
  @media (min-width: 992px) {
2040
+
2041
+
2042
  .mo_customer_validation-modal-dialog {
2043
+
2044
+
2045
  width: auto;
2046
+
2047
+
2048
  margin: 0 auto
2049
+
2050
+
2051
  }
2052
 
2053
+
2054
+
2055
+
2056
+
2057
  .mo_customer_validation-modal-lg {
2058
+
2059
+
2060
  width: 490px
2061
+
2062
+
2063
  }
2064
 
2065
+
2066
+
2067
+
2068
+
2069
  .mo_customer_validation-modal-md {
2070
+
2071
+
2072
  width: 532px
2073
+
2074
+
2075
  }
2076
+
2077
+
2078
  }
2079
 
2080
+
2081
+
2082
+
2083
+
2084
  .mo_customer_validation-textbox {
2085
+
2086
+
2087
  background: #FBFBFB;
2088
+
2089
+
2090
  font-family: "Open Sans", sans-serif;
2091
+
2092
+
2093
  font-size: 24px;
2094
+
2095
+
2096
  width: 100%;
2097
+
2098
+
2099
  border: 1px solid #DDD;
2100
+
2101
+
2102
  padding: 3px;
2103
+
2104
+
2105
  margin: 2px 6px 16px 0
2106
+
2107
+
2108
  }
2109
 
2110
+
2111
+
2112
+
2113
+
2114
  .mo_customer_validation-textbox:focus {
2115
+
2116
+
2117
  border-color: #5B9DD9;
2118
+
2119
+
2120
  box-shadow: 0 0 2px rgba(30, 140, 190, .8)
2121
+
2122
+
2123
  }
2124
 
2125
+
2126
+
2127
+
2128
+
2129
  .button-primary,
2130
+
2131
+
2132
  .button-secondary {
2133
+
2134
+
2135
  background: #00A0D2;
2136
+
2137
+
2138
  border-color: #0073AA;
2139
+
2140
+
2141
  box-shadow: 0 1px 0 rgba(120, 200, 230, .5) inset, 0 1px 0 rgba(0, 0, 0, .15);
2142
+
2143
+
2144
  color: #FFF;
2145
+
2146
+
2147
  text-decoration: none;
2148
+
2149
+
2150
  cursor: pointer;
2151
+
2152
+
2153
  border-width: 1px;
2154
+
2155
+
2156
  border-style: solid;
2157
+
2158
+
2159
  border-radius: 3px;
2160
+
2161
+
2162
  white-space: nowrap;
2163
+
2164
+
2165
  box-sizing: border-box;
2166
+
2167
+
2168
  line-height: 28px;
2169
+
2170
+
2171
  padding: 0 12px;
2172
+
2173
+
2174
  font-size: 13px
2175
+
2176
+
2177
  }
2178
 
2179
+
2180
+
2181
+
2182
+
2183
  .button:hover {
2184
+
2185
+
2186
  background-color: #0073AA
2187
+
2188
+
2189
  }
2190
 
2191
+
2192
+
2193
+
2194
+
2195
  .close {
2196
+
2197
+
2198
  float: right;
2199
+
2200
+
2201
  transition: color .1s ease-in-out, background .1s ease-in-out;
2202
+
2203
+
2204
  text-decoration: none;
2205
+
2206
+
2207
  color: #999;
2208
+
2209
+
2210
  font-size: 13px
2211
+
2212
+
2213
  }
2214
 
2215
+
2216
+
2217
+
2218
+
2219
  .mo_validate_close:focus,
2220
+
2221
+
2222
  .mo_validate_close:hover {
2223
+
2224
+
2225
  color: #0085ba
2226
+
2227
+
2228
  }
2229
 
2230
+
2231
+
2232
+
2233
+
2234
  .mo_registration_pricing_text {
2235
+
2236
+
2237
  font-size: 13px;
2238
+
2239
+
2240
  color: darkblue;
2241
+
2242
+
2243
  }
2244
 
2245
+
2246
+
2247
+
2248
+
2249
  .mo_otp_token {
2250
+
2251
+
2252
  font-size: 15px;
2253
+
2254
+
2255
  color: #212F3C;
2256
+
2257
+
2258
  border: none;
2259
+
2260
+
2261
+ display: block;
2262
+
2263
+
2264
  border-bottom-style: solid;
2265
+
2266
+
2267
  border-width: 2px;
2268
+
2269
+
2270
  border-color: #D0D3D4;
2271
+
2272
+
2273
  border-radius: 0px;
2274
+
2275
+
2276
  outline: none;
2277
+
2278
+
2279
  width: 140px;
2280
+
2281
+
2282
  text-align: center;
2283
+
2284
+
2285
  }
2286
 
2287
+
2288
+
2289
+
2290
+
2291
  .container {
2292
+
2293
+
2294
  max-width: 960px
2295
+
2296
+
2297
  }
2298
 
2299
+
2300
+
2301
+
2302
+
2303
  }
2304
+
2305
+
2306
  @media (min-width: 1200px) {
2307
+
2308
+
2309
  .container {
2310
+
2311
+
2312
  max-width: 1140px
2313
+
2314
+
2315
  }
2316
+
2317
+
2318
  }
2319
 
2320
+
2321
+
2322
+
2323
+
2324
  .container-fluid {
2325
+
2326
+
2327
  width: 100%;
2328
+
2329
+
2330
  padding-right: 15px;
2331
+
2332
+
2333
  padding-left: 15px;
2334
+
2335
+
2336
  margin-right: auto;
2337
+
2338
+
2339
  margin-left: auto
2340
+
2341
+
2342
  }
2343
 
2344
+
2345
+
2346
+
2347
+
2348
  .row {
2349
+
2350
+
2351
  display: -webkit-box;
2352
+
2353
+
2354
  display: -ms-flexbox;
2355
+
2356
+
2357
  display: flex;
2358
+
2359
+
2360
  -ms-flex-wrap: wrap;
2361
+
2362
+
2363
  flex-wrap: wrap;
2364
+
2365
+
2366
  margin-right: -15px;
2367
+
2368
+
2369
  margin-left: -15px
2370
+
2371
+
2372
  }
2373
 
2374
+
2375
+
2376
+
2377
+
2378
+
2379
+
2380
+
2381
  .no-gutters {
2382
+
2383
+
2384
  margin-right: 0;
2385
+
2386
+
2387
  margin-left: 0
2388
+
2389
+
2390
  }
2391
 
2392
+
2393
+
2394
+
2395
+
2396
  .no-gutters > .col, .no-gutters > [class*=col-] {
2397
+
2398
+
2399
  padding-right: 0;
2400
+
2401
+
2402
  padding-left: 0
2403
+
2404
+
2405
  }
2406
 
2407
+
2408
+
2409
+
2410
+
2411
  .col, .col-1, .col-10, .col-11, .col-12, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-auto, .col-lg, .col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-auto, .col-md, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-auto, .col-sm, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-auto, .col-xl, .col-xl-1, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-auto {
2412
+
2413
+
2414
  position: relative;
2415
+
2416
+
2417
  width: 100%;
2418
+
2419
+
2420
  min-height: 1px;
2421
+
2422
+
2423
  padding-right: 15px;
2424
+
2425
+
2426
  padding-left: 15px
2427
+
2428
+
2429
  }
2430
 
2431
+
2432
+
2433
+
2434
+
2435
  .col {
2436
+
2437
+
2438
  -ms-flex-preferred-size: 0;
2439
+
2440
+
2441
  flex-basis: 0;
2442
+
2443
+
2444
  -webkit-box-flex: 1;
2445
+
2446
+
2447
  -ms-flex-positive: 1;
2448
+
2449
+
2450
  flex-grow: 1;
2451
+
2452
+
2453
  max-width: 100%
2454
+
2455
+
2456
  }
2457
 
2458
+
2459
+
2460
+
2461
+
2462
  .col-auto {
2463
+
2464
+
2465
  -webkit-box-flex: 0;
2466
+
2467
+
2468
  -ms-flex: 0 0 auto;
2469
+
2470
+
2471
  flex: 0 0 auto;
2472
+
2473
+
2474
  width: auto;
2475
+
2476
+
2477
  max-width: none
2478
+
2479
+
2480
  }
2481
 
2482
+
2483
+
2484
+
2485
+
2486
  .col-1 {
2487
+
2488
+
2489
  -webkit-box-flex: 0;
2490
+
2491
+
2492
  -ms-flex: 0 0 8.333333%;
2493
+
2494
+
2495
  flex: 0 0 8.333333%;
2496
+
2497
+
2498
  max-width: 8.333333%
2499
+
2500
+
2501
  }
2502
 
2503
+
2504
+
2505
+
2506
+
2507
  .col-2 {
2508
+
2509
+
2510
  -webkit-box-flex: 0;
2511
+
2512
+
2513
  -ms-flex: 0 0 16.666667%;
2514
+
2515
+
2516
  flex: 0 0 16.666667%;
2517
+
2518
+
2519
  max-width: 16.666667%
2520
+
2521
+
2522
  }
2523
 
2524
+
2525
+
2526
+
2527
+
2528
  .col-3 {
2529
+
2530
+
2531
  -webkit-box-flex: 0;
2532
+
2533
+
2534
  -ms-flex: 0 0 25%;
2535
+
2536
+
2537
  flex: 0 0 25%;
2538
+
2539
+
2540
  max-width: 25%
2541
+
2542
+
2543
  }
2544
 
2545
+
2546
+
2547
+
2548
+
2549
  .col-4 {
2550
+
2551
+
2552
  -webkit-box-flex: 0;
2553
+
2554
+
2555
  -ms-flex: 0 0 33.333333%;
2556
+
2557
+
2558
  flex: 0 0 33.333333%;
2559
+
2560
+
2561
  max-width: 33.333333%
2562
+
2563
+
2564
  }
2565
 
2566
+
2567
+
2568
+
2569
+
2570
  .col-5 {
2571
+
2572
+
2573
  -webkit-box-flex: 0;
2574
+
2575
+
2576
  -ms-flex: 0 0 41.666667%;
2577
+
2578
+
2579
  flex: 0 0 41.666667%;
2580
+
2581
+
2582
  max-width: 41.666667%
2583
+
2584
+
2585
  }
2586
 
2587
+
2588
+
2589
+
2590
+
2591
  .col-6 {
2592
+
2593
+
2594
  -webkit-box-flex: 0;
2595
+
2596
+
2597
  -ms-flex: 0 0 50%;
2598
+
2599
+
2600
  flex: 0 0 50%;
2601
+
2602
+
2603
  max-width: 50%
2604
+
2605
+
2606
  }
2607
 
2608
+
2609
+
2610
+
2611
+
2612
  .col-7 {
2613
+
2614
+
2615
  -webkit-box-flex: 0;
2616
+
2617
+
2618
  -ms-flex: 0 0 58.333333%;
2619
+
2620
+
2621
  flex: 0 0 58.333333%;
2622
+
2623
+
2624
  max-width: 58.333333%
2625
+
2626
+
2627
  }
2628
 
2629
+
2630
+
2631
+
2632
+
2633
  .col-8 {
2634
+
2635
+
2636
  -webkit-box-flex: 0;
2637
+
2638
+
2639
  -ms-flex: 0 0 66.666667%;
2640
+
2641
+
2642
  flex: 0 0 66.666667%;
2643
+
2644
+
2645
  max-width: 66.666667%
2646
+
2647
+
2648
  }
2649
 
2650
+
2651
+
2652
+
2653
+
2654
  .col-9 {
2655
+
2656
+
2657
  -webkit-box-flex: 0;
2658
+
2659
+
2660
  -ms-flex: 0 0 75%;
2661
+
2662
+
2663
  flex: 0 0 75%;
2664
+
2665
+
2666
  max-width: 75%
2667
+
2668
+
2669
  }
2670
 
2671
+
2672
+
2673
+
2674
+
2675
  .col-10 {
2676
+
2677
+
2678
  -webkit-box-flex: 0;
2679
+
2680
+
2681
  -ms-flex: 0 0 83.333333%;
2682
+
2683
+
2684
  flex: 0 0 83.333333%;
2685
+
2686
+
2687
  max-width: 83.333333%
2688
+
2689
+
2690
  }
2691
 
2692
+
2693
+
2694
+
2695
+
2696
  .col-11 {
2697
+
2698
+
2699
  -webkit-box-flex: 0;
2700
+
2701
+
2702
  -ms-flex: 0 0 91.666667%;
2703
+
2704
+
2705
  flex: 0 0 91.666667%;
2706
+
2707
+
2708
  max-width: 91.666667%
2709
+
2710
+
2711
  }
2712
 
2713
+
2714
+
2715
+
2716
+
2717
  .col-12 {
2718
+
2719
+
2720
  -webkit-box-flex: 0;
2721
+
2722
+
2723
  -ms-flex: 0 0 100%;
2724
+
2725
+
2726
  flex: 0 0 100%;
2727
+
2728
+
2729
  max-width: 100%
2730
+
2731
+
2732
  }
2733
 
2734
+
2735
+
2736
+
2737
+
2738
  .order-first {
2739
+
2740
+
2741
  -webkit-box-ordinal-group: 0;
2742
+
2743
+
2744
  -ms-flex-order: -1;
2745
+
2746
+
2747
  order: -1
2748
+
2749
+
2750
  }
2751
 
2752
+
2753
+
2754
+
2755
+
2756
  .order-last {
2757
+
2758
+
2759
  -webkit-box-ordinal-group: 14;
2760
+
2761
+
2762
  -ms-flex-order: 13;
2763
+
2764
+
2765
  order: 13
2766
+
2767
+
2768
  }
2769
 
2770
+
2771
+
2772
+
2773
+
2774
  .order-0 {
2775
+
2776
+
2777
  -webkit-box-ordinal-group: 1;
2778
+
2779
+
2780
  -ms-flex-order: 0;
2781
+
2782
+
2783
  order: 0
2784
+
2785
+
2786
  }
2787
 
2788
+
2789
+
2790
+
2791
+
2792
  .order-1 {
2793
+
2794
+
2795
  -webkit-box-ordinal-group: 2;
2796
+
2797
+
2798
  -ms-flex-order: 1;
2799
+
2800
+
2801
  order: 1
2802
+
2803
+
2804
  }
2805
 
2806
+
2807
+
2808
+
2809
+
2810
  .order-2 {
2811
+
2812
+
2813
  -webkit-box-ordinal-group: 3;
2814
+
2815
+
2816
  -ms-flex-order: 2;
2817
+
2818
+
2819
  order: 2
2820
+
2821
+
2822
  }
2823
 
2824
+
2825
+
2826
+
2827
+
2828
  .order-3 {
2829
+
2830
+
2831
  -webkit-box-ordinal-group: 4;
2832
+
2833
+
2834
  -ms-flex-order: 3;
2835
+
2836
+
2837
  order: 3
2838
+
2839
+
2840
  }
2841
 
2842
+
2843
+
2844
+
2845
+
2846
  .order-4 {
2847
+
2848
+
2849
  -webkit-box-ordinal-group: 5;
2850
+
2851
+
2852
  -ms-flex-order: 4;
2853
+
2854
+
2855
  order: 4
2856
+
2857
+
2858
  }
2859
 
2860
+
2861
+
2862
+
2863
+
2864
  .order-5 {
2865
+
2866
+
2867
  -webkit-box-ordinal-group: 6;
2868
+
2869
+
2870
  -ms-flex-order: 5;
2871
+
2872
+
2873
  order: 5
2874
+
2875
+
2876
  }
2877
 
2878
+
2879
+
2880
+
2881
+
2882
  .order-6 {
2883
+
2884
+
2885
  -webkit-box-ordinal-group: 7;
2886
+
2887
+
2888
  -ms-flex-order: 6;
2889
+
2890
+
2891
  order: 6
2892
+
2893
+
2894
  }
2895
 
2896
+
2897
+
2898
+
2899
+
2900
  .order-7 {
2901
+
2902
+
2903
  -webkit-box-ordinal-group: 8;
2904
+
2905
+
2906
  -ms-flex-order: 7;
2907
+
2908
+
2909
  order: 7
2910
+
2911
+
2912
  }
2913
 
2914
+
2915
+
2916
+
2917
+
2918
  .order-8 {
2919
+
2920
+
2921
  -webkit-box-ordinal-group: 9;
2922
+
2923
+
2924
  -ms-flex-order: 8;
2925
+
2926
+
2927
  order: 8
2928
+
2929
+
2930
  }
2931
 
2932
+
2933
+
2934
+
2935
+
2936
  .order-9 {
2937
+
2938
+
2939
  -webkit-box-ordinal-group: 10;
2940
+
2941
+
2942
  -ms-flex-order: 9;
2943
+
2944
+
2945
  order: 9
2946
+
2947
+
2948
  }
2949
 
2950
+
2951
+
2952
+
2953
+
2954
  .order-10 {
2955
+
2956
+
2957
  -webkit-box-ordinal-group: 11;
2958
+
2959
+
2960
  -ms-flex-order: 10;
2961
+
2962
+
2963
  order: 10
2964
+
2965
+
2966
  }
2967
 
2968
+
2969
+
2970
+
2971
+
2972
  .order-11 {
2973
+
2974
+
2975
  -webkit-box-ordinal-group: 12;
2976
+
2977
+
2978
  -ms-flex-order: 11;
2979
+
2980
+
2981
  order: 11
2982
+
2983
+
2984
  }
2985
 
2986
+
2987
+
2988
+
2989
+
2990
  .order-12 {
2991
+
2992
+
2993
  -webkit-box-ordinal-group: 13;
2994
+
2995
+
2996
  -ms-flex-order: 12;
2997
+
2998
+
2999
  order: 12
3000
+
3001
+
3002
  }
3003
 
3004
+
3005
+
3006
+
3007
+
3008
  .offset-1 {
3009
+
3010
+
3011
  margin-left: 8.333333%
 
3012
 
 
 
 
3013
 
 
 
3014
  }
3015
 
3016
+
3017
+
3018
+
3019
+
3020
+ .offset-2 {
3021
+
3022
+
3023
+ margin-left: 16.666667%
3024
+
3025
+
3026
+ }
3027
+
3028
+
3029
+
3030
+
3031
+
3032
+ .offset-3 {
3033
+
3034
+
3035
+ margin-left: 25%
3036
+
3037
+
3038
+ }
3039
+
3040
+
3041
+
3042
+
3043
+
3044
+ .offset-4 {
3045
+
3046
+
3047
+ margin-left: 33.333333%
3048
+
3049
+
3050
  }
3051
 
3052
+
3053
+
3054
+
3055
+
3056
  .offset-5 {
3057
+
3058
+
3059
  margin-left: 41.666667%
3060
+
3061
+
3062
  }
3063
 
3064
+
3065
+
3066
+
3067
+
3068
  .offset-6 {
3069
+
3070
+
3071
  margin-left: 50%
3072
+
3073
+
3074
  }
3075
 
3076
+
3077
+
3078
+
3079
+
3080
  .offset-7 {
3081
+
3082
+
3083
  margin-left: 58.333333%
3084
+
3085
+
3086
  }
3087
 
3088
+
3089
+
3090
+
3091
+
3092
  .offset-8 {
3093
+
3094
+
3095
  margin-left: 66.666667%
3096
+
3097
+
3098
  }
3099
 
3100
+
3101
+
3102
+
3103
+
3104
  .offset-9 {
3105
+
3106
+
3107
  margin-left: 75%
3108
+
3109
+
3110
  }
3111
 
3112
+
3113
+
3114
+
3115
+
3116
  .offset-10 {
3117
+
3118
+
3119
  margin-left: 83.333333%
3120
+
3121
+
3122
  }
3123
 
3124
+
3125
+
3126
+
3127
+
3128
  .offset-11 {
3129
+
3130
+
3131
  margin-left: 91.666667%
3132
+
3133
+
3134
  }
3135
 
3136
+
3137
+
3138
+
3139
+
3140
  @media (min-width: 576px) {
3141
+
3142
+
3143
  .col-sm {
3144
+
3145
+
3146
  -ms-flex-preferred-size: 0;
3147
+
3148
+
3149
  flex-basis: 0;
3150
+
3151
+
3152
  -webkit-box-flex: 1;
3153
+
3154
+
3155
  -ms-flex-positive: 1;
3156
+
3157
+
3158
  flex-grow: 1;
3159
+
3160
+
3161
  max-width: 100%
3162
+
3163
+
3164
  }
3165
 
3166
+
3167
+
3168
+
3169
+
3170
  .col-sm-auto {
3171
+
3172
+
3173
  -webkit-box-flex: 0;
3174
+
3175
+
3176
  -ms-flex: 0 0 auto;
3177
+
3178
+
3179
  flex: 0 0 auto;
3180
+
3181
+
3182
  width: auto;
3183
+
3184
+
3185
  max-width: none
3186
+
3187
+
3188
  }
3189
 
3190
+
3191
+
3192
+
3193
+
3194
  .col-sm-1 {
3195
+
3196
+
3197
  -webkit-box-flex: 0;
3198
+
3199
+
3200
  -ms-flex: 0 0 8.333333%;
3201
+
3202
+
3203
  flex: 0 0 8.333333%;
3204
+
3205
+
3206
  max-width: 8.333333%
3207
+
3208
+
3209
  }
3210
 
3211
+
3212
+
3213
+
3214
+
3215
  .col-sm-2 {
3216
+
3217
+
3218
  -webkit-box-flex: 0;
3219
+
3220
+
3221
  -ms-flex: 0 0 16.666667%;
3222
+
3223
+
3224
  flex: 0 0 16.666667%;
3225
+
3226
+
3227
  max-width: 16.666667%
3228
+
3229
+
3230
  }
3231
 
3232
+
3233
+
3234
+
3235
+
3236
  .col-sm-3 {
3237
+
3238
+
3239
  -webkit-box-flex: 0;
3240
+
3241
+
3242
  -ms-flex: 0 0 25%;
3243
+
3244
+
3245
  flex: 0 0 25%;
3246
+
3247
+
3248
  max-width: 25%
3249
+
3250
+
3251
  }
3252
 
3253
+
3254
+
3255
+
3256
+
3257
  .col-sm-4 {
3258
+
3259
+
3260
  -webkit-box-flex: 0;
3261
+
3262
+
3263
  -ms-flex: 0 0 33.333333%;
3264
+
3265
+
3266
  flex: 0 0 33.333333%;
3267
+
3268
+
3269
  max-width: 33.333333%
3270
+
3271
+
3272
  }
3273
 
3274
+
3275
+
3276
+
3277
+
3278
  .col-sm-5 {
3279
+
3280
+
3281
  -webkit-box-flex: 0;
3282
+
3283
+
3284
  -ms-flex: 0 0 41.666667%;
3285
+
3286
+
3287
  flex: 0 0 41.666667%;
3288
+
3289
+
3290
  max-width: 41.666667%
3291
+
3292
+
3293
  }
3294
 
3295
+
3296
+
3297
+
3298
+
3299
  .col-sm-6 {
3300
+
3301
+
3302
  -webkit-box-flex: 0;
3303
+
3304
+
3305
  -ms-flex: 0 0 50%;
3306
+
3307
+
3308
  flex: 0 0 50%;
3309
+
3310
+
3311
  max-width: 50%
3312
+
3313
+
3314
  }
3315
 
3316
+
3317
+
3318
+
3319
+
3320
  .col-sm-7 {
3321
+
3322
+
3323
  -webkit-box-flex: 0;
3324
+
3325
+
3326
  -ms-flex: 0 0 58.333333%;
3327
+
3328
+
3329
  flex: 0 0 58.333333%;
3330
+
3331
+
3332
  max-width: 58.333333%
3333
+
3334
+
3335
  }
3336
 
3337
+
3338
+
3339
+
3340
+
3341
  .col-sm-8 {
3342
+
3343
+
3344
  -webkit-box-flex: 0;
3345
+
3346
+
3347
  -ms-flex: 0 0 66.666667%;
3348
+
3349
+
3350
  flex: 0 0 66.666667%;
3351
+
3352
+
3353
  max-width: 66.666667%
3354
+
3355
+
3356
  }
3357
 
3358
+
3359
+
3360
+
3361
+
3362
  .col-sm-9 {
3363
+
3364
+
3365
  -webkit-box-flex: 0;
3366
+
3367
+
3368
  -ms-flex: 0 0 75%;
3369
+
3370
+
3371
  flex: 0 0 75%;
3372
+
3373
+
3374
  max-width: 75%
3375
+
3376
+
3377
  }
3378
 
3379
+
3380
+
3381
+
3382
+
3383
  .col-sm-10 {
3384
+
3385
+
3386
  -webkit-box-flex: 0;
3387
+
3388
+
3389
  -ms-flex: 0 0 83.333333%;
3390
+
3391
+
3392
  flex: 0 0 83.333333%;
3393
+
3394
+
3395
  max-width: 83.333333%
3396
+
3397
+
3398
  }
3399
 
3400
+
3401
+
3402
+
3403
+
3404
  .col-sm-11 {
3405
+
3406
+
3407
  -webkit-box-flex: 0;
3408
+
3409
+
3410
  -ms-flex: 0 0 91.666667%;
3411
+
3412
+
3413
  flex: 0 0 91.666667%;
3414
+
3415
+
3416
  max-width: 91.666667%
3417
+
3418
+
3419
  }
3420
 
3421
+
3422
+
3423
+
3424
+
3425
  .col-sm-12 {
3426
+
3427
+
3428
  -webkit-box-flex: 0;
3429
+
3430
+
3431
  -ms-flex: 0 0 100%;
3432
+
3433
+
3434
  flex: 0 0 100%;
3435
+
3436
+
3437
  max-width: 100%
3438
+
3439
+
3440
  }
3441
 
3442
+
3443
+
3444
+
3445
+
3446
  .order-sm-first {
3447
+
3448
+
3449
  -webkit-box-ordinal-group: 0;
3450
+
3451
+
3452
  -ms-flex-order: -1;
3453
+
3454
+
3455
  order: -1
3456
+
3457
+
3458
  }
3459
 
3460
+
3461
+
3462
+
3463
+
3464
  .order-sm-last {
3465
+
3466
+
3467
  -webkit-box-ordinal-group: 14;
3468
+
3469
+
3470
  -ms-flex-order: 13;
3471
+
3472
+
3473
  order: 13
3474
+
3475
+
3476
  }
3477
 
3478
+
3479
+
3480
+
3481
+
3482
  .order-sm-0 {
3483
+
3484
+
3485
  -webkit-box-ordinal-group: 1;
3486
+
3487
+
3488
  -ms-flex-order: 0;
3489
+
3490
+
3491
  order: 0
3492
+
3493
+
3494
  }
3495
 
3496
+
3497
+
3498
+
3499
+
3500
  .order-sm-1 {
3501
+
3502
+
3503
  -webkit-box-ordinal-group: 2;
3504
+
3505
+
3506
  -ms-flex-order: 1;
3507
+
3508
+
3509
  order: 1
3510
+
3511
+
3512
  }
3513
 
3514
+
3515
+
3516
+
3517
+
3518
  .order-sm-2 {
3519
+
3520
+
3521
  -webkit-box-ordinal-group: 3;
3522
+
3523
+
3524
  -ms-flex-order: 2;
3525
+
3526
+
3527
  order: 2
3528
+
3529
+
3530
  }
3531
 
3532
+
3533
+
3534
+
3535
+
3536
  .order-sm-3 {
3537
+
3538
+
3539
  -webkit-box-ordinal-group: 4;
3540
+
3541
+
3542
  -ms-flex-order: 3;
3543
+
3544
+
3545
  order: 3
3546
+
3547
+
3548
  }
3549
 
3550
+
3551
+
3552
+
3553
+
3554
  .order-sm-4 {
3555
+
3556
+
3557
  -webkit-box-ordinal-group: 5;
3558
+
3559
+
3560
  -ms-flex-order: 4;
3561
+
3562
+
3563
  order: 4
3564
+
3565
+
3566
  }
3567
 
3568
+
3569
+
3570
+
3571
+
3572
  .order-sm-5 {
3573
+
3574
+
3575
  -webkit-box-ordinal-group: 6;
3576
+
3577
+
3578
  -ms-flex-order: 5;
3579
+
3580
+
3581
  order: 5
3582
+
3583
+
3584
  }
3585
 
3586
+
3587
+
3588
+
3589
+
3590
  .order-sm-6 {
3591
+
3592
+
3593
  -webkit-box-ordinal-group: 7;
3594
+
3595
+
3596
  -ms-flex-order: 6;
3597
+
3598
+
3599
  order: 6
3600
+
3601
+
3602
  }
3603
 
3604
+
3605
+
3606
+
3607
+
3608
  .order-sm-7 {
3609
+
3610
+
3611
  -webkit-box-ordinal-group: 8;
3612
+
3613
+
3614
  -ms-flex-order: 7;
3615
+
3616
+
3617
  order: 7
3618
+
3619
+
3620
  }
3621
 
3622
+
3623
+
3624
+
3625
+
3626
  .order-sm-8 {
3627
+
3628
+
3629
  -webkit-box-ordinal-group: 9;
3630
+
3631
+
3632
  -ms-flex-order: 8;
3633
+
3634
+
3635
  order: 8
3636
+
3637
+
3638
  }
3639
 
3640
+
3641
+
3642
+
3643
+
3644
  .order-sm-9 {
3645
+
3646
+
3647
  -webkit-box-ordinal-group: 10;
3648
+
3649
+
3650
  -ms-flex-order: 9;
3651
+
3652
+
3653
  order: 9
3654
+
3655
+
3656
  }
3657
 
3658
+
3659
+
3660
+
3661
+
3662
  .order-sm-10 {
3663
+
3664
+
3665
  -webkit-box-ordinal-group: 11;
3666
+
3667
+
3668
  -ms-flex-order: 10;
3669
+
3670
+
3671
  order: 10
3672
+
3673
+
3674
  }
3675
 
3676
+
3677
+
3678
+
3679
+
3680
  .order-sm-11 {
3681
+
3682
+
3683
  -webkit-box-ordinal-group: 12;
3684
+
3685
+
3686
  -ms-flex-order: 11;
3687
+
3688
+
3689
  order: 11
3690
+
3691
+
3692
  }
3693
 
3694
+
3695
+
3696
+
3697
+
3698
  .order-sm-12 {
3699
+
3700
+
3701
  -webkit-box-ordinal-group: 13;
3702
+
3703
+
3704
  -ms-flex-order: 12;
3705
+
3706
+
3707
  order: 12
3708
+
3709
+
3710
  }
3711
 
3712
+
3713
+
3714
+
3715
+
3716
  .offset-sm-0 {
3717
+
3718
+
3719
  margin-left: 0
3720
+
3721
+
3722
  }
3723
 
3724
+
3725
+
3726
+
3727
+
3728
  .offset-sm-1 {
3729
+
3730
+
3731
  margin-left: 8.333333%
3732
+
3733
+
3734
  }
3735
 
3736
+
3737
+
3738
+
3739
+
3740
  .offset-sm-2 {
3741
+
3742
+
3743
  margin-left: 16.666667%
3744
+
3745
+
3746
  }
3747
 
3748
+
3749
+
3750
+
3751
+
3752
  .offset-sm-3 {
3753
+
3754
+
3755
  margin-left: 25%
 
3756
 
 
 
 
3757
 
 
 
3758
  }
3759
 
3760
+
3761
+
3762
+
3763
+
3764
+ .offset-sm-4 {
3765
+
3766
+
3767
+ margin-left: 33.333333%
3768
+
3769
+
3770
+ }
3771
+
3772
+
3773
+
3774
+
3775
+
3776
+ .offset-sm-5 {
3777
+
3778
+
3779
+ margin-left: 41.666667%
3780
+
3781
+
3782
+ }
3783
+
3784
+
3785
+
3786
+
3787
+
3788
+ .offset-sm-6 {
3789
+
3790
+
3791
+ margin-left: 50%
3792
+
3793
+
3794
  }
3795
 
3796
+
3797
+
3798
+
3799
+
3800
  .offset-sm-7 {
3801
+
3802
+
3803
  margin-left: 58.333333%
3804
+
3805
+
3806
  }
3807
 
3808
+
3809
+
3810
+
3811
+
3812
  .offset-sm-8 {
3813
+
3814
+
3815
  margin-left: 66.666667%
3816
+
3817
+
3818
  }
3819
 
3820
+
3821
+
3822
+
3823
+
3824
  .offset-sm-9 {
3825
+
3826
+
3827
  margin-left: 75%
3828
+
3829
+
3830
  }
3831
 
3832
+
3833
+
3834
+
3835
+
3836
  .offset-sm-10 {
3837
+
3838
+
3839
  margin-left: 83.333333%
3840
+
3841
+
3842
  }
3843
 
3844
+
3845
+
3846
+
3847
+
3848
  .offset-sm-11 {
3849
+
3850
+
3851
  margin-left: 91.666667%
3852
+
3853
+
3854
  }
3855
+
3856
+
3857
  }
3858
 
3859
+
3860
+
3861
+
3862
+
3863
  @media (min-width: 768px) {
3864
+
3865
+
3866
  .col-md {
3867
+
3868
+
3869
  -ms-flex-preferred-size: 0;
3870
+
3871
+
3872
  flex-basis: 0;
3873
+
3874
+
3875
  -webkit-box-flex: 1;
3876
+
3877
+
3878
  -ms-flex-positive: 1;
3879
+
3880
+
3881
  flex-grow: 1;
3882
+
3883
+
3884
  max-width: 100%
3885
+
3886
+
3887
  }
3888
 
3889
+
3890
+
3891
+
3892
+
3893
  .col-md-auto {
3894
+
3895
+
3896
  -webkit-box-flex: 0;
3897
+
3898
+
3899
  -ms-flex: 0 0 auto;
3900
+
3901
+
3902
  flex: 0 0 auto;
3903
+
3904
+
3905
  width: auto;
3906
+
3907
+
3908
  max-width: none
3909
+
3910
+
3911
  }
3912
 
3913
+
3914
+
3915
+
3916
+
3917
  .col-md-1 {
3918
+
3919
+
3920
  -webkit-box-flex: 0;
3921
+
3922
+
3923
  -ms-flex: 0 0 8.333333%;
3924
+
3925
+
3926
  flex: 0 0 8.333333%;
3927
+
3928
+
3929
  max-width: 8.333333%
3930
+
3931
+
3932
  }
3933
 
3934
+
3935
+
3936
+
3937
+
3938
  .col-md-2 {
3939
+
3940
+
3941
  -webkit-box-flex: 0;
3942
+
3943
+
3944
  -ms-flex: 0 0 16.666667%;
3945
+
3946
+
3947
  flex: 0 0 16.666667%;
3948
+
3949
+
3950
  max-width: 16.666667%
3951
+
3952
+
3953
  }
3954
 
3955
+
3956
+
3957
+
3958
+
3959
  .col-md-3 {
3960
+
3961
+
3962
  -webkit-box-flex: 0;
3963
+
3964
+
3965
  -ms-flex: 0 0 25%;
3966
+
3967
+
3968
  flex: 0 0 25%;
3969
+
3970
+
3971
  max-width: 25%
3972
+
3973
+
3974
  }
3975
 
3976
+
3977
+
3978
+
3979
+
3980
  .col-md-4 {
3981
+
3982
+
3983
  -webkit-box-flex: 0;
3984
+
3985
+
3986
  -ms-flex: 0 0 33.333333%;
3987
+
3988
+
3989
  flex: 0 0 33.333333%;
3990
+
3991
+
3992
  max-width: 33.333333%
3993
+
3994
+
3995
  }
3996
 
3997
+
3998
+
3999
+
4000
+
4001
  .col-md-5 {
4002
+
4003
+
4004
  -webkit-box-flex: 0;
4005
+
4006
+
4007
  -ms-flex: 0 0 41.666667%;
4008
+
4009
+
4010
  flex: 0 0 41.666667%;
4011
+
4012
+
4013
  max-width: 41.666667%
4014
+
4015
+
4016
  }
4017
 
4018
+
4019
+
4020
+
4021
+
4022
  .col-md-6 {
4023
+
4024
+
4025
  -webkit-box-flex: 0;
4026
+
4027
+
4028
  -ms-flex: 0 0 50%;
4029
+
4030
+
4031
  flex: 0 0 50%;
4032
+
4033
+
4034
  max-width: 50%
4035
+
4036
+
4037
  }
4038
 
4039
+
4040
+
4041
+
4042
+
4043
  .col-md-7 {
4044
+
4045
+
4046
  -webkit-box-flex: 0;
4047
+
4048
+
4049
  -ms-flex: 0 0 58.333333%;
4050
+
4051
+
4052
  flex: 0 0 58.333333%;
4053
+
4054
+
4055
  max-width: 58.333333%
4056
+
4057
+
4058
  }
4059
 
4060
+
4061
+
4062
+
4063
+
4064
  .col-md-8 {
4065
+
4066
+
4067
  -webkit-box-flex: 0;
4068
+
4069
+
4070
  -ms-flex: 0 0 66.666667%;
4071
+
4072
+
4073
  flex: 0 0 66.666667%;
4074
+
4075
+
4076
  max-width: 66.666667%
4077
+
4078
+
4079
  }
4080
 
4081
+
4082
+
4083
+
4084
+
4085
  .col-md-9 {
4086
+
4087
+
4088
  -webkit-box-flex: 0;
4089
+
4090
+
4091
  -ms-flex: 0 0 75%;
4092
+
4093
+
4094
  flex: 0 0 75%;
4095
+
4096
+
4097
  max-width: 75%
4098
+
4099
+
4100
  }
4101
 
4102
+
4103
+
4104
+
4105
+
4106
  .col-md-10 {
4107
+
4108
+
4109
  -webkit-box-flex: 0;
4110
+
4111
+
4112
  -ms-flex: 0 0 83.333333%;
4113
+
4114
+
4115
  flex: 0 0 83.333333%;
4116
+
4117
+
4118
  max-width: 83.333333%
4119
+
4120
+
4121
  }
4122
 
4123
+
4124
+
4125
+
4126
+
4127
  .col-md-11 {
4128
+
4129
+
4130
  -webkit-box-flex: 0;
4131
+
4132
+
4133
  -ms-flex: 0 0 91.666667%;
4134
+
4135
+
4136
  flex: 0 0 91.666667%;
4137
+
4138
+
4139
  max-width: 91.666667%
4140
+
4141
+
4142
  }
4143
 
4144
+
4145
+
4146
+
4147
+
4148
  .col-md-12 {
4149
+
4150
+
4151
  -webkit-box-flex: 0;
4152
+
4153
+
4154
  -ms-flex: 0 0 100%;
4155
+
4156
+
4157
  flex: 0 0 100%;
4158
+
4159
+
4160
  max-width: 100%
4161
+
4162
+
4163
  }
4164
 
4165
+
4166
+
4167
+
4168
+
4169
  .order-md-first {
4170
+
4171
+
4172
  -webkit-box-ordinal-group: 0;
4173
+
4174
+
4175
  -ms-flex-order: -1;
4176
+
4177
+
4178
  order: -1
4179
+
4180
+
4181
  }
4182
 
4183
+
4184
+
4185
+
4186
+
4187
  .order-md-last {
4188
+
4189
+
4190
  -webkit-box-ordinal-group: 14;
4191
+
4192
+
4193
  -ms-flex-order: 13;
4194
+
4195
+
4196
  order: 13
4197
+
4198
+
4199
  }
4200
 
4201
+
4202
+
4203
+
4204
+
4205
  .order-md-0 {
4206
+
4207
+
4208
  -webkit-box-ordinal-group: 1;
4209
+
4210
+
4211
  -ms-flex-order: 0;
4212
+
4213
+
4214
  order: 0
4215
+
4216
+
4217
  }
4218
 
4219
+
4220
+
4221
+
4222
+
4223
  .order-md-1 {
4224
+
4225
+
4226
  -webkit-box-ordinal-group: 2;
4227
+
4228
+
4229
  -ms-flex-order: 1;
4230
+
4231
+
4232
  order: 1
4233
+
4234
+
4235
  }
4236
 
4237
+
4238
+
4239
+
4240
+
4241
  .order-md-2 {
4242
+
4243
+
4244
  -webkit-box-ordinal-group: 3;
4245
+
4246
+
4247
  -ms-flex-order: 2;
4248
+
4249
+
4250
  order: 2
4251
+
4252
+
4253
  }
4254
 
4255
+
4256
+
4257
+
4258
+
4259
  .order-md-3 {
4260
+
4261
+
4262
  -webkit-box-ordinal-group: 4;
4263
+
4264
+
4265
  -ms-flex-order: 3;
4266
+
4267
+
4268
  order: 3
4269
+
4270
+
4271
  }
4272
 
4273
+
4274
+
4275
+
4276
+
4277
  .order-md-4 {
4278
+
4279
+
4280
  -webkit-box-ordinal-group: 5;
4281
+
4282
+
4283
  -ms-flex-order: 4;
4284
+
4285
+
4286
  order: 4
4287
+
4288
+
4289
  }
4290
 
4291
+
4292
+
4293
+
4294
+
4295
  .order-md-5 {
4296
+
4297
+
4298
  -webkit-box-ordinal-group: 6;
4299
+
4300
+
4301
  -ms-flex-order: 5;
4302
+
4303
+
4304
  order: 5
4305
+
4306
+
4307
  }
4308
 
4309
+
4310
+
4311
+
4312
+
4313
  .order-md-6 {
4314
+
4315
+
4316
  -webkit-box-ordinal-group: 7;
4317
+
4318
+
4319
  -ms-flex-order: 6;
4320
+
4321
+
4322
  order: 6
4323
+
4324
+
4325
  }
4326
 
4327
+
4328
+
4329
+
4330
+
4331
  .order-md-7 {
4332
+
4333
+
4334
  -webkit-box-ordinal-group: 8;
4335
+
4336
+
4337
  -ms-flex-order: 7;
4338
+
4339
+
4340
  order: 7
4341
+
4342
+
4343
  }
4344
 
4345
+
4346
+
4347
+
4348
+
4349
  .order-md-8 {
4350
+
4351
+
4352
  -webkit-box-ordinal-group: 9;
4353
+
4354
+
4355
  -ms-flex-order: 8;
4356
+
4357
+
4358
  order: 8
4359
+
4360
+
4361
  }
4362
 
4363
+
4364
+
4365
+
4366
+
4367
  .order-md-9 {
4368
+
4369
+
4370
  -webkit-box-ordinal-group: 10;
4371
+
4372
+
4373
  -ms-flex-order: 9;
4374
+
4375
+
4376
  order: 9
4377
+
4378
+
4379
  }
4380
 
4381
+
4382
+
4383
+
4384
+
4385
  .order-md-10 {
4386
+
4387
+
4388
  -webkit-box-ordinal-group: 11;
4389
+
4390
+
4391
  -ms-flex-order: 10;
4392
+
4393
+
4394
  order: 10
4395
+
4396
+
4397
  }
4398
 
4399
+
4400
+
4401
+
4402
+
4403
  .order-md-11 {
4404
+
4405
+
4406
  -webkit-box-ordinal-group: 12;
4407
+
4408
+
4409
  -ms-flex-order: 11;
4410
+
4411
+
4412
  order: 11
4413
+
4414
+
4415
  }
4416
 
4417
+
4418
+
4419
+
4420
+
4421
  .order-md-12 {
4422
+
4423
+
4424
  -webkit-box-ordinal-group: 13;
4425
+
4426
+
4427
  -ms-flex-order: 12;
4428
+
4429
+
4430
  order: 12
4431
+
4432
+
4433
  }
4434
 
4435
+
4436
+
4437
+
4438
+
4439
  .offset-md-0 {
4440
+
4441
+
4442
  margin-left: 0
4443
+
4444
+
4445
  }
4446
 
4447
+
4448
+
4449
+
4450
+
4451
  .offset-md-1 {
4452
+
4453
+
4454
  margin-left: 8.333333%
4455
+
4456
+
4457
  }
4458
 
4459
+
4460
+
4461
+
4462
+
4463
  .offset-md-2 {
4464
+
4465
+
4466
  margin-left: 16.666667%
4467
+
4468
+
4469
  }
4470
 
4471
+
4472
+
4473
+
4474
+
4475
  .offset-md-3 {
4476
+
4477
+
4478
  margin-left: 25%
4479
+
4480
+
4481
  }
4482
 
4483
+
4484
+
4485
+
4486
+
4487
  .offset-md-4 {
4488
+
4489
+
4490
  margin-left: 33.333333%
4491
+
4492
+
4493
  }
4494
 
4495
+
4496
+
4497
+
4498
+
4499
  .offset-md-5 {
4500
+
4501
+
4502
  margin-left: 41.666667%
 
4503
 
 
 
 
4504
 
 
 
4505
  }
4506
 
4507
+
4508
+
4509
+
4510
+
4511
+ .offset-md-6 {
4512
+
4513
+
4514
+ margin-left: 50%
4515
+
4516
+
4517
+ }
4518
+
4519
+
4520
+
4521
+
4522
+
4523
+ .offset-md-7 {
4524
+
4525
+
4526
+ margin-left: 58.333333%
4527
+
4528
+
4529
+ }
4530
+
4531
+
4532
+
4533
+
4534
+
4535
  .offset-md-8 {
4536
+
4537
+
4538
  margin-left: 66.666667%
4539
+
4540
+
4541
  }
4542
 
4543
+
4544
+
4545
+
4546
+
4547
  .offset-md-9 {
4548
+
4549
+
4550
  margin-left: 75%
4551
+
4552
+
4553
  }
4554
 
4555
+
4556
+
4557
+
4558
+
4559
  .offset-md-10 {
4560
+
4561
+
4562
  margin-left: 83.333333%
4563
+
4564
+
4565
  }
4566
 
4567
+
4568
+
4569
+
4570
+
4571
  .offset-md-11 {
4572
+
4573
+
4574
  margin-left: 91.666667%
4575
+
4576
+
4577
  }
4578
+
4579
+
4580
  }
4581
 
4582
+
4583
+
4584
+
4585
+
4586
  @media (min-width: 992px) {
4587
+
4588
+
4589
  .col-lg {
4590
+
4591
+
4592
  -ms-flex-preferred-size: 0;
4593
+
4594
+
4595
  flex-basis: 0;
4596
+
4597
+
4598
  -webkit-box-flex: 1;
4599
+
4600
+
4601
  -ms-flex-positive: 1;
4602
+
4603
+
4604
  flex-grow: 1;
4605
+
4606
+
4607
  max-width: 100%
4608
+
4609
+
4610
  }
4611
 
4612
+
4613
+
4614
+
4615
+
4616
  .col-lg-auto {
4617
+
4618
+
4619
  -webkit-box-flex: 0;
4620
+
4621
+
4622
  -ms-flex: 0 0 auto;
4623
+
4624
+
4625
  flex: 0 0 auto;
4626
+
4627
+
4628
  width: auto;
4629
+
4630
+
4631
  max-width: none
4632
+
4633
+
4634
  }
4635
 
4636
+
4637
+
4638
+
4639
+
4640
  .col-lg-1 {
4641
+
4642
+
4643
  -webkit-box-flex: 0;
4644
+
4645
+
4646
  -ms-flex: 0 0 8.333333%;
4647
+
4648
+
4649
  flex: 0 0 8.333333%;
4650
+
4651
+
4652
  max-width: 8.333333%
4653
+
4654
+
4655
  }
4656
 
4657
+
4658
+
4659
+
4660
+
4661
  .col-lg-2 {
4662
+
4663
+
4664
  -webkit-box-flex: 0;
4665
+
4666
+
4667
  -ms-flex: 0 0 16.666667%;
4668
+
4669
+
4670
  flex: 0 0 16.666667%;
4671
+
4672
+
4673
  max-width: 16.666667%
4674
+
4675
+
4676
  }
4677
 
4678
+
4679
+
4680
+
4681
+
4682
  .col-lg-3 {
4683
+
4684
+
4685
  -webkit-box-flex: 0;
4686
+
4687
+
4688
  -ms-flex: 0 0 25%;
4689
+
4690
+
4691
  flex: 0 0 25%;
4692
+
4693
+
4694
  max-width: 25%
4695
+
4696
+
4697
  }
4698
 
4699
+
4700
+
4701
+
4702
+
4703
  .col-lg-4 {
4704
+
4705
+
4706
  -webkit-box-flex: 0;
4707
+
4708
+
4709
  -ms-flex: 0 0 33.333333%;
4710
+
4711
+
4712
  flex: 0 0 33.333333%;
4713
+
4714
+
4715
  max-width: 33.333333%
4716
+
4717
+
4718
  }
4719
 
4720
+
4721
+
4722
+
4723
+
4724
  .col-lg-5 {
4725
+
4726
+
4727
  -webkit-box-flex: 0;
4728
+
4729
+
4730
  -ms-flex: 0 0 41.666667%;
4731
+
4732
+
4733
  flex: 0 0 41.666667%;
4734
+
4735
+
4736
  max-width: 41.666667%
4737
+
4738
+
4739
  }
4740
 
4741
+
4742
+
4743
+
4744
+
4745
  .col-lg-6 {
4746
+
4747
+
4748
  -webkit-box-flex: 0;
4749
+
4750
+
4751
  -ms-flex: 0 0 50%;
4752
+
4753
+
4754
  flex: 0 0 50%;
4755
+
4756
+
4757
  max-width: 50%
4758
+
4759
+
4760
  }
4761
 
4762
+
4763
+
4764
+
4765
+
4766
  .col-lg-7 {
4767
+
4768
+
4769
  -webkit-box-flex: 0;
4770
+
4771
+
4772
  -ms-flex: 0 0 58.333333%;
4773
+
4774
+
4775
  flex: 0 0 58.333333%;
4776
+
4777
+
4778
  max-width: 58.333333%
4779
+
4780
+
4781
  }
4782
 
4783
+
4784
+
4785
+
4786
+
4787
  .col-lg-8 {
4788
+
4789
+
4790
  -webkit-box-flex: 0;
4791
+
4792
+
4793
  -ms-flex: 0 0 66.666667%;
4794
+
4795
+
4796
  flex: 0 0 66.666667%;
4797
+
4798
+
4799
  max-width: 66.666667%
4800
+
4801
+
4802
  }
4803
 
4804
+
4805
+
4806
+
4807
+
4808
  .col-lg-9 {
4809
+
4810
+
4811
  -webkit-box-flex: 0;
4812
+
4813
+
4814
  -ms-flex: 0 0 75%;
4815
+
4816
+
4817
  flex: 0 0 75%;
4818
+
4819
+
4820
  max-width: 75%
4821
+
4822
+
4823
  }
4824
 
4825
+
4826
+
4827
+
4828
+
4829
  .col-lg-10 {
4830
+
4831
+
4832
  -webkit-box-flex: 0;
4833
+
4834
+
4835
  -ms-flex: 0 0 83.333333%;
4836
+
4837
+
4838
  flex: 0 0 83.333333%;
4839
+
4840
+
4841
  max-width: 83.333333%
4842
+
4843
+
4844
  }
4845
 
4846
+
4847
+
4848
+
4849
+
4850
  .col-lg-11 {
4851
+
4852
+
4853
  -webkit-box-flex: 0;
4854
+
4855
+
4856
  -ms-flex: 0 0 91.666667%;
4857
+
4858
+
4859
  flex: 0 0 91.666667%;
4860
+
4861
+
4862
  max-width: 91.666667%
4863
+
4864
+
4865
  }
4866
 
4867
+
4868
+
4869
+
4870
+
4871
  .col-lg-12 {
4872
+
4873
+
4874
  -webkit-box-flex: 0;
4875
+
4876
+
4877
  -ms-flex: 0 0 100%;
4878
+
4879
+
4880
  flex: 0 0 100%;
4881
+
4882
+
4883
  max-width: 100%
4884
+
4885
+
4886
  }
4887
 
4888
+
4889
+
4890
+
4891
+
4892
  .order-lg-first {
4893
+
4894
+
4895
  -webkit-box-ordinal-group: 0;
4896
+
4897
+
4898
  -ms-flex-order: -1;
4899
+
4900
+
4901
  order: -1
4902
+
4903
+
4904
  }
4905
 
4906
+
4907
+
4908
+
4909
+
4910
  .order-lg-last {
4911
+
4912
+
4913
  -webkit-box-ordinal-group: 14;
4914
+
4915
+
4916
  -ms-flex-order: 13;
4917
+
4918
+
4919
  order: 13
4920
+
4921
+
4922
  }
4923
 
4924
+
4925
+
4926
+
4927
+
4928
  .order-lg-0 {
4929
+
4930
+
4931
  -webkit-box-ordinal-group: 1;
4932
+
4933
+
4934
  -ms-flex-order: 0;
4935
+
4936
+
4937
  order: 0
4938
+
4939
+
4940
  }
4941
 
4942
+
4943
+
4944
+
4945
+
4946
  .order-lg-1 {
4947
+
4948
+
4949
  -webkit-box-ordinal-group: 2;
4950
+
4951
+
4952
  -ms-flex-order: 1;
4953
+
4954
+
4955
  order: 1
4956
+
4957
+
4958
  }
4959
 
4960
+
4961
+
4962
+
4963
+
4964
  .order-lg-2 {
4965
+
4966
+
4967
  -webkit-box-ordinal-group: 3;
4968
+
4969
+
4970
  -ms-flex-order: 2;
4971
+
4972
+
4973
  order: 2
4974
+
4975
+
4976
  }
4977
 
4978
+
4979
+
4980
+
4981
+
4982
  .order-lg-3 {
4983
+
4984
+
4985
  -webkit-box-ordinal-group: 4;
4986
+
4987
+
4988
  -ms-flex-order: 3;
4989
+
4990
+
4991
  order: 3
4992
+
4993
+
4994
  }
4995
 
4996
+
4997
+
4998
+
4999
+
5000
  .order-lg-4 {
5001
+
5002
+
5003
  -webkit-box-ordinal-group: 5;
5004
+
5005
+
5006
  -ms-flex-order: 4;
5007
+
5008
+
5009
  order: 4
5010
+
5011
+
5012
  }
5013
 
5014
+
5015
+
5016
+
5017
+
5018
  .order-lg-5 {
5019
+
5020
+
5021
  -webkit-box-ordinal-group: 6;
5022
+
5023
+
5024
  -ms-flex-order: 5;
5025
+
5026
+
5027
  order: 5
5028
+
5029
+
5030
  }
5031
 
5032
+
5033
+
5034
+
5035
+
5036
  .order-lg-6 {
5037
+
5038
+
5039
  -webkit-box-ordinal-group: 7;
5040
+
5041
+
5042
  -ms-flex-order: 6;
5043
+
5044
+
5045
  order: 6
5046
+
5047
+
5048
  }
5049
 
5050
+
5051
+
5052
+
5053
+
5054
  .order-lg-7 {
5055
+
5056
+
5057
  -webkit-box-ordinal-group: 8;
5058
+
5059
+
5060
  -ms-flex-order: 7;
5061
+
5062
+
5063
  order: 7
5064
+
5065
+
5066
  }
5067
 
5068
+
5069
+
5070
+
5071
+
5072
  .order-lg-8 {
5073
+
5074
+
5075
  -webkit-box-ordinal-group: 9;
5076
+
5077
+
5078
  -ms-flex-order: 8;
5079
+
5080
+
5081
  order: 8
5082
+
5083
+
5084
  }
5085
 
5086
+
5087
+
5088
+
5089
+
5090
  .order-lg-9 {
5091
+
5092
+
5093
  -webkit-box-ordinal-group: 10;
5094
+
5095
+
5096
  -ms-flex-order: 9;
5097
+
5098
+
5099
  order: 9
5100
+
5101
+
5102
  }
5103
 
5104
+
5105
+
5106
+
5107
+
5108
  .order-lg-10 {
5109
+
5110
+
5111
  -webkit-box-ordinal-group: 11;
5112
+
5113
+
5114
  -ms-flex-order: 10;
5115
+
5116
+
5117
  order: 10
5118
+
5119
+
5120
  }
5121
 
5122
+
5123
+
5124
+
5125
+
5126
  .order-lg-11 {
5127
+
5128
+
5129
  -webkit-box-ordinal-group: 12;
5130
+
5131
+
5132
  -ms-flex-order: 11;
5133
+
5134
+
5135
  order: 11
5136
+
5137
+
5138
  }
5139
 
5140
+
5141
+
5142
+
5143
+
5144
  .order-lg-12 {
5145
+
5146
+
5147
  -webkit-box-ordinal-group: 13;
5148
+
5149
+
5150
  -ms-flex-order: 12;
5151
+
5152
+
5153
  order: 12
5154
+
5155
+
5156
  }
5157
 
5158
+
5159
+
5160
+
5161
+
5162
  .offset-lg-0 {
5163
+
5164
+
5165
  margin-left: 0
5166
+
5167
+
5168
  }
5169
 
5170
+
5171
+
5172
+
5173
+
5174
  .offset-lg-1 {
5175
+
5176
+
5177
  margin-left: 8.333333%
5178
+
5179
+
5180
  }
5181
 
5182
+
5183
+
5184
+
5185
+
5186
  .offset-lg-2 {
5187
+
5188
+
5189
  margin-left: 16.666667%
5190
+
5191
+
5192
  }
5193
 
5194
+
5195
+
5196
+
5197
+
5198
  .offset-lg-3 {
5199
+
5200
+
5201
  margin-left: 25%
5202
+
5203
+
5204
  }
5205
 
5206
+
5207
+
5208
+
5209
+
5210
  .offset-lg-4 {
5211
+
5212
+
5213
  margin-left: 33.333333%
5214
+
5215
+
5216
  }
5217
 
5218
+
5219
+
5220
+
5221
+
5222
  .offset-lg-5 {
5223
+
5224
+
5225
  margin-left: 41.666667%
5226
+
5227
+
5228
  }
5229
 
5230
+
5231
+
5232
+
5233
+
5234
  .offset-lg-6 {
5235
+
5236
+
5237
  margin-left: 50%
5238
+
5239
+
5240
  }
5241
 
5242
+
5243
+
5244
+
5245
+
5246
  .offset-lg-7 {
5247
+
5248
+
5249
  margin-left: 58.333333%
 
5250
 
 
 
 
5251
 
 
 
5252
  }
5253
 
5254
+
5255
+
5256
+
5257
+
5258
+ .offset-lg-8 {
5259
+
5260
+
5261
+ margin-left: 66.666667%
5262
+
5263
+
5264
+ }
5265
+
5266
+
5267
+
5268
+
5269
+
5270
+ .offset-lg-9 {
5271
+
5272
+
5273
+ margin-left: 75%
5274
+
5275
+
5276
  }
5277
 
5278
+
5279
+
5280
+
5281
+
5282
+ .offset-lg-10 {
5283
+
5284
+
5285
+ margin-left: 83.333333%
5286
+
5287
+
5288
+ }
5289
+
5290
+
5291
+
5292
+
5293
+
5294
  .offset-lg-11 {
5295
+
5296
+
5297
  margin-left: 91.666667%
5298
+
5299
+
5300
  }
5301
+
5302
+
5303
  }
5304
 
5305
+
5306
+
5307
+
5308
+
5309
  @media (min-width: 1200px) {
5310
+
5311
+
5312
  .col-xl {
5313
+
5314
+
5315
  -ms-flex-preferred-size: 0;
5316
+
5317
+
5318
  flex-basis: 0;
5319
+
5320
+
5321
  -webkit-box-flex: 1;
5322
+
5323
+
5324
  -ms-flex-positive: 1;
5325
+
5326
+
5327
  flex-grow: 1;
5328
+
5329
+
5330
  max-width: 100%
5331
+
5332
+
5333
  }
5334
 
5335
+
5336
+
5337
+
5338
+
5339
  .col-xl-auto {
5340
+
5341
+
5342
  -webkit-box-flex: 0;
5343
+
5344
+
5345
  -ms-flex: 0 0 auto;
5346
+
5347
+
5348
  flex: 0 0 auto;
5349
+
5350
+
5351
  width: auto;
5352
+
5353
+
5354
  max-width: none
5355
+
5356
+
5357
  }
5358
 
5359
+
5360
+
5361
+
5362
+
5363
  .col-xl-1 {
5364
+
5365
+
5366
  -webkit-box-flex: 0;
5367
+
5368
+
5369
  -ms-flex: 0 0 8.333333%;
5370
+
5371
+
5372
  flex: 0 0 8.333333%;
5373
+
5374
+
5375
  max-width: 8.333333%
5376
+
5377
+
5378
  }
5379
 
5380
+
5381
+
5382
+
5383
+
5384
  .col-xl-2 {
5385
+
5386
+
5387
  -webkit-box-flex: 0;
5388
+
5389
+
5390
  -ms-flex: 0 0 16.666667%;
5391
+
5392
+
5393
  flex: 0 0 16.666667%;
5394
+
5395
+
5396
  max-width: 16.666667%
5397
+
5398
+
5399
  }
5400
 
5401
+
5402
+
5403
+
5404
+
5405
  .col-xl-3 {
5406
+
5407
+
5408
  -webkit-box-flex: 0;
5409
+
5410
+
5411
  -ms-flex: 0 0 25%;
5412
+
5413
+
5414
  flex: 0 0 25%;
5415
+
5416
+
5417
  max-width: 25%
5418
+
5419
+
5420
  }
5421
 
5422
+
5423
+
5424
+
5425
+
5426
  .col-xl-4 {
5427
+
5428
+
5429
  -webkit-box-flex: 0;
5430
+
5431
+
5432
  -ms-flex: 0 0 33.333333%;
5433
+
5434
+
5435
  flex: 0 0 33.333333%;
5436
+
5437
+
5438
  max-width: 33.333333%
5439
+
5440
+
5441
  }
5442
 
5443
+
5444
+
5445
+
5446
+
5447
  .col-xl-5 {
5448
+
5449
+
5450
  -webkit-box-flex: 0;
5451
+
5452
+
5453
  -ms-flex: 0 0 41.666667%;
5454
+
5455
+
5456
  flex: 0 0 41.666667%;
5457
+
5458
+
5459
  max-width: 41.666667%
5460
+
5461
+
5462
  }
5463
 
5464
+
5465
+
5466
+
5467
+
5468
  .col-xl-6 {
5469
+
5470
+
5471
  -webkit-box-flex: 0;
5472
+
5473
+
5474
  -ms-flex: 0 0 50%;
5475
+
5476
+
5477
  flex: 0 0 50%;
5478
+
5479
+
5480
  max-width: 50%
5481
+
5482
+
5483
  }
5484
 
5485
+
5486
+
5487
+
5488
+
5489
  .col-xl-7 {
5490
+
5491
+
5492
  -webkit-box-flex: 0;
5493
+
5494
+
5495
  -ms-flex: 0 0 58.333333%;
5496
+
5497
+
5498
  flex: 0 0 58.333333%;
5499
+
5500
+
5501
  max-width: 58.333333%
5502
+
5503
+
5504
  }
5505
 
5506
+
5507
+
5508
+
5509
+
5510
  .col-xl-8 {
5511
+
5512
+
5513
  -webkit-box-flex: 0;
5514
+
5515
+
5516
  -ms-flex: 0 0 66.666667%;
5517
+
5518
+
5519
  flex: 0 0 66.666667%;
5520
+
5521
+
5522
  max-width: 66.666667%
5523
+
5524
+
5525
  }
5526
 
5527
+
5528
+
5529
+
5530
+
5531
  .col-xl-9 {
5532
+
5533
+
5534
  -webkit-box-flex: 0;
5535
+
5536
+
5537
  -ms-flex: 0 0 75%;
5538
+
5539
+
5540
  flex: 0 0 75%;
5541
+
5542
+
5543
  max-width: 75%
5544
+
5545
+
5546
  }
5547
 
5548
+
5549
+
5550
+
5551
+
5552
  .col-xl-10 {
5553
+
5554
+
5555
  -webkit-box-flex: 0;
5556
+
5557
+
5558
  -ms-flex: 0 0 83.333333%;
5559
+
5560
+
5561
  flex: 0 0 83.333333%;
5562
+
5563
+
5564
  max-width: 83.333333%
5565
+
5566
+
5567
  }
5568
 
5569
+
5570
+
5571
+
5572
+
5573
  .col-xl-11 {
5574
+
5575
+
5576
  -webkit-box-flex: 0;
5577
+
5578
+
5579
  -ms-flex: 0 0 91.666667%;
5580
+
5581
+
5582
  flex: 0 0 91.666667%;
5583
+
5584
+
5585
  max-width: 91.666667%
5586
+
5587
+
5588
  }
5589
 
5590
+
5591
+
5592
+
5593
+
5594
  .col-xl-12 {
5595
+
5596
+
5597
  -webkit-box-flex: 0;
5598
+
5599
+
5600
  -ms-flex: 0 0 100%;
5601
+
5602
+
5603
  flex: 0 0 100%;
5604
+
5605
+
5606
  max-width: 100%
5607
+
5608
+
5609
+ }
5610
+
5611
+
5612
+ }
5613
+
5614
+
5615
+
5616
+
5617
+
5618
+
5619
+
5620
+
5621
+ .mo_otp_token, .mo2f_user_email, .mo2f_IR_phone,
5622
+
5623
+
5624
+ .mo_IR_otp_token, .mo2f_IR_GA_token, .mo2f_IR_phone_OTP {
5625
+
5626
+
5627
+ color:#212F3C;
5628
+
5629
+
5630
+ border:none;
5631
+
5632
+
5633
+ display:block;
5634
+
5635
+
5636
+ border-bottom-style: solid;
5637
+
5638
+
5639
+ border-width: 2px;
5640
+
5641
+
5642
+ border-color:#D0D3D4;
5643
+
5644
+
5645
+ border-radius:0px;
5646
+
5647
+
5648
+ outline:none;
5649
+
5650
+
5651
+ padding:5px;
5652
+
5653
+
5654
+ }
5655
+
5656
+
5657
+
5658
+
5659
+
5660
+ .mo_otp_token {
5661
+
5662
+
5663
+ font-size:15px;
5664
+
5665
+
5666
+ width:130px;
5667
+
5668
+
5669
+ text-align:center;
5670
+
5671
+
5672
+ }
5673
+
5674
+
5675
+
5676
+
5677
+
5678
+ .mo2f_user_email{
5679
+
5680
+
5681
+ font-size:16px;
5682
+
5683
+
5684
+ width:220px;
5685
+
5686
+
5687
+ text-align:center;
5688
+
5689
+
5690
+ }
5691
+
5692
+
5693
+
5694
+
5695
+
5696
+ .mo2f_IR_phone{
5697
+
5698
+
5699
+ font-size:14px;
5700
+
5701
+
5702
+ width:170px !important;
5703
+
5704
+
5705
+ }
5706
+
5707
+
5708
+
5709
+
5710
+
5711
+ .mo2f_IR_GA_token{
5712
+
5713
+
5714
+ font-size:15px;
5715
+
5716
+
5717
+ width:100px !important;
5718
+
5719
+
5720
+ }
5721
+
5722
+
5723
+
5724
+
5725
+
5726
+ .mo2f_IR_phone_OTP{
5727
+
5728
+
5729
+ font-size:15px;
5730
+
5731
+
5732
+ width:150px !important;
5733
+
5734
+
5735
+ }
includes/css/front_end_login.css ADDED
@@ -0,0 +1,618 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .mo2f_powered_by_miniorange {
2
+
3
+
4
+ width: 100px;
5
+
6
+
7
+ height: 30px;
8
+
9
+
10
+ -webkit-background-size: 100px 25px;
11
+
12
+
13
+ background-size: 100px 25px;
14
+
15
+
16
+ background-repeat: no-repeat;
17
+
18
+
19
+ display: inline-block;
20
+
21
+
22
+ vertical-align: middle;
23
+
24
+
25
+ }
26
+
27
+
28
+
29
+
30
+
31
+ .mo2f_powered_by_div {
32
+
33
+
34
+ text-align: right;
35
+
36
+
37
+ font-size: 9px;
38
+
39
+
40
+ padding-right: 5px;
41
+
42
+
43
+ background-color: #FFFFFF;
44
+
45
+
46
+ width: 92%;
47
+
48
+
49
+ border-radius: 6px;
50
+
51
+
52
+ }
53
+
54
+
55
+
56
+
57
+
58
+ .mo2f-login-container {
59
+
60
+
61
+ display: inline-block !important;
62
+
63
+
64
+ display: -moz-inline-stack !important;
65
+
66
+
67
+ text-align: center !important;
68
+
69
+
70
+ width: 100%;
71
+
72
+
73
+
74
+
75
+
76
+ }
77
+
78
+
79
+
80
+
81
+
82
+ .mo2f-textbox {
83
+
84
+
85
+ width: 160px;
86
+
87
+
88
+ margin: 15px 0px !important;
89
+
90
+
91
+ background-color: rgba(123, 110, 110, 0.06) !important;
92
+
93
+
94
+ border-radius: 4px !important;
95
+
96
+
97
+ padding: 3px !important;
98
+
99
+
100
+ }
101
+
102
+
103
+
104
+
105
+
106
+ .mo2f-button {
107
+
108
+
109
+ width: 100% !important;
110
+
111
+
112
+ color: #fff !important;
113
+
114
+
115
+ line-height: normal;
116
+
117
+
118
+ height: 30px !important;
119
+
120
+
121
+ margin: 0px !important;
122
+
123
+
124
+ font-size: 14px !important;
125
+
126
+
127
+ padding: 7px !important;
128
+
129
+
130
+ background-color: #f0ad4e !important;
131
+
132
+
133
+ border-color: #eea236 !important;
134
+
135
+
136
+ -webkit-appearance: none;
137
+
138
+
139
+ -webkit-border-radius: 3px !important;
140
+
141
+
142
+ border-radius: 3px !important;
143
+
144
+
145
+
146
+
147
+
148
+ }
149
+
150
+
151
+
152
+
153
+
154
+ .mo2fa_display_message_login {
155
+
156
+
157
+ text-align: left !important;
158
+
159
+
160
+ font-size: 13px !important;
161
+
162
+
163
+ }
164
+
165
+
166
+
167
+
168
+
169
+ .mo2f-link {
170
+
171
+
172
+ color: #0191BF !important;
173
+
174
+
175
+ font-size: 14px !important;
176
+
177
+
178
+ font-weight: bold !important;
179
+
180
+
181
+ cursor: pointer !important;
182
+
183
+
184
+ }
185
+
186
+
187
+
188
+
189
+
190
+ .mo_green {
191
+
192
+
193
+ background: #2ECC71 !important;
194
+
195
+
196
+ border-color: #2ECC71 !important;
197
+
198
+
199
+ width: 26% !important;
200
+
201
+
202
+ border-width: 1px;
203
+
204
+
205
+ vertical-align: middle !important;
206
+
207
+
208
+ border-radius: 3px !important;
209
+
210
+
211
+ color: white;
212
+
213
+
214
+ height: 30px;
215
+
216
+
217
+ cursor: pointer;
218
+
219
+
220
+ }
221
+
222
+
223
+
224
+
225
+
226
+ .mo_red {
227
+
228
+
229
+ background: #E74C3C !important;
230
+
231
+
232
+ border-color: #E74C3C !important;
233
+
234
+
235
+ width: 26% !important;
236
+
237
+
238
+ border-width: 1px;
239
+
240
+
241
+ vertical-align: middle !important;
242
+
243
+
244
+ border-radius: 3px !important;
245
+
246
+
247
+ color: white;
248
+
249
+
250
+ height: 30px;
251
+
252
+
253
+ cursor: pointer;
254
+
255
+
256
+ }
257
+
258
+
259
+
260
+
261
+
262
+ .showQRHelp, .showOTPHelp {
263
+
264
+
265
+ text-align: center !important;
266
+
267
+
268
+
269
+
270
+
271
+ }
272
+
273
+
274
+
275
+
276
+
277
+ .mo2f_device {
278
+
279
+
280
+ padding-left: 200 px !important;
281
+
282
+
283
+ vertical-align: -webkit-baseline-middle !important;
284
+
285
+
286
+ line-height: 3 !important;
287
+
288
+
289
+ }
290
+
291
+
292
+
293
+
294
+
295
+ .miniorange-button {
296
+
297
+
298
+ height: 30px;
299
+
300
+
301
+ font-size: 14px !important;
302
+
303
+
304
+ line-height: 5px !important;
305
+
306
+
307
+ padding: 16px !important;
308
+
309
+
310
+ border-width: 1px;
311
+
312
+
313
+ vertical-align: middle !important;
314
+
315
+
316
+ background-color: #f0ad4e !important;
317
+
318
+
319
+ border-color: #eea236 !important;
320
+
321
+
322
+ -webkit-appearance: none;
323
+
324
+
325
+ border-style: solid;
326
+
327
+
328
+ -webkit-border-radius: 3px !important;
329
+
330
+
331
+ border-radius: 3px !important;
332
+
333
+
334
+ white-space: nowrap;
335
+
336
+
337
+ -webkit-box-sizing: border-box;
338
+
339
+
340
+ -moz-box-sizing: border-box;
341
+
342
+
343
+ box-sizing: border-box;
344
+
345
+
346
+ color: #fff;
347
+
348
+
349
+ text-decoration: none;
350
+
351
+
352
+ cursor: pointer;
353
+
354
+
355
+ }
356
+
357
+
358
+
359
+
360
+
361
+ .mo_hr {
362
+
363
+
364
+ border-top: 1px solid rgba(220, 214, 214, 0.25) !important;
365
+
366
+
367
+ margin-top: 5px !important;
368
+
369
+
370
+ margin-right: 10px !important;
371
+
372
+
373
+ }
374
+
375
+
376
+
377
+
378
+
379
+ .mo_margin_left {
380
+
381
+
382
+ margin-left: 20px !important;
383
+
384
+
385
+ }
386
+
387
+
388
+
389
+
390
+
391
+ .mo_app_link {
392
+
393
+
394
+ text-decoration: none !important;
395
+
396
+
397
+ color: #000 !important;
398
+
399
+
400
+ }
401
+
402
+
403
+
404
+
405
+
406
+ .mo2f_td_show {
407
+
408
+
409
+ display: grid !important;
410
+
411
+
412
+ }
413
+
414
+
415
+
416
+
417
+
418
+ .mo2f_td_hide {
419
+
420
+
421
+ display: none !important;
422
+
423
+
424
+ }
425
+
426
+
427
+
428
+
429
+
430
+ .mo2f_label {
431
+
432
+
433
+ font-weight: 100 !important;
434
+
435
+
436
+ margin-left: 10px !important;
437
+
438
+
439
+
440
+
441
+
442
+ }
443
+
444
+
445
+
446
+
447
+
448
+ .mo2f_kba_ques {
449
+
450
+
451
+ width: 394px !important;
452
+
453
+
454
+ border-radius: 4px !important;
455
+
456
+
457
+ height: 40px !important;
458
+
459
+
460
+ font-size: 14px !important;
461
+
462
+
463
+ }
464
+
465
+
466
+
467
+
468
+
469
+ .mo2f_kba_table {
470
+
471
+
472
+ padding: 0 10px;
473
+
474
+
475
+ width: 100%;
476
+
477
+
478
+ border: hidden !important;
479
+
480
+
481
+ }
482
+
483
+
484
+
485
+
486
+
487
+ .mo2f_kba_tb_data {
488
+
489
+
490
+ padding-left: 15px;
491
+
492
+
493
+ }
494
+
495
+
496
+
497
+
498
+
499
+ .mo2f_table_textbox_1 {
500
+
501
+
502
+ width: 150px;
503
+
504
+
505
+ height: 30px !important;
506
+
507
+
508
+ font-size: 14px !important;
509
+
510
+
511
+ }
512
+
513
+
514
+
515
+
516
+
517
+ .mo2f_table_textbox {
518
+
519
+
520
+ width: 200px;
521
+
522
+
523
+ height: 40px !important;
524
+
525
+
526
+ font-size: 14px !important;
527
+
528
+
529
+
530
+
531
+
532
+ }
533
+
534
+
535
+
536
+
537
+
538
+ .mo2f_kba_header {
539
+
540
+
541
+ font-weight: bold;
542
+
543
+
544
+ border: hidden !important;
545
+
546
+
547
+ }
548
+
549
+
550
+
551
+
552
+
553
+ .mo2f_kba_body {
554
+
555
+
556
+ border: hidden !important;
557
+
558
+
559
+ }
560
+
561
+
562
+
563
+
564
+
565
+ .mo2f_separator {
566
+
567
+
568
+ border-left: 1px solid #EBECEC;
569
+
570
+
571
+ padding: 5px;
572
+
573
+
574
+ }
575
+
576
+
577
+
578
+
579
+
580
+ .mo2f_authn_header {
581
+
582
+
583
+ font-size: 14px !important;
584
+
585
+
586
+ }
587
+
588
+
589
+
590
+
591
+
592
+ #mo2f_inline_table {
593
+
594
+
595
+ border: hidden !important;
596
+
597
+
598
+ }
599
+
600
+
601
+
602
+
603
+
604
+ .mo2f_ordered_list {
605
+
606
+
607
+ margin: 0 0 0 1em !important;
608
+
609
+
610
+ }
611
+
612
+ .mo2f_list {
613
+
614
+
615
+ font-size: 14px !important;
616
+
617
+
618
+ }
includes/css/jquery.ui.css ADDED
@@ -0,0 +1,743 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.11.4 - 2015-07-30
2
+ * http://jqueryui.com
3
+ * Includes: core.css, draggable.css, resizable.css, button.css, dialog.css, theme.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/
5
+ * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
6
+
7
+ /* Layout helpers
8
+ ----------------------------------*/
9
+ .ui-helper-hidden {
10
+ display: none;
11
+ }
12
+ .ui-helper-hidden-accessible {
13
+ border: 0;
14
+ clip: rect(0 0 0 0);
15
+ height: 1px;
16
+ margin: -1px;
17
+ overflow: hidden;
18
+ padding: 0;
19
+ position: absolute;
20
+ width: 1px;
21
+ }
22
+ .ui-helper-reset {
23
+ margin: 0;
24
+ padding: 0;
25
+ border: 0;
26
+ outline: 0;
27
+ line-height: 1.3;
28
+ text-decoration: none;
29
+ font-size: 100%;
30
+ list-style: none;
31
+ }
32
+ .ui-helper-clearfix:before,
33
+ .ui-helper-clearfix:after {
34
+ content: "";
35
+ display: table;
36
+ border-collapse: collapse;
37
+ }
38
+ .ui-helper-clearfix:after {
39
+ clear: both;
40
+ }
41
+ .ui-helper-clearfix {
42
+ min-height: 0; /* support: IE7 */
43
+ }
44
+ .ui-helper-zfix {
45
+ width: 100%;
46
+ height: 100%;
47
+ top: 0;
48
+ left: 0;
49
+ position: absolute;
50
+ opacity: 0;
51
+ filter:Alpha(Opacity=0); /* support: IE8 */
52
+ }
53
+
54
+ .ui-front {
55
+ z-index: 100;
56
+ }
57
+
58
+
59
+ /* Interaction Cues
60
+ ----------------------------------*/
61
+ .ui-state-disabled {
62
+ cursor: default !important;
63
+ }
64
+
65
+
66
+ /* Icons
67
+ ----------------------------------*/
68
+
69
+ /* states and images */
70
+ .ui-icon {
71
+ display: block;
72
+ text-indent: -99999px;
73
+ overflow: hidden;
74
+ background-repeat: no-repeat;
75
+ }
76
+
77
+
78
+ /* Misc visuals
79
+ ----------------------------------*/
80
+
81
+ /* Overlays */
82
+ .ui-widget-overlay {
83
+ position: fixed;
84
+ top: 0;
85
+ left: 0;
86
+ width: 100%;
87
+ height: 100%;
88
+ }
89
+ .ui-draggable-handle {
90
+ -ms-touch-action: none;
91
+ touch-action: none;
92
+ }
93
+ .ui-resizable {
94
+ position: relative;
95
+ }
96
+ .ui-resizable-handle {
97
+ position: absolute;
98
+ font-size: 0.1px;
99
+ display: block;
100
+ -ms-touch-action: none;
101
+ touch-action: none;
102
+ }
103
+ .ui-resizable-disabled .ui-resizable-handle,
104
+ .ui-resizable-autohide .ui-resizable-handle {
105
+ display: none;
106
+ }
107
+ .ui-resizable-n {
108
+ cursor: n-resize;
109
+ height: 7px;
110
+ width: 100%;
111
+ top: -5px;
112
+ left: 0;
113
+ }
114
+ .ui-resizable-s {
115
+ cursor: s-resize;
116
+ height: 7px;
117
+ width: 100%;
118
+ bottom: -5px;
119
+ left: 0;
120
+ }
121
+ .ui-resizable-e {
122
+ cursor: e-resize;
123
+ width: 7px;
124
+ right: -5px;
125
+ top: 0;
126
+ height: 100%;
127
+ }
128
+ .ui-resizable-w {
129
+ cursor: w-resize;
130
+ width: 7px;
131
+ left: -5px;
132
+ top: 0;
133
+ height: 100%;
134
+ }
135
+ .ui-resizable-se {
136
+ cursor: se-resize;
137
+ width: 12px;
138
+ height: 12px;
139
+ right: 1px;
140
+ bottom: 1px;
141
+ }
142
+ .ui-resizable-sw {
143
+ cursor: sw-resize;
144
+ width: 9px;
145
+ height: 9px;
146
+ left: -5px;
147
+ bottom: -5px;
148
+ }
149
+ .ui-resizable-nw {
150
+ cursor: nw-resize;
151
+ width: 9px;
152
+ height: 9px;
153
+ left: -5px;
154
+ top: -5px;
155
+ }
156
+ .ui-resizable-ne {
157
+ cursor: ne-resize;
158
+ width: 9px;
159
+ height: 9px;
160
+ right: -5px;
161
+ top: -5px;
162
+ }
163
+ .ui-button {
164
+ display: inline-block;
165
+ position: relative;
166
+ padding: 0;
167
+ line-height: normal;
168
+ margin-right: .1em;
169
+ cursor: pointer;
170
+ vertical-align: middle;
171
+ text-align: center;
172
+ overflow: visible; /* removes extra width in IE */
173
+ }
174
+ .ui-button,
175
+ .ui-button:link,
176
+ .ui-button:visited,
177
+ .ui-button:hover,
178
+ .ui-button:active {
179
+ text-decoration: none;
180
+ }
181
+ /* to make room for the icon, a width needs to be set here */
182
+ .ui-button-icon-only {
183
+ width: 2.2em;
184
+ }
185
+ /* button elements seem to need a little more width */
186
+ button.ui-button-icon-only {
187
+ width: 2.4em;
188
+ }
189
+ .ui-button-icons-only {
190
+ width: 3.4em;
191
+ }
192
+ button.ui-button-icons-only {
193
+ width: 3.7em;
194
+ }
195
+
196
+ /* button text element */
197
+ .ui-button .ui-button-text {
198
+ display: block;
199
+ line-height: normal;
200
+ }
201
+ .ui-button-text-only .ui-button-text {
202
+ padding: .4em 1em;
203
+ }
204
+ .ui-button-icon-only .ui-button-text,
205
+ .ui-button-icons-only .ui-button-text {
206
+ padding: .4em;
207
+ text-indent: -9999999px;
208
+ }
209
+ .ui-button-text-icon-primary .ui-button-text,
210
+ .ui-button-text-icons .ui-button-text {
211
+ padding: .4em 1em .4em 2.1em;
212
+ }
213
+ .ui-button-text-icon-secondary .ui-button-text,
214
+ .ui-button-text-icons .ui-button-text {
215
+ padding: .4em 2.1em .4em 1em;
216
+ }
217
+ .ui-button-text-icons .ui-button-text {
218
+ padding-left: 2.1em;
219
+ padding-right: 2.1em;
220
+ }
221
+ /* no icon support for input elements, provide padding by default */
222
+ input.ui-button {
223
+ padding: .4em 1em;
224
+ }
225
+
226
+ /* button icon element(s) */
227
+ .ui-button-icon-only .ui-icon,
228
+ .ui-button-text-icon-primary .ui-icon,
229
+ .ui-button-text-icon-secondary .ui-icon,
230
+ .ui-button-text-icons .ui-icon,
231
+ .ui-button-icons-only .ui-icon {
232
+ position: absolute;
233
+ top: 50%;
234
+ margin-top: -8px;
235
+ }
236
+ .ui-button-icon-only .ui-icon {
237
+ left: 50%;
238
+ margin-left: -8px;
239
+ }
240
+ .ui-button-text-icon-primary .ui-button-icon-primary,
241
+ .ui-button-text-icons .ui-button-icon-primary,
242
+ .ui-button-icons-only .ui-button-icon-primary {
243
+ left: .5em;
244
+ }
245
+ .ui-button-text-icon-secondary .ui-button-icon-secondary,
246
+ .ui-button-text-icons .ui-button-icon-secondary,
247
+ .ui-button-icons-only .ui-button-icon-secondary {
248
+ right: .5em;
249
+ }
250
+
251
+ /* button sets */
252
+ .ui-buttonset {
253
+ margin-right: 7px;
254
+ }
255
+ .ui-buttonset .ui-button {
256
+ margin-left: 0;
257
+ margin-right: -.3em;
258
+ }
259
+
260
+ /* workarounds */
261
+ /* reset extra padding in Firefox, see h5bp.com/l */
262
+ input.ui-button::-moz-focus-inner,
263
+ button.ui-button::-moz-focus-inner {
264
+ border: 0;
265
+ padding: 0;
266
+ }
267
+ .ui-dialog {
268
+ overflow: hidden;
269
+ position: absolute;
270
+ top: 0;
271
+ left: 0;
272
+ padding: .2em;
273
+ outline: 0;
274
+ width: 450px !important;
275
+ font-family: "Times New Roman", Times, serif !important;
276
+ font-size:16px !important;
277
+ z-index:200 !important;
278
+
279
+ }
280
+ .ui-dialog .ui-dialog-titlebar {
281
+ padding: .4em 1em;
282
+ position: relative;
283
+ }
284
+ .ui-dialog .ui-dialog-title {
285
+ float: left;
286
+ margin: .1em 0;
287
+ white-space: nowrap;
288
+ width: 90%;
289
+ overflow: hidden;
290
+ text-overflow: ellipsis;
291
+ }
292
+ .ui-dialog .ui-dialog-titlebar-close {
293
+ position: absolute;
294
+ right: .3em;
295
+ top: 50%;
296
+ width: 20px;
297
+ margin: -10px 0 0 0;
298
+ padding: 1px;
299
+ height: 20px;
300
+ }
301
+ .ui-dialog .ui-dialog-content {
302
+ position: relative;
303
+ border: 0;
304
+ padding: .5em 1em;
305
+ background: none;
306
+ overflow: auto;
307
+ }
308
+ .ui-dialog .ui-dialog-buttonpane {
309
+ text-align: left;
310
+ border-width: 1px 0 0 0;
311
+ background-image: none;
312
+ margin-top: .5em;
313
+ padding: .3em 1em .5em .4em;
314
+ }
315
+ .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
316
+ float: right;
317
+ }
318
+ .ui-dialog .ui-dialog-buttonpane button {
319
+ margin: .5em .4em .5em 0;
320
+ cursor: pointer;
321
+ }
322
+ .ui-dialog .ui-resizable-se {
323
+ width: 12px;
324
+ height: 12px;
325
+ right: -5px;
326
+ bottom: -5px;
327
+ background-position: 16px 16px;
328
+ }
329
+ .ui-draggable .ui-dialog-titlebar {
330
+ cursor: move;
331
+ }
332
+
333
+ /* Component containers
334
+ ----------------------------------*/
335
+ .ui-widget {
336
+ font-family: Verdana,Arial,sans-serif;
337
+ font-size: 1.1em;
338
+ }
339
+ .ui-widget .ui-widget {
340
+ font-size: 1em;
341
+ }
342
+ .ui-widget input,
343
+ .ui-widget select,
344
+ .ui-widget textarea,
345
+ .ui-widget button {
346
+ font-family: Verdana,Arial,sans-serif;
347
+ font-size: 1em;
348
+ }
349
+ .ui-widget-content {
350
+ border: 1px solid #aaaaaa;
351
+ background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;
352
+ color: #222222;
353
+ }
354
+ .ui-widget-content a {
355
+ color: #222222;
356
+ }
357
+ .ui-widget-header {
358
+ border: 1px solid #aaaaaa;
359
+ background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;
360
+ color: #222222;
361
+ font-weight: bold;
362
+ }
363
+ .ui-widget-header a {
364
+ color: #222222;
365
+ }
366
+
367
+ /* Interaction states
368
+ ----------------------------------*/
369
+ .ui-state-default,
370
+ .ui-widget-content .ui-state-default,
371
+ .ui-widget-header .ui-state-default {
372
+ border: 1px solid #d3d3d3;
373
+ background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
374
+ font-weight: normal;
375
+ color: #555555;
376
+ }
377
+ .ui-state-default a,
378
+ .ui-state-default a:link,
379
+ .ui-state-default a:visited {
380
+ color: #555555;
381
+ text-decoration: none;
382
+ }
383
+ .ui-state-hover,
384
+ .ui-widget-content .ui-state-hover,
385
+ .ui-widget-header .ui-state-hover,
386
+ .ui-state-focus,
387
+ .ui-widget-content .ui-state-focus,
388
+ .ui-widget-header .ui-state-focus {
389
+ border: 1px solid #999999;
390
+ background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
391
+ font-weight: normal;
392
+ color: #212121;
393
+ }
394
+ .ui-state-hover a,
395
+ .ui-state-hover a:hover,
396
+ .ui-state-hover a:link,
397
+ .ui-state-hover a:visited,
398
+ .ui-state-focus a,
399
+ .ui-state-focus a:hover,
400
+ .ui-state-focus a:link,
401
+ .ui-state-focus a:visited {
402
+ color: #212121;
403
+ text-decoration: none;
404
+ }
405
+ .ui-state-active,
406
+ .ui-widget-content .ui-state-active,
407
+ .ui-widget-header .ui-state-active {
408
+ border: 1px solid #aaaaaa;
409
+ background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
410
+ font-weight: normal;
411
+ color: #212121;
412
+ }
413
+ .ui-state-active a,
414
+ .ui-state-active a:link,
415
+ .ui-state-active a:visited {
416
+ color: #212121;
417
+ text-decoration: none;
418
+ }
419
+
420
+ /* Interaction Cues
421
+ ----------------------------------*/
422
+ .ui-state-highlight,
423
+ .ui-widget-content .ui-state-highlight,
424
+ .ui-widget-header .ui-state-highlight {
425
+ border: 1px solid #fcefa1;
426
+ background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
427
+ color: #363636;
428
+ }
429
+ .ui-state-highlight a,
430
+ .ui-widget-content .ui-state-highlight a,
431
+ .ui-widget-header .ui-state-highlight a {
432
+ color: #363636;
433
+ }
434
+ .ui-state-error,
435
+ .ui-widget-content .ui-state-error,
436
+ .ui-widget-header .ui-state-error {
437
+ border: 1px solid #cd0a0a;
438
+ background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
439
+ color: #cd0a0a;
440
+ }
441
+ .ui-state-error a,
442
+ .ui-widget-content .ui-state-error a,
443
+ .ui-widget-header .ui-state-error a {
444
+ color: #cd0a0a;
445
+ }
446
+ .ui-state-error-text,
447
+ .ui-widget-content .ui-state-error-text,
448
+ .ui-widget-header .ui-state-error-text {
449
+ color: #cd0a0a;
450
+ }
451
+ .ui-priority-primary,
452
+ .ui-widget-content .ui-priority-primary,
453
+ .ui-widget-header .ui-priority-primary {
454
+ font-weight: bold;
455
+ }
456
+ .ui-priority-secondary,
457
+ .ui-widget-content .ui-priority-secondary,
458
+ .ui-widget-header .ui-priority-secondary {
459
+ opacity: .7;
460
+ filter:Alpha(Opacity=70); /* support: IE8 */
461
+ font-weight: normal;
462
+ }
463
+ .ui-state-disabled,
464
+ .ui-widget-content .ui-state-disabled,
465
+ .ui-widget-header .ui-state-disabled {
466
+ opacity: .35;
467
+ filter:Alpha(Opacity=35); /* support: IE8 */
468
+ background-image: none;
469
+ }
470
+ .ui-state-disabled .ui-icon {
471
+ filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
472
+ }
473
+
474
+ /* Icons
475
+ ----------------------------------*/
476
+
477
+ /* states and images */
478
+ .ui-icon {
479
+ width: 16px;
480
+ height: 16px;
481
+ }
482
+ .ui-icon,
483
+ .ui-widget-content .ui-icon {
484
+ background-image: url("images/ui-icons_222222_256x240.png");
485
+ }
486
+ .ui-widget-header .ui-icon {
487
+ background-image: url("images/ui-icons_222222_256x240.png");
488
+ }
489
+ .ui-state-default .ui-icon {
490
+ background-image: url("images/ui-icons_888888_256x240.png");
491
+ }
492
+ .ui-state-hover .ui-icon,
493
+ .ui-state-focus .ui-icon {
494
+ background-image: url("images/ui-icons_454545_256x240.png");
495
+ }
496
+ .ui-state-active .ui-icon {
497
+ background-image: url("images/ui-icons_454545_256x240.png");
498
+ }
499
+ .ui-state-highlight .ui-icon {
500
+ background-image: url("images/ui-icons_2e83ff_256x240.png");
501
+ }
502
+ .ui-state-error .ui-icon,
503
+ .ui-state-error-text .ui-icon {
504
+ background-image: url("images/ui-icons_cd0a0a_256x240.png");
505
+ }
506
+
507
+ /* positioning */
508
+ .ui-icon-blank { background-position: 16px 16px; }
509
+ .ui-icon-carat-1-n { background-position: 0 0; }
510
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
511
+ .ui-icon-carat-1-e { background-position: -32px 0; }
512
+ .ui-icon-carat-1-se { background-position: -48px 0; }
513
+ .ui-icon-carat-1-s { background-position: -64px 0; }
514
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
515
+ .ui-icon-carat-1-w { background-position: -96px 0; }
516
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
517
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
518
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
519
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
520
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
521
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
522
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
523
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
524
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
525
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
526
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
527
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
528
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
529
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
530
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
531
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
532
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
533
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
534
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
535
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
536
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
537
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
538
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
539
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
540
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
541
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
542
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
543
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
544
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
545
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
546
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
547
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
548
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
549
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
550
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
551
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
552
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
553
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
554
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
555
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
556
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
557
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
558
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
559
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
560
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
561
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
562
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
563
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
564
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
565
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
566
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
567
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
568
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
569
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
570
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
571
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
572
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
573
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
574
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
575
+ .ui-icon-extlink { background-position: -32px -80px; }
576
+ .ui-icon-newwin { background-position: -48px -80px; }
577
+ .ui-icon-refresh { background-position: -64px -80px; }
578
+ .ui-icon-shuffle { background-position: -80px -80px; }
579
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
580
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
581
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
582
+ .ui-icon-folder-open { background-position: -16px -96px; }
583
+ .ui-icon-document { background-position: -32px -96px; }
584
+ .ui-icon-document-b { background-position: -48px -96px; }
585
+ .ui-icon-note { background-position: -64px -96px; }
586
+ .ui-icon-mail-closed { background-position: -80px -96px; }
587
+ .ui-icon-mail-open { background-position: -96px -96px; }
588
+ .ui-icon-suitcase { background-position: -112px -96px; }
589
+ .ui-icon-comment { background-position: -128px -96px; }
590
+ .ui-icon-person { background-position: -144px -96px; }
591
+ .ui-icon-print { background-position: -160px -96px; }
592
+ .ui-icon-trash { background-position: -176px -96px; }
593
+ .ui-icon-locked { background-position: -192px -96px; }
594
+ .ui-icon-unlocked { background-position: -208px -96px; }
595
+ .ui-icon-bookmark { background-position: -224px -96px; }
596
+ .ui-icon-tag { background-position: -240px -96px; }
597
+ .ui-icon-home { background-position: 0 -112px; }
598
+ .ui-icon-flag { background-position: -16px -112px; }
599
+ .ui-icon-calendar { background-position: -32px -112px; }
600
+ .ui-icon-cart { background-position: -48px -112px; }
601
+ .ui-icon-pencil { background-position: -64px -112px; }
602
+ .ui-icon-clock { background-position: -80px -112px; }
603
+ .ui-icon-disk { background-position: -96px -112px; }
604
+ .ui-icon-calculator { background-position: -112px -112px; }
605
+ .ui-icon-zoomin { background-position: -128px -112px; }
606
+ .ui-icon-zoomout { background-position: -144px -112px; }
607
+ .ui-icon-search { background-position: -160px -112px; }
608
+ .ui-icon-wrench { background-position: -176px -112px; }
609
+ .ui-icon-gear { background-position: -192px -112px; }
610
+ .ui-icon-heart { background-position: -208px -112px; }
611
+ .ui-icon-star { background-position: -224px -112px; }
612
+ .ui-icon-link { background-position: -240px -112px; }
613
+ .ui-icon-cancel { background-position: 0 -128px; }
614
+ .ui-icon-plus { background-position: -16px -128px; }
615
+ .ui-icon-plusthick { background-position: -32px -128px; }
616
+ .ui-icon-minus { background-position: -48px -128px; }
617
+ .ui-icon-minusthick { background-position: -64px -128px; }
618
+ .ui-icon-close { background-position: -80px -128px; }
619
+ .ui-icon-closethick { background-position: -96px -128px; }
620
+ .ui-icon-key { background-position: -112px -128px; }
621
+ .ui-icon-lightbulb { background-position: -128px -128px; }
622
+ .ui-icon-scissors { background-position: -144px -128px; }
623
+ .ui-icon-clipboard { background-position: -160px -128px; }
624
+ .ui-icon-copy { background-position: -176px -128px; }
625
+ .ui-icon-contact { background-position: -192px -128px; }
626
+ .ui-icon-image { background-position: -208px -128px; }
627
+ .ui-icon-video { background-position: -224px -128px; }
628
+ .ui-icon-script { background-position: -240px -128px; }
629
+ .ui-icon-alert { background-position: 0 -144px; }
630
+ .ui-icon-info { background-position: -16px -144px; }
631
+ .ui-icon-notice { background-position: -32px -144px; }
632
+ .ui-icon-help { background-position: -48px -144px; }
633
+ .ui-icon-check { background-position: -64px -144px; }
634
+ .ui-icon-bullet { background-position: -80px -144px; }
635
+ .ui-icon-radio-on { background-position: -96px -144px; }
636
+ .ui-icon-radio-off { background-position: -112px -144px; }
637
+ .ui-icon-pin-w { background-position: -128px -144px; }
638
+ .ui-icon-pin-s { background-position: -144px -144px; }
639
+ .ui-icon-play { background-position: 0 -160px; }
640
+ .ui-icon-pause { background-position: -16px -160px; }
641
+ .ui-icon-seek-next { background-position: -32px -160px; }
642
+ .ui-icon-seek-prev { background-position: -48px -160px; }
643
+ .ui-icon-seek-end { background-position: -64px -160px; }
644
+ .ui-icon-seek-start { background-position: -80px -160px; }
645
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
646
+ .ui-icon-seek-first { background-position: -80px -160px; }
647
+ .ui-icon-stop { background-position: -96px -160px; }
648
+ .ui-icon-eject { background-position: -112px -160px; }
649
+ .ui-icon-volume-off { background-position: -128px -160px; }
650
+ .ui-icon-volume-on { background-position: -144px -160px; }
651
+ .ui-icon-power { background-position: 0 -176px; }
652
+ .ui-icon-signal-diag { background-position: -16px -176px; }
653
+ .ui-icon-signal { background-position: -32px -176px; }
654
+ .ui-icon-battery-0 { background-position: -48px -176px; }
655
+ .ui-icon-battery-1 { background-position: -64px -176px; }
656
+ .ui-icon-battery-2 { background-position: -80px -176px; }
657
+ .ui-icon-battery-3 { background-position: -96px -176px; }
658
+ .ui-icon-circle-plus { background-position: 0 -192px; }
659
+ .ui-icon-circle-minus { background-position: -16px -192px; }
660
+ .ui-icon-circle-close { background-position: -32px -192px; }
661
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
662
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
663
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
664
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
665
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
666
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
667
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
668
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
669
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
670
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
671
+ .ui-icon-circle-check { background-position: -208px -192px; }
672
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
673
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
674
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
675
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
676
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
677
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
678
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
679
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
680
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
681
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
682
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
683
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
684
+
685
+
686
+ /* Misc visuals
687
+ ----------------------------------*/
688
+
689
+ /* Corner radius */
690
+ .ui-corner-all,
691
+ .ui-corner-top,
692
+ .ui-corner-left,
693
+ .ui-corner-tl {
694
+ border-top-left-radius: 4px;
695
+ }
696
+ .ui-corner-all,
697
+ .ui-corner-top,
698
+ .ui-corner-right,
699
+ .ui-corner-tr {
700
+ border-top-right-radius: 4px;
701
+ }
702
+ .ui-corner-all,
703
+ .ui-corner-bottom,
704
+ .ui-corner-left,
705
+ .ui-corner-bl {
706
+ border-bottom-left-radius: 4px;
707
+ }
708
+ .ui-corner-all,
709
+ .ui-corner-bottom,
710
+ .ui-corner-right,
711
+ .ui-corner-br {
712
+ border-bottom-right-radius: 4px;
713
+ }
714
+
715
+ /* Overlays */
716
+ .overlay_back {
717
+ position:fixed;
718
+ display:none;
719
+
720
+ /* color with alpha channel */
721
+ background-color: rgba(0, 0, 0, 0.7); /* 0.7 = 70% opacity */
722
+
723
+ /* stretch to screen edges */
724
+ top: 0;
725
+ left: 0;
726
+ bottom: 0;
727
+ right: 0;
728
+ min-height:100%;
729
+ width:100%;
730
+ z-index:111;
731
+ }
732
+ .ui-widget-overlay {
733
+ background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
734
+
735
+ }
736
+ .ui-widget-shadow {
737
+ margin: -8px 0 0 -8px;
738
+ padding: 8px;
739
+ background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
740
+ opacity: .3;
741
+ filter: Alpha(Opacity=30); /* support: IE8 */
742
+ border-radius: 8px;
743
+ }
includes/css/popup.css CHANGED
@@ -69,3 +69,14 @@
69
  flex-direction: column;
70
  }
71
  }
 
 
 
 
 
 
 
 
 
 
 
69
  flex-direction: column;
70
  }
71
  }
72
+
73
+
74
+ .logout:hover{
75
+ /*border: 2px solid black;*/
76
+ text-decoration: underline;
77
+ }
78
+ .modalhover:hover{
79
+ border:2px solid #2EB150;
80
+ background: #2EB150 !important;
81
+ color:white !important;
82
+ }
includes/css/style_settings.css CHANGED
@@ -1,4 +1,477 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  .mo_wpns_upgrade_title11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  {
3
  width: 23%;
4
  min-height: 500px;
@@ -11,6 +484,7 @@
11
  text-align: center;
12
  background-color: black;
13
  text-shadow: 3px 2px 2px black;
 
14
 
15
  }
16
  .mo_wpns_upgrade_page_2fa_plan_name
@@ -19,6 +493,13 @@
19
  padding: 6% 0% 0% 0%;
20
  color: white;
21
  font-size: 280%;
 
 
 
 
 
 
 
22
  }
23
  .mo_wpns_upgrade_page_hr
24
  {
@@ -27,7 +508,13 @@
27
  .mo_wpns_upgrade_page_2fa_background
28
  {
29
  width: 100%;
30
- min-height: 380px;
 
 
 
 
 
 
31
  background-color: #4dbfb9;
32
  }
33
  .mo_wpns_upgrade_page_show_feature_arrow
@@ -61,11 +548,12 @@
61
  .mo_wpns_upgrade_pade_pricing
62
  {
63
  color: white;
64
- font-size: 400%;
65
  }
66
  .mo_wpns_upgrade_page_starting_price
67
  {
68
  color: white;
 
69
  }
70
  .mo_wpns_upgrade_page_2fa_ns
71
  {
@@ -99,23 +587,40 @@
99
  .mo_wpns_upgrade_page_ns_background
100
  {
101
  width: 100%;
102
- min-height: 280px;
103
  background-color: #4dbfb9;
104
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  .popup_text_not_JQ
106
  {
107
  color:black;
108
  margin-top: 2%;
109
  margin-left: 5%;
110
  font-weight: 600;
111
- font-size: 14px !important;
112
  }
113
  .popup_text
114
  {
115
  color:black;
116
  margin-top: 2%;
117
  font-weight: 600;
118
- font-size: 14px !important;;
119
 
120
  }
121
  .overlay_not_JQ_success{
@@ -183,16 +688,18 @@
183
  .mo_wpns_help_title {
184
  font-size:17px;
185
  width:100%;
186
- color:#1B79AE;
187
  cursor:pointer;
188
  font-weight: bold;
189
  }
190
  .mo_wpns_help_desc {
191
- font-size:13px;
192
  border-left:solid 2px rgba(128, 128, 128, 0.65);
193
  margin-top:10px;
 
 
194
  padding-left:10px;
195
- margin-bottom:20px
196
  }
197
  .mo_wpns_help {
198
  width: 95%;
@@ -224,6 +731,7 @@
224
  background-color: #f1f1f1;
225
  margin:0px 22px;
226
  height: 84px;
 
227
 
228
  }
229
  .filebackupmessage{
@@ -315,7 +823,7 @@
315
  margin-bottom: 10px;
316
  margin-top: 10px;
317
  height:auto;
318
- width:71%;
319
  float:left;
320
 
321
 
@@ -391,6 +899,7 @@
391
  text-align: center;
392
  }
393
 
 
394
  .mo_wpns_small_3_layout
395
  {
396
  float: left;
@@ -406,7 +915,7 @@
406
  .mo_wpns_dashboard_layout
407
  {
408
  margin: 10px;
409
- padding: 5px 20px;
410
  background-color: none;
411
  /*border: 1px solid #CCCCCC;*/
412
  float: left;
@@ -416,12 +925,12 @@
416
  }
417
  .mo_wpns_inside_dashboard_layout
418
  {
419
- /*margin-top: 10px;*/
420
  padding: 5px 0px;
421
  background-color: #FFFFFF;
422
  border: 1px solid #CCCCCC;
423
  float: left;
424
- width: 17.5%;
425
  height: 100px;
426
  margin-left: 1%;
427
  font-weight: 600;
@@ -463,8 +972,11 @@
463
 
464
  .mo_wpns_dashboard_text
465
  {
466
- font-size: 50px;
467
- margin-top: -15px;
 
 
 
468
 
469
  }
470
  .mo_wpns_dashboard_upgrade_layout
@@ -602,12 +1114,13 @@ h2.mo_wpns_nav-tab-wrapper
602
  .mo_wpns_setting_layout
603
  {
604
  margin: 5px;
 
605
  padding: 5px 20px 30px 20px;
606
  background-color: #FFFFFF;
607
  border: 2px solid #20b2aa;
608
  float: left;
609
  width: 94%;
610
- margin-left: 1%;
611
 
612
  overflow: hidden;
613
  text-align: left;
@@ -717,6 +1230,14 @@ h2.mo_wpns_nav-tab-wrapper
717
  transition-duration: 0.4s;
718
  }
719
 
 
 
 
 
 
 
 
 
720
  .mo_wpns_upgrade_button
721
  {
722
  text-align: center;
@@ -1045,7 +1566,7 @@ h2.mo_wpns_nav-tab-wrapper
1045
  background-color: #FFFFFF;
1046
  border: 1px solid #CCCCCC;
1047
  float: left;
1048
- width: 17.5%;
1049
  height: 100px;
1050
  border-top: 2px solid lightseagreen;
1051
  font-weight: 600;
@@ -1324,12 +1845,13 @@ h2.mo_wpns_nav-tab-wrapper
1324
  .mo_wpns_setting_layout
1325
  {
1326
  margin: 5px;
 
1327
  padding: 5px 20px 30px 20px;
1328
  background-color: #FFFFFF;
1329
  border: 2px solid #20b2aa;
1330
  float: left;
1331
  width: 90%;
1332
- margin-left: 1%;
1333
 
1334
  overflow: hidden;
1335
  text-align: left;
@@ -1804,7 +2326,7 @@ a{
1804
  }
1805
 
1806
  .btn:hover{
1807
- background-color:#1893c0;
1808
  }
1809
 
1810
  .license-button:hover{
@@ -2409,7 +2931,7 @@ a.mo2f_thumbnail:hover, a.mo2f_thumbnail:focus, a.mo2f_thumbnail.active {
2409
 
2410
  .mo2f_thumbnail_method_desc{
2411
  padding:13px;
2412
- font-size:14px;
2413
  }
2414
 
2415
  .mo2f_set_2_factor {
@@ -2449,12 +2971,13 @@ a.mo2f_thumbnail:hover, a.mo2f_thumbnail:focus, a.mo2f_thumbnail.active {
2449
 
2450
  .mo_wpns_setting_layout{
2451
  margin: 5px;
 
2452
  padding: 5px 20px 30px 20px;
2453
  background-color: #FFFFFF;
2454
  border: 2px solid #20b2aa;
2455
  float: left;
2456
  width: 94%;
2457
- margin-left: 1%;
2458
  /*overflow: hidden;*/
2459
  text-align: left;
2460
  box-shadow: 0 0px 0px 0 rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.19);
@@ -2594,6 +3117,30 @@ a.mo2f_thumbnail:hover, a.mo2f_thumbnail:focus, a.mo2f_thumbnail.active {
2594
  margin: 0.5% 0 0 24%;
2595
  z-index: 99;
2596
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2597
 
2598
  .black_overlay {
2599
  display: none;
@@ -2674,7 +3221,11 @@ a.mo2f_thumbnail:hover, a.mo2f_thumbnail:focus, a.mo2f_thumbnail.active {
2674
  .mo2f_gauth_column {
2675
  float: left;
2676
  padding: 10px;
2677
- height: 210px;
 
 
 
 
2678
  }
2679
 
2680
  .mo2f_gauth_left {
@@ -2685,7 +3236,7 @@ a.mo2f_thumbnail:hover, a.mo2f_thumbnail:focus, a.mo2f_thumbnail.active {
2685
 
2686
  }
2687
  .mo_table-bordered, .mo_table-bordered > tbody > tr > td {
2688
- border: 1px solid #ddd;
2689
  }
2690
  .mo_align-center > tr > td {
2691
  text-align: center !important;
@@ -2836,7 +3387,7 @@ a.mo2f_thumbnail:hover, a.mo2f_thumbnail:focus, a.mo2f_thumbnail.active {
2836
  font-size: 120%;
2837
  }
2838
  .customloginform td {
2839
- width:80%;
2840
  text-align:left;
2841
  border:1px solid #20b2aa;
2842
  padding:1%;
@@ -2846,4 +3397,24 @@ a.mo2f_thumbnail:hover, a.mo2f_thumbnail:focus, a.mo2f_thumbnail.active {
2846
  text-align:left;
2847
  border:1px solid black;
2848
  padding:1%;
2849
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .mo2f-chat-popup {
2
+ display: none;
3
+ position: fixed;
4
+ bottom: 0;
5
+ right: 15px;
6
+ border: 3px solid #f1f1f1;
7
+ z-index: 9;
8
+ }
9
+ .mo2f-open-button {
10
+ background-color: #555;
11
+ color: white;
12
+ padding: 16px 20px;
13
+ border: none;
14
+ cursor: pointer;
15
+ opacity: 0.8;
16
+ position: fixed;
17
+ bottom: 23px;
18
+ right: 28px;
19
+ width: 280px;
20
+ }
21
+
22
+
23
+ .mo2f-form-container {
24
+ max-width: 49%;
25
+ padding: 10px;
26
+ background-color: white;
27
+ float: left;
28
+ }
29
+
30
+
31
+ .mo2f-form-container textarea {
32
+ width: 100%;
33
+ padding: 15px;
34
+ margin: 5px 0 22px 0;
35
+ border: none;
36
+ resize: none;
37
+ min-height: 200px;
38
+ }
39
+
40
+
41
+ .mo2f-form-container textarea:focus {
42
+ background-color: #ddd;
43
+ outline: none;
44
+ }
45
+
46
+
47
+ .mo2f-form-container .btn {
48
+ background-color: #4CAF50;
49
+ color: white;
50
+ padding: 16px 20px;
51
+ border: none;
52
+ cursor: pointer;
53
+ width: 100%;
54
+ margin-bottom:10px;
55
+ opacity: 0.8;
56
+ }
57
+
58
+ /* Add a red background color to the cancel button */
59
+ .mo2f-form-container .cancel {
60
+ background-color: red;
61
+ }
62
+
63
+
64
+ .mo2f-form-container .btn:hover, .mo2f-open-button:hover {
65
+ opacity: 1;
66
+ }
67
+ .mo2f_rating_close {
68
+ color: #aaaaaa;
69
+ float: right;
70
+ font-size: 28px;
71
+ font-weight: bold;
72
+ }
73
+
74
+ .mo2f_rating_close:hover,
75
+ .mo2f_rating_close:focus {
76
+ color: #000;
77
+ text-decoration: none;
78
+ cursor: pointer;
79
+ }
80
+ .mo-2fa-help-button-text {
81
+ cursor: pointer;
82
+ font-size: 16px;
83
+ background-color: #002ab6;
84
+ box-shadow: 1px 1px 10px 3px #8e8e9c;
85
+ bottom: 3%;
86
+ right: 7%;
87
+ position: fixed;
88
+ font-weight: 700;
89
+ color: #fff;
90
+ border-top-left-radius: 15px;
91
+ border-top-right-radius: 15px;
92
+ border-bottom-right-radius: 15px;
93
+ border-bottom-left-radius: 15px;
94
+ border: 3px solid #002ab6;
95
+ padding: 9px;
96
+ transition: all 3s ease-in-out;
97
+ }
98
+ .mo_support_input_label {
99
+ color: #999;
100
+ padding-left: 5px;
101
+ line-height: 1.5;
102
+ float: left;
103
+ }
104
+ .mo-2fa-help-button-text:before
105
+ {
106
+ content: "";
107
+ width: 0;
108
+ height: 0;
109
+ position: absolute;
110
+ border-top: 15px solid transparent;
111
+ border-left: 30px solid #002ab6;
112
+ border-bottom: 15px solid transparent;
113
+ right: -32px;
114
+ top: 16px;
115
+ }
116
+ @media (min-width:1750px)
117
+ {
118
+ .mo-2fa-help-button-text
119
+ {
120
+ right:6%!important
121
+ }
122
+ }
123
+ @media (min-width:1600px) and (max-width:1750px)
124
+ {
125
+ .mo-2fa-help-button-text
126
+ {
127
+ right:6.9%!important
128
+ }
129
+ }
130
+ @media (min-width:1400px) and (max-width:1600px)
131
+ {
132
+ .mo-2fa-help-button-text
133
+ {
134
+ right:7.5%!important
135
+ }
136
+ }
137
+ @media (min-width:1300px) and (max-width:1400px)
138
+ {
139
+ .mo-2fa-help-button-text
140
+ {
141
+ right:8%!important
142
+ }
143
+ }
144
+ @media (min-width:1100px) and (max-width:1300px)
145
+ {
146
+ .mo-2fa-help-button-text
147
+ {
148
+ right:9%!important
149
+ }
150
+ }
151
+ @media (min-width:900px) and (max-width:1100px)
152
+ {
153
+ .mo-2fa-help-button-text
154
+ {
155
+ right:11%!important
156
+ }
157
+ }
158
+ @media (min-width:800px) and (max-width:900px)
159
+ {
160
+ .mo-2fa-help-button-text
161
+ {
162
+ right:13%!important
163
+ }
164
+ }
165
+ @media (min-width:700px) and (max-width:800px)
166
+ {
167
+ .mo-2fa-help-button-text
168
+ {
169
+ right:13%!important
170
+ }
171
+ }
172
+ .mo-2fa-mail-button
173
+ {
174
+ bottom: 2.5%;
175
+ right: .5%;
176
+ position: fixed;
177
+ }
178
+ .show_support_form {
179
+ border-top-left-radius: 50% 50%;
180
+ border-top-right-radius: 50% 50%;
181
+ border-bottom-right-radius: 50% 50%;
182
+ border-bottom-left-radius: 50% 50%;
183
+ cursor: pointer;
184
+ box-shadow: 1px 1px 10px 3px #8e8e9c;
185
+ }
186
+ .mo2f_blue_premium_features{
187
+ cursor: pointer;
188
+ margin: 2px;
189
+ color:#20b2aa;
190
+ border: 2px solid #20b2aa;
191
+ text-decoration: none;
192
+ padding: 5px;
193
+ font-size: 15px;
194
+ }
195
+ .mo2f_btn_premium_features
196
+ {
197
+ background-color: #20b2aa;
198
+ color: #fff;
199
+ cursor: pointer;
200
+ margin: 2px;
201
+ border-radius: 3px;
202
+ border: 2px solid #20b2aa;
203
+ text-decoration: none;
204
+ padding: 5px;
205
+ font-size: 12px;
206
+ transition:.5s;
207
+ }
208
+ .container {
209
+ position: relative;
210
+ text-align: center;
211
+ color: white;
212
+ }
213
+
214
+ /* Bottom left text */
215
+ .bottom-left {
216
+ position: absolute;
217
+ bottom: 8px;
218
+ left: 50%;
219
+
220
+ }
221
+
222
+ /* Top left text */
223
+ .top-left {
224
+ position: absolute;
225
+ top: 8px;
226
+ left: 16px;
227
+ }
228
+
229
+ /* Top right text */
230
+ .top-right {
231
+ position: absolute;
232
+ top: 8px;
233
+ right: 16px;
234
+ }
235
+
236
+ /* Bottom right text */
237
+ .bottom-right {
238
+ position: absolute;
239
+ bottom: 8px;
240
+ right: 16px;
241
+ }
242
+
243
+ /* Centered text */
244
+ .centered {
245
+ position: absolute;
246
+ top: 50%;
247
+ left: 50%;
248
+ transform: translate(-50%, -50%);
249
+ }
250
+ .mo2f_black_background
251
+ {
252
+ background: gainsboro;
253
+ }
254
+ .mo2f_2fa_plan_title
255
+ {
256
+ background-color: #20b2aa;
257
+ border: 2px solid #20b2aa;
258
+ }
259
+ .mo2f_padding_style
260
+ {
261
+ padding: 2px 0px;
262
+ }
263
+ .mo2f_white_color_style
264
+ {
265
+ color: white;
266
+ }
267
+ .mo2f_2fa_lite_plan_title
268
+ {
269
+ background-color: #20b2aa;
270
+ border: 2px solid #20b2aa;
271
+ width: 25%
272
+ }
273
+ .mo2f_tooltip {
274
+ position: relative;
275
+ display: inline-block;
276
+ /*border-bottom: 1px dotted black;*/
277
+ }
278
+ .mo2f_tooltip .mo2f_tooltiptext {
279
+ visibility: hidden;
280
+ width: 200px;
281
+ background-color: #20b2aa;
282
+ color: white;
283
+ text-align: center;
284
+ border-radius: 6px;
285
+ font-size: 14px;
286
+ padding: 7px;
287
+ /* Position the tooltip */
288
+ position: absolute;
289
+ z-index: 1;
290
+ }
291
+ .mo2f_tooltip_addon {
292
+ position: relative;
293
+ display: inline-block;
294
+ /*border-bottom: 1px dotted black;*/
295
+ }
296
+ .mo2f_tooltip_addon .mo2f_tooltiptext_addon {
297
+ visibility: hidden;
298
+ width: 342px;
299
+ background-color: #20b2aa;
300
+ color: white;
301
+ text-align: center;
302
+ border-radius: 6px;
303
+ font-size: 14px;
304
+ padding: 5px 7px 6px 7px;
305
+ /* Position the tooltip */
306
+ position: absolute;
307
+ z-index: 9999;
308
+ }
309
+ /*.mo2f_addon_info_margin
310
+ {
311
+ width: 175px;
312
+ }*/
313
+ .mo2f_info_tab
314
+ {
315
+ font-size:16px;
316
+ color:#20b2aa;
317
+ cursor: pointer;
318
+ }
319
+ .mo2f_info_tab:hover
320
+ {
321
+ /*font-size:16px;*/
322
+ color:red;
323
+ /*cursor: pointer;*/
324
+ }
325
+ .mo2f_tooltip:hover .mo2f_tooltiptext {
326
+ visibility: visible;
327
+ }
328
+ .mo2f_tooltip_addon:hover .mo2f_tooltiptext_addon {
329
+ visibility: visible;
330
+ }
331
+ .mo2f_logout_and_configure_info
332
+ {
333
+ margin-left: -275px;
334
+ margin-top: -128px;
335
+ min-height:81px;
336
+ background-color: #2EB150;
337
+ text-align: justify;
338
+ color: white;
339
+ border: 2px solid #2EB150;
340
+ box-shadow: 2px black;
341
+ box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.2), 0 6px 30px 0 rgba(0, 0, 0, 0.19);
342
+ }
343
+ .mo_upgrade_toggle
344
+ {
345
+ text-align: center;
346
+ margin-top: -1%;
347
+ }
348
+ .mo_upgrade_toggle_2fa
349
+ {
350
+ background-color: black;
351
+ display: inline-block;
352
+ position: relative;
353
+ border-radius: 50em;
354
+ border-width: 1px;
355
+ border-style: solid;
356
+ border-color: #20b2aa;
357
+ border-image: initial;
358
+ }
359
+ .mo_upgrade_toggle_2fa_lable
360
+ {
361
+ position: relative;
362
+ z-index: 1;
363
+ display: inline-block;
364
+ float: left;
365
+ width: 210px;
366
+ height: 44px;
367
+ line-height: 40px;
368
+ cursor: pointer;
369
+ color: rgb(255, 255, 255);
370
+ font-size: 18px;
371
+ }
372
+ .mo2f_rating_close {
373
+ color: #aaaaaa;
374
+ float: right;
375
+ font-size: 28px;
376
+ font-weight: bold;
377
+ }
378
+
379
+ .mo2f_rating_close:hover,
380
+ .mo2f_rating_close:focus {
381
+ color: #000;
382
+ text-decoration: none;
383
+ cursor: pointer;
384
+ }
385
+ .mo2f_popup_close {
386
+ color: #aaaaaa;
387
+ float: right;
388
+ font-size: 28px;
389
+ font-weight: bold;
390
+ }
391
+
392
+ .mo2f_popup_close:hover,
393
+ .mo2f_popup_close:focus {
394
+ color: #000;
395
+ text-decoration: none;
396
+ cursor: pointer;
397
+ }
398
+ .mo_2fa_container
399
+ {
400
+ display:block;
401
+ box-sizing:border-box;
402
+ width:100%;
403
+ margin:auto;
404
+ }
405
+ .mo_2fa_card-deck
406
+ {
407
+ text-align:center!important;
408
+ margin-bottom:1rem!important;
409
+ flex-flow:row wrap;
410
+ margin-right:-15px;
411
+ margin-left:-15px;
412
+ display:flex;
413
+ box-sizing:border-box;
414
+ justify-content:center;
415
+ margin:auto;
416
+ }
417
+ .mo_2fa_card
418
+ {
419
+ margin:3px;
420
+ margin-top:16px;
421
+ border-radius:2%;
422
+ /* height:463px;
423
+ overflow: hidden;*/
424
+ width:25%;
425
+ border:1px solid #ecebeb;
426
+ box-sizing:border-box;
427
+ text-align:center!important;
428
+ background-color:#31ccfb1a;
429
+ box-shadow:1px 1px 6px -2px;
430
+ }
431
+ .mo_2fa_mo-supportnote
432
+ {
433
+ margin:auto;
434
+ text-align:center;
435
+ }
436
+ .mo_2fa_animation:hover
437
+ {
438
+ transition-property:all;
439
+ transition-duration:.25s;
440
+ transition-timing-function:linear;
441
+ transform:translateX(0) scale(1.02);
442
+ }
443
+ .mo_2fa_Card-header
444
+ {
445
+ box-sizing:border-box;
446
+ text-align:center!important;
447
+ display:block;
448
+ }
449
+ .mo_2fa_card-body
450
+ {
451
+ flex:1 1 auto;
452
+ padding:1.25rem;
453
+ padding-top: 0%;
454
+ box-sizing:border-box;
455
+ text-align:center!important;
456
+ display:block;
457
+ }
458
  .mo_wpns_upgrade_title11
459
+ {
460
+ width: 23%;
461
+ min-height: 633px;
462
+ background-color: white;
463
+ float: left;
464
+ border: 2px solid black;
465
+ }
466
+ .mo_wpns_upgrade_security_title
467
+ {
468
+ width: 23%;
469
+ min-height: 511px;
470
+ background-color: white;
471
+ float: left;
472
+ border: 2px solid black;
473
+ }
474
+ .mo_wpns_upgrade_title_2fa_lite
475
  {
476
  width: 23%;
477
  min-height: 500px;
484
  text-align: center;
485
  background-color: black;
486
  text-shadow: 3px 2px 2px black;
487
+ min-height: 62px;
488
 
489
  }
490
  .mo_wpns_upgrade_page_2fa_plan_name
493
  padding: 6% 0% 0% 0%;
494
  color: white;
495
  font-size: 280%;
496
+ }
497
+ .mo_wpns_upgrade_page_2fa_integration_plan_name
498
+ {
499
+ margin-top: 0%;
500
+ padding: 6% 0% 0% 0%;
501
+ color: white;
502
+ font-size: 200%;
503
  }
504
  .mo_wpns_upgrade_page_hr
505
  {
508
  .mo_wpns_upgrade_page_2fa_background
509
  {
510
  width: 100%;
511
+ min-height: 448px;
512
+ background-color: #4dbfb9;
513
+ }
514
+ .mo_wpns_upgrade_page_2fa_lite_background
515
+ {
516
+ width: 100%;
517
+ min-height: 379px;
518
  background-color: #4dbfb9;
519
  }
520
  .mo_wpns_upgrade_page_show_feature_arrow
548
  .mo_wpns_upgrade_pade_pricing
549
  {
550
  color: white;
551
+ font-size: 350%;
552
  }
553
  .mo_wpns_upgrade_page_starting_price
554
  {
555
  color: white;
556
+ padding-top: 2%;
557
  }
558
  .mo_wpns_upgrade_page_2fa_ns
559
  {
587
  .mo_wpns_upgrade_page_ns_background
588
  {
589
  width: 100%;
590
+ min-height: 277px;
591
  background-color: #4dbfb9;
592
  }
593
+ .mo_wpns_button_info_tab {
594
+ background-color: #20b2aa;
595
+ border: none;
596
+ color: white;
597
+ height: 1.8em;
598
+ width: 100%;
599
+ padding-top: 13px;
600
+ font-size: 7px;
601
+ text-align: center;
602
+ text-decoration: none;
603
+ display: inline-block;
604
+ font-size: 16px;
605
+ margin: 26px 0px;
606
+ cursor: pointer;
607
+ -webkit-transition-duration: 0.4s;
608
+ transition-duration: 0.4s;
609
+ }
610
  .popup_text_not_JQ
611
  {
612
  color:black;
613
  margin-top: 2%;
614
  margin-left: 5%;
615
  font-weight: 600;
616
+ font-size: 12px !important;
617
  }
618
  .popup_text
619
  {
620
  color:black;
621
  margin-top: 2%;
622
  font-weight: 600;
623
+ font-size: 12px !important;;
624
 
625
  }
626
  .overlay_not_JQ_success{
688
  .mo_wpns_help_title {
689
  font-size:17px;
690
  width:100%;
691
+ color: #1b5778;
692
  cursor:pointer;
693
  font-weight: bold;
694
  }
695
  .mo_wpns_help_desc {
696
+ font-size: 16px;
697
  border-left:solid 2px rgba(128, 128, 128, 0.65);
698
  margin-top:10px;
699
+ font-weight: 600;
700
+ line-height: 1.5em;
701
  padding-left:10px;
702
+ margin-bottom: 20px;
703
  }
704
  .mo_wpns_help {
705
  width: 95%;
731
  background-color: #f1f1f1;
732
  margin:0px 22px;
733
  height: 84px;
734
+ margin-left: 0px;
735
 
736
  }
737
  .filebackupmessage{
823
  margin-bottom: 10px;
824
  margin-top: 10px;
825
  height:auto;
826
+ width:100%;
827
  float:left;
828
 
829
 
899
  text-align: center;
900
  }
901
 
902
+
903
  .mo_wpns_small_3_layout
904
  {
905
  float: left;
915
  .mo_wpns_dashboard_layout
916
  {
917
  margin: 10px;
918
+ /*padding: 5px 20px;*/
919
  background-color: none;
920
  /*border: 1px solid #CCCCCC;*/
921
  float: left;
925
  }
926
  .mo_wpns_inside_dashboard_layout
927
  {
928
+ margin-top: 10px;
929
  padding: 5px 0px;
930
  background-color: #FFFFFF;
931
  border: 1px solid #CCCCCC;
932
  float: left;
933
+ width: 18.5%;
934
  height: 100px;
935
  margin-left: 1%;
936
  font-weight: 600;
972
 
973
  .mo_wpns_dashboard_text
974
  {
975
+ /*font-size: 50px;
976
+ margin-top: -15px;*/
977
+ font-size: 50px;
978
+ margin-bottom: -19px;
979
+ margin-top: -21px;
980
 
981
  }
982
  .mo_wpns_dashboard_upgrade_layout
1114
  .mo_wpns_setting_layout
1115
  {
1116
  margin: 5px;
1117
+ margin-left: 0px;
1118
  padding: 5px 20px 30px 20px;
1119
  background-color: #FFFFFF;
1120
  border: 2px solid #20b2aa;
1121
  float: left;
1122
  width: 94%;
1123
+ /*margin-left: 1%;*/
1124
 
1125
  overflow: hidden;
1126
  text-align: left;
1230
  transition-duration: 0.4s;
1231
  }
1232
 
1233
+ .mo_2f_cloud_switch_modal
1234
+ {
1235
+ width:44%;
1236
+ height:70px;
1237
+ background-color:#e2efef;
1238
+ border: 1px solid black;
1239
+ text-align:right;
1240
+ }
1241
  .mo_wpns_upgrade_button
1242
  {
1243
  text-align: center;
1566
  background-color: #FFFFFF;
1567
  border: 1px solid #CCCCCC;
1568
  float: left;
1569
+ width: 18.5%;
1570
  height: 100px;
1571
  border-top: 2px solid lightseagreen;
1572
  font-weight: 600;
1845
  .mo_wpns_setting_layout
1846
  {
1847
  margin: 5px;
1848
+ margin-left: 0px;
1849
  padding: 5px 20px 30px 20px;
1850
  background-color: #FFFFFF;
1851
  border: 2px solid #20b2aa;
1852
  float: left;
1853
  width: 90%;
1854
+ /*margin-left: 1%;*/
1855
 
1856
  overflow: hidden;
1857
  text-align: left;
2326
  }
2327
 
2328
  .btn:hover{
2329
+ /*background-color:#1893c0;*/
2330
  }
2331
 
2332
  .license-button:hover{
2931
 
2932
  .mo2f_thumbnail_method_desc{
2933
  padding:13px;
2934
+ font-size:17px;
2935
  }
2936
 
2937
  .mo2f_set_2_factor {
2971
 
2972
  .mo_wpns_setting_layout{
2973
  margin: 5px;
2974
+ margin-left: 0px;
2975
  padding: 5px 20px 30px 20px;
2976
  background-color: #FFFFFF;
2977
  border: 2px solid #20b2aa;
2978
  float: left;
2979
  width: 94%;
2980
+ /*margin-left: 1%;*/
2981
  /*overflow: hidden;*/
2982
  text-align: left;
2983
  box-shadow: 0 0px 0px 0 rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.19);
3117
  margin: 0.5% 0 0 24%;
3118
  z-index: 99;
3119
  }
3120
+ .overlay{
3121
+ position: fixed;
3122
+ top: 0;
3123
+ left: 0;
3124
+ right: 0;
3125
+ bottom: 0;
3126
+ width: 100%;
3127
+ height: 100%;
3128
+ background: #000;
3129
+ opacity: .5;
3130
+ z-index: 0;
3131
+ }
3132
+ .overlay1{
3133
+ position: fixed;
3134
+ top: 0;
3135
+ left: 0;
3136
+ right: 0;
3137
+ bottom: 0;
3138
+ width: 100%;
3139
+ height: 100%;
3140
+ background: #000;
3141
+ opacity: 0.5;
3142
+ z-index: 0;
3143
+ }
3144
 
3145
  .black_overlay {
3146
  display: none;
3221
  .mo2f_gauth_column {
3222
  float: left;
3223
  padding: 10px;
3224
+ height: 165px;
3225
+ }
3226
+ .mo2f_gauth_column_cloud {
3227
+ float: left;
3228
+ height: 150px;
3229
  }
3230
 
3231
  .mo2f_gauth_left {
3236
 
3237
  }
3238
  .mo_table-bordered, .mo_table-bordered > tbody > tr > td {
3239
+ /*border: 1px solid #ddd;*/
3240
  }
3241
  .mo_align-center > tr > td {
3242
  text-align: center !important;
3387
  font-size: 120%;
3388
  }
3389
  .customloginform td {
3390
+ /*width:80%;*/
3391
  text-align:left;
3392
  border:1px solid #20b2aa;
3393
  padding:1%;
3397
  text-align:left;
3398
  border:1px solid black;
3399
  padding:1%;
3400
+ }
3401
+ .mo2f_doc_icon_style
3402
+ {
3403
+ font-size:25px;
3404
+ color:#269eb3;
3405
+ }
3406
+ .mo2f_doc_font_size
3407
+ {
3408
+ font-size: 112%;
3409
+ width: 30%;
3410
+ }
3411
+ .mo2f_advance_setting
3412
+ {
3413
+ width: 40%;color: #111111; background: none;font-weight: bold;border: 2px solid black;margin-left: 6%;float: left;min-height: 54px;
3414
+ }
3415
+ .mo2f_advance_setting:hover
3416
+ {
3417
+ border: 2px solid black;
3418
+ background-color: #2EB150;
3419
+ color: white;
3420
+ }
includes/css/style_settings.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .mo_saml_help_title{font-size:17px;width:100%;color:#1b79ae;cursor:pointer;font-weight:700}.mo_saml_help_desc{font-size:13px;border-left:solid 2px rgba(128,128,128,.65);margin-top:10px;padding-left:10px}.mo_saml_help{border-top:solid 1px grey;width:95%}.mo_saml_help_cell{padding:20px;border-bottom:solid 1px grey}.mo_saml_support_layout{width:93%;background-color:#fff;border:1px solid #ccc;padding-left:20px}.mo_saml_table_layout{background-color:#fff;border:1px solid #ccc;padding:0 10px 10px 10px;margin-bottom:10px}.mo_saml_table_layout input['type=text']{width:80%}.mo_saml_table_layout td strong{margin-left:10px}.panel_toggle{cursor:pointer}.panel_toggle:hover{text-decoration:underline}.mo_saml_table_textbox{width:80%}.mo_saml_settings_table{width:100%}.mo_saml_settings_table tr td:first-child{width:30%}.mo_saml_heading_margin{margin-left:0}.error_wid_login{background-color:#ffebe8;border:1px dashed red;color:red;float:left;font-family:Verdana,Arial,Helvetica,sans-serif;font-weight:500;padding:6px;margin-left:200px;width:80%;clear:both!important}.login_wid li{margin:5px}.login_wid{list-style-type:none;border:1px dashed #999;width:98%;float:left;padding:5%}.login_wid li{width:48%;float:left;margin:2px}.openid_social_login{padding:5px 0 0 0;clear:both;width:100%!important}.login_wid li input{width:85%;float:left;margin:2px}.mo_saml_local_pricing_free_tab{background-color:rgba(34,153,221,.82)!important}.mo_saml_local_pricing_paid_tab{background-color:#1a71a4!important}.mo_saml_local_pricing_text{font-size:14px!important;color:#fff!important;font-weight:600!important}.mo_saml_local_pricing_sub_header{margin:2px!important;color:#fff!important}.mo_saml_local_pricing_header{color:#fff!important;margin:4px!important}.mo_saml_local_pricing_table{text-align:center;font-size:15px!important;background-color:#fff}.mo_saml_premium_thumbnail{width:350px;padding:4px;margin-bottom:10px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.mo-fa-icon>tr>td>i.fa{color:#5b8a0f}.mo_align-center>tr>td{text-align:center!important}.mo_table-bordered,.mo_table-bordered>tbody>tr>td{border:1px solid #ddd}.mo_table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.mo_table-bordered>thead>tr>th{vertical-align:top!important}.mo_plan-desc{font-size:14px!important}.mo-display-logs{color:#3c763d;background-color:#dff0d8;padding:2%;margin-bottom:20px;text-align:center;border:1px solid #aedb9a;font-size:18pt}.mo-display-block{color:#050505;width:-moz-available;min-height:300px!important;overflow:auto;display:inline-block;background-color:#f6f6f6;padding:2%;margin-bottom:20px;text-align:left;border:1px solid #aedb9a;font-size:12pt}.mo_divider{width:5px;height:auto;display:inline-block}.tooltip{position:relative;display:inline-block;size:letter}.tooltip .tooltiptext{visibility:hidden;width:120px;background-color:grey;color:#fff;text-align:center;padding:5px 0;border-radius:6px;font-size:12px;position:absolute;z-index:1;bottom:125%;left:50%;margin-left:-60px;font-size:small;opacity:50;transition:opacity .3s}.tooltip .tooltiptext::after{content:"";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#555 transparent transparent transparent}.tooltip:hover .tooltiptext{visibility:visible;opacity:1}.mo_modal{display:none;overflow:hidden;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.mo_modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);-webkit-background-clip:padding-box;background-clip:padding-box;outline:0;margin-left:20%;margin-right:24%;margin-top:6%}.mo_close{color:#aaa;float:right;font-size:28px;font-weight:700}.overlay{position:fixed;top:0;left:0;right:0;bottom:0;width:100%;height:100%;background:#000;opacity:.5;z-index:0}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143;font-size:large}.modal-body{position:relative;padding:15px}.modal-dialog{position:relative;width:auto;margin:10px}.modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-footer{padding:15px;text-align:center;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.5}button.close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none}.mo-span-circle{display:inline-block;padding:15px;line-height:100%;-moz-border-radius:50%;border-radius:50%;background-color:#000;color:#fff;text-align:center;font-size:2em}.nav-tab-active{margin-bottom:-1px;background:#fff;border-bottom:#fff;border-bottom:3px solid #fff}.nav-tab-active:hover{color:#000;background:#fff;border-bottom:#fff;border-bottom:3px solid #fff}.switch{position:relative;display:inline-block;width:40px;height:24px}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.4s;transition:.4s}input:disabled+.slider{background-color:#ebebeb;cursor:default}.slider:before{position:absolute;content:"";height:20px;width:20px;left:2px;bottom:2px;background-color:#fff;-webkit-transition:.4s;transition:.4s}input:checked+.slider{background-color:#0085ba}input:focus+.slider{box-shadow:0 0 1px #0085ba}input:checked+.slider:before{-webkit-transform:translateX(16px);-ms-transform:translateX(16px);transform:translateX(16px)}.slider.round{border-radius:24px}.slider.round:before{border-radius:50%}.mo_copy{border:1px solid #ccc;padding:8px;background-color:#fbfbfb;cursor:pointer}.mo_copy:active{background-color:#ccc}.copytooltip{position:relative;display:inline-block;size:letter}.copytooltip .copytooltiptext{visibility:hidden;width:120px;background-color:grey;color:#fff;text-align:center;padding:5px 0;border-radius:6px;font-size:12px;position:absolute;z-index:1;bottom:125%;left:50%;margin-left:-60px;font-size:small;opacity:50;transition:opacity .3s}.copytooltip .copytooltiptext::after{content:"";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#555 transparent transparent transparent}.copytooltip:hover .copytooltiptext{visibility:visible;opacity:1}.mo_demo_layout{margin-bottom:10px;padding-left:100px;padding-right:100px;border:none}.idp-guides-btns{text-align:center;padding:.5em 0 .5em 0}.guide-btn{background-color:#fff;border:1px solid #007cba;padding:.5em 1em .5em 1em;margin-right:2em;color:#007cba;font-weight:600;font-size:13px;border-radius:4px;box-shadow:2px 2px 5px rgba(0,0,0,.25);width:10em;letter-spacing:.4px;cursor:pointer}.guide-btn:hover{background-color:#007cba;color:#fff}.modal{display:none;position:fixed;z-index:1;padding-top:100px;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:rgba(0,0,0,.4);transition:all 1s}.modal-content{background-color:#fff;margin:0;padding:20px;border:1px solid #888;width:70%;border-radius:20px;box-shadow:5px 5px 5px rgba(0,0,0,.25);position:fixed;top:50%;left:50%;margin-right:-50%;transform:translate(-50%,-50%)}.modal-button{width:15%;height:50px;font-size:20px!important}
includes/css/twofa_style_settings.css CHANGED
@@ -306,7 +306,6 @@ button.mo2f_close {
306
  margin-left: 0;
307
  padding: 15px 20px 0;
308
  font-family: "Open Sans", sans-serif;
309
- color: #777;
310
  font-size: 14px;
311
  line-height: 1.4em;
312
  background: #FFF;
306
  margin-left: 0;
307
  padding: 15px 20px 0;
308
  font-family: "Open Sans", sans-serif;
 
309
  font-size: 14px;
310
  line-height: 1.4em;
311
  background: #FFF;
includes/images/amazons3.png ADDED
Binary file
includes/images/box.png ADDED
Binary file
includes/images/card.png ADDED
Binary file
includes/images/dropbox.png ADDED
Binary file
includes/images/gdrive.jpg ADDED
Binary file
includes/images/google-authenticator.png ADDED
Binary file
includes/images/google.jpg ADDED
Binary file
includes/images/google_authy.jpg ADDED
Binary file
includes/images/hide_login_form.PNG ADDED
Binary file
includes/images/login-with-password-and-2fa.PNG ADDED
Binary file
includes/images/minirange-logo.png ADDED
Binary file
includes/images/mo_support_icon.png ADDED
Binary file
includes/images/netbanking.png ADDED
Binary file
includes/images/new.png ADDED
Binary file
includes/images/{normal1.png → normal1.PNG} RENAMED
File without changes
includes/images/onedrive.png ADDED
Binary file
includes/images/paypal.png ADDED
Binary file
includes/jquery-qrcode/jquery-qrcode.js CHANGED
@@ -1,2815 +1,2337 @@
1
- /*! jquery-qrcode v0.17.0 - https://larsjung.de/jquery-qrcode/ */
2
- (function webpackUniversalModuleDefinition(root, factory) {
3
- if(typeof exports === 'object' && typeof module === 'object')
4
- module.exports = factory();
5
- else if(typeof define === 'function' && define.amd)
6
- define("jquery-qrcode", [], factory);
7
- else if(typeof exports === 'object')
8
- exports["jquery-qrcode"] = factory();
9
- else
10
- root["jquery-qrcode"] = factory();
11
- })((typeof self !== 'undefined' ? self : this), function() {
12
- return /******/ (function(modules) { // webpackBootstrap
13
- /******/ // The module cache
14
- /******/ var installedModules = {};
15
- /******/
16
- /******/ // The require function
17
- /******/ function __webpack_require__(moduleId) {
18
- /******/
19
- /******/ // Check if module is in cache
20
- /******/ if(installedModules[moduleId]) {
21
- /******/ return installedModules[moduleId].exports;
22
- /******/ }
23
- /******/ // Create a new module (and put it into the cache)
24
- /******/ var module = installedModules[moduleId] = {
25
- /******/ i: moduleId,
26
- /******/ l: false,
27
- /******/ exports: {}
28
- /******/ };
29
- /******/
30
- /******/ // Execute the module function
31
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
32
- /******/
33
- /******/ // Flag the module as loaded
34
- /******/ module.l = true;
35
- /******/
36
- /******/ // Return the exports of the module
37
- /******/ return module.exports;
38
- /******/ }
39
- /******/
40
- /******/
41
- /******/ // expose the modules object (__webpack_modules__)
42
- /******/ __webpack_require__.m = modules;
43
- /******/
44
- /******/ // expose the module cache
45
- /******/ __webpack_require__.c = installedModules;
46
- /******/
47
- /******/ // define getter function for harmony exports
48
- /******/ __webpack_require__.d = function(exports, name, getter) {
49
- /******/ if(!__webpack_require__.o(exports, name)) {
50
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
51
- /******/ }
52
- /******/ };
53
- /******/
54
- /******/ // define __esModule on exports
55
- /******/ __webpack_require__.r = function(exports) {
56
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
57
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
58
- /******/ }
59
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
60
- /******/ };
61
- /******/
62
- /******/ // create a fake namespace object
63
- /******/ // mode & 1: value is a module id, require it
64
- /******/ // mode & 2: merge all properties of value into the ns
65
- /******/ // mode & 4: return value when already ns object
66
- /******/ // mode & 8|1: behave like require
67
- /******/ __webpack_require__.t = function(value, mode) {
68
- /******/ if(mode & 1) value = __webpack_require__(value);
69
- /******/ if(mode & 8) return value;
70
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
71
- /******/ var ns = Object.create(null);
72
- /******/ __webpack_require__.r(ns);
73
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
74
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
75
- /******/ return ns;
76
- /******/ };
77
- /******/
78
- /******/ // getDefaultExport function for compatibility with non-harmony modules
79
- /******/ __webpack_require__.n = function(module) {
80
- /******/ var getter = module && module.__esModule ?
81
- /******/ function getDefault() { return module['default']; } :
82
- /******/ function getModuleExports() { return module; };
83
- /******/ __webpack_require__.d(getter, 'a', getter);
84
- /******/ return getter;
85
- /******/ };
86
- /******/
87
- /******/ // Object.prototype.hasOwnProperty.call
88
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
89
- /******/
90
- /******/ // __webpack_public_path__
91
- /******/ __webpack_require__.p = "";
92
- /******/
93
- /******/
94
- /******/ // Load entry module and return exports
95
- /******/ return __webpack_require__(__webpack_require__.s = 0);
96
- /******/ })
97
- /************************************************************************/
98
- /******/ ([
99
- /* 0 */
100
- /***/ (function(module, exports, __webpack_require__) {
101
-
102
- /* WEBPACK VAR INJECTION */(function(global) {var WIN = global.window;
103
- var JQ = WIN.jQuery; // Check if canvas is available in the browser (as Modernizr does)
104
-
105
- var HAS_CANVAS = function () {
106
- var el = WIN.document.createElement('canvas');
107
- return !!(el.getContext && el.getContext('2d'));
108
- }();
109
-
110
- var is_img_el = function is_img_el(x) {
111
- return x && typeof x.tagName === 'string' && x.tagName.toUpperCase() === 'IMG';
112
- }; // Wrapper for the original QR code generator.
113
-
114
-
115
- var create_qrcode = function create_qrcode(text, level, version, quiet) {
116
- var qr = {};
117
-
118
- var qr_gen = __webpack_require__(2);
119
-
120
- qr_gen.stringToBytes = qr_gen.stringToBytesFuncs['UTF-8'];
121
- var vqr = qr_gen(version, level);
122
- vqr.addData(text);
123
- vqr.make();
124
- quiet = quiet || 0;
125
- var module_count = vqr.getModuleCount();
126
- var quiet_module_count = module_count + 2 * quiet;
127
-
128
- var is_dark = function is_dark(row, col) {
129
- row -= quiet;
130
- col -= quiet;
131
- return row >= 0 && row < module_count && col >= 0 && col < module_count && vqr.isDark(row, col);
132
- };
133
-
134
- var add_blank = function add_blank(l, t, r, b) {
135
- var prev_is_dark = qr.is_dark;
136
- var module_size = 1 / quiet_module_count;
137
-
138
- qr.is_dark = function (row, col) {
139
- var ml = col * module_size;
140
- var mt = row * module_size;
141
- var mr = ml + module_size;
142
- var mb = mt + module_size;
143
- return prev_is_dark(row, col) && (l > mr || ml > r || t > mb || mt > b);
144
- };
145
- };
146
-
147
- qr.text = text;
148
- qr.level = level;
149
- qr.version = version;
150
- qr.module_count = quiet_module_count;
151
- qr.is_dark = is_dark;
152
- qr.add_blank = add_blank;
153
- return qr;
154
- }; // Returns a minimal QR code for the given text starting with version `min_ver`.
155
- // Returns `undefined` if `text` is too long to be encoded in `max_ver`.
156
-
157
-
158
- var create_min_qrcode = function create_min_qrcode(text, level, min_ver, max_ver, quiet) {
159
- min_ver = Math.max(1, min_ver || 1);
160
- max_ver = Math.min(40, max_ver || 40);
161
-
162
- for (var ver = min_ver; ver <= max_ver; ver += 1) {
163
- try {
164
- return create_qrcode(text, level, ver, quiet);
165
- } catch (err) {
166
- /* empty */
167
- }
168
- }
169
-
170
- return undefined;
171
- };
172
-
173
- var draw_background_label = function draw_background_label(qr, context, settings) {
174
- var size = settings.size;
175
- var font = 'bold ' + settings.mSize * size + 'px ' + settings.fontname;
176
- var ctx = JQ('<canvas/>')[0].getContext('2d');
177
- ctx.font = font;
178
- var w = ctx.measureText(settings.label).width;
179
- var sh = settings.mSize;
180
- var sw = w / size;
181
- var sl = (1 - sw) * settings.mPosX;
182
- var st = (1 - sh) * settings.mPosY;
183
- var sr = sl + sw;
184
- var sb = st + sh;
185
- var pad = 0.01;
186
-
187
- if (settings.mode === 1) {
188
- // Strip
189
- qr.add_blank(0, st - pad, size, sb + pad);
190
- } else {
191
- // Box
192
- qr.add_blank(sl - pad, st - pad, sr + pad, sb + pad);
193
- }
194
-
195
- context.fillStyle = settings.fontcolor;
196
- context.font = font;
197
- context.fillText(settings.label, sl * size, st * size + 0.75 * settings.mSize * size);
198
- };
199
-
200
- var draw_background_img = function draw_background_img(qr, context, settings) {
201
- var size = settings.size;
202
- var w = settings.image.naturalWidth || 1;
203
- var h = settings.image.naturalHeight || 1;
204
- var sh = settings.mSize;
205
- var sw = sh * w / h;
206
- var sl = (1 - sw) * settings.mPosX;
207
- var st = (1 - sh) * settings.mPosY;
208
- var sr = sl + sw;
209
- var sb = st + sh;
210
- var pad = 0.01;
211
-
212
- if (settings.mode === 3) {
213
- // Strip
214
- qr.add_blank(0, st - pad, size, sb + pad);
215
- } else {
216
- // Box
217
- qr.add_blank(sl - pad, st - pad, sr + pad, sb + pad);
218
- }
219
-
220
- context.drawImage(settings.image, sl * size, st * size, sw * size, sh * size);
221
- };
222
-
223
- var draw_background = function draw_background(qr, context, settings) {
224
- if (is_img_el(settings.background)) {
225
- context.drawImage(settings.background, 0, 0, settings.size, settings.size);
226
- } else if (settings.background) {
227
- context.fillStyle = settings.background;
228
- context.fillRect(settings.left, settings.top, settings.size, settings.size);
229
- }
230
-
231
- var mode = settings.mode;
232
-
233
- if (mode === 1 || mode === 2) {
234
- draw_background_label(qr, context, settings);
235
- } else if (is_img_el(settings.image) && (mode === 3 || mode === 4)) {
236
- draw_background_img(qr, context, settings);
237
- }
238
- };
239
-
240
- var draw_modules_default = function draw_modules_default(qr, context, settings, left, top, width, row, col) {
241
- if (qr.is_dark(row, col)) {
242
- context.rect(left, top, width, width);
243
- }
244
- };
245
-
246
- var draw_modules_rounded_dark = function draw_modules_rounded_dark(ctx, l, t, r, b, rad, nw, ne, se, sw) {
247
- if (nw) {
248
- ctx.moveTo(l + rad, t);
249
- } else {
250
- ctx.moveTo(l, t);
251
- }
252
-
253
- if (ne) {
254
- ctx.lineTo(r - rad, t);
255
- ctx.arcTo(r, t, r, b, rad);
256
- } else {
257
- ctx.lineTo(r, t);
258
- }
259
-
260
- if (se) {
261
- ctx.lineTo(r, b - rad);
262
- ctx.arcTo(r, b, l, b, rad);
263
- } else {
264
- ctx.lineTo(r, b);
265
- }
266
-
267
- if (sw) {
268
- ctx.lineTo(l + rad, b);
269
- ctx.arcTo(l, b, l, t, rad);
270
- } else {
271
- ctx.lineTo(l, b);
272
- }
273
-
274
- if (nw) {
275
- ctx.lineTo(l, t + rad);
276
- ctx.arcTo(l, t, r, t, rad);
277
- } else {
278
- ctx.lineTo(l, t);
279
- }
280
- };
281
-
282
- var draw_modules_rounded_light = function draw_modules_rounded_light(ctx, l, t, r, b, rad, nw, ne, se, sw) {
283
- if (nw) {
284
- ctx.moveTo(l + rad, t);
285
- ctx.lineTo(l, t);
286
- ctx.lineTo(l, t + rad);
287
- ctx.arcTo(l, t, l + rad, t, rad);
288
- }
289
-
290
- if (ne) {
291
- ctx.moveTo(r - rad, t);
292
- ctx.lineTo(r, t);
293
- ctx.lineTo(r, t + rad);
294
- ctx.arcTo(r, t, r - rad, t, rad);
295
- }
296
-
297
- if (se) {
298
- ctx.moveTo(r - rad, b);
299
- ctx.lineTo(r, b);
300
- ctx.lineTo(r, b - rad);
301
- ctx.arcTo(r, b, r - rad, b, rad);
302
- }
303
-
304
- if (sw) {
305
- ctx.moveTo(l + rad, b);
306
- ctx.lineTo(l, b);
307
- ctx.lineTo(l, b - rad);
308
- ctx.arcTo(l, b, l + rad, b, rad);
309
- }
310
- };
311
-
312
- var draw_modules_rounded = function draw_modules_rounded(qr, context, settings, left, top, width, row, col) {
313
- var is_dark = qr.is_dark;
314
- var right = left + width;
315
- var bottom = top + width;
316
- var radius = settings.radius * width;
317
- var rowT = row - 1;
318
- var rowB = row + 1;
319
- var colL = col - 1;
320
- var colR = col + 1;
321
- var center = is_dark(row, col);
322
- var northwest = is_dark(rowT, colL);
323
- var north = is_dark(rowT, col);
324
- var northeast = is_dark(rowT, colR);
325
- var east = is_dark(row, colR);
326
- var southeast = is_dark(rowB, colR);
327
- var south = is_dark(rowB, col);
328
- var southwest = is_dark(rowB, colL);
329
- var west = is_dark(row, colL);
330
-
331
- if (center) {
332
- draw_modules_rounded_dark(context, left, top, right, bottom, radius, !north && !west, !north && !east, !south && !east, !south && !west);
333
- } else {
334
- draw_modules_rounded_light(context, left, top, right, bottom, radius, north && west && northwest, north && east && northeast, south && east && southeast, south && west && southwest);
335
- }
336
- };
337
-
338
- var draw_modules = function draw_modules(qr, context, settings) {
339
- var module_count = qr.module_count;
340
- var module_size = settings.size / module_count;
341
- var fn = draw_modules_default;
342
- var row;
343
- var col;
344
-
345
- if (settings.radius > 0 && settings.radius <= 0.5) {
346
- fn = draw_modules_rounded;
347
- }
348
-
349
- context.beginPath();
350
-
351
- for (row = 0; row < module_count; row += 1) {
352
- for (col = 0; col < module_count; col += 1) {
353
- var l = settings.left + col * module_size;
354
- var t = settings.top + row * module_size;
355
- var w = module_size;
356
- fn(qr, context, settings, l, t, w, row, col);
357
- }
358
- }
359
-
360
- if (is_img_el(settings.fill)) {
361
- context.strokeStyle = 'rgba(0,0,0,0.5)';
362
- context.lineWidth = 2;
363
- context.stroke();
364
- var prev = context.globalCompositeOperation;
365
- context.globalCompositeOperation = 'destination-out';
366
- context.fill();
367
- context.globalCompositeOperation = prev;
368
- context.clip();
369
- context.drawImage(settings.fill, 0, 0, settings.size, settings.size);
370
- context.restore();
371
- } else {
372
- context.fillStyle = settings.fill;
373
- context.fill();
374
- }
375
- }; // Draws QR code to the given `canvas` and returns it.
376
-
377
-
378
- var draw_on_canvas = function draw_on_canvas(canvas, settings) {
379
- var qr = create_min_qrcode(settings.text, settings.ecLevel, settings.minVersion, settings.maxVersion, settings.quiet);
380
-
381
- if (!qr) {
382
- return null;
383
- }
384
-
385
- var $canvas = JQ(canvas).data('qrcode', qr);
386
- var context = $canvas[0].getContext('2d');
387
- draw_background(qr, context, settings);
388
- draw_modules(qr, context, settings);
389
- return $canvas;
390
- }; // Returns a `canvas` element representing the QR code for the given settings.
391
-
392
-
393
- var create_canvas = function create_canvas(settings) {
394
- var $canvas = JQ('<canvas/>').attr('width', settings.size).attr('height', settings.size);
395
- return draw_on_canvas($canvas, settings);
396
- }; // Returns an `image` element representing the QR code for the given settings.
397
-
398
-
399
- var create_img = function create_img(settings) {
400
- return JQ('<img/>').attr('src', create_canvas(settings)[0].toDataURL('image/png'));
401
- }; // Returns a `div` element representing the QR code for the given settings.
402
-
403
-
404
- var create_div = function create_div(settings) {
405
- var qr = create_min_qrcode(settings.text, settings.ecLevel, settings.minVersion, settings.maxVersion, settings.quiet);
406
-
407
- if (!qr) {
408
- return null;
409
- } // some shortcuts to improve compression
410
-
411
-
412
- var settings_size = settings.size;
413
- var settings_bgColor = settings.background;
414
- var math_floor = Math.floor;
415
- var module_count = qr.module_count;
416
- var module_size = math_floor(settings_size / module_count);
417
- var offset = math_floor(0.5 * (settings_size - module_size * module_count));
418
- var row;
419
- var col;
420
- var container_css = {
421
- position: 'relative',
422
- left: 0,
423
- top: 0,
424
- padding: 0,
425
- margin: 0,
426
- width: settings_size,
427
- height: settings_size
428
- };
429
- var dark_css = {
430
- position: 'absolute',
431
- padding: 0,
432
- margin: 0,
433
- width: module_size,
434
- height: module_size,
435
- 'background-color': settings.fill
436
- };
437
- var $div = JQ('<div/>').data('qrcode', qr).css(container_css);
438
-
439
- if (settings_bgColor) {
440
- $div.css('background-color', settings_bgColor);
441
- }
442
-
443
- for (row = 0; row < module_count; row += 1) {
444
- for (col = 0; col < module_count; col += 1) {
445
- if (qr.is_dark(row, col)) {
446
- JQ('<div/>').css(dark_css).css({
447
- left: offset + col * module_size,
448
- top: offset + row * module_size
449
- }).appendTo($div);
450
- }
451
- }
452
- }
453
-
454
- return $div;
455
- };
456
-
457
- var create_html = function create_html(settings) {
458
- if (HAS_CANVAS && settings.render === 'canvas') {
459
- return create_canvas(settings);
460
- } else if (HAS_CANVAS && settings.render === 'image') {
461
- return create_img(settings);
462
- }
463
-
464
- return create_div(settings);
465
- };
466
-
467
- var DEFAULTS = {
468
- // render method: `'canvas'`, `'image'` or `'div'`
469
- render: 'canvas',
470
- // version range somewhere in 1 .. 40
471
- minVersion: 1,
472
- maxVersion: 40,
473
- // error correction level: `'L'`, `'M'`, `'Q'` or `'H'`
474
- ecLevel: 'L',
475
- // offset in pixel if drawn onto existing canvas
476
- left: 0,
477
- top: 0,
478
- // size in pixel
479
- size: 200,
480
- // code color or image element
481
- fill: '#000',
482
- // background color or image element, `null` for transparent background
483
- background: '#fff',
484
- // content
485
- text: 'no text',
486
- // corner radius relative to module width: 0.0 .. 0.5
487
- radius: 0,
488
- // quiet zone in modules
489
- quiet: 0,
490
- // modes
491
- // 0: normal
492
- // 1: label strip
493
- // 2: label box
494
- // 3: image strip
495
- // 4: image box
496
- mode: 0,
497
- mSize: 0.1,
498
- mPosX: 0.5,
499
- mPosY: 0.5,
500
- label: 'no label',
501
- fontname: 'sans',
502
- fontcolor: '#000',
503
- image: null
504
- };
505
-
506
- JQ.fn.qrcode = module.exports = function main(options) {
507
- var settings = JQ.extend({}, DEFAULTS, options);
508
- return this.each(function (idx, el) {
509
- if (el.nodeName.toLowerCase() === 'canvas') {
510
- draw_on_canvas(el, settings);
511
- } else {
512
- JQ(el).append(create_html(settings));
513
- }
514
- });
515
- };
516
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(1)))
517
-
518
- /***/ }),
519
- /* 1 */
520
- /***/ (function(module, exports) {
521
-
522
- var g;
523
-
524
- // This works in non-strict mode
525
- g = (function() {
526
- return this;
527
- })();
528
-
529
- try {
530
- // This works if eval is allowed (see CSP)
531
- g = g || new Function("return this")();
532
- } catch (e) {
533
- // This works if the window reference is available
534
- if (typeof window === "object") g = window;
535
- }
536
-
537
- // g can still be undefined, but nothing to do about it...
538
- // We return undefined, instead of nothing here, so it's
539
- // easier to handle this case. if(!global) { ...}
540
-
541
- module.exports = g;
542
-
543
-
544
- /***/ }),
545
- /* 2 */
546
- /***/ (function(module, exports, __webpack_require__) {
547
-
548
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;//---------------------------------------------------------------------
549
- //
550
- // QR Code Generator for JavaScript
551
- //
552
- // Copyright (c) 2009 Kazuhiko Arase
553
- //
554
- // URL: http://www.d-project.com/
555
- //
556
- // Licensed under the MIT license:
557
- // http://www.opensource.org/licenses/mit-license.php
558
- //
559
- // The word 'QR Code' is registered trademark of
560
- // DENSO WAVE INCORPORATED
561
- // http://www.denso-wave.com/qrcode/faqpatent-e.html
562
- //
563
- //---------------------------------------------------------------------
564
-
565
- var qrcode = function() {
566
-
567
- //---------------------------------------------------------------------
568
- // qrcode
569
- //---------------------------------------------------------------------
570
-
571
- /**
572
- * qrcode
573
- * @param typeNumber 1 to 40
574
- * @param errorCorrectionLevel 'L','M','Q','H'
575
- */
576
- var qrcode = function(typeNumber, errorCorrectionLevel) {
577
-
578
- var PAD0 = 0xEC;
579
- var PAD1 = 0x11;
580
-
581
- var _typeNumber = typeNumber;
582
- var _errorCorrectionLevel = QRErrorCorrectionLevel[errorCorrectionLevel];
583
- var _modules = null;
584
- var _moduleCount = 0;
585
- var _dataCache = null;
586
- var _dataList = [];
587
-
588
- var _this = {};
589
-
590
- var makeImpl = function(test, maskPattern) {
591
-
592
- _moduleCount = _typeNumber * 4 + 17;
593
- _modules = function(moduleCount) {
594
- var modules = new Array(moduleCount);
595
- for (var row = 0; row < moduleCount; row += 1) {
596
- modules[row] = new Array(moduleCount);
597
- for (var col = 0; col < moduleCount; col += 1) {
598
- modules[row][col] = null;
599
- }
600
- }
601
- return modules;
602
- }(_moduleCount);
603
-
604
- setupPositionProbePattern(0, 0);
605
- setupPositionProbePattern(_moduleCount - 7, 0);
606
- setupPositionProbePattern(0, _moduleCount - 7);
607
- setupPositionAdjustPattern();
608
- setupTimingPattern();
609
- setupTypeInfo(test, maskPattern);
610
-
611
- if (_typeNumber >= 7) {
612
- setupTypeNumber(test);
613
- }
614
 
615
- if (_dataCache == null) {
616
- _dataCache = createData(_typeNumber, _errorCorrectionLevel, _dataList);
617
- }
618
 
619
- mapData(_dataCache, maskPattern);
620
- };
 
 
 
621
 
622
- var setupPositionProbePattern = function(row, col) {
 
 
623
 
624
- for (var r = -1; r <= 7; r += 1) {
 
 
625
 
626
- if (row + r <= -1 || _moduleCount <= row + r) continue;
627
 
628
- for (var c = -1; c <= 7; c += 1) {
 
629
 
630
- if (col + c <= -1 || _moduleCount <= col + c) continue;
 
 
631
 
632
- if ( (0 <= r && r <= 6 && (c == 0 || c == 6) )
633
- || (0 <= c && c <= 6 && (r == 0 || r == 6) )
634
- || (2 <= r && r <= 4 && 2 <= c && c <= 4) ) {
635
- _modules[row + r][col + c] = true;
636
- } else {
637
- _modules[row + r][col + c] = false;
638
- }
639
  }
640
- }
641
- };
642
-
643
- var getBestMaskPattern = function() {
644
 
645
- var minLostPoint = 0;
646
- var pattern = 0;
 
647
 
648
- for (var i = 0; i < 8; i += 1) {
 
 
 
 
649
 
650
- makeImpl(true, i);
651
-
652
- var lostPoint = QRUtil.getLostPoint(_this);
653
-
654
- if (i == 0 || minLostPoint > lostPoint) {
655
- minLostPoint = lostPoint;
656
- pattern = i;
657
  }
658
- }
659
 
660
- return pattern;
661
- };
 
 
 
 
662
 
663
- var setupTimingPattern = function() {
 
664
 
665
- for (var r = 8; r < _moduleCount - 8; r += 1) {
666
- if (_modules[r][6] != null) {
667
- continue;
 
 
 
 
 
 
668
  }
669
- _modules[r][6] = (r % 2 == 0);
670
- }
671
 
672
- for (var c = 8; c < _moduleCount - 8; c += 1) {
673
- if (_modules[6][c] != null) {
674
- continue;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
675
  }
676
- _modules[6][c] = (c % 2 == 0);
677
- }
678
- };
679
-
680
- var setupPositionAdjustPattern = function() {
681
-
682
- var pos = QRUtil.getPatternPosition(_typeNumber);
683
-
684
- for (var i = 0; i < pos.length; i += 1) {
685
-
686
- for (var j = 0; j < pos.length; j += 1) {
687
-
688
- var row = pos[i];
689
- var col = pos[j];
690
-
691
- if (_modules[row][col] != null) {
692
- continue;
693
- }
694
-
695
- for (var r = -2; r <= 2; r += 1) {
696
 
697
- for (var c = -2; c <= 2; c += 1) {
 
 
 
698
 
699
- if (r == -2 || r == 2 || c == -2 || c == 2
700
- || (r == 0 && c == 0) ) {
701
- _modules[row + r][col + c] = true;
702
- } else {
703
- _modules[row + r][col + c] = false;
704
- }
705
- }
706
- }
 
 
 
 
 
 
 
 
 
 
707
  }
708
- }
709
- };
710
-
711
- var setupTypeNumber = function(test) {
712
-
713
- var bits = QRUtil.getBCHTypeNumber(_typeNumber);
714
 
715
- for (var i = 0; i < 18; i += 1) {
716
- var mod = (!test && ( (bits >> i) & 1) == 1);
717
- _modules[Math.floor(i / 3)][i % 3 + _moduleCount - 8 - 3] = mod;
718
- }
719
-
720
- for (var i = 0; i < 18; i += 1) {
721
- var mod = (!test && ( (bits >> i) & 1) == 1);
722
- _modules[i % 3 + _moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
723
- }
724
- };
725
-
726
- var setupTypeInfo = function(test, maskPattern) {
727
 
728
- var data = (_errorCorrectionLevel << 3) | maskPattern;
729
- var bits = QRUtil.getBCHTypeInfo(data);
 
 
 
 
 
730
 
731
- // vertical
732
- for (var i = 0; i < 15; i += 1) {
 
 
 
 
 
733
 
734
- var mod = (!test && ( (bits >> i) & 1) == 1);
 
 
 
 
735
 
736
- if (i < 6) {
737
- _modules[i][8] = mod;
738
- } else if (i < 8) {
739
- _modules[i + 1][8] = mod;
740
  } else {
741
- _modules[_moduleCount - 15 + i][8] = mod;
742
  }
743
- }
744
-
745
- // horizontal
746
- for (var i = 0; i < 15; i += 1) {
747
 
748
- var mod = (!test && ( (bits >> i) & 1) == 1);
749
-
750
- if (i < 8) {
751
- _modules[8][_moduleCount - i - 1] = mod;
752
- } else if (i < 9) {
753
- _modules[8][15 - i - 1 + 1] = mod;
754
  } else {
755
- _modules[8][15 - i - 1] = mod;
756
  }
757
- }
758
-
759
- // fixed module
760
- _modules[_moduleCount - 8][8] = (!test);
761
- };
762
 
763
- var mapData = function(data, maskPattern) {
764
-
765
- var inc = -1;
766
- var row = _moduleCount - 1;
767
- var bitIndex = 7;
768
- var byteIndex = 0;
769
- var maskFunc = QRUtil.getMaskFunction(maskPattern);
770
 
771
- for (var col = _moduleCount - 1; col > 0; col -= 2) {
 
 
 
 
 
772
 
773
- if (col == 6) col -= 1;
 
 
 
 
 
 
774
 
775
- while (true) {
 
 
 
 
 
 
776
 
777
- for (var c = 0; c < 2; c += 1) {
 
 
 
 
 
778
 
779
- if (_modules[row][col - c] == null) {
 
 
 
 
 
780
 
781
- var dark = false;
 
 
 
 
 
 
782
 
783
- if (byteIndex < data.length) {
784
- dark = ( ( (data[byteIndex] >>> bitIndex) & 1) == 1);
785
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
786
 
787
- var mask = maskFunc(row, col - c);
 
 
 
 
 
788
 
789
- if (mask) {
790
- dark = !dark;
791
- }
792
 
793
- _modules[row][col - c] = dark;
794
- bitIndex -= 1;
 
 
 
 
795
 
796
- if (bitIndex == -1) {
797
- byteIndex += 1;
798
- bitIndex = 7;
799
- }
800
  }
801
- }
802
-
803
- row += inc;
804
-
805
- if (row < 0 || _moduleCount <= row) {
806
- row -= inc;
807
- inc = -inc;
808
- break;
809
- }
810
  }
811
- }
812
- };
813
-
814
- var createBytes = function(buffer, rsBlocks) {
815
-
816
- var offset = 0;
 
 
 
 
 
 
 
 
 
 
 
817
 
818
- var maxDcCount = 0;
819
- var maxEcCount = 0;
 
 
 
 
820
 
821
- var dcdata = new Array(rsBlocks.length);
822
- var ecdata = new Array(rsBlocks.length);
823
 
824
- for (var r = 0; r < rsBlocks.length; r += 1) {
 
825
 
826
- var dcCount = rsBlocks[r].dataCount;
827
- var ecCount = rsBlocks[r].totalCount - dcCount;
828
 
829
- maxDcCount = Math.max(maxDcCount, dcCount);
830
- maxEcCount = Math.max(maxEcCount, ecCount);
 
 
 
831
 
832
- dcdata[r] = new Array(dcCount);
 
 
 
833
 
834
- for (var i = 0; i < dcdata[r].length; i += 1) {
835
- dcdata[r][i] = 0xff & buffer.getBuffer()[i + offset];
 
 
 
836
  }
837
- offset += dcCount;
838
 
839
- var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
840
- var rawPoly = qrPolynomial(dcdata[r], rsPoly.getLength() - 1);
841
-
842
- var modPoly = rawPoly.mod(rsPoly);
843
- ecdata[r] = new Array(rsPoly.getLength() - 1);
844
- for (var i = 0; i < ecdata[r].length; i += 1) {
845
- var modIndex = i + modPoly.getLength() - ecdata[r].length;
846
- ecdata[r][i] = (modIndex >= 0)? modPoly.getAt(modIndex) : 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
847
  }
848
- }
849
 
850
- var totalCodeCount = 0;
851
- for (var i = 0; i < rsBlocks.length; i += 1) {
852
- totalCodeCount += rsBlocks[i].totalCount;
853
- }
 
 
 
 
 
 
 
 
 
854
 
855
- var data = new Array(totalCodeCount);
856
- var index = 0;
857
 
858
- for (var i = 0; i < maxDcCount; i += 1) {
859
- for (var r = 0; r < rsBlocks.length; r += 1) {
860
- if (i < dcdata[r].length) {
861
- data[index] = dcdata[r][i];
862
- index += 1;
863
- }
864
  }
865
- }
866
 
867
- for (var i = 0; i < maxEcCount; i += 1) {
868
- for (var r = 0; r < rsBlocks.length; r += 1) {
869
- if (i < ecdata[r].length) {
870
- data[index] = ecdata[r][i];
871
- index += 1;
872
- }
873
- }
874
- }
875
 
876
- return data;
877
- };
878
 
879
- var createData = function(typeNumber, errorCorrectionLevel, dataList) {
 
 
 
 
880
 
881
- var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectionLevel);
 
 
882
 
883
- var buffer = qrBitBuffer();
 
884
 
885
- for (var i = 0; i < dataList.length; i += 1) {
886
- var data = dataList[i];
887
- buffer.put(data.getMode(), 4);
888
- buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber) );
889
- data.write(buffer);
890
- }
891
 
892
- // calc num max data.
893
- var totalDataCount = 0;
894
- for (var i = 0; i < rsBlocks.length; i += 1) {
895
- totalDataCount += rsBlocks[i].dataCount;
896
- }
897
 
898
- if (buffer.getLengthInBits() > totalDataCount * 8) {
899
- throw 'code length overflow. ('
900
- + buffer.getLengthInBits()
901
- + '>'
902
- + totalDataCount * 8
903
- + ')';
904
- }
905
 
906
- // end code
907
- if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
908
- buffer.put(0, 4);
909
- }
910
 
911
- // padding
912
- while (buffer.getLengthInBits() % 8 != 0) {
913
- buffer.putBit(false);
914
- }
915
 
916
- // padding
917
- while (true) {
918
 
919
- if (buffer.getLengthInBits() >= totalDataCount * 8) {
920
- break;
921
- }
922
- buffer.put(PAD0, 8);
923
 
924
- if (buffer.getLengthInBits() >= totalDataCount * 8) {
925
- break;
926
- }
927
- buffer.put(PAD1, 8);
928
- }
 
 
929
 
930
- return createBytes(buffer, rsBlocks);
931
- };
 
932
 
933
- _this.addData = function(data, mode) {
934
-
935
- mode = mode || 'Byte';
936
-
937
- var newData = null;
938
-
939
- switch(mode) {
940
- case 'Numeric' :
941
- newData = qrNumber(data);
942
- break;
943
- case 'Alphanumeric' :
944
- newData = qrAlphaNum(data);
945
- break;
946
- case 'Byte' :
947
- newData = qr8BitByte(data);
948
- break;
949
- case 'Kanji' :
950
- newData = qrKanji(data);
951
- break;
952
- default :
953
- throw 'mode:' + mode;
954
- }
955
 
956
- _dataList.push(newData);
957
- _dataCache = null;
958
  };
959
 
960
- _this.isDark = function(row, col) {
961
- if (row < 0 || _moduleCount <= row || col < 0 || _moduleCount <= col) {
962
- throw row + ',' + col;
963
- }
964
- return _modules[row][col];
965
- };
966
 
967
- _this.getModuleCount = function() {
968
- return _moduleCount;
 
 
 
 
 
969
  };
970
-
971
- _this.make = function() {
972
- if (_typeNumber < 1) {
973
- var typeNumber = 1;
974
-
975
- for (; typeNumber < 40; typeNumber++) {
976
- var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, _errorCorrectionLevel);
977
- var buffer = qrBitBuffer();
978
-
979
- for (var i = 0; i < _dataList.length; i++) {
980
- var data = _dataList[i];
981
- buffer.put(data.getMode(), 4);
982
- buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber) );
983
- data.write(buffer);
984
- }
985
-
986
- var totalDataCount = 0;
987
- for (var i = 0; i < rsBlocks.length; i++) {
988
- totalDataCount += rsBlocks[i].dataCount;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
989
  }
990
 
991
- if (buffer.getLengthInBits() <= totalDataCount * 8) {
992
- break;
993
  }
994
- }
995
 
996
- _typeNumber = typeNumber;
997
- }
998
 
999
- makeImpl(false, getBestMaskPattern() );
1000
- };
1001
 
1002
- _this.createTableTag = function(cellSize, margin) {
1003
 
1004
- cellSize = cellSize || 2;
1005
- margin = (typeof margin == 'undefined')? cellSize * 4 : margin;
1006
 
1007
- var qrHtml = '';
1008
 
1009
- qrHtml += '<table style="';
1010
- qrHtml += ' border-width: 0px; border-style: none;';
1011
- qrHtml += ' border-collapse: collapse;';
1012
- qrHtml += ' padding: 0px; margin: ' + margin + 'px;';
1013
- qrHtml += '">';
1014
- qrHtml += '<tbody>';
1015
 
1016
- for (var r = 0; r < _this.getModuleCount(); r += 1) {
1017
-
1018
- qrHtml += '<tr>';
 
 
 
 
 
 
 
1019
 
1020
- for (var c = 0; c < _this.getModuleCount(); c += 1) {
1021
- qrHtml += '<td style="';
1022
- qrHtml += ' border-width: 0px; border-style: none;';
1023
- qrHtml += ' border-collapse: collapse;';
1024
- qrHtml += ' padding: 0px; margin: 0px;';
1025
- qrHtml += ' width: ' + cellSize + 'px;';
1026
- qrHtml += ' height: ' + cellSize + 'px;';
1027
- qrHtml += ' background-color: ';
1028
- qrHtml += _this.isDark(r, c)? '#000000' : '#ffffff';
1029
- qrHtml += ';';
1030
- qrHtml += '"/>';
1031
- }
1032
 
1033
- qrHtml += '</tr>';
1034
- }
1035
 
1036
- qrHtml += '</tbody>';
1037
- qrHtml += '</table>';
1038
 
1039
- return qrHtml;
1040
- };
1041
 
1042
- _this.createSvgTag = function(cellSize, margin) {
1043
 
1044
- var opts = {};
1045
- if (typeof arguments[0] == 'object') {
1046
- // Called by options.
1047
- opts = arguments[0];
1048
- // overwrite cellSize and margin.
1049
- cellSize = opts.cellSize;
1050
- margin = opts.margin;
1051
- }
1052
-
1053
- cellSize = cellSize || 2;
1054
- margin = (typeof margin == 'undefined')? cellSize * 4 : margin;
1055
- var size = _this.getModuleCount() * cellSize + margin * 2;
1056
- var c, mc, r, mr, qrSvg='', rect;
1057
 
1058
- rect = 'l' + cellSize + ',0 0,' + cellSize +
1059
- ' -' + cellSize + ',0 0,-' + cellSize + 'z ';
1060
 
1061
- qrSvg += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"';
1062
- qrSvg += !opts.scalable ? ' width="' + size + 'px" height="' + size + 'px"' : '';
1063
- qrSvg += ' viewBox="0 0 ' + size + ' ' + size + '" ';
1064
- qrSvg += ' preserveAspectRatio="xMinYMin meet">';
1065
- qrSvg += '<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>';
1066
- qrSvg += '<path d="';
1067
 
1068
- for (r = 0; r < _this.getModuleCount(); r += 1) {
1069
- mr = r * cellSize + margin;
1070
- for (c = 0; c < _this.getModuleCount(); c += 1) {
1071
- if (_this.isDark(r, c) ) {
1072
- mc = c*cellSize+margin;
1073
- qrSvg += 'M' + mc + ',' + mr + rect;
1074
  }
1075
- }
1076
- }
1077
 
1078
- qrSvg += '" stroke="transparent" fill="black"/>';
1079
- qrSvg += '</svg>';
1080
-
1081
- return qrSvg;
1082
- };
1083
-
1084
- _this.createDataURL = function(cellSize, margin) {
1085
 
1086
- cellSize = cellSize || 2;
1087
- margin = (typeof margin == 'undefined')? cellSize * 4 : margin;
1088
 
1089
- var size = _this.getModuleCount() * cellSize + margin * 2;
1090
- var min = margin;
1091
- var max = size - margin;
1092
 
1093
- return createDataURL(size, size, function(x, y) {
1094
- if (min <= x && x < max && min <= y && y < max) {
1095
- var c = Math.floor( (x - min) / cellSize);
1096
- var r = Math.floor( (y - min) / cellSize);
1097
- return _this.isDark(r, c)? 0 : 1;
1098
- } else {
1099
- return 1;
1100
- }
1101
- } );
1102
- };
1103
 
1104
- _this.createImgTag = function(cellSize, margin, alt) {
1105
-
1106
- cellSize = cellSize || 2;
1107
- margin = (typeof margin == 'undefined')? cellSize * 4 : margin;
1108
-
1109
- var size = _this.getModuleCount() * cellSize + margin * 2;
1110
-
1111
- var img = '';
1112
- img += '<img';
1113
- img += '\u0020src="';
1114
- img += _this.createDataURL(cellSize, margin);
1115
- img += '"';
1116
- img += '\u0020width="';
1117
- img += size;
1118
- img += '"';
1119
- img += '\u0020height="';
1120
- img += size;
1121
- img += '"';
1122
- if (alt) {
1123
- img += '\u0020alt="';
1124
- img += alt;
1125
- img += '"';
1126
- }
1127
- img += '/>';
1128
 
1129
- return img;
1130
- };
1131
 
1132
- var _createHalfASCII = function(margin) {
1133
- var cellSize = 1;
1134
- margin = (typeof margin == 'undefined')? cellSize * 2 : margin;
1135
 
1136
- var size = _this.getModuleCount() * cellSize + margin * 2;
1137
- var min = margin;
1138
- var max = size - margin;
1139
 
1140
- var y, x, r1, r2, p;
1141
 
1142
- var blocks = {
1143
- '██': '█',
1144
- '█ ': '▀',
1145
- ' █': '▄',
1146
- ' ': ' '
1147
- };
 
 
 
 
 
1148
 
1149
- var blocksLastLineNoMargin = {
1150
- '██': '▀',
1151
- '█ ': '▀',
1152
- ' █': ' ',
1153
- ' ': ' '
1154
- };
1155
 
1156
- var ascii = '';
1157
- for (y = 0; y < size; y += 2) {
1158
- r1 = Math.floor((y - min) / cellSize);
1159
- r2 = Math.floor((y + 1 - min) / cellSize);
1160
- for (x = 0; x < size; x += 1) {
1161
- p = '█';
1162
 
1163
- if (min <= x && x < max && min <= y && y < max && _this.isDark(r1, Math.floor((x - min) / cellSize))) {
1164
- p = ' ';
 
1165
  }
1166
 
1167
- if (min <= x && x < max && min <= y+1 && y+1 < max && _this.isDark(r2, Math.floor((x - min) / cellSize))) {
1168
- p += ' ';
1169
- }
1170
- else {
1171
- p += '█';
1172
  }
 
1173
 
1174
- // Output 2 characters per pixel, to create full square. 1 character per pixels gives only half width of square.
1175
- ascii += (margin < 1 && y+1 >= max) ? blocksLastLineNoMargin[p] : blocks[p];
1176
- }
1177
 
1178
- ascii += '\n';
1179
- }
1180
-
1181
- if (size % 2 && margin > 0) {
1182
- return ascii.substring(0, ascii.length - size - 1) + Array(size+1).join('▀');
1183
- }
1184
 
1185
- return ascii.substring(0, ascii.length-1);
1186
- };
1187
-
1188
- _this.createASCII = function(cellSize, margin) {
1189
- cellSize = cellSize || 1;
1190
-
1191
- if (cellSize < 2) {
1192
- return _createHalfASCII(margin);
1193
- }
1194
 
1195
- cellSize -= 1;
1196
- margin = (typeof margin == 'undefined')? cellSize * 2 : margin;
1197
 
1198
- var size = _this.getModuleCount() * cellSize + margin * 2;
1199
- var min = margin;
1200
- var max = size - margin;
1201
-
1202
- var y, x, r, p;
 
 
 
1203
 
1204
- var white = Array(cellSize+1).join('██');
1205
- var black = Array(cellSize+1).join(' ');
1206
 
1207
- var ascii = '';
1208
- var line = '';
1209
- for (y = 0; y < size; y += 1) {
1210
- r = Math.floor( (y - min) / cellSize);
1211
- line = '';
1212
- for (x = 0; x < size; x += 1) {
1213
- p = 1;
1214
 
1215
- if (min <= x && x < max && min <= y && y < max && _this.isDark(r, Math.floor((x - min) / cellSize))) {
1216
- p = 0;
 
 
 
 
 
1217
  }
1218
 
1219
- // Output 2 characters per pixel, to create full square. 1 character per pixels gives only half width of square.
1220
- line += p ? white : black;
1221
- }
1222
 
1223
- for (r = 0; r < cellSize; r += 1) {
1224
- ascii += line + '\n';
1225
- }
1226
- }
1227
 
1228
- return ascii.substring(0, ascii.length-1);
1229
- };
1230
-
1231
- _this.renderTo2dContext = function(context, cellSize) {
1232
- cellSize = cellSize || 2;
1233
- var length = _this.getModuleCount();
1234
- for (var row = 0; row < length; row++) {
1235
- for (var col = 0; col < length; col++) {
1236
- context.fillStyle = _this.isDark(row, col) ? 'black' : 'white';
1237
- context.fillRect(row * cellSize, col * cellSize, cellSize, cellSize);
1238
- }
1239
- }
1240
- }
1241
 
1242
- return _this;
1243
- };
1244
 
1245
- //---------------------------------------------------------------------
1246
- // qrcode.stringToBytes
1247
- //---------------------------------------------------------------------
1248
 
1249
- qrcode.stringToBytesFuncs = {
1250
- 'default' : function(s) {
1251
- var bytes = [];
1252
- for (var i = 0; i < s.length; i += 1) {
1253
- var c = s.charCodeAt(i);
1254
- bytes.push(c & 0xff);
1255
- }
1256
- return bytes;
1257
- }
1258
- };
1259
 
1260
- qrcode.stringToBytes = qrcode.stringToBytesFuncs['default'];
1261
 
1262
- //---------------------------------------------------------------------
1263
- // qrcode.createStringToBytes
1264
- //---------------------------------------------------------------------
1265
 
1266
- /**
1267
- * @param unicodeData base64 string of byte array.
1268
- * [16bit Unicode],[16bit Bytes], ...
1269
- * @param numChars
1270
- */
1271
- qrcode.createStringToBytes = function(unicodeData, numChars) {
1272
 
1273
- // create conversion map.
 
 
1274
 
1275
- var unicodeMap = function() {
1276
 
1277
- var bin = base64DecodeInputStream(unicodeData);
1278
- var read = function() {
1279
- var b = bin.read();
1280
- if (b == -1) throw 'eof';
1281
- return b;
1282
- };
1283
 
1284
- var count = 0;
1285
- var unicodeMap = {};
1286
- while (true) {
1287
- var b0 = bin.read();
1288
- if (b0 == -1) break;
1289
- var b1 = read();
1290
- var b2 = read();
1291
- var b3 = read();
1292
- var k = String.fromCharCode( (b0 << 8) | b1);
1293
- var v = (b2 << 8) | b3;
1294
- unicodeMap[k] = v;
1295
- count += 1;
1296
- }
1297
- if (count != numChars) {
1298
- throw count + ' != ' + numChars;
1299
- }
1300
 
1301
- return unicodeMap;
1302
- }();
 
 
 
 
1303
 
1304
- var unknownChar = '?'.charCodeAt(0);
1305
 
1306
- return function(s) {
1307
- var bytes = [];
1308
- for (var i = 0; i < s.length; i += 1) {
1309
- var c = s.charCodeAt(i);
1310
- if (c < 128) {
1311
- bytes.push(c);
1312
- } else {
1313
- var b = unicodeMap[s.charAt(i)];
1314
- if (typeof b == 'number') {
1315
- if ( (b & 0xff) == b) {
1316
- // 1byte
1317
- bytes.push(b);
1318
- } else {
1319
- // 2bytes
1320
- bytes.push(b >>> 8);
1321
- bytes.push(b & 0xff);
1322
  }
1323
- } else {
1324
- bytes.push(unknownChar);
1325
  }
1326
- }
1327
- }
1328
- return bytes;
1329
- };
1330
- };
1331
-
1332
- //---------------------------------------------------------------------
1333
- // QRMode
1334
- //---------------------------------------------------------------------
1335
-
1336
- var QRMode = {
1337
- MODE_NUMBER : 1 << 0,
1338
- MODE_ALPHA_NUM : 1 << 1,
1339
- MODE_8BIT_BYTE : 1 << 2,
1340
- MODE_KANJI : 1 << 3
1341
- };
1342
-
1343
- //---------------------------------------------------------------------
1344
- // QRErrorCorrectionLevel
1345
- //---------------------------------------------------------------------
1346
-
1347
- var QRErrorCorrectionLevel = {
1348
- L : 1,
1349
- M : 0,
1350
- Q : 3,
1351
- H : 2
1352
- };
1353
-
1354
- //---------------------------------------------------------------------
1355
- // QRMaskPattern
1356
- //---------------------------------------------------------------------
1357
-
1358
- var QRMaskPattern = {
1359
- PATTERN000 : 0,
1360
- PATTERN001 : 1,
1361
- PATTERN010 : 2,
1362
- PATTERN011 : 3,
1363
- PATTERN100 : 4,
1364
- PATTERN101 : 5,
1365
- PATTERN110 : 6,
1366
- PATTERN111 : 7
1367
- };
1368
-
1369
- //---------------------------------------------------------------------
1370
- // QRUtil
1371
- //---------------------------------------------------------------------
1372
-
1373
- var QRUtil = function() {
1374
-
1375
- var PATTERN_POSITION_TABLE = [
1376
- [],
1377
- [6, 18],
1378
- [6, 22],
1379
- [6, 26],
1380
- [6, 30],
1381
- [6, 34],
1382
- [6, 22, 38],
1383
- [6, 24, 42],
1384
- [6, 26, 46],
1385
- [6, 28, 50],
1386
- [6, 30, 54],
1387
- [6, 32, 58],
1388
- [6, 34, 62],
1389
- [6, 26, 46, 66],
1390
- [6, 26, 48, 70],
1391
- [6, 26, 50, 74],
1392
- [6, 30, 54, 78],
1393
- [6, 30, 56, 82],
1394
- [6, 30, 58, 86],
1395
- [6, 34, 62, 90],
1396
- [6, 28, 50, 72, 94],
1397
- [6, 26, 50, 74, 98],
1398
- [6, 30, 54, 78, 102],
1399
- [6, 28, 54, 80, 106],
1400
- [6, 32, 58, 84, 110],
1401
- [6, 30, 58, 86, 114],
1402
- [6, 34, 62, 90, 118],
1403
- [6, 26, 50, 74, 98, 122],
1404
- [6, 30, 54, 78, 102, 126],
1405
- [6, 26, 52, 78, 104, 130],
1406
- [6, 30, 56, 82, 108, 134],
1407
- [6, 34, 60, 86, 112, 138],
1408
- [6, 30, 58, 86, 114, 142],
1409
- [6, 34, 62, 90, 118, 146],
1410
- [6, 30, 54, 78, 102, 126, 150],
1411
- [6, 24, 50, 76, 102, 128, 154],
1412
- [6, 28, 54, 80, 106, 132, 158],
1413
- [6, 32, 58, 84, 110, 136, 162],
1414
- [6, 26, 54, 82, 110, 138, 166],
1415
- [6, 30, 58, 86, 114, 142, 170]
1416
- ];
1417
- var G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0);
1418
- var G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0);
1419
- var G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1);
1420
-
1421
- var _this = {};
1422
-
1423
- var getBCHDigit = function(data) {
1424
- var digit = 0;
1425
- while (data != 0) {
1426
- digit += 1;
1427
- data >>>= 1;
1428
- }
1429
- return digit;
1430
- };
1431
 
1432
- _this.getBCHTypeInfo = function(data) {
1433
- var d = data << 10;
1434
- while (getBCHDigit(d) - getBCHDigit(G15) >= 0) {
1435
- d ^= (G15 << (getBCHDigit(d) - getBCHDigit(G15) ) );
1436
- }
1437
- return ( (data << 10) | d) ^ G15_MASK;
1438
- };
1439
 
1440
- _this.getBCHTypeNumber = function(data) {
1441
- var d = data << 12;
1442
- while (getBCHDigit(d) - getBCHDigit(G18) >= 0) {
1443
- d ^= (G18 << (getBCHDigit(d) - getBCHDigit(G18) ) );
1444
- }
1445
- return (data << 12) | d;
1446
- };
1447
 
1448
- _this.getPatternPosition = function(typeNumber) {
1449
- return PATTERN_POSITION_TABLE[typeNumber - 1];
1450
- };
1451
 
1452
- _this.getMaskFunction = function(maskPattern) {
1453
-
1454
- switch (maskPattern) {
1455
-
1456
- case QRMaskPattern.PATTERN000 :
1457
- return function(i, j) { return (i + j) % 2 == 0; };
1458
- case QRMaskPattern.PATTERN001 :
1459
- return function(i, j) { return i % 2 == 0; };
1460
- case QRMaskPattern.PATTERN010 :
1461
- return function(i, j) { return j % 3 == 0; };
1462
- case QRMaskPattern.PATTERN011 :
1463
- return function(i, j) { return (i + j) % 3 == 0; };
1464
- case QRMaskPattern.PATTERN100 :
1465
- return function(i, j) { return (Math.floor(i / 2) + Math.floor(j / 3) ) % 2 == 0; };
1466
- case QRMaskPattern.PATTERN101 :
1467
- return function(i, j) { return (i * j) % 2 + (i * j) % 3 == 0; };
1468
- case QRMaskPattern.PATTERN110 :
1469
- return function(i, j) { return ( (i * j) % 2 + (i * j) % 3) % 2 == 0; };
1470
- case QRMaskPattern.PATTERN111 :
1471
- return function(i, j) { return ( (i * j) % 3 + (i + j) % 2) % 2 == 0; };
1472
-
1473
- default :
1474
- throw 'bad maskPattern:' + maskPattern;
1475
- }
1476
- };
1477
 
1478
- _this.getErrorCorrectPolynomial = function(errorCorrectLength) {
1479
- var a = qrPolynomial([1], 0);
1480
- for (var i = 0; i < errorCorrectLength; i += 1) {
1481
- a = a.multiply(qrPolynomial([1, QRMath.gexp(i)], 0) );
1482
- }
1483
- return a;
1484
- };
1485
 
1486
- _this.getLengthInBits = function(mode, type) {
 
1487
 
1488
- if (1 <= type && type < 10) {
 
1489
 
1490
- // 1 - 9
1491
 
1492
- switch(mode) {
1493
- case QRMode.MODE_NUMBER : return 10;
1494
- case QRMode.MODE_ALPHA_NUM : return 9;
1495
- case QRMode.MODE_8BIT_BYTE : return 8;
1496
- case QRMode.MODE_KANJI : return 8;
1497
- default :
1498
- throw 'mode:' + mode;
1499
- }
1500
-
1501
- } else if (type < 27) {
1502
 
1503
- // 10 - 26
 
1504
 
1505
- switch(mode) {
1506
- case QRMode.MODE_NUMBER : return 12;
1507
- case QRMode.MODE_ALPHA_NUM : return 11;
1508
- case QRMode.MODE_8BIT_BYTE : return 16;
1509
- case QRMode.MODE_KANJI : return 10;
1510
- default :
1511
- throw 'mode:' + mode;
1512
- }
1513
 
1514
- } else if (type < 41) {
 
 
 
1515
 
1516
- // 27 - 40
 
1517
 
1518
- switch(mode) {
1519
- case QRMode.MODE_NUMBER : return 14;
1520
- case QRMode.MODE_ALPHA_NUM : return 13;
1521
- case QRMode.MODE_8BIT_BYTE : return 16;
1522
- case QRMode.MODE_KANJI : return 12;
1523
- default :
1524
- throw 'mode:' + mode;
1525
- }
1526
 
1527
- } else {
1528
- throw 'type:' + type;
1529
- }
1530
- };
 
 
 
 
1531
 
1532
- _this.getLostPoint = function(qrcode) {
 
1533
 
1534
- var moduleCount = qrcode.getModuleCount();
1535
 
1536
- var lostPoint = 0;
1537
 
1538
- // LEVEL1
1539
 
1540
- for (var row = 0; row < moduleCount; row += 1) {
1541
- for (var col = 0; col < moduleCount; col += 1) {
 
 
 
 
1542
 
1543
- var sameCount = 0;
1544
- var dark = qrcode.isDark(row, col);
 
 
 
1545
 
1546
- for (var r = -1; r <= 1; r += 1) {
 
 
 
 
 
 
1547
 
1548
- if (row + r < 0 || moduleCount <= row + r) {
1549
- continue;
1550
- }
 
1551
 
1552
- for (var c = -1; c <= 1; c += 1) {
 
 
 
1553
 
1554
- if (col + c < 0 || moduleCount <= col + c) {
1555
- continue;
1556
- }
1557
 
1558
- if (r == 0 && c == 0) {
1559
- continue;
1560
- }
 
1561
 
1562
- if (dark == qrcode.isDark(row + r, col + c) ) {
1563
- sameCount += 1;
1564
- }
1565
  }
 
1566
  }
1567
 
1568
- if (sameCount > 5) {
1569
- lostPoint += (3 + sameCount - 5);
1570
- }
1571
- }
1572
- };
1573
 
1574
- // LEVEL2
 
 
 
 
1575
 
1576
- for (var row = 0; row < moduleCount - 1; row += 1) {
1577
- for (var col = 0; col < moduleCount - 1; col += 1) {
1578
- var count = 0;
1579
- if (qrcode.isDark(row, col) ) count += 1;
1580
- if (qrcode.isDark(row + 1, col) ) count += 1;
1581
- if (qrcode.isDark(row, col + 1) ) count += 1;
1582
- if (qrcode.isDark(row + 1, col + 1) ) count += 1;
1583
- if (count == 0 || count == 4) {
1584
- lostPoint += 3;
1585
  }
1586
- }
1587
- }
 
 
 
 
 
 
 
 
 
 
1588
 
1589
- // LEVEL3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1590
 
1591
- for (var row = 0; row < moduleCount; row += 1) {
1592
- for (var col = 0; col < moduleCount - 6; col += 1) {
1593
- if (qrcode.isDark(row, col)
1594
- && !qrcode.isDark(row, col + 1)
1595
- && qrcode.isDark(row, col + 2)
1596
- && qrcode.isDark(row, col + 3)
1597
- && qrcode.isDark(row, col + 4)
1598
- && !qrcode.isDark(row, col + 5)
1599
- && qrcode.isDark(row, col + 6) ) {
1600
- lostPoint += 40;
1601
  }
1602
- }
1603
- }
1604
 
1605
- for (var col = 0; col < moduleCount; col += 1) {
1606
- for (var row = 0; row < moduleCount - 6; row += 1) {
1607
- if (qrcode.isDark(row, col)
1608
- && !qrcode.isDark(row + 1, col)
1609
- && qrcode.isDark(row + 2, col)
1610
- && qrcode.isDark(row + 3, col)
1611
- && qrcode.isDark(row + 4, col)
1612
- && !qrcode.isDark(row + 5, col)
1613
- && qrcode.isDark(row + 6, col) ) {
1614
- lostPoint += 40;
1615
- }
1616
- }
1617
- }
1618
 
1619
- // LEVEL4
 
1620
 
1621
- var darkCount = 0;
1622
 
1623
- for (var col = 0; col < moduleCount; col += 1) {
1624
- for (var row = 0; row < moduleCount; row += 1) {
1625
- if (qrcode.isDark(row, col) ) {
1626
- darkCount += 1;
1627
- }
1628
- }
1629
- }
1630
 
1631
- var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
1632
- lostPoint += ratio * 10;
 
1633
 
1634
- return lostPoint;
1635
- };
 
 
 
 
 
 
 
 
1636
 
1637
- return _this;
1638
- }();
1639
 
1640
- //---------------------------------------------------------------------
1641
- // QRMath
1642
- //---------------------------------------------------------------------
1643
 
1644
- var QRMath = function() {
 
 
 
 
 
 
 
1645
 
1646
- var EXP_TABLE = new Array(256);
1647
- var LOG_TABLE = new Array(256);
 
1648
 
1649
- // initialize tables
1650
- for (var i = 0; i < 8; i += 1) {
1651
- EXP_TABLE[i] = 1 << i;
1652
- }
1653
- for (var i = 8; i < 256; i += 1) {
1654
- EXP_TABLE[i] = EXP_TABLE[i - 4]
1655
- ^ EXP_TABLE[i - 5]
1656
- ^ EXP_TABLE[i - 6]
1657
- ^ EXP_TABLE[i - 8];
1658
- }
1659
- for (var i = 0; i < 255; i += 1) {
1660
- LOG_TABLE[EXP_TABLE[i] ] = i;
1661
- }
1662
 
1663
- var _this = {};
1664
 
1665
- _this.glog = function(n) {
1666
 
1667
- if (n < 1) {
1668
- throw 'glog(' + n + ')';
1669
- }
 
 
 
1670
 
1671
- return LOG_TABLE[n];
1672
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1673
 
1674
- _this.gexp = function(n) {
 
1675
 
1676
- while (n < 0) {
1677
- n += 255;
1678
- }
1679
 
1680
- while (n >= 256) {
1681
- n -= 255;
1682
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1683
 
1684
- return EXP_TABLE[n];
1685
- };
 
1686
 
1687
- return _this;
1688
- }();
 
 
 
 
1689
 
1690
- //---------------------------------------------------------------------
1691
- // qrPolynomial
1692
- //---------------------------------------------------------------------
1693
 
1694
- function qrPolynomial(num, shift) {
 
 
 
 
 
1695
 
1696
- if (typeof num.length == 'undefined') {
1697
- throw num.length + '/' + shift;
1698
- }
 
 
 
 
 
 
 
 
 
 
 
1699
 
1700
- var _num = function() {
1701
- var offset = 0;
1702
- while (offset < num.length && num[offset] == 0) {
1703
- offset += 1;
1704
- }
1705
- var _num = new Array(num.length - offset + shift);
1706
- for (var i = 0; i < num.length - offset; i += 1) {
1707
- _num[i] = num[i + offset];
1708
- }
1709
- return _num;
1710
- }();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1711
 
1712
- var _this = {};
 
 
 
 
 
 
1713
 
1714
- _this.getAt = function(index) {
1715
- return _num[index];
1716
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1717
 
1718
- _this.getLength = function() {
1719
- return _num.length;
1720
- };
 
 
 
 
1721
 
1722
- _this.multiply = function(e) {
1723
 
1724
- var num = new Array(_this.getLength() + e.getLength() - 1);
1725
 
1726
- for (var i = 0; i < _this.getLength(); i += 1) {
1727
- for (var j = 0; j < e.getLength(); j += 1) {
1728
- num[i + j] ^= QRMath.gexp(QRMath.glog(_this.getAt(i) ) + QRMath.glog(e.getAt(j) ) );
1729
- }
1730
- }
1731
 
1732
- return qrPolynomial(num, 0);
1733
- };
 
 
 
 
 
 
1734
 
1735
- _this.mod = function(e) {
1736
 
1737
- if (_this.getLength() - e.getLength() < 0) {
1738
- return _this;
1739
- }
1740
 
1741
- var ratio = QRMath.glog(_this.getAt(0) ) - QRMath.glog(e.getAt(0) );
 
 
 
 
 
 
 
1742
 
1743
- var num = new Array(_this.getLength() );
1744
- for (var i = 0; i < _this.getLength(); i += 1) {
1745
- num[i] = _this.getAt(i);
1746
- }
1747
 
1748
- for (var i = 0; i < e.getLength(); i += 1) {
1749
- num[i] ^= QRMath.gexp(QRMath.glog(e.getAt(i) ) + ratio);
1750
- }
1751
 
1752
- // recursive call
1753
- return qrPolynomial(num, 0).mod(e);
1754
- };
 
 
 
 
 
1755
 
1756
- return _this;
1757
- };
1758
-
1759
- //---------------------------------------------------------------------
1760
- // QRRSBlock
1761
- //---------------------------------------------------------------------
1762
-
1763
- var QRRSBlock = function() {
1764
-
1765
- var RS_BLOCK_TABLE = [
1766
-
1767
- // L
1768
- // M
1769
- // Q
1770
- // H
1771
-
1772
- // 1
1773
- [1, 26, 19],
1774
- [1, 26, 16],
1775
- [1, 26, 13],
1776
- [1, 26, 9],
1777
-
1778
- // 2
1779
- [1, 44, 34],
1780
- [1, 44, 28],
1781
- [1, 44, 22],
1782
- [1, 44, 16],
1783
-
1784
- // 3
1785
- [1, 70, 55],
1786
- [1, 70, 44],
1787
- [2, 35, 17],
1788
- [2, 35, 13],
1789
-
1790
- // 4
1791
- [1, 100, 80],
1792
- [2, 50, 32],
1793
- [2, 50, 24],
1794
- [4, 25, 9],
1795
-
1796
- // 5
1797
- [1, 134, 108],
1798
- [2, 67, 43],
1799
- [2, 33, 15, 2, 34, 16],
1800
- [2, 33, 11, 2, 34, 12],
1801
-
1802
- // 6
1803
- [2, 86, 68],
1804
- [4, 43, 27],
1805
- [4, 43, 19],
1806
- [4, 43, 15],
1807
-
1808
- // 7
1809
- [2, 98, 78],
1810
- [4, 49, 31],
1811
- [2, 32, 14, 4, 33, 15],
1812
- [4, 39, 13, 1, 40, 14],
1813
-
1814
- // 8
1815
- [2, 121, 97],
1816
- [2, 60, 38, 2, 61, 39],
1817
- [4, 40, 18, 2, 41, 19],
1818
- [4, 40, 14, 2, 41, 15],
1819
-
1820
- // 9
1821
- [2, 146, 116],
1822
- [3, 58, 36, 2, 59, 37],
1823
- [4, 36, 16, 4, 37, 17],
1824
- [4, 36, 12, 4, 37, 13],
1825
-
1826
- // 10
1827
- [2, 86, 68, 2, 87, 69],
1828
- [4, 69, 43, 1, 70, 44],
1829
- [6, 43, 19, 2, 44, 20],
1830
- [6, 43, 15, 2, 44, 16],
1831
-
1832
- // 11
1833
- [4, 101, 81],
1834
- [1, 80, 50, 4, 81, 51],
1835
- [4, 50, 22, 4, 51, 23],
1836
- [3, 36, 12, 8, 37, 13],
1837
-
1838
- // 12
1839
- [2, 116, 92, 2, 117, 93],
1840
- [6, 58, 36, 2, 59, 37],
1841
- [4, 46, 20, 6, 47, 21],
1842
- [7, 42, 14, 4, 43, 15],
1843
-
1844
- // 13
1845
- [4, 133, 107],
1846
- [8, 59, 37, 1, 60, 38],
1847
- [8, 44, 20, 4, 45, 21],
1848
- [12, 33, 11, 4, 34, 12],
1849
-
1850
- // 14
1851
- [3, 145, 115, 1, 146, 116],
1852
- [4, 64, 40, 5, 65, 41],
1853
- [11, 36, 16, 5, 37, 17],
1854
- [11, 36, 12, 5, 37, 13],
1855
-
1856
- // 15
1857
- [5, 109, 87, 1, 110, 88],
1858
- [5, 65, 41, 5, 66, 42],
1859
- [5, 54, 24, 7, 55, 25],
1860
- [11, 36, 12, 7, 37, 13],
1861
-
1862
- // 16
1863
- [5, 122, 98, 1, 123, 99],
1864
- [7, 73, 45, 3, 74, 46],
1865
- [15, 43, 19, 2, 44, 20],
1866
- [3, 45, 15, 13, 46, 16],
1867
-
1868
- // 17
1869
- [1, 135, 107, 5, 136, 108],
1870
- [10, 74, 46, 1, 75, 47],
1871
- [1, 50, 22, 15, 51, 23],
1872
- [2, 42, 14, 17, 43, 15],
1873
-
1874
- // 18
1875
- [5, 150, 120, 1, 151, 121],
1876
- [9, 69, 43, 4, 70, 44],
1877
- [17, 50, 22, 1, 51, 23],
1878
- [2, 42, 14, 19, 43, 15],
1879
-
1880
- // 19
1881
- [3, 141, 113, 4, 142, 114],
1882
- [3, 70, 44, 11, 71, 45],
1883
- [17, 47, 21, 4, 48, 22],
1884
- [9, 39, 13, 16, 40, 14],
1885
-
1886
- // 20
1887
- [3, 135, 107, 5, 136, 108],
1888
- [3, 67, 41, 13, 68, 42],
1889
- [15, 54, 24, 5, 55, 25],
1890
- [15, 43, 15, 10, 44, 16],
1891
-
1892
- // 21
1893
- [4, 144, 116, 4, 145, 117],
1894
- [17, 68, 42],
1895
- [17, 50, 22, 6, 51, 23],
1896
- [19, 46, 16, 6, 47, 17],
1897
-
1898
- // 22
1899
- [2, 139, 111, 7, 140, 112],
1900
- [17, 74, 46],
1901
- [7, 54, 24, 16, 55, 25],
1902
- [34, 37, 13],
1903
-
1904
- // 23
1905
- [4, 151, 121, 5, 152, 122],
1906
- [4, 75, 47, 14, 76, 48],
1907
- [11, 54, 24, 14, 55, 25],
1908
- [16, 45, 15, 14, 46, 16],
1909
-
1910
- // 24
1911
- [6, 147, 117, 4, 148, 118],
1912
- [6, 73, 45, 14, 74, 46],
1913
- [11, 54, 24, 16, 55, 25],
1914
- [30, 46, 16, 2, 47, 17],
1915
-
1916
- // 25
1917
- [8, 132, 106, 4, 133, 107],
1918
- [8, 75, 47, 13, 76, 48],
1919
- [7, 54, 24, 22, 55, 25],
1920
- [22, 45, 15, 13, 46, 16],
1921
-
1922
- // 26
1923
- [10, 142, 114, 2, 143, 115],
1924
- [19, 74, 46, 4, 75, 47],
1925
- [28, 50, 22, 6, 51, 23],
1926
- [33, 46, 16, 4, 47, 17],
1927
-
1928
- // 27
1929
- [8, 152, 122, 4, 153, 123],
1930
- [22, 73, 45, 3, 74, 46],
1931
- [8, 53, 23, 26, 54, 24],
1932
- [12, 45, 15, 28, 46, 16],
1933
-
1934
- // 28
1935
- [3, 147, 117, 10, 148, 118],
1936
- [3, 73, 45, 23, 74, 46],
1937
- [4, 54, 24, 31, 55, 25],
1938
- [11, 45, 15, 31, 46, 16],
1939
-
1940
- // 29
1941
- [7, 146, 116, 7, 147, 117],
1942
- [21, 73, 45, 7, 74, 46],
1943
- [1, 53, 23, 37, 54, 24],
1944
- [19, 45, 15, 26, 46, 16],
1945
-
1946
- // 30
1947
- [5, 145, 115, 10, 146, 116],
1948
- [19, 75, 47, 10, 76, 48],
1949
- [15, 54, 24, 25, 55, 25],
1950
- [23, 45, 15, 25, 46, 16],
1951
-
1952
- // 31
1953
- [13, 145, 115, 3, 146, 116],
1954
- [2, 74, 46, 29, 75, 47],
1955
- [42, 54, 24, 1, 55, 25],
1956
- [23, 45, 15, 28, 46, 16],
1957
-
1958
- // 32
1959
- [17, 145, 115],
1960
- [10, 74, 46, 23, 75, 47],
1961
- [10, 54, 24, 35, 55, 25],
1962
- [19, 45, 15, 35, 46, 16],
1963
-
1964
- // 33
1965
- [17, 145, 115, 1, 146, 116],
1966
- [14, 74, 46, 21, 75, 47],
1967
- [29, 54, 24, 19, 55, 25],
1968
- [11, 45, 15, 46, 46, 16],
1969
-
1970
- // 34
1971
- [13, 145, 115, 6, 146, 116],
1972
- [14, 74, 46, 23, 75, 47],
1973
- [44, 54, 24, 7, 55, 25],
1974
- [59, 46, 16, 1, 47, 17],
1975
-
1976
- // 35
1977
- [12, 151, 121, 7, 152, 122],
1978
- [12, 75, 47, 26, 76, 48],
1979
- [39, 54, 24, 14, 55, 25],
1980
- [22, 45, 15, 41, 46, 16],
1981
-
1982
- // 36
1983
- [6, 151, 121, 14, 152, 122],
1984
- [6, 75, 47, 34, 76, 48],
1985
- [46, 54, 24, 10, 55, 25],
1986
- [2, 45, 15, 64, 46, 16],
1987
-
1988
- // 37
1989
- [17, 152, 122, 4, 153, 123],
1990
- [29, 74, 46, 14, 75, 47],
1991
- [49, 54, 24, 10, 55, 25],
1992
- [24, 45, 15, 46, 46, 16],
1993
-
1994
- // 38
1995
- [4, 152, 122, 18, 153, 123],
1996
- [13, 74, 46, 32, 75, 47],
1997
- [48, 54, 24, 14, 55, 25],
1998
- [42, 45, 15, 32, 46, 16],
1999
-
2000
- // 39
2001
- [20, 147, 117, 4, 148, 118],
2002
- [40, 75, 47, 7, 76, 48],
2003
- [43, 54, 24, 22, 55, 25],
2004
- [10, 45, 15, 67, 46, 16],
2005
-
2006
- // 40
2007
- [19, 148, 118, 6, 149, 119],
2008
- [18, 75, 47, 31, 76, 48],
2009
- [34, 54, 24, 34, 55, 25],
2010
- [20, 45, 15, 61, 46, 16]
2011
- ];
2012
-
2013
- var qrRSBlock = function(totalCount, dataCount) {
2014
- var _this = {};
2015
- _this.totalCount = totalCount;
2016
- _this.dataCount = dataCount;
2017
- return _this;
2018
- };
2019
 
2020
- var _this = {};
2021
 
2022
- var getRsBlockTable = function(typeNumber, errorCorrectionLevel) {
2023
 
2024
- switch(errorCorrectionLevel) {
2025
- case QRErrorCorrectionLevel.L :
2026
- return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
2027
- case QRErrorCorrectionLevel.M :
2028
- return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
2029
- case QRErrorCorrectionLevel.Q :
2030
- return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
2031
- case QRErrorCorrectionLevel.H :
2032
- return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
2033
- default :
2034
- return undefined;
2035
- }
2036
- };
2037
 
2038
- _this.getRSBlocks = function(typeNumber, errorCorrectionLevel) {
2039
 
2040
- var rsBlock = getRsBlockTable(typeNumber, errorCorrectionLevel);
 
2041
 
2042
- if (typeof rsBlock == 'undefined') {
2043
- throw 'bad rs block @ typeNumber:' + typeNumber +
2044
- '/errorCorrectionLevel:' + errorCorrectionLevel;
2045
- }
2046
 
2047
- var length = rsBlock.length / 3;
2048
 
2049
- var list = [];
 
 
2050
 
2051
- for (var i = 0; i < length; i += 1) {
2052
 
2053
- var count = rsBlock[i * 3 + 0];
2054
- var totalCount = rsBlock[i * 3 + 1];
2055
- var dataCount = rsBlock[i * 3 + 2];
2056
 
2057
- for (var j = 0; j < count; j += 1) {
2058
- list.push(qrRSBlock(totalCount, dataCount) );
2059
- }
2060
- }
2061
 
2062
- return list;
2063
- };
 
 
 
2064
 
2065
- return _this;
2066
- }();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2067
 
2068
- //---------------------------------------------------------------------
2069
- // qrBitBuffer
2070
- //---------------------------------------------------------------------
 
 
 
 
 
 
 
 
 
 
 
 
2071
 
2072
- var qrBitBuffer = function() {
 
 
 
 
 
 
 
 
 
 
 
 
2073
 
2074
- var _buffer = [];
2075
- var _length = 0;
2076
 
2077
- var _this = {};
2078
 
2079
- _this.getBuffer = function() {
2080
- return _buffer;
2081
- };
 
 
 
 
2082
 
2083
- _this.getAt = function(index) {
2084
- var bufIndex = Math.floor(index / 8);
2085
- return ( (_buffer[bufIndex] >>> (7 - index % 8) ) & 1) == 1;
2086
- };
2087
 
2088
- _this.put = function(num, length) {
2089
- for (var i = 0; i < length; i += 1) {
2090
- _this.putBit( ( (num >>> (length - i - 1) ) & 1) == 1);
2091
- }
2092
- };
2093
 
2094
- _this.getLengthInBits = function() {
2095
- return _length;
2096
- };
2097
 
2098
- _this.putBit = function(bit) {
 
 
2099
 
2100
- var bufIndex = Math.floor(_length / 8);
2101
- if (_buffer.length <= bufIndex) {
2102
- _buffer.push(0);
2103
- }
2104
 
2105
- if (bit) {
2106
- _buffer[bufIndex] |= (0x80 >>> (_length % 8) );
2107
- }
2108
 
2109
- _length += 1;
2110
- };
 
 
 
 
 
 
 
 
 
 
 
2111
 
2112
- return _this;
2113
- };
2114
 
2115
- //---------------------------------------------------------------------
2116
- // qrNumber
2117
- //---------------------------------------------------------------------
2118
 
2119
- var qrNumber = function(data) {
 
 
2120
 
2121
- var _mode = QRMode.MODE_NUMBER;
2122
- var _data = data;
2123
 
2124
- var _this = {};
2125
 
2126
- _this.getMode = function() {
2127
- return _mode;
2128
- };
2129
 
2130
- _this.getLength = function(buffer) {
2131
- return _data.length;
2132
- };
2133
 
2134
- _this.write = function(buffer) {
 
2135
 
2136
- var data = _data;
 
2137
 
2138
- var i = 0;
 
 
2139
 
2140
- while (i + 2 < data.length) {
2141
- buffer.put(strToNum(data.substring(i, i + 3) ), 10);
2142
- i += 3;
2143
- }
2144
 
2145
- if (i < data.length) {
2146
- if (data.length - i == 1) {
2147
- buffer.put(strToNum(data.substring(i, i + 1) ), 4);
2148
- } else if (data.length - i == 2) {
2149
- buffer.put(strToNum(data.substring(i, i + 2) ), 7);
2150
  }
2151
- }
2152
- };
2153
 
2154
- var strToNum = function(s) {
2155
- var num = 0;
2156
- for (var i = 0; i < s.length; i += 1) {
2157
- num = num * 10 + chatToNum(s.charAt(i) );
2158
- }
2159
- return num;
2160
- };
 
 
 
 
2161
 
2162
- var chatToNum = function(c) {
2163
- if ('0' <= c && c <= '9') {
2164
- return c.charCodeAt(0) - '0'.charCodeAt(0);
2165
- }
2166
- throw 'illegal char :' + c;
2167
- };
2168
 
2169
- return _this;
2170
- };
 
2171
 
2172
- //---------------------------------------------------------------------
2173
- // qrAlphaNum
2174
- //---------------------------------------------------------------------
2175
 
2176
- var qrAlphaNum = function(data) {
2177
 
2178
- var _mode = QRMode.MODE_ALPHA_NUM;
2179
- var _data = data;
2180
 
2181
- var _this = {};
 
 
 
 
2182
 
2183
- _this.getMode = function() {
2184
- return _mode;
2185
- };
2186
 
2187
- _this.getLength = function(buffer) {
2188
- return _data.length;
2189
- };
2190
 
2191
- _this.write = function(buffer) {
 
 
2192
 
2193
- var s = _data;
2194
 
2195
- var i = 0;
 
 
 
2196
 
2197
- while (i + 1 < s.length) {
2198
- buffer.put(
2199
- getCode(s.charAt(i) ) * 45 +
2200
- getCode(s.charAt(i + 1) ), 11);
2201
- i += 2;
2202
- }
2203
 
2204
- if (i < s.length) {
2205
- buffer.put(getCode(s.charAt(i) ), 6);
2206
- }
2207
- };
2208
 
2209
- var getCode = function(c) {
2210
-
2211
- if ('0' <= c && c <= '9') {
2212
- return c.charCodeAt(0) - '0'.charCodeAt(0);
2213
- } else if ('A' <= c && c <= 'Z') {
2214
- return c.charCodeAt(0) - 'A'.charCodeAt(0) + 10;
2215
- } else {
2216
- switch (c) {
2217
- case ' ' : return 36;
2218
- case '$' : return 37;
2219
- case '%' : return 38;
2220
- case '*' : return 39;
2221
- case '+' : return 40;
2222
- case '-' : return 41;
2223
- case '.' : return 42;
2224
- case '/' : return 43;
2225
- case ':' : return 44;
2226
- default :
2227
- throw 'illegal char :' + c;
2228
- }
2229
- }
2230
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2231
 
2232
- return _this;
2233
- };
2234
 
2235
- //---------------------------------------------------------------------
2236
- // qr8BitByte
2237
- //---------------------------------------------------------------------
2238
 
2239
- var qr8BitByte = function(data) {
 
 
 
2240
 
2241
- var _mode = QRMode.MODE_8BIT_BYTE;
2242
- var _data = data;
2243
- var _bytes = qrcode.stringToBytes(data);
2244
 
2245
- var _this = {};
2246
 
2247
- _this.getMode = function() {
2248
- return _mode;
2249
- };
2250
 
2251
- _this.getLength = function(buffer) {
2252
- return _bytes.length;
2253
- };
2254
 
2255
- _this.write = function(buffer) {
2256
- for (var i = 0; i < _bytes.length; i += 1) {
2257
- buffer.put(_bytes[i], 8);
2258
- }
2259
- };
2260
 
2261
- return _this;
2262
- };
2263
 
2264
- //---------------------------------------------------------------------
2265
- // qrKanji
2266
- //---------------------------------------------------------------------
2267
 
2268
- var qrKanji = function(data) {
 
 
2269
 
2270
- var _mode = QRMode.MODE_KANJI;
2271
- var _data = data;
2272
 
2273
- var stringToBytes = qrcode.stringToBytesFuncs['SJIS'];
2274
- if (!stringToBytes) {
2275
- throw 'sjis not supported.';
2276
- }
2277
- !function(c, code) {
2278
- // self test for sjis support.
2279
- var test = stringToBytes(c);
2280
- if (test.length != 2 || ( (test[0] << 8) | test[1]) != code) {
2281
- throw 'sjis not supported.';
2282
- }
2283
- }('\u53cb', 0x9746);
2284
 
2285
- var _bytes = stringToBytes(data);
2286
 
2287
- var _this = {};
 
 
2288
 
2289
- _this.getMode = function() {
2290
- return _mode;
2291
- };
 
2292
 
2293
- _this.getLength = function(buffer) {
2294
- return ~~(_bytes.length / 2);
2295
- };
 
 
2296
 
2297
- _this.write = function(buffer) {
 
 
2298
 
2299
- var data = _bytes;
2300
 
2301
- var i = 0;
 
 
 
2302
 
2303
- while (i + 1 < data.length) {
 
 
2304
 
2305
- var c = ( (0xff & data[i]) << 8) | (0xff & data[i + 1]);
 
2306
 
2307
- if (0x8140 <= c && c <= 0x9FFC) {
2308
- c -= 0x8140;
2309
- } else if (0xE040 <= c && c <= 0xEBBF) {
2310
- c -= 0xC140;
2311
- } else {
2312
- throw 'illegal char at ' + (i + 1) + '/' + c;
2313
- }
2314
 
2315
- c = ( (c >>> 8) & 0xff) * 0xC0 + (c & 0xff);
 
 
2316
 
2317
- buffer.put(c, 13);
2318
 
2319
- i += 2;
2320
- }
 
2321
 
2322
- if (i < data.length) {
2323
- throw 'illegal char at ' + (i + 1);
2324
- }
2325
- };
2326
 
2327
- return _this;
2328
- };
 
2329
 
2330
- //=====================================================================
2331
- // GIF Support etc.
2332
- //
2333
 
2334
- //---------------------------------------------------------------------
2335
- // byteArrayOutputStream
2336
- //---------------------------------------------------------------------
 
 
2337
 
2338
- var byteArrayOutputStream = function() {
 
2339
 
2340
- var _bytes = [];
 
 
2341
 
2342
- var _this = {};
 
 
2343
 
2344
- _this.writeByte = function(b) {
2345
- _bytes.push(b & 0xff);
2346
- };
2347
 
2348
- _this.writeShort = function(i) {
2349
- _this.writeByte(i);
2350
- _this.writeByte(i >>> 8);
2351
- };
2352
 
2353
- _this.writeBytes = function(b, off, len) {
2354
- off = off || 0;
2355
- len = len || b.length;
2356
- for (var i = 0; i < len; i += 1) {
2357
- _this.writeByte(b[i + off]);
2358
- }
2359
- };
2360
 
2361
- _this.writeString = function(s) {
2362
- for (var i = 0; i < s.length; i += 1) {
2363
- _this.writeByte(s.charCodeAt(i) );
2364
- }
2365
- };
2366
 
2367
- _this.toByteArray = function() {
2368
- return _bytes;
2369
- };
 
2370
 
2371
- _this.toString = function() {
2372
- var s = '';
2373
- s += '[';
2374
- for (var i = 0; i < _bytes.length; i += 1) {
2375
- if (i > 0) {
2376
- s += ',';
2377
- }
2378
- s += _bytes[i];
2379
- }
2380
- s += ']';
2381
- return s;
2382
- };
2383
 
2384
- return _this;
2385
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2386
 
2387
- //---------------------------------------------------------------------
2388
- // base64EncodeOutputStream
2389
- //---------------------------------------------------------------------
2390
 
2391
- var base64EncodeOutputStream = function() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2392
 
2393
- var _buffer = 0;
2394
- var _buflen = 0;
2395
- var _length = 0;
2396
- var _base64 = '';
2397
 
2398
- var _this = {};
 
 
2399
 
2400
- var writeEncoded = function(b) {
2401
- _base64 += String.fromCharCode(encode(b & 0x3f) );
2402
- };
 
 
2403
 
2404
- var encode = function(n) {
2405
- if (n < 0) {
2406
- // error.
2407
- } else if (n < 26) {
2408
- return 0x41 + n;
2409
- } else if (n < 52) {
2410
- return 0x61 + (n - 26);
2411
- } else if (n < 62) {
2412
- return 0x30 + (n - 52);
2413
- } else if (n == 62) {
2414
- return 0x2b;
2415
- } else if (n == 63) {
2416
- return 0x2f;
2417
- }
2418
- throw 'n:' + n;
2419
- };
2420
 
2421
- _this.writeByte = function(n) {
 
 
 
 
2422
 
2423
- _buffer = (_buffer << 8) | (n & 0xff);
2424
- _buflen += 8;
2425
- _length += 1;
 
 
 
 
 
2426
 
2427
- while (_buflen >= 6) {
2428
- writeEncoded(_buffer >>> (_buflen - 6) );
2429
- _buflen -= 6;
2430
- }
2431
- };
2432
 
2433
- _this.flush = function() {
 
2434
 
2435
- if (_buflen > 0) {
2436
- writeEncoded(_buffer << (6 - _buflen) );
2437
- _buffer = 0;
2438
- _buflen = 0;
2439
- }
2440
 
2441
- if (_length % 3 != 0) {
2442
- // padding
2443
- var padlen = 3 - _length % 3;
2444
- for (var i = 0; i < padlen; i += 1) {
2445
- _base64 += '=';
2446
- }
2447
- }
2448
- };
2449
 
2450
- _this.toString = function() {
2451
- return _base64;
2452
- };
 
2453
 
2454
- return _this;
2455
- };
2456
 
2457
- //---------------------------------------------------------------------
2458
- // base64DecodeInputStream
2459
- //---------------------------------------------------------------------
2460
 
2461
- var base64DecodeInputStream = function(str) {
2462
 
2463
- var _str = str;
2464
- var _pos = 0;
2465
- var _buffer = 0;
2466
- var _buflen = 0;
 
 
2467
 
2468
- var _this = {};
 
2469
 
2470
- _this.read = function() {
 
 
 
 
 
 
2471
 
2472
- while (_buflen < 8) {
 
 
2473
 
2474
- if (_pos >= _str.length) {
2475
- if (_buflen == 0) {
2476
- return -1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2477
  }
2478
- throw 'unexpected end of file./' + _buflen;
2479
- }
2480
 
2481
- var c = _str.charAt(_pos);
2482
- _pos += 1;
2483
 
2484
- if (c == '=') {
2485
- _buflen = 0;
2486
- return -1;
2487
- } else if (c.match(/^\s$/) ) {
2488
- // ignore if whitespace.
2489
- continue;
2490
- }
2491
 
2492
- _buffer = (_buffer << 6) | decode(c.charCodeAt(0) );
2493
- _buflen += 6;
2494
- }
2495
 
2496
- var n = (_buffer >>> (_buflen - 8) ) & 0xff;
2497
- _buflen -= 8;
2498
- return n;
2499
- };
2500
 
2501
- var decode = function(c) {
2502
- if (0x41 <= c && c <= 0x5a) {
2503
- return c - 0x41;
2504
- } else if (0x61 <= c && c <= 0x7a) {
2505
- return c - 0x61 + 26;
2506
- } else if (0x30 <= c && c <= 0x39) {
2507
- return c - 0x30 + 52;
2508
- } else if (c == 0x2b) {
2509
- return 62;
2510
- } else if (c == 0x2f) {
2511
- return 63;
2512
- } else {
2513
- throw 'c:' + c;
2514
- }
2515
- };
2516
 
2517
- return _this;
2518
- };
 
2519
 
2520
- //---------------------------------------------------------------------
2521
- // gifImage (B/W)
2522
- //---------------------------------------------------------------------
2523
 
2524
- var gifImage = function(width, height) {
 
2525
 
2526
- var _width = width;
2527
- var _height = height;
2528
- var _data = new Array(width * height);
2529
 
2530
- var _this = {};
 
2531
 
2532
- _this.setPixel = function(x, y, pixel) {
2533
- _data[y * _width + x] = pixel;
2534
- };
2535
 
2536
- _this.write = function(out) {
 
 
2537
 
2538
- //---------------------------------
2539
- // GIF Signature
2540
 
2541
- out.writeString('GIF87a');
 
 
 
2542
 
2543
- //---------------------------------
2544
- // Screen Descriptor
 
 
2545
 
2546
- out.writeShort(_width);
2547
- out.writeShort(_height);
2548
 
2549
- out.writeByte(0x80); // 2bit
2550
- out.writeByte(0);
2551
- out.writeByte(0);
 
 
 
2552
 
2553
- //---------------------------------
2554
- // Global Color Map
2555
 
2556
- // black
2557
- out.writeByte(0x00);
2558
- out.writeByte(0x00);
2559
- out.writeByte(0x00);
2560
 
2561
- // white
2562
- out.writeByte(0xff);
2563
- out.writeByte(0xff);
2564
- out.writeByte(0xff);
2565
 
2566
- //---------------------------------
2567
- // Image Descriptor
2568
 
2569
- out.writeString(',');
2570
- out.writeShort(0);
2571
- out.writeShort(0);
2572
- out.writeShort(_width);
2573
- out.writeShort(_height);
2574
- out.writeByte(0);
2575
 
2576
- //---------------------------------
2577
- // Local Color Map
 
 
 
2578
 
2579
- //---------------------------------
2580
- // Raster Data
 
2581
 
2582
- var lzwMinCodeSize = 2;
2583
- var raster = getLZWRaster(lzwMinCodeSize);
 
 
2584
 
2585
- out.writeByte(lzwMinCodeSize);
2586
 
2587
- var offset = 0;
 
 
2588
 
2589
- while (raster.length - offset > 255) {
2590
- out.writeByte(255);
2591
- out.writeBytes(raster, offset, 255);
2592
- offset += 255;
2593
- }
2594
 
2595
- out.writeByte(raster.length - offset);
2596
- out.writeBytes(raster, offset, raster.length - offset);
2597
- out.writeByte(0x00);
2598
 
2599
- //---------------------------------
2600
- // GIF Terminator
2601
- out.writeString(';');
2602
- };
2603
 
2604
- var bitOutputStream = function(out) {
 
 
 
 
 
 
2605
 
2606
- var _out = out;
2607
- var _bitLength = 0;
2608
- var _bitBuffer = 0;
2609
 
2610
- var _this = {};
 
 
 
 
2611
 
2612
- _this.write = function(data, length) {
 
2613
 
2614
- if ( (data >>> length) != 0) {
2615
- throw 'length over';
2616
- }
2617
 
2618
- while (_bitLength + length >= 8) {
2619
- _out.writeByte(0xff & ( (data << _bitLength) | _bitBuffer) );
2620
- length -= (8 - _bitLength);
2621
- data >>>= (8 - _bitLength);
2622
- _bitBuffer = 0;
2623
- _bitLength = 0;
2624
- }
2625
 
2626
- _bitBuffer = (data << _bitLength) | _bitBuffer;
2627
- _bitLength = _bitLength + length;
2628
- };
2629
 
2630
- _this.flush = function() {
2631
- if (_bitLength > 0) {
2632
- _out.writeByte(_bitBuffer);
2633
- }
2634
- };
2635
 
2636
- return _this;
2637
- };
2638
 
2639
- var getLZWRaster = function(lzwMinCodeSize) {
 
2640
 
2641
- var clearCode = 1 << lzwMinCodeSize;
2642
- var endCode = (1 << lzwMinCodeSize) + 1;
2643
- var bitLength = lzwMinCodeSize + 1;
2644
 
2645
- // Setup LZWTable
2646
- var table = lzwTable();
2647
 
2648
- for (var i = 0; i < clearCode; i += 1) {
2649
- table.add(String.fromCharCode(i) );
2650
- }
2651
- table.add(String.fromCharCode(clearCode) );
2652
- table.add(String.fromCharCode(endCode) );
2653
 
2654
- var byteOut = byteArrayOutputStream();
2655
- var bitOut = bitOutputStream(byteOut);
2656
 
2657
- // clear code
2658
- bitOut.write(clearCode, bitLength);
2659
 
2660
- var dataIndex = 0;
2661
 
2662
- var s = String.fromCharCode(_data[dataIndex]);
2663
- dataIndex += 1;
2664
 
2665
- while (dataIndex < _data.length) {
2666
 
2667
- var c = String.fromCharCode(_data[dataIndex]);
2668
- dataIndex += 1;
2669
 
2670
- if (table.contains(s + c) ) {
 
 
2671
 
2672
- s = s + c;
 
2673
 
2674
- } else {
 
 
2675
 
2676
  bitOut.write(table.indexOf(s), bitLength);
2677
 
2678
- if (table.size() < 0xfff) {
 
2679
 
2680
- if (table.size() == (1 << bitLength) ) {
2681
- bitLength += 1;
2682
- }
2683
 
2684
- table.add(s + c);
2685
- }
2686
 
2687
- s = c;
2688
- }
2689
- }
2690
 
2691
- bitOut.write(table.indexOf(s), bitLength);
 
2692
 
2693
- // end code
2694
- bitOut.write(endCode, bitLength);
2695
 
2696
- bitOut.flush();
 
 
 
 
 
 
2697
 
2698
- return byteOut.toByteArray();
2699
- };
 
2700
 
2701
- var lzwTable = function() {
 
 
2702
 
2703
- var _map = {};
2704
- var _size = 0;
 
2705
 
2706
- var _this = {};
 
2707
 
2708
- _this.add = function(key) {
2709
- if (_this.contains(key) ) {
2710
- throw 'dup key:' + key;
2711
- }
2712
- _map[key] = _size;
2713
- _size += 1;
2714
  };
2715
 
2716
- _this.size = function() {
2717
- return _size;
2718
- };
2719
 
2720
- _this.indexOf = function(key) {
2721
- return _map[key];
2722
- };
 
 
 
2723
 
2724
- _this.contains = function(key) {
2725
- return typeof _map[key] != 'undefined';
2726
- };
2727
 
2728
- return _this;
2729
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2730
 
2731
- return _this;
2732
- };
2733
 
2734
- var createDataURL = function(width, height, getPixel) {
2735
- var gif = gifImage(width, height);
2736
- for (var y = 0; y < height; y += 1) {
2737
- for (var x = 0; x < width; x += 1) {
2738
- gif.setPixel(x, y, getPixel(x, y) );
2739
- }
2740
- }
2741
 
2742
- var b = byteArrayOutputStream();
2743
- gif.write(b);
2744
 
2745
- var base64 = base64EncodeOutputStream();
2746
- var bytes = b.toByteArray();
2747
- for (var i = 0; i < bytes.length; i += 1) {
2748
- base64.writeByte(bytes[i]);
2749
- }
2750
- base64.flush();
2751
-
2752
- return 'data:image/gif;base64,' + base64;
2753
- };
2754
-
2755
- //---------------------------------------------------------------------
2756
- // returns qrcode function.
2757
-
2758
- return qrcode;
2759
- }();
2760
-
2761
- // multibyte support
2762
- !function() {
2763
-
2764
- qrcode.stringToBytesFuncs['UTF-8'] = function(s) {
2765
- // http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array
2766
- function toUTF8Array(str) {
2767
- var utf8 = [];
2768
- for (var i=0; i < str.length; i++) {
2769
- var charcode = str.charCodeAt(i);
2770
- if (charcode < 0x80) utf8.push(charcode);
2771
- else if (charcode < 0x800) {
2772
- utf8.push(0xc0 | (charcode >> 6),
2773
- 0x80 | (charcode & 0x3f));
2774
- }
2775
- else if (charcode < 0xd800 || charcode >= 0xe000) {
2776
- utf8.push(0xe0 | (charcode >> 12),
2777
- 0x80 | ((charcode>>6) & 0x3f),
2778
- 0x80 | (charcode & 0x3f));
2779
- }
2780
- // surrogate pair
2781
- else {
2782
- i++;
2783
- // UTF-16 encodes 0x10000-0x10FFFF by
2784
- // subtracting 0x10000 and splitting the
2785
- // 20 bits of 0x0-0xFFFFF into two halves
2786
- charcode = 0x10000 + (((charcode & 0x3ff)<<10)
2787
- | (str.charCodeAt(i) & 0x3ff));
2788
- utf8.push(0xf0 | (charcode >>18),
2789
- 0x80 | ((charcode>>12) & 0x3f),
2790
- 0x80 | ((charcode>>6) & 0x3f),
2791
- 0x80 | (charcode & 0x3f));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2792
  }
2793
- }
2794
- return utf8;
2795
- }
2796
- return toUTF8Array(s);
2797
- };
2798
-
2799
- }();
2800
-
2801
- (function (factory) {
2802
- if (true) {
2803
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
2804
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
2805
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
2806
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
2807
- } else {}
2808
- }(function () {
2809
- return qrcode;
2810
- }));
2811
 
 
2812
 
2813
- /***/ })
2814
- /******/ ]);
 
 
 
 
2815
  });
1
+ /*! jquery-qrcode v0.14.0 - https://larsjung.de/jquery-qrcode/ */
2
+ (function (vendor_qrcode) {
3
+ 'use strict';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
+ var jq = window.jQuery;
 
 
6
 
7
+ // Check if canvas is available in the browser (as Modernizr does)
8
+ var hasCanvas = (function () {
9
+ var elem = document.createElement('canvas');
10
+ return !!(elem.getContext && elem.getContext('2d'));
11
+ }());
12
 
13
+ // Wrapper for the original QR code generator.
14
+ function createQRCode(text, level, version, quiet) {
15
+ var qr = {};
16
 
17
+ var vqr = vendor_qrcode(version, level);
18
+ vqr.addData(text);
19
+ vqr.make();
20
 
21
+ quiet = quiet || 0;
22
 
23
+ var qrModuleCount = vqr.getModuleCount();
24
+ var quietModuleCount = vqr.getModuleCount() + 2 * quiet;
25
 
26
+ function isDark(row, col) {
27
+ row -= quiet;
28
+ col -= quiet;
29
 
30
+ if (row < 0 || row >= qrModuleCount || col < 0 || col >= qrModuleCount) {
31
+ return false;
32
+ }
33
+ return vqr.isDark(row, col);
 
 
 
34
  }
 
 
 
 
35
 
36
+ function addBlank(l, t, r, b) {
37
+ var prevIsDark = qr.isDark;
38
+ var moduleSize = 1 / quietModuleCount;
39
 
40
+ qr.isDark = function (row, col) {
41
+ var ml = col * moduleSize;
42
+ var mt = row * moduleSize;
43
+ var mr = ml + moduleSize;
44
+ var mb = mt + moduleSize;
45
 
46
+ return prevIsDark(row, col) && (l > mr || ml > r || t > mb || mt > b);
47
+ };
 
 
 
 
 
48
  }
 
49
 
50
+ qr.text = text;
51
+ qr.level = level;
52
+ qr.version = version;
53
+ qr.moduleCount = quietModuleCount;
54
+ qr.isDark = isDark;
55
+ qr.addBlank = addBlank;
56
 
57
+ return qr;
58
+ }
59
 
60
+ // Returns a minimal QR code for the given text starting with version `minVersion`.
61
+ // Returns `undefined` if `text` is too long to be encoded in `maxVersion`.
62
+ function createMinQRCode(text, level, minVersion, maxVersion, quiet) {
63
+ minVersion = Math.max(1, minVersion || 1);
64
+ maxVersion = Math.min(40, maxVersion || 40);
65
+ for (var version = minVersion; version <= maxVersion; version += 1) {
66
+ try {
67
+ return createQRCode(text, level, version, quiet);
68
+ } catch (err) {/* empty */}
69
  }
70
+ return undefined;
71
+ }
72
 
73
+ function drawBackgroundLabel(qr, context, settings) {
74
+ var size = settings.size;
75
+ var font = 'bold ' + settings.mSize * size + 'px ' + settings.fontname;
76
+ var ctx = jq('<canvas/>')[0].getContext('2d');
77
+
78
+ ctx.font = font;
79
+
80
+ var w = ctx.measureText(settings.label).width;
81
+ var sh = settings.mSize;
82
+ var sw = w / size;
83
+ var sl = (1 - sw) * settings.mPosX;
84
+ var st = (1 - sh) * settings.mPosY;
85
+ var sr = sl + sw;
86
+ var sb = st + sh;
87
+ var pad = 0.01;
88
+
89
+ if (settings.mode === 1) {
90
+ // Strip
91
+ qr.addBlank(0, st - pad, size, sb + pad);
92
+ } else {
93
+ // Box
94
+ qr.addBlank(sl - pad, st - pad, sr + pad, sb + pad);
95
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
 
97
+ context.fillStyle = settings.fontcolor;
98
+ context.font = font;
99
+ context.fillText(settings.label, sl * size, st * size + 0.75 * settings.mSize * size);
100
+ }
101
 
102
+ function drawBackgroundImage(qr, context, settings) {
103
+ var size = settings.size;
104
+ var w = settings.image.naturalWidth || 1;
105
+ var h = settings.image.naturalHeight || 1;
106
+ var sh = settings.mSize;
107
+ var sw = sh * w / h;
108
+ var sl = (1 - sw) * settings.mPosX;
109
+ var st = (1 - sh) * settings.mPosY;
110
+ var sr = sl + sw;
111
+ var sb = st + sh;
112
+ var pad = 0.01;
113
+
114
+ if (settings.mode === 3) {
115
+ // Strip
116
+ qr.addBlank(0, st - pad, size, sb + pad);
117
+ } else {
118
+ // Box
119
+ qr.addBlank(sl - pad, st - pad, sr + pad, sb + pad);
120
  }
 
 
 
 
 
 
121
 
122
+ context.drawImage(settings.image, sl * size, st * size, sw * size, sh * size);
123
+ }
 
 
 
 
 
 
 
 
 
 
124
 
125
+ function drawBackground(qr, context, settings) {
126
+ if (jq(settings.background).is('img')) {
127
+ context.drawImage(settings.background, 0, 0, settings.size, settings.size);
128
+ } else if (settings.background) {
129
+ context.fillStyle = settings.background;
130
+ context.fillRect(settings.left, settings.top, settings.size, settings.size);
131
+ }
132
 
133
+ var mode = settings.mode;
134
+ if (mode === 1 || mode === 2) {
135
+ drawBackgroundLabel(qr, context, settings);
136
+ } else if (mode === 3 || mode === 4) {
137
+ drawBackgroundImage(qr, context, settings);
138
+ }
139
+ }
140
 
141
+ function drawModuleDefault(qr, context, settings, left, top, width, row, col) {
142
+ if (qr.isDark(row, col)) {
143
+ context.rect(left, top, width, width);
144
+ }
145
+ }
146
 
147
+ function drawModuleRoundedDark(ctx, l, t, r, b, rad, nw, ne, se, sw) {
148
+ if (nw) {
149
+ ctx.moveTo(l + rad, t);
 
150
  } else {
151
+ ctx.moveTo(l, t);
152
  }
 
 
 
 
153
 
154
+ if (ne) {
155
+ ctx.lineTo(r - rad, t);
156
+ ctx.arcTo(r, t, r, b, rad);
 
 
 
157
  } else {
158
+ ctx.lineTo(r, t);
159
  }
 
 
 
 
 
160
 
161
+ if (se) {
162
+ ctx.lineTo(r, b - rad);
163
+ ctx.arcTo(r, b, l, b, rad);
164
+ } else {
165
+ ctx.lineTo(r, b);
166
+ }
 
167
 
168
+ if (sw) {
169
+ ctx.lineTo(l + rad, b);
170
+ ctx.arcTo(l, b, l, t, rad);
171
+ } else {
172
+ ctx.lineTo(l, b);
173
+ }
174
 
175
+ if (nw) {
176
+ ctx.lineTo(l, t + rad);
177
+ ctx.arcTo(l, t, r, t, rad);
178
+ } else {
179
+ ctx.lineTo(l, t);
180
+ }
181
+ }
182
 
183
+ function drawModuleRoundendLight(ctx, l, t, r, b, rad, nw, ne, se, sw) {
184
+ if (nw) {
185
+ ctx.moveTo(l + rad, t);
186
+ ctx.lineTo(l, t);
187
+ ctx.lineTo(l, t + rad);
188
+ ctx.arcTo(l, t, l + rad, t, rad);
189
+ }
190
 
191
+ if (ne) {
192
+ ctx.moveTo(r - rad, t);
193
+ ctx.lineTo(r, t);
194
+ ctx.lineTo(r, t + rad);
195
+ ctx.arcTo(r, t, r - rad, t, rad);
196
+ }
197
 
198
+ if (se) {
199
+ ctx.moveTo(r - rad, b);
200
+ ctx.lineTo(r, b);
201
+ ctx.lineTo(r, b - rad);
202
+ ctx.arcTo(r, b, r - rad, b, rad);
203
+ }
204
 
205
+ if (sw) {
206
+ ctx.moveTo(l + rad, b);
207
+ ctx.lineTo(l, b);
208
+ ctx.lineTo(l, b - rad);
209
+ ctx.arcTo(l, b, l + rad, b, rad);
210
+ }
211
+ }
212
 
213
+ function drawModuleRounded(qr, context, settings, left, top, width, row, col) {
214
+ var isDark = qr.isDark;
215
+ var right = left + width;
216
+ var bottom = top + width;
217
+ var radius = settings.radius * width;
218
+ var rowT = row - 1;
219
+ var rowB = row + 1;
220
+ var colL = col - 1;
221
+ var colR = col + 1;
222
+ var center = isDark(row, col);
223
+ var northwest = isDark(rowT, colL);
224
+ var north = isDark(rowT, col);
225
+ var northeast = isDark(rowT, colR);
226
+ var east = isDark(row, colR);
227
+ var southeast = isDark(rowB, colR);
228
+ var south = isDark(rowB, col);
229
+ var southwest = isDark(rowB, colL);
230
+ var west = isDark(row, colL);
231
+
232
+ if (center) {
233
+ drawModuleRoundedDark(context, left, top, right, bottom, radius, !north && !west, !north && !east, !south && !east, !south && !west);
234
+ } else {
235
+ drawModuleRoundendLight(context, left, top, right, bottom, radius, north && west && northwest, north && east && northeast, south && east && southeast, south && west && southwest);
236
+ }
237
+ }
238
 
239
+ function drawModules(qr, context, settings) {
240
+ var moduleCount = qr.moduleCount;
241
+ var moduleSize = settings.size / moduleCount;
242
+ var fn = drawModuleDefault;
243
+ var row;
244
+ var col;
245
 
246
+ if (settings.radius > 0 && settings.radius <= 0.5) {
247
+ fn = drawModuleRounded;
248
+ }
249
 
250
+ context.beginPath();
251
+ for (row = 0; row < moduleCount; row += 1) {
252
+ for (col = 0; col < moduleCount; col += 1) {
253
+ var l = settings.left + col * moduleSize;
254
+ var t = settings.top + row * moduleSize;
255
+ var w = moduleSize;
256
 
257
+ fn(qr, context, settings, l, t, w, row, col);
 
 
 
258
  }
 
 
 
 
 
 
 
 
 
259
  }
260
+ if (jq(settings.fill).is('img')) {
261
+ context.strokeStyle = 'rgba(0,0,0,0.5)';
262
+ context.lineWidth = 2;
263
+ context.stroke();
264
+ var prev = context.globalCompositeOperation;
265
+ context.globalCompositeOperation = 'destination-out';
266
+ context.fill();
267
+ context.globalCompositeOperation = prev;
268
+
269
+ context.clip();
270
+ context.drawImage(settings.fill, 0, 0, settings.size, settings.size);
271
+ context.restore();
272
+ } else {
273
+ context.fillStyle = settings.fill;
274
+ context.fill();
275
+ }
276
+ }
277
 
278
+ // Draws QR code to the given `canvas` and returns it.
279
+ function drawOnCanvas(canvas, settings) {
280
+ var qr = createMinQRCode(settings.text, settings.ecLevel, settings.minVersion, settings.maxVersion, settings.quiet);
281
+ if (!qr) {
282
+ return null;
283
+ }
284
 
285
+ var $canvas = jq(canvas).data('qrcode', qr);
286
+ var context = $canvas[0].getContext('2d');
287
 
288
+ drawBackground(qr, context, settings);
289
+ drawModules(qr, context, settings);
290
 
291
+ return $canvas;
292
+ }
293
 
294
+ // Returns a `canvas` element representing the QR code for the given settings.
295
+ function createCanvas(settings) {
296
+ var $canvas = jq('<canvas/>').attr('width', settings.size).attr('height', settings.size);
297
+ return drawOnCanvas($canvas, settings);
298
+ }
299
 
300
+ // Returns an `image` element representing the QR code for the given settings.
301
+ function createImage(settings) {
302
+ return jq('<img/>').attr('src', createCanvas(settings)[0].toDataURL('image/png'));
303
+ }
304
 
305
+ // Returns a `div` element representing the QR code for the given settings.
306
+ function createDiv(settings) {
307
+ var qr = createMinQRCode(settings.text, settings.ecLevel, settings.minVersion, settings.maxVersion, settings.quiet);
308
+ if (!qr) {
309
+ return null;
310
  }
 
311
 
312
+ // some shortcuts to improve compression
313
+ var settings_size = settings.size;
314
+ var settings_bgColor = settings.background;
315
+ var math_floor = Math.floor;
316
+
317
+ var moduleCount = qr.moduleCount;
318
+ var moduleSize = math_floor(settings_size / moduleCount);
319
+ var offset = math_floor(0.5 * (settings_size - moduleSize * moduleCount));
320
+
321
+ var row;
322
+ var col;
323
+
324
+ var containerCSS = {
325
+ position: 'relative',
326
+ left: 0,
327
+ top: 0,
328
+ padding: 0,
329
+ margin: 0,
330
+ width: settings_size,
331
+ height: settings_size
332
+ };
333
+ var darkCSS = {
334
+ position: 'absolute',
335
+ padding: 0,
336
+ margin: 0,
337
+ width: moduleSize,
338
+ height: moduleSize,
339
+ 'background-color': settings.fill
340
+ };
341
+
342
+ var $div = jq('<div/>').data('qrcode', qr).css(containerCSS);
343
+
344
+ if (settings_bgColor) {
345
+ $div.css('background-color', settings_bgColor);
346
  }
 
347
 
348
+ for (row = 0; row < moduleCount; row += 1) {
349
+ for (col = 0; col < moduleCount; col += 1) {
350
+ if (qr.isDark(row, col)) {
351
+ jq('<div/>')
352
+ .css(darkCSS)
353
+ .css({
354
+ left: offset + col * moduleSize,
355
+ top: offset + row * moduleSize
356
+ })
357
+ .appendTo($div);
358
+ }
359
+ }
360
+ }
361
 
362
+ return $div;
363
+ }
364
 
365
+ function createHTML(settings) {
366
+ if (hasCanvas && settings.render === 'canvas') {
367
+ return createCanvas(settings);
368
+ } else if (hasCanvas && settings.render === 'image') {
369
+ return createImage(settings);
 
370
  }
 
371
 
372
+ return createDiv(settings);
373
+ }
 
 
 
 
 
 
374
 
375
+ // Plugin
376
+ // ======
377
 
378
+ // Default settings
379
+ // ----------------
380
+ var defaults = {
381
+ // render method: `'canvas'`, `'image'` or `'div'`
382
+ render: 'canvas',
383
 
384
+ // version range somewhere in 1 .. 40
385
+ minVersion: 1,
386
+ maxVersion: 40,
387
 
388
+ // error correction level: `'L'`, `'M'`, `'Q'` or `'H'`
389
+ ecLevel: 'L',
390
 
391
+ // offset in pixel if drawn onto existing canvas
392
+ left: 0,
393
+ top: 0,
 
 
 
394
 
395
+ // size in pixel
396
+ size: 200,
 
 
 
397
 
398
+ // code color or image element
399
+ fill: '#000',
 
 
 
 
 
400
 
401
+ // background color or image element, `null` for transparent background
402
+ background: null,
 
 
403
 
404
+ // content
405
+ text: 'no text',
 
 
406
 
407
+ // corner radius relative to module width: 0.0 .. 0.5
408
+ radius: 0,
409
 
410
+ // quiet zone in modules
411
+ quiet: 0,
 
 
412
 
413
+ // modes
414
+ // 0: normal
415
+ // 1: label strip
416
+ // 2: label box
417
+ // 3: image strip
418
+ // 4: image box
419
+ mode: 0,
420
 
421
+ mSize: 0.1,
422
+ mPosX: 0.5,
423
+ mPosY: 0.5,
424
 
425
+ label: 'no label',
426
+ fontname: 'sans',
427
+ fontcolor: '#000',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
428
 
429
+ image: null
 
430
  };
431
 
432
+ // Register the plugin
433
+ // -------------------
434
+ jq.fn.qrcode = function (options) {
435
+ var settings = jq.extend({}, defaults, options);
 
 
436
 
437
+ return this.each(function (idx, el) {
438
+ if (el.nodeName.toLowerCase() === 'canvas') {
439
+ drawOnCanvas(el, settings);
440
+ } else {
441
+ jq(el).append(createHTML(settings));
442
+ }
443
+ });
444
  };
445
+ }(function () {
446
+ // `qrcode` is the single public function defined by the `QR Code Generator`
447
+ //---------------------------------------------------------------------
448
+ //
449
+ // QR Code Generator for JavaScript
450
+ //
451
+ // Copyright (c) 2009 Kazuhiko Arase
452
+ //
453
+ // URL: http://www.d-project.com/
454
+ //
455
+ // Licensed under the MIT license:
456
+ // http://www.opensource.org/licenses/mit-license.php
457
+ //
458
+ // The word 'QR Code' is registered trademark of
459
+ // DENSO WAVE INCORPORATED
460
+ // http://www.denso-wave.com/qrcode/faqpatent-e.html
461
+ //
462
+ //---------------------------------------------------------------------
463
+
464
+ var qrcode = function() {
465
+
466
+ //---------------------------------------------------------------------
467
+ // qrcode
468
+ //---------------------------------------------------------------------
469
+
470
+ /**
471
+ * qrcode
472
+ * @param typeNumber 1 to 40
473
+ * @param errorCorrectLevel 'L','M','Q','H'
474
+ */
475
+ var qrcode = function(typeNumber, errorCorrectLevel) {
476
+
477
+ var PAD0 = 0xEC;
478
+ var PAD1 = 0x11;
479
+
480
+ var _typeNumber = typeNumber;
481
+ var _errorCorrectLevel = QRErrorCorrectLevel[errorCorrectLevel];
482
+ var _modules = null;
483
+ var _moduleCount = 0;
484
+ var _dataCache = null;
485
+ var _dataList = new Array();
486
+
487
+ var _this = {};
488
+
489
+ var makeImpl = function(test, maskPattern) {
490
+
491
+ _moduleCount = _typeNumber * 4 + 17;
492
+ _modules = function(moduleCount) {
493
+ var modules = new Array(moduleCount);
494
+ for (var row = 0; row < moduleCount; row += 1) {
495
+ modules[row] = new Array(moduleCount);
496
+ for (var col = 0; col < moduleCount; col += 1) {
497
+ modules[row][col] = null;
498
+ }
499
+ }
500
+ return modules;
501
+ }(_moduleCount);
502
+
503
+ setupPositionProbePattern(0, 0);
504
+ setupPositionProbePattern(_moduleCount - 7, 0);
505
+ setupPositionProbePattern(0, _moduleCount - 7);
506
+ setupPositionAdjustPattern();
507
+ setupTimingPattern();
508
+ setupTypeInfo(test, maskPattern);
509
+
510
+ if (_typeNumber >= 7) {
511
+ setupTypeNumber(test);
512
  }
513
 
514
+ if (_dataCache == null) {
515
+ _dataCache = createData(_typeNumber, _errorCorrectLevel, _dataList);
516
  }
 
517
 
518
+ mapData(_dataCache, maskPattern);
519
+ };
520
 
521
+ var setupPositionProbePattern = function(row, col) {
 
522
 
523
+ for (var r = -1; r <= 7; r += 1) {
524
 
525
+ if (row + r <= -1 || _moduleCount <= row + r) continue;
 
526
 
527
+ for (var c = -1; c <= 7; c += 1) {
528
 
529
+ if (col + c <= -1 || _moduleCount <= col + c) continue;
 
 
 
 
 
530
 
531
+ if ( (0 <= r && r <= 6 && (c == 0 || c == 6) )
532
+ || (0 <= c && c <= 6 && (r == 0 || r == 6) )
533
+ || (2 <= r && r <= 4 && 2 <= c && c <= 4) ) {
534
+ _modules[row + r][col + c] = true;
535
+ } else {
536
+ _modules[row + r][col + c] = false;
537
+ }
538
+ }
539
+ }
540
+ };
541
 
542
+ var getBestMaskPattern = function() {
 
 
 
 
 
 
 
 
 
 
 
543
 
544
+ var minLostPoint = 0;
545
+ var pattern = 0;
546
 
547
+ for (var i = 0; i < 8; i += 1) {
 
548
 
549
+ makeImpl(true, i);
 
550
 
551
+ var lostPoint = QRUtil.getLostPoint(_this);
552
 
553
+ if (i == 0 || minLostPoint > lostPoint) {
554
+ minLostPoint = lostPoint;
555
+ pattern = i;
556
+ }
557
+ }
 
 
 
 
 
 
 
 
558
 
559
+ return pattern;
560
+ };
561
 
562
+ var setupTimingPattern = function() {
 
 
 
 
 
563
 
564
+ for (var r = 8; r < _moduleCount - 8; r += 1) {
565
+ if (_modules[r][6] != null) {
566
+ continue;
567
+ }
568
+ _modules[r][6] = (r % 2 == 0);
 
569
  }
 
 
570
 
571
+ for (var c = 8; c < _moduleCount - 8; c += 1) {
572
+ if (_modules[6][c] != null) {
573
+ continue;
574
+ }
575
+ _modules[6][c] = (c % 2 == 0);
576
+ }
577
+ };
578
 
579
+ var setupPositionAdjustPattern = function() {
 
580
 
581
+ var pos = QRUtil.getPatternPosition(_typeNumber);
 
 
582
 
583
+ for (var i = 0; i < pos.length; i += 1) {
 
 
 
 
 
 
 
 
 
584
 
585
+ for (var j = 0; j < pos.length; j += 1) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
586
 
587
+ var row = pos[i];
588
+ var col = pos[j];
589
 
590
+ if (_modules[row][col] != null) {
591
+ continue;
592
+ }
593
 
594
+ for (var r = -2; r <= 2; r += 1) {
 
 
595
 
596
+ for (var c = -2; c <= 2; c += 1) {
597
 
598
+ if (r == -2 || r == 2 || c == -2 || c == 2
599
+ || (r == 0 && c == 0) ) {
600
+ _modules[row + r][col + c] = true;
601
+ } else {
602
+ _modules[row + r][col + c] = false;
603
+ }
604
+ }
605
+ }
606
+ }
607
+ }
608
+ };
609
 
610
+ var setupTypeNumber = function(test) {
 
 
 
 
 
611
 
612
+ var bits = QRUtil.getBCHTypeNumber(_typeNumber);
 
 
 
 
 
613
 
614
+ for (var i = 0; i < 18; i += 1) {
615
+ var mod = (!test && ( (bits >> i) & 1) == 1);
616
+ _modules[Math.floor(i / 3)][i % 3 + _moduleCount - 8 - 3] = mod;
617
  }
618
 
619
+ for (var i = 0; i < 18; i += 1) {
620
+ var mod = (!test && ( (bits >> i) & 1) == 1);
621
+ _modules[i % 3 + _moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
 
 
622
  }
623
+ };
624
 
625
+ var setupTypeInfo = function(test, maskPattern) {
 
 
626
 
627
+ var data = (_errorCorrectLevel << 3) | maskPattern;
628
+ var bits = QRUtil.getBCHTypeInfo(data);
 
 
 
 
629
 
630
+ // vertical
631
+ for (var i = 0; i < 15; i += 1) {
 
 
 
 
 
 
 
632
 
633
+ var mod = (!test && ( (bits >> i) & 1) == 1);
 
634
 
635
+ if (i < 6) {
636
+ _modules[i][8] = mod;
637
+ } else if (i < 8) {
638
+ _modules[i + 1][8] = mod;
639
+ } else {
640
+ _modules[_moduleCount - 15 + i][8] = mod;
641
+ }
642
+ }
643
 
644
+ // horizontal
645
+ for (var i = 0; i < 15; i += 1) {
646
 
647
+ var mod = (!test && ( (bits >> i) & 1) == 1);
 
 
 
 
 
 
648
 
649
+ if (i < 8) {
650
+ _modules[8][_moduleCount - i - 1] = mod;
651
+ } else if (i < 9) {
652
+ _modules[8][15 - i - 1 + 1] = mod;
653
+ } else {
654
+ _modules[8][15 - i - 1] = mod;
655
+ }
656
  }
657
 
658
+ // fixed module
659
+ _modules[_moduleCount - 8][8] = (!test);
660
+ };
661
 
662
+ var mapData = function(data, maskPattern) {
 
 
 
663
 
664
+ var inc = -1;
665
+ var row = _moduleCount - 1;
666
+ var bitIndex = 7;
667
+ var byteIndex = 0;
668
+ var maskFunc = QRUtil.getMaskFunction(maskPattern);
 
 
 
 
 
 
 
 
669
 
670
+ for (var col = _moduleCount - 1; col > 0; col -= 2) {
 
671
 
672
+ if (col == 6) col -= 1;
 
 
673
 
674
+ while (true) {
 
 
 
 
 
 
 
 
 
675
 
676
+ for (var c = 0; c < 2; c += 1) {
677
 
678
+ if (_modules[row][col - c] == null) {
 
 
679
 
680
+ var dark = false;
 
 
 
 
 
681
 
682
+ if (byteIndex < data.length) {
683
+ dark = ( ( (data[byteIndex] >>> bitIndex) & 1) == 1);
684
+ }
685
 
686
+ var mask = maskFunc(row, col - c);
687
 
688
+ if (mask) {
689
+ dark = !dark;
690
+ }
 
 
 
691
 
692
+ _modules[row][col - c] = dark;
693
+ bitIndex -= 1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
694
 
695
+ if (bitIndex == -1) {
696
+ byteIndex += 1;
697
+ bitIndex = 7;
698
+ }
699
+ }
700
+ }
701
 
702
+ row += inc;
703
 
704
+ if (row < 0 || _moduleCount <= row) {
705
+ row -= inc;
706
+ inc = -inc;
707
+ break;
708
+ }
 
 
 
 
 
 
 
 
 
 
 
709
  }
 
 
710
  }
711
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
712
 
713
+ var createBytes = function(buffer, rsBlocks) {
 
 
 
 
 
 
714
 
715
+ var offset = 0;
 
 
 
 
 
 
716
 
717
+ var maxDcCount = 0;
718
+ var maxEcCount = 0;
 
719
 
720
+ var dcdata = new Array(rsBlocks.length);
721
+ var ecdata = new Array(rsBlocks.length);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
722
 
723
+ for (var r = 0; r < rsBlocks.length; r += 1) {
 
 
 
 
 
 
724
 
725
+ var dcCount = rsBlocks[r].dataCount;
726
+ var ecCount = rsBlocks[r].totalCount - dcCount;
727
 
728
+ maxDcCount = Math.max(maxDcCount, dcCount);
729
+ maxEcCount = Math.max(maxEcCount, ecCount);
730
 
731
+ dcdata[r] = new Array(dcCount);
732
 
733
+ for (var i = 0; i < dcdata[r].length; i += 1) {
734
+ dcdata[r][i] = 0xff & buffer.getBuffer()[i + offset];
735
+ }
736
+ offset += dcCount;
 
 
 
 
 
 
737
 
738
+ var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
739
+ var rawPoly = qrPolynomial(dcdata[r], rsPoly.getLength() - 1);
740
 
741
+ var modPoly = rawPoly.mod(rsPoly);
742
+ ecdata[r] = new Array(rsPoly.getLength() - 1);
743
+ for (var i = 0; i < ecdata[r].length; i += 1) {
744
+ var modIndex = i + modPoly.getLength() - ecdata[r].length;
745
+ ecdata[r][i] = (modIndex >= 0)? modPoly.getAt(modIndex) : 0;
746
+ }
747
+ }
 
748
 
749
+ var totalCodeCount = 0;
750
+ for (var i = 0; i < rsBlocks.length; i += 1) {
751
+ totalCodeCount += rsBlocks[i].totalCount;
752
+ }
753
 
754
+ var data = new Array(totalCodeCount);
755
+ var index = 0;
756
 
757
+ for (var i = 0; i < maxDcCount; i += 1) {
758
+ for (var r = 0; r < rsBlocks.length; r += 1) {
759
+ if (i < dcdata[r].length) {
760
+ data[index] = dcdata[r][i];
761
+ index += 1;
762
+ }
763
+ }
764
+ }
765
 
766
+ for (var i = 0; i < maxEcCount; i += 1) {
767
+ for (var r = 0; r < rsBlocks.length; r += 1) {
768
+ if (i < ecdata[r].length) {
769
+ data[index] = ecdata[r][i];
770
+ index += 1;
771
+ }
772
+ }
773
+ }
774
 
775
+ return data;
776
+ };
777
 
778
+ var createData = function(typeNumber, errorCorrectLevel, dataList) {
779
 
780
+ var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel);
781
 
782
+ var buffer = qrBitBuffer();
783
 
784
+ for (var i = 0; i < dataList.length; i += 1) {
785
+ var data = dataList[i];
786
+ buffer.put(data.getMode(), 4);
787
+ buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber) );
788
+ data.write(buffer);
789
+ }
790
 
791
+ // calc num max data.
792
+ var totalDataCount = 0;
793
+ for (var i = 0; i < rsBlocks.length; i += 1) {
794
+ totalDataCount += rsBlocks[i].dataCount;
795
+ }
796
 
797
+ if (buffer.getLengthInBits() > totalDataCount * 8) {
798
+ throw new Error('code length overflow. ('
799
+ + buffer.getLengthInBits()
800
+ + '>'
801
+ + totalDataCount * 8
802
+ + ')');
803
+ }
804
 
805
+ // end code
806
+ if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
807
+ buffer.put(0, 4);
808
+ }
809
 
810
+ // padding
811
+ while (buffer.getLengthInBits() % 8 != 0) {
812
+ buffer.putBit(false);
813
+ }
814
 
815
+ // padding
816
+ while (true) {
 
817
 
818
+ if (buffer.getLengthInBits() >= totalDataCount * 8) {
819
+ break;
820
+ }
821
+ buffer.put(PAD0, 8);
822
 
823
+ if (buffer.getLengthInBits() >= totalDataCount * 8) {
824
+ break;
 
825
  }
826
+ buffer.put(PAD1, 8);
827
  }
828
 
829
+ return createBytes(buffer, rsBlocks);
830
+ };
 
 
 
831
 
832
+ _this.addData = function(data) {
833
+ var newData = qr8BitByte(data);
834
+ _dataList.push(newData);
835
+ _dataCache = null;
836
+ };
837
 
838
+ _this.isDark = function(row, col) {
839
+ if (row < 0 || _moduleCount <= row || col < 0 || _moduleCount <= col) {
840
+ throw new Error(row + ',' + col);
 
 
 
 
 
 
841
  }
842
+ return _modules[row][col];
843
+ };
844
+
845
+ _this.getModuleCount = function() {
846
+ return _moduleCount;
847
+ };
848
+
849
+ _this.make = function() {
850
+ makeImpl(false, getBestMaskPattern() );
851
+ };
852
+
853
+ _this.createTableTag = function(cellSize, margin) {
854
 
855
+ cellSize = cellSize || 2;
856
+ margin = (typeof margin == 'undefined')? cellSize * 4 : margin;
857
+
858
+ var qrHtml = '';
859
+
860
+ qrHtml += '<table style="';
861
+ qrHtml += ' border-width: 0px; border-style: none;';
862
+ qrHtml += ' border-collapse: collapse;';
863
+ qrHtml += ' padding: 0px; margin: ' + margin + 'px;';
864
+ qrHtml += '">';
865
+ qrHtml += '<tbody>';
866
+
867
+ for (var r = 0; r < _this.getModuleCount(); r += 1) {
868
+
869
+ qrHtml += '<tr>';
870
+
871
+ for (var c = 0; c < _this.getModuleCount(); c += 1) {
872
+ qrHtml += '<td style="';
873
+ qrHtml += ' border-width: 0px; border-style: none;';
874
+ qrHtml += ' border-collapse: collapse;';
875
+ qrHtml += ' padding: 0px; margin: 0px;';
876
+ qrHtml += ' width: ' + cellSize + 'px;';
877
+ qrHtml += ' height: ' + cellSize + 'px;';
878
+ qrHtml += ' background-color: ';
879
+ qrHtml += _this.isDark(r, c)? '#000000' : '#ffffff';
880
+ qrHtml += ';';
881
+ qrHtml += '"/>';
882
+ }
883
 
884
+ qrHtml += '</tr>';
 
 
 
 
 
 
 
 
 
885
  }
 
 
886
 
887
+ qrHtml += '</tbody>';
888
+ qrHtml += '</table>';
 
 
 
 
 
 
 
 
 
 
 
889
 
890
+ return qrHtml;
891
+ };
892
 
893
+ _this.createImgTag = function(cellSize, margin) {
894
 
895
+ cellSize = cellSize || 2;
896
+ margin = (typeof margin == 'undefined')? cellSize * 4 : margin;
 
 
 
 
 
897
 
898
+ var size = _this.getModuleCount() * cellSize + margin * 2;
899
+ var min = margin;
900
+ var max = size - margin;
901
 
902
+ return createImgTag(size, size, function(x, y) {
903
+ if (min <= x && x < max && min <= y && y < max) {
904
+ var c = Math.floor( (x - min) / cellSize);
905
+ var r = Math.floor( (y - min) / cellSize);
906
+ return _this.isDark(r, c)? 0 : 1;
907
+ } else {
908
+ return 1;
909
+ }
910
+ } );
911
+ };
912
 
913
+ return _this;
914
+ };
915
 
916
+ //---------------------------------------------------------------------
917
+ // qrcode.stringToBytes
918
+ //---------------------------------------------------------------------
919
 
920
+ qrcode.stringToBytes = function(s) {
921
+ var bytes = new Array();
922
+ for (var i = 0; i < s.length; i += 1) {
923
+ var c = s.charCodeAt(i);
924
+ bytes.push(c & 0xff);
925
+ }
926
+ return bytes;
927
+ };
928
 
929
+ //---------------------------------------------------------------------
930
+ // qrcode.createStringToBytes
931
+ //---------------------------------------------------------------------
932
 
933
+ /**
934
+ * @param unicodeData base64 string of byte array.
935
+ * [16bit Unicode],[16bit Bytes], ...
936
+ * @param numChars
937
+ */
938
+ qrcode.createStringToBytes = function(unicodeData, numChars) {
 
 
 
 
 
 
 
939
 
940
+ // create conversion map.
941
 
942
+ var unicodeMap = function() {
943
 
944
+ var bin = base64DecodeInputStream(unicodeData);
945
+ var read = function() {
946
+ var b = bin.read();
947
+ if (b == -1) throw new Error();
948
+ return b;
949
+ };
950
 
951
+ var count = 0;
952
+ var unicodeMap = {};
953
+ while (true) {
954
+ var b0 = bin.read();
955
+ if (b0 == -1) break;
956
+ var b1 = read();
957
+ var b2 = read();
958
+ var b3 = read();
959
+ var k = String.fromCharCode( (b0 << 8) | b1);
960
+ var v = (b2 << 8) | b3;
961
+ unicodeMap[k] = v;
962
+ count += 1;
963
+ }
964
+ if (count != numChars) {
965
+ throw new Error(count + ' != ' + numChars);
966
+ }
967
 
968
+ return unicodeMap;
969
+ }();
970
 
971
+ var unknownChar = '?'.charCodeAt(0);
 
 
972
 
973
+ return function(s) {
974
+ var bytes = new Array();
975
+ for (var i = 0; i < s.length; i += 1) {
976
+ var c = s.charCodeAt(i);
977
+ if (c < 128) {
978
+ bytes.push(c);
979
+ } else {
980
+ var b = unicodeMap[s.charAt(i)];
981
+ if (typeof b == 'number') {
982
+ if ( (b & 0xff) == b) {
983
+ // 1byte
984
+ bytes.push(b);
985
+ } else {
986
+ // 2bytes
987
+ bytes.push(b >>> 8);
988
+ bytes.push(b & 0xff);
989
+ }
990
+ } else {
991
+ bytes.push(unknownChar);
992
+ }
993
+ }
994
+ }
995
+ return bytes;
996
+ };
997
+ };
998
 
999
+ //---------------------------------------------------------------------
1000
+ // QRMode
1001
+ //---------------------------------------------------------------------
1002
 
1003
+ var QRMode = {
1004
+ MODE_NUMBER : 1 << 0,
1005
+ MODE_ALPHA_NUM : 1 << 1,
1006
+ MODE_8BIT_BYTE : 1 << 2,
1007
+ MODE_KANJI : 1 << 3
1008
+ };
1009
 
1010
+ //---------------------------------------------------------------------
1011
+ // QRErrorCorrectLevel
1012
+ //---------------------------------------------------------------------
1013
 
1014
+ var QRErrorCorrectLevel = {
1015
+ L : 1,
1016
+ M : 0,
1017
+ Q : 3,
1018
+ H : 2
1019
+ };
1020
 
1021
+ //---------------------------------------------------------------------
1022
+ // QRMaskPattern
1023
+ //---------------------------------------------------------------------
1024
+
1025
+ var QRMaskPattern = {
1026
+ PATTERN000 : 0,
1027
+ PATTERN001 : 1,
1028
+ PATTERN010 : 2,
1029
+ PATTERN011 : 3,
1030
+ PATTERN100 : 4,
1031
+ PATTERN101 : 5,
1032
+ PATTERN110 : 6,
1033
+ PATTERN111 : 7
1034
+ };
1035
 
1036
+ //---------------------------------------------------------------------
1037
+ // QRUtil
1038
+ //---------------------------------------------------------------------
1039
+
1040
+ var QRUtil = function() {
1041
+
1042
+ var PATTERN_POSITION_TABLE = [
1043
+ [],
1044
+ [6, 18],
1045
+ [6, 22],
1046
+ [6, 26],
1047
+ [6, 30],
1048
+ [6, 34],
1049
+ [6, 22, 38],
1050
+ [6, 24, 42],
1051
+ [6, 26, 46],
1052
+ [6, 28, 50],
1053
+ [6, 30, 54],
1054
+ [6, 32, 58],
1055
+ [6, 34, 62],
1056
+ [6, 26, 46, 66],
1057
+ [6, 26, 48, 70],
1058
+ [6, 26, 50, 74],
1059
+ [6, 30, 54, 78],
1060
+ [6, 30, 56, 82],
1061
+ [6, 30, 58, 86],
1062
+ [6, 34, 62, 90],
1063
+ [6, 28, 50, 72, 94],
1064
+ [6, 26, 50, 74, 98],
1065
+ [6, 30, 54, 78, 102],
1066
+ [6, 28, 54, 80, 106],
1067
+ [6, 32, 58, 84, 110],
1068
+ [6, 30, 58, 86, 114],
1069
+ [6, 34, 62, 90, 118],
1070
+ [6, 26, 50, 74, 98, 122],
1071
+ [6, 30, 54, 78, 102, 126],
1072
+ [6, 26, 52, 78, 104, 130],
1073
+ [6, 30, 56, 82, 108, 134],
1074
+ [6, 34, 60, 86, 112, 138],
1075
+ [6, 30, 58, 86, 114, 142],
1076
+ [6, 34, 62, 90, 118, 146],
1077
+ [6, 30, 54, 78, 102, 126, 150],
1078
+ [6, 24, 50, 76, 102, 128, 154],
1079
+ [6, 28, 54, 80, 106, 132, 158],
1080
+ [6, 32, 58, 84, 110, 136, 162],
1081
+ [6, 26, 54, 82, 110, 138, 166],
1082
+ [6, 30, 58, 86, 114, 142, 170]
1083
+ ];
1084
+ var G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0);
1085
+ var G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0);
1086
+ var G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1);
1087
+
1088
+ var _this = {};
1089
+
1090
+ var getBCHDigit = function(data) {
1091
+ var digit = 0;
1092
+ while (data != 0) {
1093
+ digit += 1;
1094
+ data >>>= 1;
1095
+ }
1096
+ return digit;
1097
+ };
1098
 
1099
+ _this.getBCHTypeInfo = function(data) {
1100
+ var d = data << 10;
1101
+ while (getBCHDigit(d) - getBCHDigit(G15) >= 0) {
1102
+ d ^= (G15 << (getBCHDigit(d) - getBCHDigit(G15) ) );
1103
+ }
1104
+ return ( (data << 10) | d) ^ G15_MASK;
1105
+ };
1106
 
1107
+ _this.getBCHTypeNumber = function(data) {
1108
+ var d = data << 12;
1109
+ while (getBCHDigit(d) - getBCHDigit(G18) >= 0) {
1110
+ d ^= (G18 << (getBCHDigit(d) - getBCHDigit(G18) ) );
1111
+ }
1112
+ return (data << 12) | d;
1113
+ };
1114
+
1115
+ _this.getPatternPosition = function(typeNumber) {
1116
+ return PATTERN_POSITION_TABLE[typeNumber - 1];
1117
+ };
1118
+
1119
+ _this.getMaskFunction = function(maskPattern) {
1120
+
1121
+ switch (maskPattern) {
1122
+
1123
+ case QRMaskPattern.PATTERN000 :
1124
+ return function(i, j) { return (i + j) % 2 == 0; };
1125
+ case QRMaskPattern.PATTERN001 :
1126
+ return function(i, j) { return i % 2 == 0; };
1127
+ case QRMaskPattern.PATTERN010 :
1128
+ return function(i, j) { return j % 3 == 0; };
1129
+ case QRMaskPattern.PATTERN011 :
1130
+ return function(i, j) { return (i + j) % 3 == 0; };
1131
+ case QRMaskPattern.PATTERN100 :
1132
+ return function(i, j) { return (Math.floor(i / 2) + Math.floor(j / 3) ) % 2 == 0; };
1133
+ case QRMaskPattern.PATTERN101 :
1134
+ return function(i, j) { return (i * j) % 2 + (i * j) % 3 == 0; };
1135
+ case QRMaskPattern.PATTERN110 :
1136
+ return function(i, j) { return ( (i * j) % 2 + (i * j) % 3) % 2 == 0; };
1137
+ case QRMaskPattern.PATTERN111 :
1138
+ return function(i, j) { return ( (i * j) % 3 + (i + j) % 2) % 2 == 0; };
1139
+
1140
+ default :
1141
+ throw new Error('bad maskPattern:' + maskPattern);
1142
+ }
1143
+ };
1144
 
1145
+ _this.getErrorCorrectPolynomial = function(errorCorrectLength) {
1146
+ var a = qrPolynomial([1], 0);
1147
+ for (var i = 0; i < errorCorrectLength; i += 1) {
1148
+ a = a.multiply(qrPolynomial([1, QRMath.gexp(i)], 0) );
1149
+ }
1150
+ return a;
1151
+ };
1152
 
1153
+ _this.getLengthInBits = function(mode, type) {
1154
 
1155
+ if (1 <= type && type < 10) {
1156
 
1157
+ // 1 - 9
 
 
 
 
1158
 
1159
+ switch(mode) {
1160
+ case QRMode.MODE_NUMBER : return 10;
1161
+ case QRMode.MODE_ALPHA_NUM : return 9;
1162
+ case QRMode.MODE_8BIT_BYTE : return 8;
1163
+ case QRMode.MODE_KANJI : return 8;
1164
+ default :
1165
+ throw new Error('mode:' + mode);
1166
+ }
1167
 
1168
+ } else if (type < 27) {
1169
 
1170
+ // 10 - 26
 
 
1171
 
1172
+ switch(mode) {
1173
+ case QRMode.MODE_NUMBER : return 12;
1174
+ case QRMode.MODE_ALPHA_NUM : return 11;
1175
+ case QRMode.MODE_8BIT_BYTE : return 16;
1176
+ case QRMode.MODE_KANJI : return 10;
1177
+ default :
1178
+ throw new Error('mode:' + mode);
1179
+ }
1180
 
1181
+ } else if (type < 41) {
 
 
 
1182
 
1183
+ // 27 - 40
 
 
1184
 
1185
+ switch(mode) {
1186
+ case QRMode.MODE_NUMBER : return 14;
1187
+ case QRMode.MODE_ALPHA_NUM : return 13;
1188
+ case QRMode.MODE_8BIT_BYTE : return 16;
1189
+ case QRMode.MODE_KANJI : return 12;
1190
+ default :
1191
+ throw new Error('mode:' + mode);
1192
+ }
1193
 
1194
+ } else {
1195
+ throw new Error('type:' + type);
1196
+ }
1197
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1198
 
1199
+ _this.getLostPoint = function(qrcode) {
1200
 
1201
+ var moduleCount = qrcode.getModuleCount();
1202
 
1203
+ var lostPoint = 0;
 
 
 
 
 
 
 
 
 
 
 
 
1204
 
1205
+ // LEVEL1
1206
 
1207
+ for (var row = 0; row < moduleCount; row += 1) {
1208
+ for (var col = 0; col < moduleCount; col += 1) {
1209
 
1210
+ var sameCount = 0;
1211
+ var dark = qrcode.isDark(row, col);
 
 
1212
 
1213
+ for (var r = -1; r <= 1; r += 1) {
1214
 
1215
+ if (row + r < 0 || moduleCount <= row + r) {
1216
+ continue;
1217
+ }
1218
 
1219
+ for (var c = -1; c <= 1; c += 1) {
1220
 
1221
+ if (col + c < 0 || moduleCount <= col + c) {
1222
+ continue;
1223
+ }
1224
 
1225
+ if (r == 0 && c == 0) {
1226
+ continue;
1227
+ }
 
1228
 
1229
+ if (dark == qrcode.isDark(row + r, col + c) ) {
1230
+ sameCount += 1;
1231
+ }
1232
+ }
1233
+ }
1234
 
1235
+ if (sameCount > 5) {
1236
+ lostPoint += (3 + sameCount - 5);
1237
+ }
1238
+ }
1239
+ };
1240
+
1241
+ // LEVEL2
1242
+
1243
+ for (var row = 0; row < moduleCount - 1; row += 1) {
1244
+ for (var col = 0; col < moduleCount - 1; col += 1) {
1245
+ var count = 0;
1246
+ if (qrcode.isDark(row, col) ) count += 1;
1247
+ if (qrcode.isDark(row + 1, col) ) count += 1;
1248
+ if (qrcode.isDark(row, col + 1) ) count += 1;
1249
+ if (qrcode.isDark(row + 1, col + 1) ) count += 1;
1250
+ if (count == 0 || count == 4) {
1251
+ lostPoint += 3;
1252
+ }
1253
+ }
1254
+ }
1255
 
1256
+ // LEVEL3
1257
+
1258
+ for (var row = 0; row < moduleCount; row += 1) {
1259
+ for (var col = 0; col < moduleCount - 6; col += 1) {
1260
+ if (qrcode.isDark(row, col)
1261
+ && !qrcode.isDark(row, col + 1)
1262
+ && qrcode.isDark(row, col + 2)
1263
+ && qrcode.isDark(row, col + 3)
1264
+ && qrcode.isDark(row, col + 4)
1265
+ && !qrcode.isDark(row, col + 5)
1266
+ && qrcode.isDark(row, col + 6) ) {
1267
+ lostPoint += 40;
1268
+ }
1269
+ }
1270
+ }
1271
 
1272
+ for (var col = 0; col < moduleCount; col += 1) {
1273
+ for (var row = 0; row < moduleCount - 6; row += 1) {
1274
+ if (qrcode.isDark(row, col)
1275
+ && !qrcode.isDark(row + 1, col)
1276
+ && qrcode.isDark(row + 2, col)
1277
+ && qrcode.isDark(row + 3, col)
1278
+ && qrcode.isDark(row + 4, col)
1279
+ && !qrcode.isDark(row + 5, col)
1280
+ && qrcode.isDark(row + 6, col) ) {
1281
+ lostPoint += 40;
1282
+ }
1283
+ }
1284
+ }
1285
 
1286
+ // LEVEL4
 
1287
 
1288
+ var darkCount = 0;
1289
 
1290
+ for (var col = 0; col < moduleCount; col += 1) {
1291
+ for (var row = 0; row < moduleCount; row += 1) {
1292
+ if (qrcode.isDark(row, col) ) {
1293
+ darkCount += 1;
1294
+ }
1295
+ }
1296
+ }
1297
 
1298
+ var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
1299
+ lostPoint += ratio * 10;
 
 
1300
 
1301
+ return lostPoint;
1302
+ };
 
 
 
1303
 
1304
+ return _this;
1305
+ }();
 
1306
 
1307
+ //---------------------------------------------------------------------
1308
+ // QRMath
1309
+ //---------------------------------------------------------------------
1310
 
1311
+ var QRMath = function() {
 
 
 
1312
 
1313
+ var EXP_TABLE = new Array(256);
1314
+ var LOG_TABLE = new Array(256);
 
1315
 
1316
+ // initialize tables
1317
+ for (var i = 0; i < 8; i += 1) {
1318
+ EXP_TABLE[i] = 1 << i;
1319
+ }
1320
+ for (var i = 8; i < 256; i += 1) {
1321
+ EXP_TABLE[i] = EXP_TABLE[i - 4]
1322
+ ^ EXP_TABLE[i - 5]
1323
+ ^ EXP_TABLE[i - 6]
1324
+ ^ EXP_TABLE[i - 8];
1325
+ }
1326
+ for (var i = 0; i < 255; i += 1) {
1327
+ LOG_TABLE[EXP_TABLE[i] ] = i;
1328
+ }
1329
 
1330
+ var _this = {};
 
1331
 
1332
+ _this.glog = function(n) {
 
 
1333
 
1334
+ if (n < 1) {
1335
+ throw new Error('glog(' + n + ')');
1336
+ }
1337
 
1338
+ return LOG_TABLE[n];
1339
+ };
1340
 
1341
+ _this.gexp = function(n) {
1342
 
1343
+ while (n < 0) {
1344
+ n += 255;
1345
+ }
1346
 
1347
+ while (n >= 256) {
1348
+ n -= 255;
1349
+ }
1350
 
1351
+ return EXP_TABLE[n];
1352
+ };
1353
 
1354
+ return _this;
1355
+ }();
1356
 
1357
+ //---------------------------------------------------------------------
1358
+ // qrPolynomial
1359
+ //---------------------------------------------------------------------
1360
 
1361
+ function qrPolynomial(num, shift) {
 
 
 
1362
 
1363
+ if (typeof num.length == 'undefined') {
1364
+ throw new Error(num.length + '/' + shift);
 
 
 
1365
  }
 
 
1366
 
1367
+ var _num = function() {
1368
+ var offset = 0;
1369
+ while (offset < num.length && num[offset] == 0) {
1370
+ offset += 1;
1371
+ }
1372
+ var _num = new Array(num.length - offset + shift);
1373
+ for (var i = 0; i < num.length - offset; i += 1) {
1374
+ _num[i] = num[i + offset];
1375
+ }
1376
+ return _num;
1377
+ }();
1378
 
1379
+ var _this = {};
 
 
 
 
 
1380
 
1381
+ _this.getAt = function(index) {
1382
+ return _num[index];
1383
+ };
1384
 
1385
+ _this.getLength = function() {
1386
+ return _num.length;
1387
+ };
1388
 
1389
+ _this.multiply = function(e) {
1390
 
1391
+ var num = new Array(_this.getLength() + e.getLength() - 1);
 
1392
 
1393
+ for (var i = 0; i < _this.getLength(); i += 1) {
1394
+ for (var j = 0; j < e.getLength(); j += 1) {
1395
+ num[i + j] ^= QRMath.gexp(QRMath.glog(_this.getAt(i) ) + QRMath.glog(e.getAt(j) ) );
1396
+ }
1397
+ }
1398
 
1399
+ return qrPolynomial(num, 0);
1400
+ };
 
1401
 
1402
+ _this.mod = function(e) {
 
 
1403
 
1404
+ if (_this.getLength() - e.getLength() < 0) {
1405
+ return _this;
1406
+ }
1407
 
1408
+ var ratio = QRMath.glog(_this.getAt(0) ) - QRMath.glog(e.getAt(0) );
1409
 
1410
+ var num = new Array(_this.getLength() );
1411
+ for (var i = 0; i < _this.getLength(); i += 1) {
1412
+ num[i] = _this.getAt(i);
1413
+ }
1414
 
1415
+ for (var i = 0; i < e.getLength(); i += 1) {
1416
+ num[i] ^= QRMath.gexp(QRMath.glog(e.getAt(i) ) + ratio);
1417
+ }
 
 
 
1418
 
1419
+ // recursive call
1420
+ return qrPolynomial(num, 0).mod(e);
1421
+ };
 
1422
 
1423
+ return _this;
1424
+ };
1425
+
1426
+ //---------------------------------------------------------------------
1427
+ // QRRSBlock
1428
+ //---------------------------------------------------------------------
1429
+
1430
+ var QRRSBlock = function() {
1431
+
1432
+ var RS_BLOCK_TABLE = [
1433
+
1434
+ // L
1435
+ // M
1436
+ // Q
1437
+ // H
1438
+
1439
+ // 1
1440
+ [1, 26, 19],
1441
+ [1, 26, 16],
1442
+ [1, 26, 13],
1443
+ [1, 26, 9],
1444
+
1445
+ // 2
1446
+ [1, 44, 34],
1447
+ [1, 44, 28],
1448
+ [1, 44, 22],
1449
+ [1, 44, 16],
1450
+
1451
+ // 3
1452
+ [1, 70, 55],
1453
+ [1, 70, 44],
1454
+ [2, 35, 17],
1455
+ [2, 35, 13],
1456
+
1457
+ // 4
1458
+ [1, 100, 80],
1459
+ [2, 50, 32],
1460
+ [2, 50, 24],
1461
+ [4, 25, 9],
1462
+
1463
+ // 5
1464
+ [1, 134, 108],
1465
+ [2, 67, 43],
1466
+ [2, 33, 15, 2, 34, 16],
1467
+ [2, 33, 11, 2, 34, 12],
1468
+
1469
+ // 6
1470
+ [2, 86, 68],
1471
+ [4, 43, 27],
1472
+ [4, 43, 19],
1473
+ [4, 43, 15],
1474
+
1475
+ // 7
1476
+ [2, 98, 78],
1477
+ [4, 49, 31],
1478
+ [2, 32, 14, 4, 33, 15],
1479
+ [4, 39, 13, 1, 40, 14],
1480
+
1481
+ // 8
1482
+ [2, 121, 97],
1483
+ [2, 60, 38, 2, 61, 39],
1484
+ [4, 40, 18, 2, 41, 19],
1485
+ [4, 40, 14, 2, 41, 15],
1486
+
1487
+ // 9
1488
+ [2, 146, 116],
1489
+ [3, 58, 36, 2, 59, 37],
1490
+ [4, 36, 16, 4, 37, 17],
1491
+ [4, 36, 12, 4, 37, 13],
1492
+
1493
+ // 10
1494
+ [2, 86, 68, 2, 87, 69],
1495
+ [4, 69, 43, 1, 70, 44],
1496
+ [6, 43, 19, 2, 44, 20],
1497
+ [6, 43, 15, 2, 44, 16],
1498
+
1499
+ // 11
1500
+ [4, 101, 81],
1501
+ [1, 80, 50, 4, 81, 51],
1502
+ [4, 50, 22, 4, 51, 23],
1503
+ [3, 36, 12, 8, 37, 13],
1504
+
1505
+ // 12
1506
+ [2, 116, 92, 2, 117, 93],
1507
+ [6, 58, 36, 2, 59, 37],
1508
+ [4, 46, 20, 6, 47, 21],
1509
+ [7, 42, 14, 4, 43, 15],
1510
+
1511
+ // 13
1512
+ [4, 133, 107],
1513
+ [8, 59, 37, 1, 60, 38],
1514
+ [8, 44, 20, 4, 45, 21],
1515
+ [12, 33, 11, 4, 34, 12],
1516
+
1517
+ // 14
1518
+ [3, 145, 115, 1, 146, 116],
1519
+ [4, 64, 40, 5, 65, 41],
1520
+ [11, 36, 16, 5, 37, 17],
1521
+ [11, 36, 12, 5, 37, 13],
1522
+
1523
+ // 15
1524
+ [5, 109, 87, 1, 110, 88],
1525
+ [5, 65, 41, 5, 66, 42],
1526
+ [5, 54, 24, 7, 55, 25],
1527
+ [11, 36, 12, 7, 37, 13],
1528
+
1529
+ // 16
1530
+ [5, 122, 98, 1, 123, 99],
1531
+ [7, 73, 45, 3, 74, 46],
1532
+ [15, 43, 19, 2, 44, 20],
1533
+ [3, 45, 15, 13, 46, 16],
1534
+
1535
+ // 17
1536
+ [1, 135, 107, 5, 136, 108],
1537
+ [10, 74, 46, 1, 75, 47],
1538
+ [1, 50, 22, 15, 51, 23],
1539
+ [2, 42, 14, 17, 43, 15],
1540
+
1541
+ // 18
1542
+ [5, 150, 120, 1, 151, 121],
1543
+ [9, 69, 43, 4, 70, 44],
1544
+ [17, 50, 22, 1, 51, 23],
1545
+ [2, 42, 14, 19, 43, 15],
1546
+
1547
+ // 19
1548
+ [3, 141, 113, 4, 142, 114],
1549
+ [3, 70, 44, 11, 71, 45],
1550
+ [17, 47, 21, 4, 48, 22],
1551
+ [9, 39, 13, 16, 40, 14],
1552
+
1553
+ // 20
1554
+ [3, 135, 107, 5, 136, 108],
1555
+ [3, 67, 41, 13, 68, 42],
1556
+ [15, 54, 24, 5, 55, 25],
1557
+ [15, 43, 15, 10, 44, 16],
1558
+
1559
+ // 21
1560
+ [4, 144, 116, 4, 145, 117],
1561
+ [17, 68, 42],
1562
+ [17, 50, 22, 6, 51, 23],
1563
+ [19, 46, 16, 6, 47, 17],
1564
+
1565
+ // 22
1566
+ [2, 139, 111, 7, 140, 112],
1567
+ [17, 74, 46],
1568
+ [7, 54, 24, 16, 55, 25],
1569
+ [34, 37, 13],
1570
+
1571
+ // 23
1572
+ [4, 151, 121, 5, 152, 122],
1573
+ [4, 75, 47, 14, 76, 48],
1574
+ [11, 54, 24, 14, 55, 25],
1575
+ [16, 45, 15, 14, 46, 16],
1576
+
1577
+ // 24
1578
+ [6, 147, 117, 4, 148, 118],
1579
+ [6, 73, 45, 14, 74, 46],
1580
+ [11, 54, 24, 16, 55, 25],
1581
+ [30, 46, 16, 2, 47, 17],
1582
+
1583
+ // 25
1584
+ [8, 132, 106, 4, 133, 107],
1585
+ [8, 75, 47, 13, 76, 48],
1586
+ [7, 54, 24, 22, 55, 25],
1587
+ [22, 45, 15, 13, 46, 16],
1588
+
1589
+ // 26
1590
+ [10, 142, 114, 2, 143, 115],
1591
+ [19, 74, 46, 4, 75, 47],
1592
+ [28, 50, 22, 6, 51, 23],
1593
+ [33, 46, 16, 4, 47, 17],
1594
+
1595
+ // 27
1596
+ [8, 152, 122, 4, 153, 123],
1597
+ [22, 73, 45, 3, 74, 46],
1598
+ [8, 53, 23, 26, 54, 24],
1599
+ [12, 45, 15, 28, 46, 16],
1600
+
1601
+ // 28
1602
+ [3, 147, 117, 10, 148, 118],
1603
+ [3, 73, 45, 23, 74, 46],
1604
+ [4, 54, 24, 31, 55, 25],
1605
+ [11, 45, 15, 31, 46, 16],
1606
+
1607
+ // 29
1608
+ [7, 146, 116, 7, 147, 117],
1609
+ [21, 73, 45, 7, 74, 46],
1610
+ [1, 53, 23, 37, 54, 24],
1611
+ [19, 45, 15, 26, 46, 16],
1612
+
1613
+ // 30
1614
+ [5, 145, 115, 10, 146, 116],
1615
+ [19, 75, 47, 10, 76, 48],
1616
+ [15, 54, 24, 25, 55, 25],
1617
+ [23, 45, 15, 25, 46, 16],
1618
+
1619
+ // 31
1620
+ [13, 145, 115, 3, 146, 116],
1621
+ [2, 74, 46, 29, 75, 47],
1622
+ [42, 54, 24, 1, 55, 25],
1623
+ [23, 45, 15, 28, 46, 16],
1624
+
1625
+ // 32
1626
+ [17, 145, 115],
1627
+ [10, 74, 46, 23, 75, 47],
1628
+ [10, 54, 24, 35, 55, 25],
1629
+ [19, 45, 15, 35, 46, 16],
1630
+
1631
+ // 33
1632
+ [17, 145, 115, 1, 146, 116],
1633
+ [14, 74, 46, 21, 75, 47],
1634
+ [29, 54, 24, 19, 55, 25],
1635
+ [11, 45, 15, 46, 46, 16],
1636
+
1637
+ // 34
1638
+ [13, 145, 115, 6, 146, 116],
1639
+ [14, 74, 46, 23, 75, 47],
1640
+ [44, 54, 24, 7, 55, 25],
1641
+ [59, 46, 16, 1, 47, 17],
1642
+
1643
+ // 35
1644
+ [12, 151, 121, 7, 152, 122],
1645
+ [12, 75, 47, 26, 76, 48],
1646
+ [39, 54, 24, 14, 55, 25],
1647
+ [22, 45, 15, 41, 46, 16],
1648
+
1649
+ // 36
1650
+ [6, 151, 121, 14, 152, 122],
1651
+ [6, 75, 47, 34, 76, 48],
1652
+ [46, 54, 24, 10, 55, 25],
1653
+ [2, 45, 15, 64, 46, 16],
1654
+
1655
+ // 37
1656
+ [17, 152, 122, 4, 153, 123],
1657
+ [29, 74, 46, 14, 75, 47],
1658
+ [49, 54, 24, 10, 55, 25],
1659
+ [24, 45, 15, 46, 46, 16],
1660
+
1661
+ // 38
1662
+ [4, 152, 122, 18, 153, 123],
1663
+ [13, 74, 46, 32, 75, 47],
1664
+ [48, 54, 24, 14, 55, 25],
1665
+ [42, 45, 15, 32, 46, 16],
1666
+
1667
+ // 39
1668
+ [20, 147, 117, 4, 148, 118],
1669
+ [40, 75, 47, 7, 76, 48],
1670
+ [43, 54, 24, 22, 55, 25],
1671
+ [10, 45, 15, 67, 46, 16],
1672
+
1673
+ // 40
1674
+ [19, 148, 118, 6, 149, 119],
1675
+ [18, 75, 47, 31, 76, 48],
1676
+ [34, 54, 24, 34, 55, 25],
1677
+ [20, 45, 15, 61, 46, 16]
1678
+ ];
1679
+
1680
+ var qrRSBlock = function(totalCount, dataCount) {
1681
+ var _this = {};
1682
+ _this.totalCount = totalCount;
1683
+ _this.dataCount = dataCount;
1684
+ return _this;
1685
+ };
1686
+
1687
+ var _this = {};
1688
+
1689
+ var getRsBlockTable = function(typeNumber, errorCorrectLevel) {
1690
+
1691
+ switch(errorCorrectLevel) {
1692
+ case QRErrorCorrectLevel.L :
1693
+ return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
1694
+ case QRErrorCorrectLevel.M :
1695
+ return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
1696
+ case QRErrorCorrectLevel.Q :
1697
+ return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
1698
+ case QRErrorCorrectLevel.H :
1699
+ return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
1700
+ default :
1701
+ return undefined;
1702
+ }
1703
+ };
1704
 
1705
+ _this.getRSBlocks = function(typeNumber, errorCorrectLevel) {
 
1706
 
1707
+ var rsBlock = getRsBlockTable(typeNumber, errorCorrectLevel);
 
 
1708
 
1709
+ if (typeof rsBlock == 'undefined') {
1710
+ throw new Error('bad rs block @ typeNumber:' + typeNumber +
1711
+ '/errorCorrectLevel:' + errorCorrectLevel);
1712
+ }
1713
 
1714
+ var length = rsBlock.length / 3;
 
 
1715
 
1716
+ var list = new Array();
1717
 
1718
+ for (var i = 0; i < length; i += 1) {
 
 
1719
 
1720
+ var count = rsBlock[i * 3 + 0];
1721
+ var totalCount = rsBlock[i * 3 + 1];
1722
+ var dataCount = rsBlock[i * 3 + 2];
1723
 
1724
+ for (var j = 0; j < count; j += 1) {
1725
+ list.push(qrRSBlock(totalCount, dataCount) );
1726
+ }
1727
+ }
 
1728
 
1729
+ return list;
1730
+ };
1731
 
1732
+ return _this;
1733
+ }();
 
1734
 
1735
+ //---------------------------------------------------------------------
1736
+ // qrBitBuffer
1737
+ //---------------------------------------------------------------------
1738
 
1739
+ var qrBitBuffer = function() {
 
1740
 
1741
+ var _buffer = new Array();
1742
+ var _length = 0;
 
 
 
 
 
 
 
 
 
1743
 
1744
+ var _this = {};
1745
 
1746
+ _this.getBuffer = function() {
1747
+ return _buffer;
1748
+ };
1749
 
1750
+ _this.getAt = function(index) {
1751
+ var bufIndex = Math.floor(index / 8);
1752
+ return ( (_buffer[bufIndex] >>> (7 - index % 8) ) & 1) == 1;
1753
+ };
1754
 
1755
+ _this.put = function(num, length) {
1756
+ for (var i = 0; i < length; i += 1) {
1757
+ _this.putBit( ( (num >>> (length - i - 1) ) & 1) == 1);
1758
+ }
1759
+ };
1760
 
1761
+ _this.getLengthInBits = function() {
1762
+ return _length;
1763
+ };
1764
 
1765
+ _this.putBit = function(bit) {
1766
 
1767
+ var bufIndex = Math.floor(_length / 8);
1768
+ if (_buffer.length <= bufIndex) {
1769
+ _buffer.push(0);
1770
+ }
1771
 
1772
+ if (bit) {
1773
+ _buffer[bufIndex] |= (0x80 >>> (_length % 8) );
1774
+ }
1775
 
1776
+ _length += 1;
1777
+ };
1778
 
1779
+ return _this;
1780
+ };
 
 
 
 
 
1781
 
1782
+ //---------------------------------------------------------------------
1783
+ // qr8BitByte
1784
+ //---------------------------------------------------------------------
1785
 
1786
+ var qr8BitByte = function(data) {
1787
 
1788
+ var _mode = QRMode.MODE_8BIT_BYTE;
1789
+ var _data = data;
1790
+ var _bytes = qrcode.stringToBytes(data);
1791
 
1792
+ var _this = {};
 
 
 
1793
 
1794
+ _this.getMode = function() {
1795
+ return _mode;
1796
+ };
1797
 
1798
+ _this.getLength = function(buffer) {
1799
+ return _bytes.length;
1800
+ };
1801
 
1802
+ _this.write = function(buffer) {
1803
+ for (var i = 0; i < _bytes.length; i += 1) {
1804
+ buffer.put(_bytes[i], 8);
1805
+ }
1806
+ };
1807
 
1808
+ return _this;
1809
+ };
1810
 
1811
+ //=====================================================================
1812
+ // GIF Support etc.
1813
+ //
1814
 
1815
+ //---------------------------------------------------------------------
1816
+ // byteArrayOutputStream
1817
+ //---------------------------------------------------------------------
1818
 
1819
+ var byteArrayOutputStream = function() {
 
 
1820
 
1821
+ var _bytes = new Array();
 
 
 
1822
 
1823
+ var _this = {};
 
 
 
 
 
 
1824
 
1825
+ _this.writeByte = function(b) {
1826
+ _bytes.push(b & 0xff);
1827
+ };
 
 
1828
 
1829
+ _this.writeShort = function(i) {
1830
+ _this.writeByte(i);
1831
+ _this.writeByte(i >>> 8);
1832
+ };
1833
 
1834
+ _this.writeBytes = function(b, off, len) {
1835
+ off = off || 0;
1836
+ len = len || b.length;
1837
+ for (var i = 0; i < len; i += 1) {
1838
+ _this.writeByte(b[i + off]);
1839
+ }
1840
+ };
 
 
 
 
 
1841
 
1842
+ _this.writeString = function(s) {
1843
+ for (var i = 0; i < s.length; i += 1) {
1844
+ _this.writeByte(s.charCodeAt(i) );
1845
+ }
1846
+ };
1847
+
1848
+ _this.toByteArray = function() {
1849
+ return _bytes;
1850
+ };
1851
+
1852
+ _this.toString = function() {
1853
+ var s = '';
1854
+ s += '[';
1855
+ for (var i = 0; i < _bytes.length; i += 1) {
1856
+ if (i > 0) {
1857
+ s += ',';
1858
+ }
1859
+ s += _bytes[i];
1860
+ }
1861
+ s += ']';
1862
+ return s;
1863
+ };
1864
 
1865
+ return _this;
1866
+ };
 
1867
 
1868
+ //---------------------------------------------------------------------
1869
+ // base64EncodeOutputStream
1870
+ //---------------------------------------------------------------------
1871
+
1872
+ var base64EncodeOutputStream = function() {
1873
+
1874
+ var _buffer = 0;
1875
+ var _buflen = 0;
1876
+ var _length = 0;
1877
+ var _base64 = '';
1878
+
1879
+ var _this = {};
1880
+
1881
+ var writeEncoded = function(b) {
1882
+ _base64 += String.fromCharCode(encode(b & 0x3f) );
1883
+ };
1884
+
1885
+ var encode = function(n) {
1886
+ if (n < 0) {
1887
+ // error.
1888
+ } else if (n < 26) {
1889
+ return 0x41 + n;
1890
+ } else if (n < 52) {
1891
+ return 0x61 + (n - 26);
1892
+ } else if (n < 62) {
1893
+ return 0x30 + (n - 52);
1894
+ } else if (n == 62) {
1895
+ return 0x2b;
1896
+ } else if (n == 63) {
1897
+ return 0x2f;
1898
+ }
1899
+ throw new Error('n:' + n);
1900
+ };
1901
 
1902
+ _this.writeByte = function(n) {
 
 
 
1903
 
1904
+ _buffer = (_buffer << 8) | (n & 0xff);
1905
+ _buflen += 8;
1906
+ _length += 1;
1907
 
1908
+ while (_buflen >= 6) {
1909
+ writeEncoded(_buffer >>> (_buflen - 6) );
1910
+ _buflen -= 6;
1911
+ }
1912
+ };
1913
 
1914
+ _this.flush = function() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1915
 
1916
+ if (_buflen > 0) {
1917
+ writeEncoded(_buffer << (6 - _buflen) );
1918
+ _buffer = 0;
1919
+ _buflen = 0;
1920
+ }
1921
 
1922
+ if (_length % 3 != 0) {
1923
+ // padding
1924
+ var padlen = 3 - _length % 3;
1925
+ for (var i = 0; i < padlen; i += 1) {
1926
+ _base64 += '=';
1927
+ }
1928
+ }
1929
+ };
1930
 
1931
+ _this.toString = function() {
1932
+ return _base64;
1933
+ };
 
 
1934
 
1935
+ return _this;
1936
+ };
1937
 
1938
+ //---------------------------------------------------------------------
1939
+ // base64DecodeInputStream
1940
+ //---------------------------------------------------------------------
 
 
1941
 
1942
+ var base64DecodeInputStream = function(str) {
 
 
 
 
 
 
 
1943
 
1944
+ var _str = str;
1945
+ var _pos = 0;
1946
+ var _buffer = 0;
1947
+ var _buflen = 0;
1948
 
1949
+ var _this = {};
 
1950
 
1951
+ _this.read = function() {
 
 
1952
 
1953
+ while (_buflen < 8) {
1954
 
1955
+ if (_pos >= _str.length) {
1956
+ if (_buflen == 0) {
1957
+ return -1;
1958
+ }
1959
+ throw new Error('unexpected end of file./' + _buflen);
1960
+ }
1961
 
1962
+ var c = _str.charAt(_pos);
1963
+ _pos += 1;
1964
 
1965
+ if (c == '=') {
1966
+ _buflen = 0;
1967
+ return -1;
1968
+ } else if (c.match(/^\s$/) ) {
1969
+ // ignore if whitespace.
1970
+ continue;
1971
+ }
1972
 
1973
+ _buffer = (_buffer << 6) | decode(c.charCodeAt(0) );
1974
+ _buflen += 6;
1975
+ }
1976
 
1977
+ var n = (_buffer >>> (_buflen - 8) ) & 0xff;
1978
+ _buflen -= 8;
1979
+ return n;
1980
+ };
1981
+
1982
+ var decode = function(c) {
1983
+ if (0x41 <= c && c <= 0x5a) {
1984
+ return c - 0x41;
1985
+ } else if (0x61 <= c && c <= 0x7a) {
1986
+ return c - 0x61 + 26;
1987
+ } else if (0x30 <= c && c <= 0x39) {
1988
+ return c - 0x30 + 52;
1989
+ } else if (c == 0x2b) {
1990
+ return 62;
1991
+ } else if (c == 0x2f) {
1992
+ return 63;
1993
+ } else {
1994
+ throw new Error('c:' + c);
1995
  }
1996
+ };
 
1997
 
1998
+ return _this;
1999
+ };
2000
 
2001
+ //---------------------------------------------------------------------
2002
+ // gifImage (B/W)
2003
+ //---------------------------------------------------------------------
 
 
 
 
2004
 
2005
+ var gifImage = function(width, height) {
 
 
2006
 
2007
+ var _width = width;
2008
+ var _height = height;
2009
+ var _data = new Array(width * height);
 
2010
 
2011
+ var _this = {};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2012
 
2013
+ _this.setPixel = function(x, y, pixel) {
2014
+ _data[y * _width + x] = pixel;
2015
+ };
2016
 
2017
+ _this.write = function(out) {
 
 
2018
 
2019
+ //---------------------------------
2020
+ // GIF Signature
2021
 
2022
+ out.writeString('GIF87a');
 
 
2023
 
2024
+ //---------------------------------
2025
+ // Screen Descriptor
2026
 
2027
+ out.writeShort(_width);
2028
+ out.writeShort(_height);
 
2029
 
2030
+ out.writeByte(0x80); // 2bit
2031
+ out.writeByte(0);
2032
+ out.writeByte(0);
2033
 
2034
+ //---------------------------------
2035
+ // Global Color Map
2036
 
2037
+ // black
2038
+ out.writeByte(0x00);
2039
+ out.writeByte(0x00);
2040
+ out.writeByte(0x00);
2041
 
2042
+ // white
2043
+ out.writeByte(0xff);
2044
+ out.writeByte(0xff);
2045
+ out.writeByte(0xff);
2046
 
2047
+ //---------------------------------
2048
+ // Image Descriptor
2049
 
2050
+ out.writeString(',');
2051
+ out.writeShort(0);
2052
+ out.writeShort(0);
2053
+ out.writeShort(_width);
2054
+ out.writeShort(_height);
2055
+ out.writeByte(0);
2056
 
2057
+ //---------------------------------
2058
+ // Local Color Map
2059
 
2060
+ //---------------------------------
2061
+ // Raster Data
 
 
2062
 
2063
+ var lzwMinCodeSize = 2;
2064
+ var raster = getLZWRaster(lzwMinCodeSize);
 
 
2065
 
2066
+ out.writeByte(lzwMinCodeSize);
 
2067
 
2068
+ var offset = 0;
 
 
 
 
 
2069
 
2070
+ while (raster.length - offset > 255) {
2071
+ out.writeByte(255);
2072
+ out.writeBytes(raster, offset, 255);
2073
+ offset += 255;
2074
+ }
2075
 
2076
+ out.writeByte(raster.length - offset);
2077
+ out.writeBytes(raster, offset, raster.length - offset);
2078
+ out.writeByte(0x00);
2079
 
2080
+ //---------------------------------
2081
+ // GIF Terminator
2082
+ out.writeString(';');
2083
+ };
2084
 
2085
+ var bitOutputStream = function(out) {
2086
 
2087
+ var _out = out;
2088
+ var _bitLength = 0;
2089
+ var _bitBuffer = 0;
2090
 
2091
+ var _this = {};
 
 
 
 
2092
 
2093
+ _this.write = function(data, length) {
 
 
2094
 
2095
+ if ( (data >>> length) != 0) {
2096
+ throw new Error('length over');
2097
+ }
 
2098
 
2099
+ while (_bitLength + length >= 8) {
2100
+ _out.writeByte(0xff & ( (data << _bitLength) | _bitBuffer) );
2101
+ length -= (8 - _bitLength);
2102
+ data >>>= (8 - _bitLength);
2103
+ _bitBuffer = 0;
2104
+ _bitLength = 0;
2105
+ }
2106
 
2107
+ _bitBuffer = (data << _bitLength) | _bitBuffer;
2108
+ _bitLength = _bitLength + length;
2109
+ };
2110
 
2111
+ _this.flush = function() {
2112
+ if (_bitLength > 0) {
2113
+ _out.writeByte(_bitBuffer);
2114
+ }
2115
+ };
2116
 
2117
+ return _this;
2118
+ };
2119
 
2120
+ var getLZWRaster = function(lzwMinCodeSize) {
 
 
2121
 
2122
+ var clearCode = 1 << lzwMinCodeSize;
2123
+ var endCode = (1 << lzwMinCodeSize) + 1;
2124
+ var bitLength = lzwMinCodeSize + 1;
 
 
 
 
2125
 
2126
+ // Setup LZWTable
2127
+ var table = lzwTable();
 
2128
 
2129
+ for (var i = 0; i < clearCode; i += 1) {
2130
+ table.add(String.fromCharCode(i) );
2131
+ }
2132
+ table.add(String.fromCharCode(clearCode) );
2133
+ table.add(String.fromCharCode(endCode) );
2134
 
2135
+ var byteOut = byteArrayOutputStream();
2136
+ var bitOut = bitOutputStream(byteOut);
2137
 
2138
+ // clear code
2139
+ bitOut.write(clearCode, bitLength);
2140
 
2141
+ var dataIndex = 0;
 
 
2142
 
2143
+ var s = String.fromCharCode(_data[dataIndex]);
2144
+ dataIndex += 1;
2145
 
2146
+ while (dataIndex < _data.length) {
 
 
 
 
2147
 
2148
+ var c = String.fromCharCode(_data[dataIndex]);
2149
+ dataIndex += 1;
2150
 
2151
+ if (table.contains(s + c) ) {
 
2152
 
2153
+ s = s + c;
2154
 
2155
+ } else {
 
2156
 
2157
+ bitOut.write(table.indexOf(s), bitLength);
2158
 
2159
+ if (table.size() < 0xfff) {
 
2160
 
2161
+ if (table.size() == (1 << bitLength) ) {
2162
+ bitLength += 1;
2163
+ }
2164
 
2165
+ table.add(s + c);
2166
+ }
2167
 
2168
+ s = c;
2169
+ }
2170
+ }
2171
 
2172
  bitOut.write(table.indexOf(s), bitLength);
2173
 
2174
+ // end code
2175
+ bitOut.write(endCode, bitLength);
2176
 
2177
+ bitOut.flush();
 
 
2178
 
2179
+ return byteOut.toByteArray();
2180
+ };
2181
 
2182
+ var lzwTable = function() {
 
 
2183
 
2184
+ var _map = {};
2185
+ var _size = 0;
2186
 
2187
+ var _this = {};
 
2188
 
2189
+ _this.add = function(key) {
2190
+ if (_this.contains(key) ) {
2191
+ throw new Error('dup key:' + key);
2192
+ }
2193
+ _map[key] = _size;
2194
+ _size += 1;
2195
+ };
2196
 
2197
+ _this.size = function() {
2198
+ return _size;
2199
+ };
2200
 
2201
+ _this.indexOf = function(key) {
2202
+ return _map[key];
2203
+ };
2204
 
2205
+ _this.contains = function(key) {
2206
+ return typeof _map[key] != 'undefined';
2207
+ };
2208
 
2209
+ return _this;
2210
+ };
2211
 
2212
+ return _this;
 
 
 
 
 
2213
  };
2214
 
2215
+ var createImgTag = function(width, height, getPixel, alt) {
 
 
2216
 
2217
+ var gif = gifImage(width, height);
2218
+ for (var y = 0; y < height; y += 1) {
2219
+ for (var x = 0; x < width; x += 1) {
2220
+ gif.setPixel(x, y, getPixel(x, y) );
2221
+ }
2222
+ }
2223
 
2224
+ var b = byteArrayOutputStream();
2225
+ gif.write(b);
 
2226
 
2227
+ var base64 = base64EncodeOutputStream();
2228
+ var bytes = b.toByteArray();
2229
+ for (var i = 0; i < bytes.length; i += 1) {
2230
+ base64.writeByte(bytes[i]);
2231
+ }
2232
+ base64.flush();
2233
+
2234
+ var img = '';
2235
+ img += '<img';
2236
+ img += '\u0020src="';
2237
+ img += 'data:image/gif;base64,';
2238
+ img += base64;
2239
+ img += '"';
2240
+ img += '\u0020width="';
2241
+ img += width;
2242
+ img += '"';
2243
+ img += '\u0020height="';
2244
+ img += height;
2245
+ img += '"';
2246
+ if (alt) {
2247
+ img += '\u0020alt="';
2248
+ img += alt;
2249
+ img += '"';
2250
+ }
2251
+ img += '/>';
2252
 
2253
+ return img;
2254
+ };
2255
 
2256
+ //---------------------------------------------------------------------
2257
+ // returns qrcode function.
 
 
 
 
 
2258
 
2259
+ return qrcode;
2260
+ }();
2261
 
2262
+ (function (factory) {
2263
+ if (typeof define === 'function' && define.amd) {
2264
+ define([], factory);
2265
+ } else if (typeof exports === 'object') {
2266
+ module.exports = factory();
2267
+ }
2268
+ }(function () {
2269
+ return qrcode;
2270
+ }));
2271
+ //---------------------------------------------------------------------
2272
+ //
2273
+ // QR Code Generator for JavaScript UTF8 Support (optional)
2274
+ //
2275
+ // Copyright (c) 2011 Kazuhiko Arase
2276
+ //
2277
+ // URL: http://www.d-project.com/
2278
+ //
2279
+ // Licensed under the MIT license:
2280
+ // http://www.opensource.org/licenses/mit-license.php
2281
+ //
2282
+ // The word 'QR Code' is registered trademark of
2283
+ // DENSO WAVE INCORPORATED
2284
+ // http://www.denso-wave.com/qrcode/faqpatent-e.html
2285
+ //
2286
+ //---------------------------------------------------------------------
2287
+
2288
+ !function(qrcode) {
2289
+
2290
+ //---------------------------------------------------------------------
2291
+ // overwrite qrcode.stringToBytes
2292
+ //---------------------------------------------------------------------
2293
+
2294
+ qrcode.stringToBytes = function(s) {
2295
+ // http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array
2296
+ function toUTF8Array(str) {
2297
+ var utf8 = [];
2298
+ for (var i=0; i < str.length; i++) {
2299
+ var charcode = str.charCodeAt(i);
2300
+ if (charcode < 0x80) utf8.push(charcode);
2301
+ else if (charcode < 0x800) {
2302
+ utf8.push(0xc0 | (charcode >> 6),
2303
+ 0x80 | (charcode & 0x3f));
2304
+ }
2305
+ else if (charcode < 0xd800 || charcode >= 0xe000) {
2306
+ utf8.push(0xe0 | (charcode >> 12),
2307
+ 0x80 | ((charcode>>6) & 0x3f),
2308
+ 0x80 | (charcode & 0x3f));
2309
+ }
2310
+ // surrogate pair
2311
+ else {
2312
+ i++;
2313
+ // UTF-16 encodes 0x10000-0x10FFFF by
2314
+ // subtracting 0x10000 and splitting the
2315
+ // 20 bits of 0x0-0xFFFFF into two halves
2316
+ charcode = 0x10000 + (((charcode & 0x3ff)<<10)
2317
+ | (str.charCodeAt(i) & 0x3ff));
2318
+ utf8.push(0xf0 | (charcode >>18),
2319
+ 0x80 | ((charcode>>12) & 0x3f),
2320
+ 0x80 | ((charcode>>6) & 0x3f),
2321
+ 0x80 | (charcode & 0x3f));
2322
+ }
2323
+ }
2324
+ return utf8;
2325
  }
2326
+ return toUTF8Array(s);
2327
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2328
 
2329
+ }(qrcode);
2330
 
2331
+ return qrcode; // eslint-disable-line no-undef
2332
+ }()));
2333
+ jQuery('.mo2f_gauth').qrcode({
2334
+ 'render': 'image',
2335
+ size: 175,
2336
+ 'text': jQuery('.mo2f_gauth').data('qrcode')
2337
  });
includes/jquery-qrcode/jquery-qrcode.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! jquery-qrcode v0.17.0 - https://larsjung.de/jquery-qrcode/ */
2
- !function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("jquery-qrcode",[],r):"object"==typeof exports?exports["jquery-qrcode"]=r():t["jquery-qrcode"]=r()}("undefined"!=typeof self?self:this,function(){return function(e){var n={};function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=n,o.d=function(t,r,e){o.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:e})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(r,t){if(1&t&&(r=o(r)),8&t)return r;if(4&t&&"object"==typeof r&&r&&r.__esModule)return r;var e=Object.create(null);if(o.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:r}),2&t&&"string"!=typeof r)for(var n in r)o.d(e,n,function(t){return r[t]}.bind(null,n));return e},o.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(r,"a",r),r},o.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},o.p="",o(o.s=0)}([function(v,t,p){(function(t){function c(t){return t&&"string"==typeof t.tagName&&"IMG"===t.tagName.toUpperCase()}function a(t,r,e,n){var o={},i=p(2);i.stringToBytes=i.stringToBytesFuncs["UTF-8"];var a=i(e,r);a.addData(t),a.make(),n=n||0;var u=a.getModuleCount(),s=u+2*n;return o.text=t,o.level=r,o.version=e,o.module_count=s,o.is_dark=function(t,r){return r-=n,0<=(t-=n)&&t<u&&0<=r&&r<u&&a.isDark(t,r)},o.add_blank=function(a,u,f,c){var l=o.is_dark,g=1/s;o.is_dark=function(t,r){var e=r*g,n=t*g,o=e+g,i=n+g;return l(t,r)&&(o<a||f<e||i<u||c<n)}},o}function h(t,r,e,n,o){e=Math.max(1,e||1),n=Math.min(40,n||40);for(var i=e;i<=n;i+=1)try{return a(t,r,i,o)}catch(t){}}function i(t,r,e){c(e.background)?r.drawImage(e.background,0,0,e.size,e.size):e.background&&(r.fillStyle=e.background,r.fillRect(e.left,e.top,e.size,e.size));var n=e.mode;1===n||2===n?function(t,r,e){var n=e.size,o="bold "+e.mSize*n+"px "+e.fontname,i=d("<canvas/>")[0].getContext("2d");i.font=o;var a=i.measureText(e.label).width,u=e.mSize,f=a/n,c=(1-f)*e.mPosX,l=(1-u)*e.mPosY,g=c+f,s=l+u;1===e.mode?t.add_blank(0,l-.01,n,s+.01):t.add_blank(c-.01,l-.01,.01+g,s+.01),r.fillStyle=e.fontcolor,r.font=o,r.fillText(e.label,c*n,l*n+.75*e.mSize*n)}(t,r,e):!c(e.image)||3!==n&&4!==n||function(t,r,e){var n=e.size,o=e.image.naturalWidth||1,i=e.image.naturalHeight||1,a=e.mSize,u=a*o/i,f=(1-u)*e.mPosX,c=(1-a)*e.mPosY,l=f+u,g=c+a;3===e.mode?t.add_blank(0,c-.01,n,g+.01):t.add_blank(f-.01,c-.01,.01+l,g+.01),r.drawImage(e.image,f*n,c*n,u*n,a*n)}(t,r,e)}function l(t,r,e,n,o,i,a,u){t.is_dark(a,u)&&r.rect(n,o,i,i)}function g(t,r,e,n,o,i,a,u){var f=t.is_dark,c=n+i,l=o+i,g=e.radius*i,s=a-1,h=a+1,d=u-1,v=u+1,p=f(a,u),w=f(s,d),y=f(s,u),m=f(s,v),b=f(a,v),k=f(h,v),C=f(h,u),B=f(h,d),x=f(a,d);p?function(t,r,e,n,o,i,a,u,f,c){a?t.moveTo(r+i,e):t.moveTo(r,e),u?(t.lineTo(n-i,e),t.arcTo(n,e,n,o,i)):t.lineTo(n,e),f?(t.lineTo(n,o-i),t.arcTo(n,o,r,o,i)):t.lineTo(n,o),c?(t.lineTo(r+i,o),t.arcTo(r,o,r,e,i)):t.lineTo(r,o),a?(t.lineTo(r,e+i),t.arcTo(r,e,n,e,i)):t.lineTo(r,e)}(r,n,o,c,l,g,!y&&!x,!y&&!b,!C&&!b,!C&&!x):function(t,r,e,n,o,i,a,u,f,c){a&&(t.moveTo(r+i,e),t.lineTo(r,e),t.lineTo(r,e+i),t.arcTo(r,e,r+i,e,i)),u&&(t.moveTo(n-i,e),t.lineTo(n,e),t.lineTo(n,e+i),t.arcTo(n,e,n-i,e,i)),f&&(t.moveTo(n-i,o),t.lineTo(n,o),t.lineTo(n,o-i),t.arcTo(n,o,n-i,o,i)),c&&(t.moveTo(r+i,o),t.lineTo(r,o),t.lineTo(r,o-i),t.arcTo(r,o,r+i,o,i))}(r,n,o,c,l,g,y&&x&&w,y&&b&&m,C&&b&&k,C&&x&&B)}function n(t,r){var e=h(r.text,r.ecLevel,r.minVersion,r.maxVersion,r.quiet);if(!e)return null;var n=d(t).data("qrcode",e),o=n[0].getContext("2d");return i(e,o,r),function(t,r,e){var n,o,i=t.module_count,a=e.size/i,u=l;for(0<e.radius&&e.radius<=.5&&(u=g),r.beginPath(),n=0;n<i;n+=1)for(o=0;o<i;o+=1)u(t,r,e,e.left+o*a,e.top+n*a,a,n,o);if(c(e.fill)){r.strokeStyle="rgba(0,0,0,0.5)",r.lineWidth=2,r.stroke();var f=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",r.fill(),r.globalCompositeOperation=f,r.clip(),r.drawImage(e.fill,0,0,e.size,e.size),r.restore()}else r.fillStyle=e.fill,r.fill()}(e,o,r),n}function r(t){var r=d("<canvas/>").attr("width",t.size).attr("height",t.size);return n(r,t)}function o(t){return f&&"canvas"===t.render?r(t):f&&"image"===t.render?function(t){return d("<img/>").attr("src",r(t)[0].toDataURL("image/png"))}(t):function(t){var r=h(t.text,t.ecLevel,t.minVersion,t.maxVersion,t.quiet);if(!r)return null;var e,n,o=t.size,i=t.background,a=Math.floor,u=r.module_count,f=a(o/u),c=a(.5*(o-f*u)),l={position:"relative",left:0,top:0,padding:0,margin:0,width:o,height:o},g={position:"absolute",padding:0,margin:0,width:f,height:f,"background-color":t.fill},s=d("<div/>").data("qrcode",r).css(l);for(i&&s.css("background-color",i),e=0;e<u;e+=1)for(n=0;n<u;n+=1)r.is_dark(e,n)&&d("<div/>").css(g).css({left:c+n*f,top:c+e*f}).appendTo(s);return s}(t)}var e,u=t.window,d=u.jQuery,f=!(!(e=u.document.createElement("canvas")).getContext||!e.getContext("2d")),s={render:"canvas",minVersion:1,maxVersion:40,ecLevel:"L",left:0,top:0,size:200,fill:"#000",background:"#fff",text:"no text",radius:0,quiet:0,mode:0,mSize:.1,mPosX:.5,mPosY:.5,label:"no label",fontname:"sans",fontcolor:"#000",image:null};d.fn.qrcode=v.exports=function(t){var e=d.extend({},s,t);return this.each(function(t,r){"canvas"===r.nodeName.toLowerCase()?n(r,e):d(r).append(o(e))})}}).call(this,p(1))},function(t,r){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,r,e){var n,o,i,a=function(){function i(t,r){function a(t,r){l=function(t){for(var r=new Array(t),e=0;e<t;e+=1){r[e]=new Array(t);for(var n=0;n<t;n+=1)r[e][n]=null}return r}(g=4*u+17),e(0,0),e(g-7,0),e(0,g-7),i(),o(),d(t,r),7<=u&&s(t),null==n&&(n=p(u,f,c)),v(n,r)}var u=t,f=w[r],l=null,g=0,n=null,c=[],h={},e=function(t,r){for(var e=-1;e<=7;e+=1)if(!(t+e<=-1||g<=t+e))for(var n=-1;n<=7;n+=1)r+n<=-1||g<=r+n||(l[t+e][r+n]=0<=e&&e<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==e||6==e)||2<=e&&e<=4&&2<=n&&n<=4)},o=function(){for(var t=8;t<g-8;t+=1)null==l[t][6]&&(l[t][6]=t%2==0);for(var r=8;r<g-8;r+=1)null==l[6][r]&&(l[6][r]=r%2==0)},i=function(){for(var t=y.getPatternPosition(u),r=0;r<t.length;r+=1)for(var e=0;e<t.length;e+=1){var n=t[r],o=t[e];if(null==l[n][o])for(var i=-2;i<=2;i+=1)for(var a=-2;a<=2;a+=1)l[n+i][o+a]=-2==i||2==i||-2==a||2==a||0==i&&0==a}},s=function(t){for(var r=y.getBCHTypeNumber(u),e=0;e<18;e+=1){var n=!t&&1==(r>>e&1);l[Math.floor(e/3)][e%3+g-8-3]=n}for(e=0;e<18;e+=1){n=!t&&1==(r>>e&1);l[e%3+g-8-3][Math.floor(e/3)]=n}},d=function(t,r){for(var e=f<<3|r,n=y.getBCHTypeInfo(e),o=0;o<15;o+=1){var i=!t&&1==(n>>o&1);o<6?l[o][8]=i:o<8?l[o+1][8]=i:l[g-15+o][8]=i}for(o=0;o<15;o+=1){i=!t&&1==(n>>o&1);o<8?l[8][g-o-1]=i:o<9?l[8][15-o-1+1]=i:l[8][15-o-1]=i}l[g-8][8]=!t},v=function(t,r){for(var e=-1,n=g-1,o=7,i=0,a=y.getMaskFunction(r),u=g-1;0<u;u-=2)for(6==u&&(u-=1);;){for(var f=0;f<2;f+=1)if(null==l[n][u-f]){var c=!1;i<t.length&&(c=1==(t[i]>>>o&1)),a(n,u-f)&&(c=!c),l[n][u-f]=c,-1==(o-=1)&&(i+=1,o=7)}if((n+=e)<0||g<=n){n-=e,e=-e;break}}},p=function(t,r,e){for(var n=C.getRSBlocks(t,r),o=B(),i=0;i<e.length;i+=1){var a=e[i];o.put(a.getMode(),4),o.put(a.getLength(),y.getLengthInBits(a.getMode(),t)),a.write(o)}var u=0;for(i=0;i<n.length;i+=1)u+=n[i].dataCount;if(o.getLengthInBits()>8*u)throw"code length overflow. ("+o.getLengthInBits()+">"+8*u+")";for(o.getLengthInBits()+4<=8*u&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=8*u||(o.put(236,8),o.getLengthInBits()>=8*u));)o.put(17,8);return function(t,r){for(var e=0,n=0,o=0,i=new Array(r.length),a=new Array(r.length),u=0;u<r.length;u+=1){var f=r[u].dataCount,c=r[u].totalCount-f;n=Math.max(n,f),o=Math.max(o,c),i[u]=new Array(f);for(var l=0;l<i[u].length;l+=1)i[u][l]=255&t.getBuffer()[l+e];e+=f;var g=y.getErrorCorrectPolynomial(c),s=m(i[u],g.getLength()-1).mod(g);for(a[u]=new Array(g.getLength()-1),l=0;l<a[u].length;l+=1){var h=l+s.getLength()-a[u].length;a[u][l]=0<=h?s.getAt(h):0}}var d=0;for(l=0;l<r.length;l+=1)d+=r[l].totalCount;var v=new Array(d),p=0;for(l=0;l<n;l+=1)for(u=0;u<r.length;u+=1)l<i[u].length&&(v[p]=i[u][l],p+=1);for(l=0;l<o;l+=1)for(u=0;u<r.length;u+=1)l<a[u].length&&(v[p]=a[u][l],p+=1);return v}(o,n)};return h.addData=function(t,r){var e=null;switch(r=r||"Byte"){case"Numeric":e=x(t);break;case"Alphanumeric":e=T(t);break;case"Byte":e=M(t);break;case"Kanji":e=A(t);break;default:throw"mode:"+r}c.push(e),n=null},h.isDark=function(t,r){if(t<0||g<=t||r<0||g<=r)throw t+","+r;return l[t][r]},h.getModuleCount=function(){return g},h.make=function(){if(u<1){for(var t=1;t<40;t++){for(var r=C.getRSBlocks(t,f),e=B(),n=0;n<c.length;n++){var o=c[n];e.put(o.getMode(),4),e.put(o.getLength(),y.getLengthInBits(o.getMode(),t)),o.write(e)}var i=0;for(n=0;n<r.length;n++)i+=r[n].dataCount;if(e.getLengthInBits()<=8*i)break}u=t}a(!1,function(){for(var t=0,r=0,e=0;e<8;e+=1){a(!0,e);var n=y.getLostPoint(h);(0==e||n<t)&&(t=n,r=e)}return r}())},h.createTableTag=function(t,r){t=t||2;var e="";e+='<table style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: "+(r=void 0===r?4*t:r)+"px;",e+='">',e+="<tbody>";for(var n=0;n<h.getModuleCount();n+=1){e+="<tr>";for(var o=0;o<h.getModuleCount();o+=1)e+='<td style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: 0px;",e+=" width: "+t+"px;",e+=" height: "+t+"px;",e+=" background-color: ",e+=h.isDark(n,o)?"#000000":"#ffffff",e+=";",e+='"/>';e+="</tr>"}return e+="</tbody>",e+="</table>"},h.createSvgTag=function(t,r){var e={};"object"==typeof t&&(t=(e=t).cellSize,r=e.margin),t=t||2,r=void 0===r?4*t:r;var n,o,i,a,u=h.getModuleCount()*t+2*r,f="";for(a="l"+t+",0 0,"+t+" -"+t+",0 0,-"+t+"z ",f+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',f+=e.scalable?"":' width="'+u+'px" height="'+u+'px"',f+=' viewBox="0 0 '+u+" "+u+'" ',f+=' preserveAspectRatio="xMinYMin meet">',f+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',f+='<path d="',o=0;o<h.getModuleCount();o+=1)for(i=o*t+r,n=0;n<h.getModuleCount();n+=1)h.isDark(o,n)&&(f+="M"+(n*t+r)+","+i+a);return f+='" stroke="transparent" fill="black"/>',f+="</svg>"},h.createDataURL=function(o,t){o=o||2,t=void 0===t?4*o:t;var r=h.getModuleCount()*o+2*t,i=t,a=r-t;return L(r,r,function(t,r){if(i<=t&&t<a&&i<=r&&r<a){var e=Math.floor((t-i)/o),n=Math.floor((r-i)/o);return h.isDark(n,e)?0:1}return 1})},h.createImgTag=function(t,r,e){t=t||2,r=void 0===r?4*t:r;var n=h.getModuleCount()*t+2*r,o="";return o+="<img",o+=' src="',o+=h.createDataURL(t,r),o+='"',o+=' width="',o+=n,o+='"',o+=' height="',o+=n,o+='"',e&&(o+=' alt="',o+=e,o+='"'),o+="/>"},h.createASCII=function(t,r){if((t=t||1)<2)return function(t){t=void 0===t?2:t;var r,e,n,o,i,a=1*h.getModuleCount()+2*t,u=t,f=a-t,c={"██":"█","█ ":"▀"," █":"▄"," ":" "},l={"██":"▀","█ ":"▀"," █":" "," ":" "},g="";for(r=0;r<a;r+=2){for(n=Math.floor((r-u)/1),o=Math.floor((r+1-u)/1),e=0;e<a;e+=1)i="█",u<=e&&e<f&&u<=r&&r<f&&h.isDark(n,Math.floor((e-u)/1))&&(i=" "),u<=e&&e<f&&u<=r+1&&r+1<f&&h.isDark(o,Math.floor((e-u)/1))?i+=" ":i+="█",g+=t<1&&f<=r+1?l[i]:c[i];g+="\n"}return a%2&&0<t?g.substring(0,g.length-a-1)+Array(1+a).join("▀"):g.substring(0,g.length-1)}(r);t-=1,r=void 0===r?2*t:r;var e,n,o,i,a=h.getModuleCount()*t+2*r,u=r,f=a-r,c=Array(t+1).join("██"),l=Array(t+1).join(" "),g="",s="";for(e=0;e<a;e+=1){for(o=Math.floor((e-u)/t),s="",n=0;n<a;n+=1)i=1,u<=n&&n<f&&u<=e&&e<f&&h.isDark(o,Math.floor((n-u)/t))&&(i=0),s+=i?c:l;for(o=0;o<t;o+=1)g+=s+"\n"}return g.substring(0,g.length-1)},h.renderTo2dContext=function(t,r){r=r||2;for(var e=h.getModuleCount(),n=0;n<e;n++)for(var o=0;o<e;o++)t.fillStyle=h.isDark(n,o)?"black":"white",t.fillRect(n*r,o*r,r,r)},h}i.stringToBytes=(i.stringToBytesFuncs={default:function(t){for(var r=[],e=0;e<t.length;e+=1){var n=t.charCodeAt(e);r.push(255&n)}return r}}).default,i.createStringToBytes=function(u,f){var i=function(){function t(){var t=r.read();if(-1==t)throw"eof";return t}for(var r=S(u),e=0,n={};;){var o=r.read();if(-1==o)break;var i=t(),a=t()<<8|t();n[String.fromCharCode(o<<8|i)]=a,e+=1}if(e!=f)throw e+" != "+f;return n}(),a="?".charCodeAt(0);return function(t){for(var r=[],e=0;e<t.length;e+=1){var n=t.charCodeAt(e);if(n<128)r.push(n);else{var o=i[t.charAt(e)];"number"==typeof o?(255&o)==o?r.push(o):(r.push(o>>>8),r.push(255&o)):r.push(a)}}return r}};var a=1,u=2,o=4,f=8,w={L:1,M:0,Q:3,H:2},n=0,c=1,l=2,g=3,s=4,h=5,d=6,v=7,y=function(){function e(t){for(var r=0;0!=t;)r+=1,t>>>=1;return r}var r=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t={};return t.getBCHTypeInfo=function(t){for(var r=t<<10;0<=e(r)-e(1335);)r^=1335<<e(r)-e(1335);return 21522^(t<<10|r)},t.getBCHTypeNumber=function(t){for(var r=t<<12;0<=e(r)-e(7973);)r^=7973<<e(r)-e(7973);return t<<12|r},t.getPatternPosition=function(t){return r[t-1]},t.getMaskFunction=function(t){switch(t){case n:return function(t,r){return(t+r)%2==0};case c:return function(t,r){return t%2==0};case l:return function(t,r){return r%3==0};case g:return function(t,r){return(t+r)%3==0};case s:return function(t,r){return(Math.floor(t/2)+Math.floor(r/3))%2==0};case h:return function(t,r){return t*r%2+t*r%3==0};case d:return function(t,r){return(t*r%2+t*r%3)%2==0};case v:return function(t,r){return(t*r%3+(t+r)%2)%2==0};default:throw"bad maskPattern:"+t}},t.getErrorCorrectPolynomial=function(t){for(var r=m([1],0),e=0;e<t;e+=1)r=r.multiply(m([1,p.gexp(e)],0));return r},t.getLengthInBits=function(t,r){if(1<=r&&r<10)switch(t){case a:return 10;case u:return 9;case o:case f:return 8;default:throw"mode:"+t}else if(r<27)switch(t){case a:return 12;case u:return 11;case o:return 16;case f:return 10;default:throw"mode:"+t}else{if(!(r<41))throw"type:"+r;switch(t){case a:return 14;case u:return 13;case o:return 16;case f:return 12;default:throw"mode:"+t}}},t.getLostPoint=function(t){for(var r=t.getModuleCount(),e=0,n=0;n<r;n+=1)for(var o=0;o<r;o+=1){for(var i=0,a=t.isDark(n,o),u=-1;u<=1;u+=1)if(!(n+u<0||r<=n+u))for(var f=-1;f<=1;f+=1)o+f<0||r<=o+f||0==u&&0==f||a==t.isDark(n+u,o+f)&&(i+=1);5<i&&(e+=3+i-5)}for(n=0;n<r-1;n+=1)for(o=0;o<r-1;o+=1){var c=0;t.isDark(n,o)&&(c+=1),t.isDark(n+1,o)&&(c+=1),t.isDark(n,o+1)&&(c+=1),t.isDark(n+1,o+1)&&(c+=1),0!=c&&4!=c||(e+=3)}for(n=0;n<r;n+=1)for(o=0;o<r-6;o+=1)t.isDark(n,o)&&!t.isDark(n,o+1)&&t.isDark(n,o+2)&&t.isDark(n,o+3)&&t.isDark(n,o+4)&&!t.isDark(n,o+5)&&t.isDark(n,o+6)&&(e+=40);for(o=0;o<r;o+=1)for(n=0;n<r-6;n+=1)t.isDark(n,o)&&!t.isDark(n+1,o)&&t.isDark(n+2,o)&&t.isDark(n+3,o)&&t.isDark(n+4,o)&&!t.isDark(n+5,o)&&t.isDark(n+6,o)&&(e+=40);var l=0;for(o=0;o<r;o+=1)for(n=0;n<r;n+=1)t.isDark(n,o)&&(l+=1);return e+=10*(Math.abs(100*l/r/r-50)/5)},t}(),p=function(){for(var r=new Array(256),e=new Array(256),t=0;t<8;t+=1)r[t]=1<<t;for(t=8;t<256;t+=1)r[t]=r[t-4]^r[t-5]^r[t-6]^r[t-8];for(t=0;t<255;t+=1)e[r[t]]=t;var n={glog:function(t){if(t<1)throw"glog("+t+")";return e[t]},gexp:function(t){for(;t<0;)t+=255;for(;256<=t;)t-=255;return r[t]}};return n}();function m(n,o){if(void 0===n.length)throw n.length+"/"+o;var r=function(){for(var t=0;t<n.length&&0==n[t];)t+=1;for(var r=new Array(n.length-t+o),e=0;e<n.length-t;e+=1)r[e]=n[e+t];return r}(),i={getAt:function(t){return r[t]},getLength:function(){return r.length},multiply:function(t){for(var r=new Array(i.getLength()+t.getLength()-1),e=0;e<i.getLength();e+=1)for(var n=0;n<t.getLength();n+=1)r[e+n]^=p.gexp(p.glog(i.getAt(e))+p.glog(t.getAt(n)));return m(r,0)},mod:function(t){if(i.getLength()-t.getLength()<0)return i;for(var r=p.glog(i.getAt(0))-p.glog(t.getAt(0)),e=new Array(i.getLength()),n=0;n<i.getLength();n+=1)e[n]=i.getAt(n);for(n=0;n<t.getLength();n+=1)e[n]^=p.gexp(p.glog(t.getAt(n))+r);return m(e,0).mod(t)}};return i}function b(){var e=[],o={writeByte:function(t){e.push(255&t)},writeShort:function(t){o.writeByte(t),o.writeByte(t>>>8)},writeBytes:function(t,r,e){r=r||0,e=e||t.length;for(var n=0;n<e;n+=1)o.writeByte(t[n+r])},writeString:function(t){for(var r=0;r<t.length;r+=1)o.writeByte(t.charCodeAt(r))},toByteArray:function(){return e},toString:function(){var t="";t+="[";for(var r=0;r<e.length;r+=1)0<r&&(t+=","),t+=e[r];return t+="]"}};return o}var k,t,C=(k=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],(t={}).getRSBlocks=function(t,r){var e=function(t,r){switch(r){case w.L:return k[4*(t-1)+0];case w.M:return k[4*(t-1)+1];case w.Q:return k[4*(t-1)+2];case w.H:return k[4*(t-1)+3];default:return}}(t,r);if(void 0===e)throw"bad rs block @ typeNumber:"+t+"/errorCorrectionLevel:"+r;for(var n,o,i=e.length/3,a=[],u=0;u<i;u+=1)for(var f=e[3*u+0],c=e[3*u+1],l=e[3*u+2],g=0;g<f;g+=1)a.push((n=l,o=void 0,(o={}).totalCount=c,o.dataCount=n,o));return a},t),B=function(){var e=[],n=0,o={getBuffer:function(){return e},getAt:function(t){var r=Math.floor(t/8);return 1==(e[r]>>>7-t%8&1)},put:function(t,r){for(var e=0;e<r;e+=1)o.putBit(1==(t>>>r-e-1&1))},getLengthInBits:function(){return n},putBit:function(t){var r=Math.floor(n/8);e.length<=r&&e.push(0),t&&(e[r]|=128>>>n%8),n+=1}};return o},x=function(t){var r=a,n=t,e={getMode:function(){return r},getLength:function(t){return n.length},write:function(t){for(var r=n,e=0;e+2<r.length;)t.put(o(r.substring(e,e+3)),10),e+=3;e<r.length&&(r.length-e==1?t.put(o(r.substring(e,e+1)),4):r.length-e==2&&t.put(o(r.substring(e,e+2)),7))}},o=function(t){for(var r=0,e=0;e<t.length;e+=1)r=10*r+i(t.charAt(e));return r},i=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);throw"illegal char :"+t};return e},T=function(t){var r=u,n=t,e={getMode:function(){return r},getLength:function(t){return n.length},write:function(t){for(var r=n,e=0;e+1<r.length;)t.put(45*o(r.charAt(e))+o(r.charAt(e+1)),11),e+=2;e<r.length&&t.put(o(r.charAt(e)),6)}},o=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);if("A"<=t&&t<="Z")return t.charCodeAt(0)-"A".charCodeAt(0)+10;switch(t){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+t}};return e},M=function(t){var r=o,e=i.stringToBytes(t),n={getMode:function(){return r},getLength:function(t){return e.length},write:function(t){for(var r=0;r<e.length;r+=1)t.put(e[r],8)}};return n},A=function(t){var r=f,n=i.stringToBytesFuncs.SJIS;if(!n)throw"sjis not supported.";!function(t,r){var e=n("友");if(2!=e.length||38726!=(e[0]<<8|e[1]))throw"sjis not supported."}();var o=n(t),e={getMode:function(){return r},getLength:function(t){return~~(o.length/2)},write:function(t){for(var r=o,e=0;e+1<r.length;){var n=(255&r[e])<<8|255&r[e+1];if(33088<=n&&n<=40956)n-=33088;else{if(!(57408<=n&&n<=60351))throw"illegal char at "+(e+1)+"/"+n;n-=49472}n=192*(n>>>8&255)+(255&n),t.put(n,13),e+=2}if(e<r.length)throw"illegal char at "+(e+1)}};return e},S=function(t){var e=t,n=0,o=0,i=0,r={read:function(){for(;i<8;){if(n>=e.length){if(0==i)return-1;throw"unexpected end of file./"+i}var t=e.charAt(n);if(n+=1,"="==t)return i=0,-1;t.match(/^\s$/)||(o=o<<6|a(t.charCodeAt(0)),i+=6)}var r=o>>>i-8&255;return i-=8,r}},a=function(t){if(65<=t&&t<=90)return t-65;if(97<=t&&t<=122)return t-97+26;if(48<=t&&t<=57)return t-48+52;if(43==t)return 62;if(47==t)return 63;throw"c:"+t};return r},L=function(t,r,e){for(var n=function(t,r){var n=t,o=r,g=new Array(t*r),e={setPixel:function(t,r,e){g[r*n+t]=e},write:function(t){t.writeString("GIF87a"),t.writeShort(n),t.writeShort(o),t.writeByte(128),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(255),t.writeByte(255),t.writeByte(255),t.writeString(","),t.writeShort(0),t.writeShort(0),t.writeShort(n),t.writeShort(o),t.writeByte(0);var r=i(2);t.writeByte(2);for(var e=0;255<r.length-e;)t.writeByte(255),t.writeBytes(r,e,255),e+=255;t.writeByte(r.length-e),t.writeBytes(r,e,r.length-e),t.writeByte(0),t.writeString(";")}},i=function(t){for(var r=1<<t,e=1+(1<<t),n=t+1,o=s(),i=0;i<r;i+=1)o.add(String.fromCharCode(i));o.add(String.fromCharCode(r)),o.add(String.fromCharCode(e));var a=b(),u=function(t){var e=t,n=0,o=0,r={write:function(t,r){if(t>>>r!=0)throw"length over";for(;8<=n+r;)e.writeByte(255&(t<<n|o)),r-=8-n,t>>>=8-n,n=o=0;o|=t<<n,n+=r},flush:function(){0<n&&e.writeByte(o)}};return r}(a);u.write(r,n);var f=0,c=String.fromCharCode(g[f]);for(f+=1;f<g.length;){var l=String.fromCharCode(g[f]);f+=1,o.contains(c+l)?c+=l:(u.write(o.indexOf(c),n),o.size()<4095&&(o.size()==1<<n&&(n+=1),o.add(c+l)),c=l)}return u.write(o.indexOf(c),n),u.write(e,n),u.flush(),a.toByteArray()},s=function(){var r={},e=0,n={add:function(t){if(n.contains(t))throw"dup key:"+t;r[t]=e,e+=1},size:function(){return e},indexOf:function(t){return r[t]},contains:function(t){return void 0!==r[t]}};return n};return e}(t,r),o=0;o<r;o+=1)for(var i=0;i<t;i+=1)n.setPixel(i,o,e(i,o));var a=b();n.write(a);for(var u=function(){function e(t){a+=String.fromCharCode(r(63&t))}var n=0,o=0,i=0,a="",t={},r=function(t){if(t<0);else{if(t<26)return 65+t;if(t<52)return t-26+97;if(t<62)return t-52+48;if(62==t)return 43;if(63==t)return 47}throw"n:"+t};return t.writeByte=function(t){for(n=n<<8|255&t,o+=8,i+=1;6<=o;)e(n>>>o-6),o-=6},t.flush=function(){if(0<o&&(e(n<<6-o),o=n=0),i%3!=0)for(var t=3-i%3,r=0;r<t;r+=1)a+="="},t.toString=function(){return a},t}(),f=a.toByteArray(),c=0;c<f.length;c+=1)u.writeByte(f[c]);return u.flush(),"data:image/gif;base64,"+u};return i}();a.stringToBytesFuncs["UTF-8"]=function(t){return function(t){for(var r=[],e=0;e<t.length;e++){var n=t.charCodeAt(e);n<128?r.push(n):n<2048?r.push(192|n>>6,128|63&n):n<55296||57344<=n?r.push(224|n>>12,128|n>>6&63,128|63&n):(e++,n=65536+((1023&n)<<10|1023&t.charCodeAt(e)),r.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return r}(t)},o=[],void 0===(i="function"==typeof(n=function(){return a})?n.apply(r,o):n)||(t.exports=i)}])});
1
+ /*! jquery-qrcode v0.14.0 - https://larsjung.de/jquery-qrcode/ */
2
+ !function(r){"use strict";function t(t,e,n,o){function a(r,t){return r-=o,t-=o,0>r||r>=c||0>t||t>=c?!1:f.isDark(r,t)}function i(r,t,e,n){var o=u.isDark,a=1/l;u.isDark=function(i,u){var f=u*a,c=i*a,l=f+a,g=c+a;return o(i,u)&&(r>l||f>e||t>g||c>n)}}var u={},f=r(n,e);f.addData(t),f.make(),o=o||0;var c=f.getModuleCount(),l=f.getModuleCount()+2*o;return u.text=t,u.level=e,u.version=n,u.moduleCount=l,u.isDark=a,u.addBlank=i,u}function e(r,e,n,o,a){n=Math.max(1,n||1),o=Math.min(40,o||40);for(var i=n;o>=i;i+=1)try{return t(r,e,i,a)}catch(u){}}function n(r,t,e){var n=e.size,o="bold "+e.mSize*n+"px "+e.fontname,a=w("<canvas/>")[0].getContext("2d");a.font=o;var i=a.measureText(e.label).width,u=e.mSize,f=i/n,c=(1-f)*e.mPosX,l=(1-u)*e.mPosY,g=c+f,s=l+u,v=.01;1===e.mode?r.addBlank(0,l-v,n,s+v):r.addBlank(c-v,l-v,g+v,s+v),t.fillStyle=e.fontcolor,t.font=o,t.fillText(e.label,c*n,l*n+.75*e.mSize*n)}function o(r,t,e){var n=e.size,o=e.image.naturalWidth||1,a=e.image.naturalHeight||1,i=e.mSize,u=i*o/a,f=(1-u)*e.mPosX,c=(1-i)*e.mPosY,l=f+u,g=c+i,s=.01;3===e.mode?r.addBlank(0,c-s,n,g+s):r.addBlank(f-s,c-s,l+s,g+s),t.drawImage(e.image,f*n,c*n,u*n,i*n)}function a(r,t,e){w(e.background).is("img")?t.drawImage(e.background,0,0,e.size,e.size):e.background&&(t.fillStyle=e.background,t.fillRect(e.left,e.top,e.size,e.size));var a=e.mode;1===a||2===a?n(r,t,e):(3===a||4===a)&&o(r,t,e)}function i(r,t,e,n,o,a,i,u){r.isDark(i,u)&&t.rect(n,o,a,a)}function u(r,t,e,n,o,a,i,u,f,c){i?r.moveTo(t+a,e):r.moveTo(t,e),u?(r.lineTo(n-a,e),r.arcTo(n,e,n,o,a)):r.lineTo(n,e),f?(r.lineTo(n,o-a),r.arcTo(n,o,t,o,a)):r.lineTo(n,o),c?(r.lineTo(t+a,o),r.arcTo(t,o,t,e,a)):r.lineTo(t,o),i?(r.lineTo(t,e+a),r.arcTo(t,e,n,e,a)):r.lineTo(t,e)}function f(r,t,e,n,o,a,i,u,f,c){i&&(r.moveTo(t+a,e),r.lineTo(t,e),r.lineTo(t,e+a),r.arcTo(t,e,t+a,e,a)),u&&(r.moveTo(n-a,e),r.lineTo(n,e),r.lineTo(n,e+a),r.arcTo(n,e,n-a,e,a)),f&&(r.moveTo(n-a,o),r.lineTo(n,o),r.lineTo(n,o-a),r.arcTo(n,o,n-a,o,a)),c&&(r.moveTo(t+a,o),r.lineTo(t,o),r.lineTo(t,o-a),r.arcTo(t,o,t+a,o,a))}function c(r,t,e,n,o,a,i,c){var l=r.isDark,g=n+a,s=o+a,v=e.radius*a,h=i-1,d=i+1,w=c-1,m=c+1,y=l(i,c),T=l(h,w),p=l(h,c),B=l(h,m),A=l(i,m),E=l(d,m),k=l(d,c),M=l(d,w),C=l(i,w);y?u(t,n,o,g,s,v,!p&&!C,!p&&!A,!k&&!A,!k&&!C):f(t,n,o,g,s,v,p&&C&&T,p&&A&&B,k&&A&&E,k&&C&&M)}function l(r,t,e){var n,o,a=r.moduleCount,u=e.size/a,f=i;for(e.radius>0&&e.radius<=.5&&(f=c),t.beginPath(),n=0;a>n;n+=1)for(o=0;a>o;o+=1){var l=e.left+o*u,g=e.top+n*u,s=u;f(r,t,e,l,g,s,n,o)}if(w(e.fill).is("img")){t.strokeStyle="rgba(0,0,0,0.5)",t.lineWidth=2,t.stroke();var v=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",t.fill(),t.globalCompositeOperation=v,t.clip(),t.drawImage(e.fill,0,0,e.size,e.size),t.restore()}else t.fillStyle=e.fill,t.fill()}function g(r,t){var n=e(t.text,t.ecLevel,t.minVersion,t.maxVersion,t.quiet);if(!n)return null;var o=w(r).data("qrcode",n),i=o[0].getContext("2d");return a(n,i,t),l(n,i,t),o}function s(r){var t=w("<canvas/>").attr("width",r.size).attr("height",r.size);return g(t,r)}function v(r){return w("<img/>").attr("src",s(r)[0].toDataURL("image/png"))}function h(r){var t=e(r.text,r.ecLevel,r.minVersion,r.maxVersion,r.quiet);if(!t)return null;var n,o,a=r.size,i=r.background,u=Math.floor,f=t.moduleCount,c=u(a/f),l=u(.5*(a-c*f)),g={position:"relative",left:0,top:0,padding:0,margin:0,width:a,height:a},s={position:"absolute",padding:0,margin:0,width:c,height:c,"background-color":r.fill},v=w("<div/>").data("qrcode",t).css(g);for(i&&v.css("background-color",i),n=0;f>n;n+=1)for(o=0;f>o;o+=1)t.isDark(n,o)&&w("<div/>").css(s).css({left:l+o*c,top:l+n*c}).appendTo(v);return v}function d(r){return m&&"canvas"===r.render?s(r):m&&"image"===r.render?v(r):h(r)}var w=window.jQuery,m=function(){var r=document.createElement("canvas");return!(!r.getContext||!r.getContext("2d"))}(),y={render:"canvas",minVersion:1,maxVersion:40,ecLevel:"L",left:0,top:0,size:200,fill:"#000",background:null,text:"no text",radius:0,quiet:0,mode:0,mSize:.1,mPosX:.5,mPosY:.5,label:"no label",fontname:"sans",fontcolor:"#000",image:null};w.fn.qrcode=function(r){var t=w.extend({},y,r);return this.each(function(r,e){"canvas"===e.nodeName.toLowerCase()?g(e,t):w(e).append(d(t))})}}(function(){var r=function(){function r(t,e){if("undefined"==typeof t.length)throw new Error(t.length+"/"+e);var n=function(){for(var r=0;r<t.length&&0==t[r];)r+=1;for(var n=new Array(t.length-r+e),o=0;o<t.length-r;o+=1)n[o]=t[o+r];return n}(),o={};return o.getAt=function(r){return n[r]},o.getLength=function(){return n.length},o.multiply=function(t){for(var e=new Array(o.getLength()+t.getLength()-1),n=0;n<o.getLength();n+=1)for(var a=0;a<t.getLength();a+=1)e[n+a]^=i.gexp(i.glog(o.getAt(n))+i.glog(t.getAt(a)));return r(e,0)},o.mod=function(t){if(o.getLength()-t.getLength()<0)return o;for(var e=i.glog(o.getAt(0))-i.glog(t.getAt(0)),n=new Array(o.getLength()),a=0;a<o.getLength();a+=1)n[a]=o.getAt(a);for(var a=0;a<t.getLength();a+=1)n[a]^=i.gexp(i.glog(t.getAt(a))+e);return r(n,0).mod(t)},o}var t=function(t,e){var o=236,i=17,l=t,g=n[e],s=null,v=0,d=null,w=new Array,m={},y=function(r,t){v=4*l+17,s=function(r){for(var t=new Array(r),e=0;r>e;e+=1){t[e]=new Array(r);for(var n=0;r>n;n+=1)t[e][n]=null}return t}(v),T(0,0),T(v-7,0),T(0,v-7),A(),B(),k(r,t),l>=7&&E(r),null==d&&(d=D(l,g,w)),M(d,t)},T=function(r,t){for(var e=-1;7>=e;e+=1)if(!(-1>=r+e||r+e>=v))for(var n=-1;7>=n;n+=1)-1>=t+n||t+n>=v||(e>=0&&6>=e&&(0==n||6==n)||n>=0&&6>=n&&(0==e||6==e)||e>=2&&4>=e&&n>=2&&4>=n?s[r+e][t+n]=!0:s[r+e][t+n]=!1)},p=function(){for(var r=0,t=0,e=0;8>e;e+=1){y(!0,e);var n=a.getLostPoint(m);(0==e||r>n)&&(r=n,t=e)}return t},B=function(){for(var r=8;v-8>r;r+=1)null==s[r][6]&&(s[r][6]=r%2==0);for(var t=8;v-8>t;t+=1)null==s[6][t]&&(s[6][t]=t%2==0)},A=function(){for(var r=a.getPatternPosition(l),t=0;t<r.length;t+=1)for(var e=0;e<r.length;e+=1){var n=r[t],o=r[e];if(null==s[n][o])for(var i=-2;2>=i;i+=1)for(var u=-2;2>=u;u+=1)-2==i||2==i||-2==u||2==u||0==i&&0==u?s[n+i][o+u]=!0:s[n+i][o+u]=!1}},E=function(r){for(var t=a.getBCHTypeNumber(l),e=0;18>e;e+=1){var n=!r&&1==(t>>e&1);s[Math.floor(e/3)][e%3+v-8-3]=n}for(var e=0;18>e;e+=1){var n=!r&&1==(t>>e&1);s[e%3+v-8-3][Math.floor(e/3)]=n}},k=function(r,t){for(var e=g<<3|t,n=a.getBCHTypeInfo(e),o=0;15>o;o+=1){var i=!r&&1==(n>>o&1);6>o?s[o][8]=i:8>o?s[o+1][8]=i:s[v-15+o][8]=i}for(var o=0;15>o;o+=1){var i=!r&&1==(n>>o&1);8>o?s[8][v-o-1]=i:9>o?s[8][15-o-1+1]=i:s[8][15-o-1]=i}s[v-8][8]=!r},M=function(r,t){for(var e=-1,n=v-1,o=7,i=0,u=a.getMaskFunction(t),f=v-1;f>0;f-=2)for(6==f&&(f-=1);;){for(var c=0;2>c;c+=1)if(null==s[n][f-c]){var l=!1;i<r.length&&(l=1==(r[i]>>>o&1));var g=u(n,f-c);g&&(l=!l),s[n][f-c]=l,o-=1,-1==o&&(i+=1,o=7)}if(n+=e,0>n||n>=v){n-=e,e=-e;break}}},C=function(t,e){for(var n=0,o=0,i=0,u=new Array(e.length),f=new Array(e.length),c=0;c<e.length;c+=1){var l=e[c].dataCount,g=e[c].totalCount-l;o=Math.max(o,l),i=Math.max(i,g),u[c]=new Array(l);for(var s=0;s<u[c].length;s+=1)u[c][s]=255&t.getBuffer()[s+n];n+=l;var v=a.getErrorCorrectPolynomial(g),h=r(u[c],v.getLength()-1),d=h.mod(v);f[c]=new Array(v.getLength()-1);for(var s=0;s<f[c].length;s+=1){var w=s+d.getLength()-f[c].length;f[c][s]=w>=0?d.getAt(w):0}}for(var m=0,s=0;s<e.length;s+=1)m+=e[s].totalCount;for(var y=new Array(m),T=0,s=0;o>s;s+=1)for(var c=0;c<e.length;c+=1)s<u[c].length&&(y[T]=u[c][s],T+=1);for(var s=0;i>s;s+=1)for(var c=0;c<e.length;c+=1)s<f[c].length&&(y[T]=f[c][s],T+=1);return y},D=function(r,t,e){for(var n=u.getRSBlocks(r,t),c=f(),l=0;l<e.length;l+=1){var g=e[l];c.put(g.getMode(),4),c.put(g.getLength(),a.getLengthInBits(g.getMode(),r)),g.write(c)}for(var s=0,l=0;l<n.length;l+=1)s+=n[l].dataCount;if(c.getLengthInBits()>8*s)throw new Error("code length overflow. ("+c.getLengthInBits()+">"+8*s+")");for(c.getLengthInBits()+4<=8*s&&c.put(0,4);c.getLengthInBits()%8!=0;)c.putBit(!1);for(;;){if(c.getLengthInBits()>=8*s)break;if(c.put(o,8),c.getLengthInBits()>=8*s)break;c.put(i,8)}return C(c,n)};return m.addData=function(r){var t=c(r);w.push(t),d=null},m.isDark=function(r,t){if(0>r||r>=v||0>t||t>=v)throw new Error(r+","+t);return s[r][t]},m.getModuleCount=function(){return v},m.make=function(){y(!1,p())},m.createTableTag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e="";e+='<table style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: "+t+"px;",e+='">',e+="<tbody>";for(var n=0;n<m.getModuleCount();n+=1){e+="<tr>";for(var o=0;o<m.getModuleCount();o+=1)e+='<td style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: 0px;",e+=" width: "+r+"px;",e+=" height: "+r+"px;",e+=" background-color: ",e+=m.isDark(n,o)?"#000000":"#ffffff",e+=";",e+='"/>';e+="</tr>"}return e+="</tbody>",e+="</table>"},m.createImgTag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e=m.getModuleCount()*r+2*t,n=t,o=e-t;return h(e,e,function(t,e){if(t>=n&&o>t&&e>=n&&o>e){var a=Math.floor((t-n)/r),i=Math.floor((e-n)/r);return m.isDark(i,a)?0:1}return 1})},m};t.stringToBytes=function(r){for(var t=new Array,e=0;e<r.length;e+=1){var n=r.charCodeAt(e);t.push(255&n)}return t},t.createStringToBytes=function(r,t){var e=function(){for(var e=s(r),n=function(){var r=e.read();if(-1==r)throw new Error;return r},o=0,a={};;){var i=e.read();if(-1==i)break;var u=n(),f=n(),c=n(),l=String.fromCharCode(i<<8|u),g=f<<8|c;a[l]=g,o+=1}if(o!=t)throw new Error(o+" != "+t);return a}(),n="?".charCodeAt(0);return function(r){for(var t=new Array,o=0;o<r.length;o+=1){var a=r.charCodeAt(o);if(128>a)t.push(a);else{var i=e[r.charAt(o)];"number"==typeof i?(255&i)==i?t.push(i):(t.push(i>>>8),t.push(255&i)):t.push(n)}}return t}};var e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},n={L:1,M:0,Q:3,H:2},o={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},a=function(){var t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],n=1335,a=7973,u=21522,f={},c=function(r){for(var t=0;0!=r;)t+=1,r>>>=1;return t};return f.getBCHTypeInfo=function(r){for(var t=r<<10;c(t)-c(n)>=0;)t^=n<<c(t)-c(n);return(r<<10|t)^u},f.getBCHTypeNumber=function(r){for(var t=r<<12;c(t)-c(a)>=0;)t^=a<<c(t)-c(a);return r<<12|t},f.getPatternPosition=function(r){return t[r-1]},f.getMaskFunction=function(r){switch(r){case o.PATTERN000:return function(r,t){return(r+t)%2==0};case o.PATTERN001:return function(r,t){return r%2==0};case o.PATTERN010:return function(r,t){return t%3==0};case o.PATTERN011:return function(r,t){return(r+t)%3==0};case o.PATTERN100:return function(r,t){return(Math.floor(r/2)+Math.floor(t/3))%2==0};case o.PATTERN101:return function(r,t){return r*t%2+r*t%3==0};case o.PATTERN110:return function(r,t){return(r*t%2+r*t%3)%2==0};case o.PATTERN111:return function(r,t){return(r*t%3+(r+t)%2)%2==0};default:throw new Error("bad maskPattern:"+r)}},f.getErrorCorrectPolynomial=function(t){for(var e=r([1],0),n=0;t>n;n+=1)e=e.multiply(r([1,i.gexp(n)],0));return e},f.getLengthInBits=function(r,t){if(t>=1&&10>t)switch(r){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw new Error("mode:"+r)}else if(27>t)switch(r){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw new Error("mode:"+r)}else{if(!(41>t))throw new Error("type:"+t);switch(r){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw new Error("mode:"+r)}}},f.getLostPoint=function(r){for(var t=r.getModuleCount(),e=0,n=0;t>n;n+=1)for(var o=0;t>o;o+=1){for(var a=0,i=r.isDark(n,o),u=-1;1>=u;u+=1)if(!(0>n+u||n+u>=t))for(var f=-1;1>=f;f+=1)0>o+f||o+f>=t||(0!=u||0!=f)&&i==r.isDark(n+u,o+f)&&(a+=1);a>5&&(e+=3+a-5)}for(var n=0;t-1>n;n+=1)for(var o=0;t-1>o;o+=1){var c=0;r.isDark(n,o)&&(c+=1),r.isDark(n+1,o)&&(c+=1),r.isDark(n,o+1)&&(c+=1),r.isDark(n+1,o+1)&&(c+=1),(0==c||4==c)&&(e+=3)}for(var n=0;t>n;n+=1)for(var o=0;t-6>o;o+=1)r.isDark(n,o)&&!r.isDark(n,o+1)&&r.isDark(n,o+2)&&r.isDark(n,o+3)&&r.isDark(n,o+4)&&!r.isDark(n,o+5)&&r.isDark(n,o+6)&&(e+=40);for(var o=0;t>o;o+=1)for(var n=0;t-6>n;n+=1)r.isDark(n,o)&&!r.isDark(n+1,o)&&r.isDark(n+2,o)&&r.isDark(n+3,o)&&r.isDark(n+4,o)&&!r.isDark(n+5,o)&&r.isDark(n+6,o)&&(e+=40);for(var l=0,o=0;t>o;o+=1)for(var n=0;t>n;n+=1)r.isDark(n,o)&&(l+=1);var g=Math.abs(100*l/t/t-50)/5;return e+=10*g},f}(),i=function(){for(var r=new Array(256),t=new Array(256),e=0;8>e;e+=1)r[e]=1<<e;for(var e=8;256>e;e+=1)r[e]=r[e-4]^r[e-5]^r[e-6]^r[e-8];for(var e=0;255>e;e+=1)t[r[e]]=e;var n={};return n.glog=function(r){if(1>r)throw new Error("glog("+r+")");return t[r]},n.gexp=function(t){for(;0>t;)t+=255;for(;t>=256;)t-=255;return r[t]},n}(),u=function(){var r=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(r,t){var e={};return e.totalCount=r,e.dataCount=t,e},e={},o=function(t,e){switch(e){case n.L:return r[4*(t-1)+0];case n.M:return r[4*(t-1)+1];case n.Q:return r[4*(t-1)+2];case n.H:return r[4*(t-1)+3];default:return}};return e.getRSBlocks=function(r,e){var n=o(r,e);if("undefined"==typeof n)throw new Error("bad rs block @ typeNumber:"+r+"/errorCorrectLevel:"+e);for(var a=n.length/3,i=new Array,u=0;a>u;u+=1)for(var f=n[3*u+0],c=n[3*u+1],l=n[3*u+2],g=0;f>g;g+=1)i.push(t(c,l));return i},e}(),f=function(){var r=new Array,t=0,e={};return e.getBuffer=function(){return r},e.getAt=function(t){var e=Math.floor(t/8);return 1==(r[e]>>>7-t%8&1)},e.put=function(r,t){for(var n=0;t>n;n+=1)e.putBit(1==(r>>>t-n-1&1))},e.getLengthInBits=function(){return t},e.putBit=function(e){var n=Math.floor(t/8);r.length<=n&&r.push(0),e&&(r[n]|=128>>>t%8),t+=1},e},c=function(r){var n=e.MODE_8BIT_BYTE,o=t.stringToBytes(r),a={};return a.getMode=function(){return n},a.getLength=function(r){return o.length},a.write=function(r){for(var t=0;t<o.length;t+=1)r.put(o[t],8)},a},l=function(){var r=new Array,t={};return t.writeByte=function(t){r.push(255&t)},t.writeShort=function(r){t.writeByte(r),t.writeByte(r>>>8)},t.writeBytes=function(r,e,n){e=e||0,n=n||r.length;for(var o=0;n>o;o+=1)t.writeByte(r[o+e])},t.writeString=function(r){for(var e=0;e<r.length;e+=1)t.writeByte(r.charCodeAt(e))},t.toByteArray=function(){return r},t.toString=function(){var t="";t+="[";for(var e=0;e<r.length;e+=1)e>0&&(t+=","),t+=r[e];return t+="]"},t},g=function(){var r=0,t=0,e=0,n="",o={},a=function(r){n+=String.fromCharCode(i(63&r))},i=function(r){if(0>r);else{if(26>r)return 65+r;if(52>r)return 97+(r-26);if(62>r)return 48+(r-52);if(62==r)return 43;if(63==r)return 47}throw new Error("n:"+r)};return o.writeByte=function(n){for(r=r<<8|255&n,t+=8,e+=1;t>=6;)a(r>>>t-6),t-=6},o.flush=function(){if(t>0&&(a(r<<6-t),r=0,t=0),e%3!=0)for(var o=3-e%3,i=0;o>i;i+=1)n+="="},o.toString=function(){return n},o},s=function(r){var t=r,e=0,n=0,o=0,a={};a.read=function(){for(;8>o;){if(e>=t.length){if(0==o)return-1;throw new Error("unexpected end of file./"+o)}var r=t.charAt(e);if(e+=1,"="==r)return o=0,-1;r.match(/^\s$/)||(n=n<<6|i(r.charCodeAt(0)),o+=6)}var a=n>>>o-8&255;return o-=8,a};var i=function(r){if(r>=65&&90>=r)return r-65;if(r>=97&&122>=r)return r-97+26;if(r>=48&&57>=r)return r-48+52;if(43==r)return 62;if(47==r)return 63;throw new Error("c:"+r)};return a},v=function(r,t){var e=r,n=t,o=new Array(r*t),a={};a.setPixel=function(r,t,n){o[t*e+r]=n},a.write=function(r){r.writeString("GIF87a"),r.writeShort(e),r.writeShort(n),r.writeByte(128),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(255),r.writeByte(255),r.writeByte(255),r.writeString(","),r.writeShort(0),r.writeShort(0),r.writeShort(e),r.writeShort(n),r.writeByte(0);var t=2,o=u(t);r.writeByte(t);for(var a=0;o.length-a>255;)r.writeByte(255),r.writeBytes(o,a,255),a+=255;r.writeByte(o.length-a),r.writeBytes(o,a,o.length-a),r.writeByte(0),r.writeString(";")};var i=function(r){var t=r,e=0,n=0,o={};return o.write=function(r,o){if(r>>>o!=0)throw new Error("length over");for(;e+o>=8;)t.writeByte(255&(r<<e|n)),o-=8-e,r>>>=8-e,n=0,e=0;n=r<<e|n,e+=o},o.flush=function(){e>0&&t.writeByte(n)},o},u=function(r){for(var t=1<<r,e=(1<<r)+1,n=r+1,a=f(),u=0;t>u;u+=1)a.add(String.fromCharCode(u));a.add(String.fromCharCode(t)),a.add(String.fromCharCode(e));var c=l(),g=i(c);g.write(t,n);var s=0,v=String.fromCharCode(o[s]);for(s+=1;s<o.length;){var h=String.fromCharCode(o[s]);s+=1,a.contains(v+h)?v+=h:(g.write(a.indexOf(v),n),a.size()<4095&&(a.size()==1<<n&&(n+=1),a.add(v+h)),v=h)}return g.write(a.indexOf(v),n),g.write(e,n),g.flush(),c.toByteArray()},f=function(){var r={},t=0,e={};return e.add=function(n){if(e.contains(n))throw new Error("dup key:"+n);r[n]=t,t+=1},e.size=function(){return t},e.indexOf=function(t){return r[t]},e.contains=function(t){return"undefined"!=typeof r[t]},e};return a},h=function(r,t,e,n){for(var o=v(r,t),a=0;t>a;a+=1)for(var i=0;r>i;i+=1)o.setPixel(i,a,e(i,a));var u=l();o.write(u);for(var f=g(),c=u.toByteArray(),s=0;s<c.length;s+=1)f.writeByte(c[s]);f.flush();var h="";return h+="<img",h+=' src="',h+="data:image/gif;base64,",h+=f,h+='"',h+=' width="',h+=r,h+='"',h+=' height="',h+=t,h+='"',n&&(h+=' alt="',h+=n,h+='"'),h+="/>"};return t}();return function(r){"function"==typeof define&&define.amd?define([],r):"object"==typeof exports&&(module.exports=r())}(function(){return r}),!function(r){r.stringToBytes=function(r){function t(r){for(var t=[],e=0;e<r.length;e++){var n=r.charCodeAt(e);128>n?t.push(n):2048>n?t.push(192|n>>6,128|63&n):55296>n||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(e++,n=65536+((1023&n)<<10|1023&r.charCodeAt(e)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}return t(r)}}(r),r}());
includes/js/pointers.js ADDED
@@ -0,0 +1,534 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function($, MAP) {
2
+
3
+ $(document).on( 'MOAdminPointers.setup_done', function( e, data ) {
4
+ e.stopImmediatePropagation();
5
+ MAP.setPlugin( data ); // open first popup
6
+ // var data1={
7
+ // 'action' : 'mo_wpns_tour',
8
+ // 'call_type' : 'mo2f_close_tour_details',
9
+ // 'page' : data.where
10
+ // };
11
+ // jQuery.post(ajaxurl, data1, function(response){
12
+ // });
13
+
14
+
15
+ } );
16
+
17
+ $(document).on( 'MOAdminPointers.current_ready', function( e ) {
18
+ e.stopImmediatePropagation();
19
+ MAP.openPointer(); // open a popup
20
+ } );
21
+
22
+
23
+ MAP.js_pointers = {}; // contain js-parsed pointer objects
24
+ MAP.first_pointer = false; // contain first pointer anchor jQuery object
25
+ MAP.current_pointer = false; // contain current pointer jQuery object
26
+ MAP.last_pointer = false; // contain last pointer jQuery object
27
+ MAP.visible_pointers = []; // contain ids of pointers whose anchors are visible
28
+
29
+ MAP.hasNext = function( data ) { // check if a given pointer has valid next property
30
+ return typeof data.next === 'string'
31
+ && data.next !== ''
32
+ && typeof MAP.js_pointers[data.next].data !== 'undefined'
33
+ && typeof MAP.js_pointers[data.next].data.id === 'string';
34
+ };
35
+
36
+ MAP.isVisible = function( data ) { // check if anchor for given pointer is visible
37
+ return $.inArray( data.id, MAP.visible_pointers ) !== -1;
38
+ };
39
+
40
+ // given a pointer object, return its the anchor jQuery object if available
41
+ // otherwise return first available, lookin at next property of subsequent pointers
42
+ MAP.getPointerData = function( data ) {
43
+
44
+ var $target = $( data.anchor_id );
45
+ if ( $.inArray(data.id, MAP.visible_pointers) !== -1 ) {
46
+ return { target: $target, data: data };
47
+ }
48
+ $target = false;
49
+
50
+ while( MAP.hasNext( data ) && ! MAP.isVisible( data ) ) {
51
+ data = MAP.js_pointers[data.next].data;
52
+ if ( MAP.isVisible( data ) ) {
53
+ $target = $(data.anchor_id);
54
+ }
55
+ }
56
+ return MAP.isVisible( data )
57
+ ? { target: $target, data: data }
58
+ : { target: false, data: false };
59
+ };
60
+
61
+ // take pointer data and setup pointer plugin for anchor element
62
+ MAP.setPlugin = function( data ) {
63
+
64
+
65
+ if(data.anchor_id !='#mo2f_save_free_plan_auth_methods_form' && data.anchor_id != '#GoogleAuthenticator_configuration')
66
+ {
67
+ jQuery('#miniOrangeQRCodeAuthentication_thumbnail_2_factor').css('opacity',0.2);
68
+ jQuery('#SecurityQuestions_thumbnail_2_factor').css('opacity',0.2);
69
+ jQuery('#miniOrangeSoftToken_thumbnail_2_factor').css('opacity',0.2);
70
+ jQuery('#miniOrangePushNotification_thumbnail_2_factor').css('opacity',0.2);
71
+ jQuery('#GoogleAuthenticator_thumbnail_2_factor').css('opacity',0.2);
72
+ jQuery('#OTPOverSMS_thumbnail_2_factor').css('opacity',0.2);
73
+ jQuery('#OTPOverEmail_thumbnail_2_factor').css('opacity',0.2);
74
+ }
75
+ else if (data.anchor_id == '#mo2f_choose_app_tour')
76
+ {
77
+ jQuery('input[type=radio][name=authy]').click(function(){
78
+ document.getElementById("mo2f_current_totp").value = "aa";
79
+ delete MAP.visible_pointers[2];
80
+
81
+ });
82
+ jQuery('input[type=radio][name=lastpass]').click(function(){
83
+ MAP.visible_pointers.push('custom_admin_pointers4_8_52_default-miniorange-2fa-choose_name_on_app');
84
+ document.getElementById("mo2f_current_totp").value = "lpa";
85
+ });
86
+ jQuery('input[type=radio][name=google]').click(function(){
87
+ document.getElementById("mo2f_current_totp").value = "ga";
88
+ MAP.visible_pointers.push('custom_admin_pointers4_8_52_default-miniorange-2fa-choose_name_on_app');
89
+ });
90
+ }
91
+ else if(data.anchor_id == "#GoogleAuthenticator_configuration")
92
+ {
93
+ jQuery('#miniOrangeQRCodeAuthentication_thumbnail_2_factor').css('opacity',0.2);
94
+ jQuery('#SecurityQuestions_thumbnail_2_factor').css('opacity',0.2);
95
+ jQuery('#miniOrangeSoftToken_thumbnail_2_factor').css('opacity',0.2);
96
+ jQuery('#miniOrangePushNotification_thumbnail_2_factor').css('opacity',0.2);
97
+ jQuery('#OTPOverSMS_thumbnail_2_factor').css('opacity',0.2);
98
+ jQuery('#OTPOverEmail_thumbnail_2_factor').css('opacity',0.2);
99
+ }
100
+ jQuery(data.anchor_id).css('position','relative');
101
+
102
+ if(data.anchor_id == '#mo2f_save_free_plan_auth_methods_form')
103
+ {
104
+ jQuery('#mo2f_save_premium_plan_auth_methods_form').css('opacity',0.2);
105
+ }
106
+
107
+ if(jQuery(data.anchor_id).is(":visible") || data.anchor_id =='#mo2f_choose_app_tour') {
108
+
109
+ jQuery('#overlay').show();
110
+
111
+ }
112
+
113
+
114
+ var tab = localStorage.getItem("last_tab");
115
+ var data1={
116
+ 'action' : 'mo_wpns_tour',
117
+ 'call_type' : 'mo2f_last_visit_tab',
118
+ 'tab' : tab
119
+ };
120
+ jQuery.post(ajaxurl, data1, function(response){
121
+
122
+ });
123
+
124
+
125
+ if ( typeof MAP.last_pointer === 'object') {
126
+ MAP.last_pointer.pointer('destroy');
127
+ MAP.last_pointer = false;
128
+ }
129
+ // jQuery(data.anchor_id).css('top','80px');
130
+ // jQuery(data.anchor_id).css('opacity',0);
131
+
132
+
133
+
134
+ MAP.current_pointer = false;
135
+ var pointer_data = MAP.getPointerData( data );
136
+
137
+
138
+ if ( ! pointer_data.target || ! pointer_data.data ) {
139
+ return;
140
+ }
141
+ $target = pointer_data.target;
142
+ data = pointer_data.data;
143
+
144
+
145
+ $pointer = $target.pointer({
146
+ content: data.title + data.content,
147
+ position: { edge: data.edge, align: data.align },
148
+ close: function() {
149
+
150
+ jQuery(data.anchor_id).css('z-index','0');
151
+ jQuery('#overlay').hide();
152
+ $.post( ajaxurl, { pointer: data.id, action: 'dismiss-wp-pointer' } );
153
+
154
+ }
155
+ });
156
+ MAP.current_pointer = { pointer: $pointer, data: data };
157
+
158
+ $(document).trigger( 'MOAdminPointers.current_ready' );
159
+ };
160
+
161
+ // scroll the page to current pointer then open it
162
+ MAP.openPointer = function() {
163
+ var $pointer = MAP.current_pointer.pointer;
164
+
165
+
166
+ if ( ! typeof $pointer === 'object' ) {
167
+ return;
168
+ }
169
+
170
+ $('html, body').animate({ // scroll page to pointer
171
+ scrollTop: $pointer.offset().top-120
172
+ }, 300, function() { // when scroll complete
173
+
174
+ console.log($pointer);
175
+ MAP.last_pointer = $pointer;
176
+
177
+ var $widget = $pointer.pointer('widget');
178
+ MAP.setNext( $widget, MAP.current_pointer.data );
179
+ $pointer.pointer( 'open' ); // open
180
+ });
181
+
182
+ jQuery('#mo2f_save_premium_plan_auth_methods_form').css('opacity',0.2);
183
+
184
+
185
+ };
186
+
187
+ // if there is a next pointer set button label to "Next", to "Close" otherwise
188
+ MAP.setNext = function( $widget, data ) {
189
+
190
+
191
+ if ( typeof $widget === 'object' ) {
192
+ var $buttons = $widget.find('.wp-pointer-buttons').eq(0);
193
+ var $close = $buttons.find('a.close').eq(0);
194
+
195
+ $button = $close.clone(true, true).removeClass('close');
196
+ $close_button = $close.clone(true, true).removeClass('close');
197
+ $buttons.find('a.close').remove();
198
+ $button.addClass('button').addClass('button-primary');
199
+ $close_button.addClass('button').addClass('button-primary');
200
+
201
+ has_next = false;
202
+
203
+
204
+
205
+ if ( MAP.hasNext( data ) ) {
206
+ has_next_data = MAP.getPointerData(MAP.js_pointers[data.next].data);
207
+ has_next = has_next_data.target && has_next_data.data;
208
+ $button.html(MAP.next_label).appendTo($buttons);
209
+ $close_button.html(MAP.close_label).appendTo($buttons);
210
+ jQuery($close_button).css('margin-right','10px');
211
+
212
+ jQuery($close_button).click(function (e) {
213
+ jQuery('#GoogleAuthenticator_thumbnail_2_factor').css('opacity',1);
214
+ jQuery('#miniOrangeQRCodeAuthentication_thumbnail_2_factor').css('opacity',1);
215
+ jQuery('#SecurityQuestions_thumbnail_2_factor').css('opacity',1);
216
+ jQuery('#miniOrangeSoftToken_thumbnail_2_factor').css('opacity',1);
217
+ jQuery('#miniOrangePushNotification_thumbnail_2_factor').css('opacity',1);
218
+ jQuery('#mo2f_save_premium_plan_auth_methods_form').css('opacity',1);
219
+ jQuery('#OTPOverSMS_thumbnail_2_factor').css('opacity',1);
220
+ jQuery('#OTPOverEmail_thumbnail_2_factor').css('opacity',1);
221
+
222
+
223
+ var data1={
224
+ 'action' : 'mo_wpns_tour',
225
+ 'call_type' : 'mo2f_close_tour_details',
226
+ 'page' : data.where
227
+ };
228
+ jQuery.post(ajaxurl, data1, function(response){
229
+ });
230
+
231
+ jQuery('#overlay').hide();
232
+
233
+
234
+
235
+ setTimeout(function () {
236
+ jQuery('#dismiss_pointers').submit();
237
+ }, 1000);
238
+ });
239
+ }
240
+ else
241
+ {
242
+
243
+ var label = has_next ? MAP.next_label : MAP.close_label;
244
+ jQuery($button).css('margin-right','10px');
245
+ $button.html(label).appendTo($buttons);
246
+ jQuery($button).click(function (e) {
247
+ var data1={
248
+ 'action' : 'mo_wpns_tour',
249
+ 'call_type' : 'mo2f_close_tour_details',
250
+ 'page' : data.where
251
+ };
252
+ jQuery.post(ajaxurl, data1, function(response){
253
+ jQuery('#mo2f_save_premium_plan_auth_methods_form').css('opacity',1);
254
+
255
+ });
256
+ });
257
+ }
258
+
259
+
260
+ jQuery($button).click(function () {
261
+
262
+ var data1={
263
+ 'action' : 'mo_wpns_tour',
264
+ 'call_type' : 'mo2f_visit_page_tour_details',
265
+ 'index' : data.index
266
+ };
267
+ jQuery.post(ajaxurl, data1, function(response){
268
+
269
+ });
270
+
271
+ if(data.isdefault ==='yes')
272
+ {
273
+ jQuery(data.anchor_id).css('position','');
274
+
275
+ switch(data.anchor_id){
276
+ case '#mo2f_save_free_plan_auth_methods_form':
277
+ //jQuery(data.anchor_id).css('opacity',0.2);
278
+ jQuery('#miniOrangeQRCodeAuthentication_thumbnail_2_factor').css('opacity',0.2);
279
+ jQuery('#SecurityQuestions_thumbnail_2_factor').css('opacity',0.2);
280
+ jQuery('#miniOrangeSoftToken_thumbnail_2_factor').css('opacity',0.2);
281
+ jQuery('#miniOrangePushNotification_thumbnail_2_factor').css('opacity',0.2);
282
+ jQuery('#OTPOverSMS_thumbnail_2_factor').css('opacity',0.2);
283
+ jQuery('#OTPOverEmail_thumbnail_2_factor').css('opacity',0.2);
284
+ break;
285
+
286
+ case '#GoogleAuthenticator_configuration':
287
+ // configureOrSet2ndFactor_free_plan('GoogleAuthenticator', 'configure2factor');
288
+ //document.getElementById('setup_2fa_div').style.display = 'none';
289
+ //document.write('<?php mo2f_configure_google_authenticator(wp_get_current_user()); ?>');
290
+ jQuery('#GoogleAuthenticator_thumbnail_2_factor').css('opacity',0.2);
291
+ jQuery('#miniOrangeQRCodeAuthentication_thumbnail_2_factor').css('opacity',0.2);
292
+ jQuery('#SecurityQuestions_thumbnail_2_factor').css('opacity',0.2);
293
+ jQuery('#miniOrangeSoftToken_thumbnail_2_factor').css('opacity',0.2);
294
+ jQuery('#miniOrangePushNotification_thumbnail_2_factor').css('opacity',0.2);
295
+
296
+ jQuery('#test').css('position','relative');
297
+ //$("#setup_2fa_div").empty();
298
+ break;
299
+ case '#displayGAQrCodeTour':
300
+ $(data.anchor_id).removeAttr("style");
301
+ break;
302
+ case '#SaveOTPGATour':
303
+ $("#mo2f_go_back_form").submit();
304
+ break;
305
+ case '#test':
306
+ jQuery('#test').css('position','');
307
+ jQuery('#unlimittedUser_2fa').css('position','relative');
308
+ document.getElementById("unlimittedUser_2fa").click();
309
+ break;
310
+ case '#mo2f_inline_registration_tour':
311
+ jQuery('#custom_form_2fa').css('position','relative');
312
+ jQuery('#custom_form_2fa_div').css('position','relative');
313
+ jQuery('#unlimittedUser_2fa').css('position','');
314
+ document.getElementById("custom_form_2fa").click();
315
+ break;
316
+ case '#custom_form_2fa_div':
317
+ jQuery('#custom_form_2fa_div').css('position','');
318
+ jQuery('#custom_form_2fa').css('position','');
319
+ jQuery('#custom_login_2fa').css('z-index',1);
320
+ document.getElementById("custom_login_2fa").click();
321
+ jQuery('#premium_feature_phone_lost').css('position','relative');
322
+ jQuery('#premium_feature_specific_method').css('position','relative');
323
+ jQuery('#premium_feature_login_screen_option').css('position','relative');
324
+ jQuery('#premium_feature_user_enrollment').css('position','relative');
325
+ jQuery('#premium_feature_skip_option').css('position','relative');
326
+ break;
327
+ case '#custom_login_2fa':
328
+ jQuery('#premium_feature_phone_lost').css('position','');
329
+ jQuery('#premium_feature_specific_method').css('position','');
330
+ jQuery('#premium_feature_login_screen_option').css('position','');
331
+ jQuery('#premium_feature_user_enrollment').css('position','');
332
+ jQuery('#premium_feature_skip_option').css('position','');
333
+
334
+ jQuery('#custom_login_2fa').removeAttr("style");
335
+ jQuery('#custom_login_2fa').css('position','');
336
+ jQuery('#mo_2fa_upgrade_tour').css('position','relative');
337
+ jQuery('#mo_2fa_upgrade_tour').css('z-index',1);
338
+
339
+ document.getElementById("setup_2fa").click();
340
+ break;
341
+ case '#mo_2fa_upgrade_tour':
342
+ jQuery('#mo_wpns_support_layout_tour').css('position','relative');
343
+ break;
344
+ case '#mo_wpns_support_layout_tour':
345
+ document.getElementById("myForm").style.display = "block";
346
+ document.getElementById("feedback_form_bg").style.display = "block";
347
+ jQuery('#GoogleAuthenticator_thumbnail_2_factor').css('opacity',1);
348
+ jQuery('#miniOrangeQRCodeAuthentication_thumbnail_2_factor').css('opacity',1);
349
+ jQuery('#SecurityQuestions_thumbnail_2_factor').css('opacity',1);
350
+ jQuery('#miniOrangeSoftToken_thumbnail_2_factor').css('opacity',1);
351
+ jQuery('#miniOrangePushNotification_thumbnail_2_factor').css('opacity',1);
352
+ jQuery('#OTPOverSMS_thumbnail_2_factor').css('opacity',1);
353
+ jQuery('#OTPOverEmail_thumbnail_2_factor').css('opacity',1);
354
+ break;
355
+ case '#mo_wpns_support_layout_tour_open':
356
+ document.getElementById("myForm").style.display = "none";
357
+ document.getElementById("feedback_form_bg").style.display = "none";
358
+
359
+
360
+ jQuery('#GoogleAuthenticator_thumbnail_2_factor').css('opacity',1);
361
+ jQuery('#miniOrangeQRCodeAuthentication_thumbnail_2_factor').css('opacity',1);
362
+ jQuery('#SecurityQuestions_thumbnail_2_factor').css('opacity',1);
363
+ jQuery('#miniOrangeSoftToken_thumbnail_2_factor').css('opacity',1);
364
+ jQuery('#miniOrangePushNotification_thumbnail_2_factor').css('opacity',1);
365
+ jQuery('#OTPOverSMS_thumbnail_2_factor').css('opacity',1);
366
+ jQuery('#OTPOverEmail_thumbnail_2_factor').css('opacity',1);
367
+
368
+ break;
369
+
370
+ }
371
+ }
372
+ else if(data.isfirewall == 'yes')
373
+ {
374
+ jQuery(data.anchor_id).css('position','');
375
+
376
+
377
+ switch(data.anchor_id){
378
+ case '#mo2f_waf_block_after':
379
+ document.getElementById("RateLimitTab").click();
380
+ break;
381
+ case '#mo2f_ratelimiting':
382
+ document.getElementById("defaultOpen").click();
383
+ break;
384
+ case '#mo2f_firewall_attack_dash':
385
+ jQuery('#mo_2fa_upgrade_tour').css('z-index',1);
386
+ break;
387
+ case '#mo_wpns_support_layout_tour':
388
+ document.getElementById("myForm").style.display = "block";
389
+ document.getElementById("feedback_form_bg").style.display = "block";
390
+ break;
391
+ case '#mo_wpns_support_layout_tour_open':
392
+ document.getElementById("myForm").style.display = "none";
393
+ document.getElementById("feedback_form_bg").style.display = "none";
394
+ break;
395
+ }
396
+
397
+ }
398
+ else if(data.loginSpam == 'yes')
399
+ {
400
+ jQuery(data.anchor_id).css('position','');
401
+
402
+ switch(data.anchor_id){
403
+ case '#mo2f_enforce_strong_password_div':
404
+ document.getElementById("reg_sec").click();
405
+ break;
406
+ case '#mo2f_block_registration':
407
+ document.getElementById("spam_content").click();
408
+ break;
409
+ case '#mo2f_comment_protection':
410
+ document.getElementById("login_sec").click();
411
+ jQuery('#mo_2fa_upgrade_tour').css('z-index',1);
412
+ break;
413
+ case '#mo_wpns_support_layout_tour':
414
+ document.getElementById("myForm").style.display = "block";
415
+ document.getElementById("feedback_form_bg").style.display = "block";
416
+ break;
417
+ case '#mo_wpns_support_layout_tour_open':
418
+ document.getElementById("myForm").style.display = "none";
419
+ document.getElementById("feedback_form_bg").style.display = "none";
420
+ break;
421
+ }
422
+ }
423
+ else if(data.ismalware == 'yes')
424
+ {
425
+ jQuery(data.anchor_id).css('position','');
426
+ switch(data.anchor_id){
427
+ case '#scan_status_table':
428
+ document.getElementById("scan_set").click();
429
+ break;
430
+ case '#mo2f_select_scanning_files':
431
+ document.getElementById("report_scan").click();
432
+ break;
433
+ case '#scan_report_table':
434
+ document.getElementById("malware_view").click();
435
+ break;
436
+ case '#mo2f_scan_dash':
437
+ jQuery('#mo_2fa_upgrade_tour').css('z-index',1);
438
+ break;
439
+ case '#mo_wpns_support_layout_tour':
440
+ document.getElementById("myForm").style.display = "block";
441
+ document.getElementById("feedback_form_bg").style.display = "block";
442
+ break;
443
+ case '#mo_wpns_support_layout_tour_open':
444
+ document.getElementById("myForm").style.display = "none";
445
+ document.getElementById("feedback_form_bg").style.display = "none";
446
+ break;
447
+ }
448
+ }
449
+
450
+ else if(data.advcblock == 'yes')
451
+ {
452
+ jQuery(data.anchor_id).css('position','');
453
+ if(data.anchor_id == '#mo2f_ip_lookup')
454
+ {
455
+ document.getElementById("adv_block_subtab").click();
456
+ }
457
+ else if(data.anchor_id =='#mo2f_browser_blocking')
458
+ {
459
+ $('html, body').animate({ // scroll page to pointer
460
+ scrollTop: $pointer.offset().top+30
461
+ }, 100, function() { // when scroll complete
462
+ console.log($pointer);
463
+ MAP.last_pointer = $pointer;
464
+ var $widget = $pointer.pointer('widget');
465
+ MAP.setNext( $widget, MAP.current_pointer.data );
466
+ $pointer.pointer( 'open' ); // open
467
+ });
468
+
469
+ }
470
+ else if(data.anchor_id =='#mo2f_country_blocking')
471
+ jQuery('#mo_2fa_upgrade_tour').css('z-index',1);
472
+
473
+ else if(data.anchor_id == '#mo_wpns_support_layout_tour')
474
+ {
475
+ document.getElementById("myForm").style.display = "block";
476
+ document.getElementById("feedback_form_bg").style.display = "block";
477
+ }
478
+ else if(data.anchor_id == '#mo_wpns_support_layout_tour_open')
479
+ {
480
+ document.getElementById("myForm").style.display = "none";
481
+ document.getElementById("feedback_form_bg").style.display = "none";
482
+ }
483
+ }
484
+ else if(data.isBackup =='yes')
485
+ {
486
+ jQuery(data.anchor_id).css('position','');
487
+ switch(data.anchor_id){
488
+ case '#mo2f_select_files_backup':
489
+ document.getElementById("schdule").click();
490
+ break;
491
+ case '#mo2f_schedule_backup_status':
492
+ document.getElementById("report").click();
493
+ break;
494
+ case '#backup_report_table':
495
+ jQuery('#mo_2fa_upgrade_tour').css('z-index',1);
496
+ document.getElementById('backup_set').click();
497
+ break;
498
+ case '#mo_wpns_support_layout_tour':
499
+ document.getElementById("myForm").style.display = "block";
500
+ document.getElementById("feedback_form_bg").style.display = "block";
501
+ break;
502
+ case '#mo_wpns_support_layout_tour_open':
503
+ document.getElementById("myForm").style.display = "none";
504
+ document.getElementById("feedback_form_bg").style.display = "none";
505
+ break;
506
+ }
507
+ }
508
+
509
+ if ( MAP.hasNext( data ) ) {
510
+ MAP.setPlugin( MAP.js_pointers[data.next].data );
511
+
512
+ }
513
+ });
514
+ }
515
+ };
516
+
517
+ $(MAP.pointers).each(function(index, pointer) { // loop pointers data
518
+
519
+ if( ! $().pointer ) return; // do nothing if pointer plugin isn't available
520
+ MAP.js_pointers[pointer.id] = { data: pointer };
521
+ var $target = $(pointer.anchor_id);
522
+
523
+ if ( $target.length) { // anchor exists and is visible?
524
+ MAP.visible_pointers.push(pointer.id);
525
+ if ( ! MAP.first_pointer ) {
526
+ MAP.first_pointer = pointer;
527
+ }
528
+ }
529
+ if ( index === ( MAP.pointers.length - 1 ) && MAP.first_pointer ) {
530
+ $(document).trigger( 'MOAdminPointers.setup_done', MAP.first_pointer );
531
+ }
532
+ });
533
+
534
+ } )(jQuery, MOAdminPointers); // MOAdminPointers is passed by `wp_localize_script`
includes/js/settings_page.js CHANGED
@@ -21,33 +21,52 @@ jQuery(document).ready(function () {
21
 
22
  //Instructions
23
  $("#mo_wpns_help_curl_title").click(function () {
24
- $("#mo_wpns_help_curl_desc").slideToggle(400);
25
  });
26
 
27
- $("#mo_wpns_help_mobile_auth_title").click(function () {
28
- $("#mo_wpns_help_mobile_auth_desc").slideToggle(400);
29
  });
30
 
31
- $("#mo_wpns_help_disposable_title").click(function () {
32
- $("#mo_wpns_help_disposable_desc").slideToggle(400);
33
  });
34
 
35
- $("#mo_wpns_help_strong_pass_title").click(function () {
36
- $("#mo_wpns_help_strong_pass_desc").slideToggle(400);
37
  });
38
 
39
- $("#mo_wpns_help_adv_user_ver_title").click(function () {
40
- $("#mo_wpns_help_adv_user_ver_desc").slideToggle(400);
41
  });
42
-
43
- $("#mo_wpns_help_social_login_title").click(function () {
44
- $("#mo_wpns_help_social_login_desc").slideToggle(400);
 
 
45
  });
46
 
47
- $("#mo_wpns_help_custom_template_title").click(function () {
48
- $("#mo_wpns_help_custom_template_desc").slideToggle(400);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  });
50
-
51
  $(".feedback").click(function(){
52
  ajaxCall("dissmissfeedback",".feedback-notice",true);
53
  });
@@ -104,4 +123,21 @@ function ajaxCall(option,element,hide)
104
  },
105
  error: function(o, e, n) {}
106
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  }
21
 
22
  //Instructions
23
  $("#mo_wpns_help_curl_title").click(function () {
24
+ $("#mo_wpns_help_curl_desc").slideToggle(600);
25
  });
26
 
27
+ $("#mo_wpns_issue_in_scanning_QR").click(function () {
28
+ $("#mo_wpns_issue_in_scanning_QR_solution").slideToggle(600);
29
  });
30
 
31
+ $("#mo_wpns_help_get_back_to_account").click(function () {
32
+ $("#mo_wpns_help_get_back_to_account_solution").slideToggle(600);
33
  });
34
 
35
+ $("#mo_wpns_help_multisite").click(function () {
36
+ $("#mo_wpns_help_multisite_solution").slideToggle(600);
37
  });
38
 
39
+ $("#mo_wpns_help_adv_user_ver_title").click(function () {
40
+ $("#mo_wpns_help_adv_user_ver_desc").slideToggle(600);
41
  });
42
+ $("#mo_wpns_help_forgot_password").click(function () {
43
+ $("#mo_wpns_help_forgot_password_solution").slideToggle(600);
44
+ });
45
+ $("#mo_wpns_help_MFA_propmted").click(function () {
46
+ $("#mo_wpns_help_MFA_propmted_solution").slideToggle(600);
47
  });
48
 
49
+ $("#mo_wpns_help_redirect_back").click(function () {
50
+ $("#mo_wpns_help_redirect_back_solution").slideToggle(600);
51
+ });
52
+ $("#mo_wpns_help_alternet_login").click(function () {
53
+ $("#mo_wpns_help_alternet_login_solution").slideToggle(600);
54
+ });
55
+ $("#mo_wpns_help_lost_ability").click(function () {
56
+ $("#mo_wpns_help_lost_ability_solution").slideToggle(600);
57
+ });
58
+ $("#mo_wpns_help_translate").click(function () {
59
+ $("#mo_wpns_help_translate_solution").slideToggle(600);
60
+ });
61
+ $("#mo_wpns_help_particular_use_role").click(function () {
62
+ $("#mo_wpns_help_particular_use_role_solution").slideToggle(600);
63
+ });
64
+ $("#mo_wpns_help_enforce_MFA").click(function () {
65
+ $("#mo_wpns_help_enforce_MFA_solution").slideToggle(600);
66
+ });
67
+ $("#mo_wpns_help_reset_MFA").click(function () {
68
+ $("#mo_wpns_help_reset_MFA_solution").slideToggle(600);
69
  });
 
70
  $(".feedback").click(function(){
71
  ajaxCall("dissmissfeedback",".feedback-notice",true);
72
  });
123
  },
124
  error: function(o, e, n) {}
125
  });
126
+ }
127
+
128
+ function success_msg(msg){
129
+ jQuery('#wpns_nav_message').empty();
130
+ jQuery('#wpns_nav_message').append("<div id='notice_div' class='overlay_success'><div class='popup_text'>&nbsp&nbsp"+msg+"</div></div>");
131
+ window.onload = nav_popup();
132
+ }
133
+
134
+ function error_msg(msg){
135
+ jQuery('#wpns_nav_message').empty();
136
+ jQuery('#wpns_nav_message').append("<div id='notice_div' class='overlay_error'><div class='popup_text'>&nbsp&nbsp"+msg+"</div></div>");
137
+ window.onload = nav_popup();
138
+ }
139
+
140
+ function nav_popup() {
141
+ document.getElementById("notice_div").style.width = "40%";
142
+ setTimeout(function(){ jQuery('#notice_div').fadeOut('slow'); }, 3000);
143
  }
includes/js/skip_tour.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready( function(){
2
+ console.log('tested');
3
+ jQuery('#skip-plugin-tour').onclick(function(e) {
4
+ e.preventDefault();
5
+ var rml_post_id = jQuery(this).data( 'id' );
6
+ jQuery.ajax({
7
+ url : readmelater_ajax.ajax_url,
8
+ type : 'post',
9
+ data : {
10
+ action : 'read_me_later',
11
+ post_id : rml_post_id
12
+ },
13
+ success : function( response ) {
14
+ jQuery('.rml_contents').html(response);
15
+ }
16
+ });
17
+ jQuery(this).hide();
18
+ });
19
+ });
includes/js/wp-pointer.dev.js ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Pointer jQuery widget.
3
+ */
4
+ (function($){
5
+ var identifier = 0,
6
+ zindex = 9999;
7
+
8
+ $.widget("wp.pointer", {
9
+ options: {
10
+ pointerClass: 'wp-pointer',
11
+ pointerWidth: 320,
12
+ content: function( respond, event, t ) {
13
+ return $(this).text();
14
+ },
15
+ buttons: function( event, t ) {
16
+ var close = ( wpPointerL10n ) ? wpPointerL10n.dismiss : 'Dismiss',
17
+ button = $('<a class="close" href="#">' + close + '</a>');
18
+
19
+ return button.bind( 'click.pointer', function(e) {
20
+ e.preventDefault();
21
+ t.element.pointer('close');
22
+ });
23
+ },
24
+ position: 'top',
25
+ show: function( event, t ) {
26
+ t.pointer.show();
27
+ t.opened();
28
+ },
29
+ hide: function( event, t ) {
30
+ t.pointer.hide();
31
+ t.closed();
32
+ },
33
+ document: document
34
+ },
35
+
36
+ _create: function() {
37
+ var positioning,
38
+ family;
39
+
40
+ this.content = $('<div class="wp-pointer-content"></div>');
41
+ this.arrow = $('<div class="wp-pointer-arrow"><div class="wp-pointer-arrow-inner"></div></div>');
42
+
43
+ family = this.element.parents().add( this.element );
44
+ positioning = 'absolute';
45
+
46
+ if ( family.filter(function(){ return 'fixed' === $(this).css('position'); }).length )
47
+ positioning = 'fixed';
48
+
49
+ this.pointer = $('<div />')
50
+ .append( this.content )
51
+ .append( this.arrow )
52
+ .attr('id', 'wp-pointer-' + identifier++)
53
+ .addClass( this.options.pointerClass )
54
+ .css({'position': positioning, 'width': this.options.pointerWidth+'px', 'display': 'none'})
55
+ .appendTo( this.options.document.body );
56
+ },
57
+
58
+ _setOption: function( key, value ) {
59
+ var o = this.options,
60
+ tip = this.pointer;
61
+
62
+ // Handle document transfer
63
+ if ( key === "document" && value !== o.document ) {
64
+ tip.detach().appendTo( value.body );
65
+
66
+ // Handle class change
67
+ } else if ( key === "pointerClass" ) {
68
+ tip.removeClass( o.pointerClass ).addClass( value );
69
+ }
70
+
71
+ // Call super method.
72
+ $.Widget.prototype._setOption.apply( this, arguments );
73
+
74
+ // Reposition automatically
75
+ if ( key === "position" ) {
76
+ this.reposition();
77
+
78
+ // Update content automatically if pointer is open
79
+ } else if ( key === "content" && this.active ) {
80
+ this.update();
81
+ }
82
+ },
83
+
84
+ destroy: function() {
85
+ this.pointer.remove();
86
+ $.Widget.prototype.destroy.call( this );
87
+ },
88
+
89
+ widget: function() {
90
+ return this.pointer;
91
+ },
92
+
93
+ update: function( event ) {
94
+ var self = this,
95
+ o = this.options,
96
+ dfd = $.Deferred(),
97
+ content;
98
+
99
+ if ( o.disabled )
100
+ return;
101
+
102
+ dfd.done( function( content ) {
103
+ self._update( event, content );
104
+ })
105
+
106
+ // Either o.content is a string...
107
+ if ( typeof o.content === 'string' ) {
108
+ content = o.content;
109
+
110
+ // ...or o.content is a callback.
111
+ } else {
112
+ content = o.content.call( this.element[0], dfd.resolve, event, this._handoff() );
113
+ }
114
+
115
+ // If content is set, then complete the update.
116
+ if ( content )
117
+ dfd.resolve( content );
118
+
119
+ return dfd.promise();
120
+ },
121
+
122
+ /**
123
+ * Update is separated into two functions to allow events to defer
124
+ * updating the pointer (e.g. fetch content with ajax, etc).
125
+ */
126
+ _update: function( event, content ) {
127
+ var buttons,
128
+ o = this.options;
129
+
130
+ if ( ! content )
131
+ return;
132
+
133
+ this.pointer.stop(); // Kill any animations on the pointer.
134
+ this.content.html( content );
135
+
136
+ buttons = o.buttons.call( this.element[0], event, this._handoff() );
137
+ if ( buttons ) {
138
+ buttons.wrap('<div class="wp-pointer-buttons" />').parent().appendTo( this.content );
139
+ }
140
+
141
+ this.reposition();
142
+ },
143
+
144
+ reposition: function() {
145
+ var position;
146
+
147
+ if ( this.options.disabled )
148
+ return;
149
+
150
+ position = this._processPosition( this.options.position );
151
+
152
+ // Reposition pointer.
153
+ this.pointer.css({
154
+ top: 0,
155
+ left: 0,
156
+ zIndex: zindex++ // Increment the z-index so that it shows above other opened pointers.
157
+ }).show().position($.extend({
158
+ of: this.element,
159
+ collision: 'fit none'
160
+ }, position )); // the object comes before this.options.position so the user can override position.of.
161
+
162
+ this.repoint();
163
+ },
164
+
165
+ repoint: function() {
166
+ var o = this.options,
167
+ edge;
168
+
169
+ if ( o.disabled )
170
+ return;
171
+
172
+ edge = ( typeof o.position == 'string' ) ? o.position : o.position.edge;
173
+
174
+ // Remove arrow classes.
175
+ this.pointer[0].className = this.pointer[0].className.replace( /wp-pointer-[^\s'"]*/, '' );
176
+
177
+ // Add arrow class.
178
+ this.pointer.addClass( 'wp-pointer-' + edge );
179
+ },
180
+
181
+ _processPosition: function( position ) {
182
+ var opposite = {
183
+ top: 'bottom',
184
+ bottom: 'top',
185
+ left: 'right',
186
+ right: 'left'
187
+ },
188
+ result;
189
+
190
+ // If the position object is a string, it is shorthand for position.edge.
191
+ if ( typeof position == 'string' ) {
192
+ result = {
193
+ edge: position + ''
194
+ };
195
+ } else {
196
+ result = $.extend( {}, position );
197
+ }
198
+
199
+ if ( ! result.edge )
200
+ return result;
201
+
202
+ if ( result.edge == 'top' || result.edge == 'bottom' ) {
203
+ result.align = result.align || 'left';
204
+
205
+ result.at = result.at || result.align + ' ' + opposite[ result.edge ];
206
+ result.my = result.my || result.align + ' ' + result.edge;
207
+ } else {
208
+ result.align = result.align || 'top';
209
+
210
+ result.at = result.at || opposite[ result.edge ] + ' ' + result.align;
211
+ result.my = result.my || result.edge + ' ' + result.align;
212
+ }
213
+
214
+ return result;
215
+ },
216
+
217
+ open: function( event ) {
218
+ var self = this,
219
+ o = this.options;
220
+
221
+ if ( this.active || o.disabled || this.element.is(':hidden') )
222
+ return;
223
+
224
+ this.update().done( function() {
225
+ self._open( event );
226
+ });
227
+ },
228
+
229
+ _open: function( event ) {
230
+ var self = this,
231
+ o = this.options;
232
+
233
+ if ( this.active || o.disabled || this.element.is(':hidden') )
234
+ return;
235
+
236
+ this.active = true;
237
+
238
+ this._trigger( "open", event, this._handoff() );
239
+
240
+ this._trigger( "show", event, this._handoff({
241
+ opened: function() {
242
+ self._trigger( "opened", event, self._handoff() );
243
+ }
244
+ }));
245
+ },
246
+
247
+ close: function( event ) {
248
+ if ( !this.active || this.options.disabled )
249
+ return;
250
+
251
+ var self = this;
252
+ this.active = false;
253
+
254
+ this._trigger( "close", event, this._handoff() );
255
+ this._trigger( "hide", event, this._handoff({
256
+ closed: function() {
257
+ self._trigger( "closed", event, self._handoff() );
258
+ }
259
+ }));
260
+ },
261
+
262
+ sendToTop: function( event ) {
263
+ if ( this.active )
264
+ this.pointer.css( 'z-index', zindex++ );
265
+ },
266
+
267
+ toggle: function( event ) {
268
+ if ( this.pointer.is(':hidden') )
269
+ this.open( event );
270
+ else
271
+ this.close( event );
272
+ },
273
+
274
+ _handoff: function( extend ) {
275
+ return $.extend({
276
+ pointer: this.pointer,
277
+ element: this.element
278
+ }, extend);
279
+ }
280
+ });
281
+ })(jQuery);
includes/lib/Mo2FABasicEnum.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ abstract class Mo2FABasicEnum {
4
+ private static $constCacheArray = NULL;
5
+
6
+ public static function getConstants() {
7
+ if (self::$constCacheArray == NULL) {
8
+ self::$constCacheArray = array();
9
+ }
10
+ $calledClass = get_called_class();
11
+ if (!array_key_exists($calledClass, self::$constCacheArray)) {
12
+ $reflect = new ReflectionClass($calledClass);
13
+ self::$constCacheArray[$calledClass] = $reflect->getConstants();
14
+ }
15
+ return self::$constCacheArray[$calledClass];
16
+ }
17
+
18
+ public static function isValidName($name, $strict = false) {
19
+ $constants = self::getConstants();
20
+
21
+ if ($strict) {
22
+ return array_key_exists($name, $constants);
23
+ }
24
+
25
+ $keys = array_map('strtolower', array_keys($constants));
26
+ return in_array(strtolower($name), $keys);
27
+ }
28
+
29
+ public static function isValidValue($value, $strict = true) {
30
+ $values = array_values(self::getConstants());
31
+ return in_array($value, $values, $strict);
32
+ }
33
+ }
includes/lib/mo-2fa-options-enum.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ include "Mo2FABasicEnum.php";
3
+
4
+ class mo_2fa_options_enum_pointers extends Mo2FABasicEnum{
5
+ public static
6
+ $DEFAULT = array(
7
+ 'custom_admin_pointers4_8_52_default-miniorange-sp-metadata-url',
8
+ 'custom_admin_pointers4_8_52_default-miniorange-2fa-select-authentication',
9
+
10
+ 'custom_admin_pointers4_8_52_default-miniorange-2fa-configure',
11
+ 'custom_admin_pointers4_8_52_default-miniorange-2fa-choose_app',
12
+ 'custom_admin_pointers4_8_52_default-miniorange-2fa-download_app',
13
+ 'custom_admin_pointers4_8_52_default-miniorange-2fa-choose_name_on_app',
14
+ 'custom_admin_pointers4_8_52_default-miniorange-2fa-scan-qrcode',
15
+ 'custom_admin_pointers4_8_52_default-miniorange-2fa-enter_code_manually',
16
+ 'custom_admin_pointers4_8_52_default-miniorange-2fa-enter-otp',
17
+ 'custom_admin_pointers4_8_52_default-miniorange-2fa-save-otp',
18
+ 'custom_admin_pointers4_8_52_default-miniorange-2fa-test',
19
+ 'custom_admin_pointers4_8_52_default-miniorange-2fa-customizations',
20
+ 'custom_admin_pointers4_8_52_default-miniorange-2fa-inline-registration',
21
+ 'custom_admin_pointers4_8_52_default-miniorange-2fa-integration',
22
+ 'custom_admin_pointers4_8_52_default-miniorange-2fa-premium-features',
23
+
24
+ 'custom_admin_pointers4_8_52_default-miniorange-2fa-upgrade',
25
+ 'custom_admin_pointers4_8_52_default-miniorange-2fa-support',
26
+ 'custom_admin_pointers4_8_52_default-miniorange-2fa-support_open',
27
+
28
+
29
+ 'custom_admin_pointers4_8_52_default-miniorange-firewall-level',
30
+ 'custom_admin_pointers4_8_52_default-miniorange-firewall-attacks',
31
+ 'custom_admin_pointers4_8_52_default-miniorange-firewall-attack-limit',
32
+ 'custom_admin_pointers4_8_52_default-miniorange-firewall-rate-limit',
33
+ 'custom_admin_pointers4_8_52_default-miniorange-firewall-check-attacks',
34
+ 'custom_admin_pointers4_8_52_default-miniorange-firewall-support',
35
+ 'custom_admin_pointers4_8_52_default-miniorange-firewall-support_open',
36
+
37
+
38
+ 'custom_admin_pointers4_8_52_default-miniorange-malware-scan-modes',
39
+ 'custom_admin_pointers4_8_52_default-miniorange-malware-custom-scan-files',
40
+ 'custom_admin_pointers4_8_52_default-miniorange-malware-scan-reports',
41
+ 'custom_admin_pointers4_8_52_default-miniorange-malware-scan-dashboard',
42
+ 'custom_admin_pointers4_8_52_default-miniorange-malware-support',
43
+ 'custom_admin_pointers4_8_52_default-miniorange-malware-support_open',
44
+
45
+
46
+ 'custom_admin_pointers4_8_52_default-miniorange-advance-blocking-IP-blocking',
47
+ 'custom_admin_pointers4_8_52_default-miniorange-advance-blocking-IP-whitelisting',
48
+ 'custom_admin_pointers4_8_52_default-miniorange-advance-blocking-IP-lookup',
49
+ 'custom_admin_pointers4_8_52_default-miniorange-advance-blocking-IP-range',
50
+ 'custom_admin_pointers4_8_52_default-miniorange-advance-blocking-htaccess-blocking',
51
+ 'custom_admin_pointers4_8_52_default-miniorange-advance-blocking-browser-blocking',
52
+ 'custom_admin_pointers4_8_52_default-miniorange-advance-blocking-country-blocking',
53
+ 'custom_admin_pointers4_8_52_default-miniorange-advance-blocking-support',
54
+ 'custom_admin_pointers4_8_52_default-miniorange-advance-blocking-support_open',
55
+
56
+
57
+ 'custom_admin_pointers4_8_52_default-miniorange-backup-manual-db',
58
+ 'custom_admin_pointers4_8_52_default-miniorange-backup-auto-db',
59
+ 'custom_admin_pointers4_8_52_default-miniorange-backup-file',
60
+ 'custom_admin_pointers4_8_52_default-miniorange-backup-report',
61
+ 'custom_admin_pointers4_8_52_default-miniorange-backup-support',
62
+ 'custom_admin_pointers4_8_52_default-miniorange-backup-support_open',
63
+
64
+
65
+
66
+ 'custom_admin_pointers4_8_52_default-miniorange-login-spam-bruteforce',
67
+ 'custom_admin_pointers4_8_52_default-miniorange-login-spam-recaptcha',
68
+ 'custom_admin_pointers4_8_52_default-miniorange-login-spam-strong-pass',
69
+ 'custom_admin_pointers4_8_52_default-miniorange-login-spam-fake-registration',
70
+ 'custom_admin_pointers4_8_52_default-miniorange-login-spam-content',
71
+ 'custom_admin_pointers4_8_52_default-miniorange-login-spam-block-spam',
72
+ 'custom_admin_pointers4_8_52_default-miniorange-login-spam-support',
73
+ 'custom_admin_pointers4_8_52_default-miniorange-login-spam-support_open'
74
+ );
75
+
76
+
77
+ }
78
+
79
+
miniorange_2_factor_settings.php CHANGED
@@ -3,14 +3,14 @@
3
  * Plugin Name: miniOrange 2 Factor Authentication
4
  * Plugin URI: https://miniorange.com
5
  * Description: This plugin provides various two-factor authentication methods as an additional layer of security after the default wordpress login. We Support Google/Authy/LastPass Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA) for 1 User in the free version of the plugin.
6
- * Version: 5.4.5
7
  * Author: miniOrange
8
  * Author URI: https://miniorange.com
9
  * License: GPL2
10
  */
11
  define( 'MO_HOST_NAME', 'https://login.xecurify.com' );
12
- define( 'MO2F_VERSION', '5.4.5' );
13
- define( 'MO2F_TEST_MODE', False );
14
  define( 'MO2F_IS_ONPREM', get_option('is_onprem'));
15
  class Miniorange_twoFactor{
16
 
@@ -29,15 +29,13 @@
29
 
30
  $actions = add_filter('user_row_actions' , array( $this, 'miniorange_reset_users' ),10 , 2 );
31
  add_action( 'admin_footer' , array( $this, 'feedback_request' ) );
32
- add_action('admin_notices',array( $this, 'mo_wpns_malware_notices' ) );
33
-
34
  if(!defined("DISALLOW_FILE_EDIT") && get_option('mo2f_disable_file_editing') ) define('DISALLOW_FILE_EDIT', true);
35
  $this->includes();
36
- if(get_option("mo_wpns_2fa_with_network_security"))
37
- {
38
- $notify = new miniorange_security_notification;
39
- add_action('wp_dashboard_setup', array($notify,'my_custom_dashboard_widgets'));
40
- }
41
  }
42
  // As on plugins.php page not in the plugin
43
  function feedback_request() {
@@ -69,8 +67,13 @@
69
  if(is_array($theme_last)){
70
  if(sizeof($theme_current) == sizeof($theme_last)){
71
  foreach ($theme_current as $key => $value) {
72
- if($theme_current[$key] != $theme_last[$key]){
73
- $flag_theme=1;
 
 
 
 
 
74
  break;
75
  }
76
  }
@@ -87,7 +90,12 @@
87
  if(is_array($plugin_last)){
88
  if(sizeof($plugins_found) == sizeof($plugin_last)){
89
  foreach ($plugins_found as $key => $value) {
90
- if($plugins_found[$key] != $plugin_last[$key]){
 
 
 
 
 
91
  $flag_plugin=1;
92
  break;
93
  }
@@ -117,6 +125,7 @@
117
  echo MoWpnsMessages::showMessage('WEEKLY_SCAN_CHECK');
118
  }
119
  }
 
120
  }
121
  function mo_wpns_widget_menu()
122
  {
@@ -165,6 +174,7 @@
165
  }
166
  add_submenu_page( $menu_slug ,'miniOrange 2-Factor' ,'Troubleshooting' ,'administrator','mo_2fa_troubleshooting' , array( $this, 'mo_wpns'),10);
167
  add_submenu_page( $menu_slug ,'miniOrange 2-Factor' ,'Account' ,'administrator','mo_2fa_account' , array( $this, 'mo_wpns'),11);
 
168
  add_submenu_page( $menu_slug ,'miniOrange 2-Factor' ,'Upgrade' ,'administrator','mo_2fa_upgrade' , array( $this, 'mo_wpns'),12);
169
  add_submenu_page( $menu_slug ,'miniOrange 2-Factor' ,'Request for Demo' ,'administrator','mo_2fa_request_demo' , array( $this, 'mo_wpns'),13);
170
  $mo2fa_hook_page = add_users_page ('Reset 2nd Factor', null , 'manage_options', 'reset', array( $this, 'mo_reset_2fa_for_users_by_admin' ),66);
@@ -198,6 +208,8 @@
198
  add_option('Rate_limiting',0);
199
  add_option('Rate_request',240);
200
  add_option('limitAttack',10);
 
 
201
  add_option( 'mo_wpns_check_vulnerable_code', 1);
202
  add_option( 'mo_wpns_check_sql_injection', 1);
203
  add_option( 'mo_wpns_scan_plugins', true);
@@ -228,8 +240,10 @@
228
  add_action( 'mo_auth_show_error_message', array($this, 'mo_auth_show_error_message'), 10, 1 );
229
  add_option( 'mo2f_show_sms_transaction_message', 0 );
230
  add_option( 'mo2f_enforce_strong_passswords_for_accounts' ,'all');
231
- add_option('mo2f_onprem_admin' , $userid );
232
-
 
 
233
  update_site_option('mo_file_backup_plugins',1);
234
  update_site_option('mo_file_backup_themes',1);
235
  update_site_option('mo_wpns_backup_time',12);
@@ -239,6 +253,7 @@
239
  update_site_option('scheduled_db_backup',0);
240
  add_site_option('file_backup_created_time',0);
241
  add_site_option('db_backup_created_time',0);
 
242
 
243
  add_option('mo_database_backup',1);
244
  add_option('mo_wpns_scan_initialize',1);
@@ -247,29 +262,18 @@
247
  add_site_option('mo_file_manual_backup_themes',1);
248
  add_site_option('mo_schedule_database_backup',1);
249
 
250
- add_option( 'mo_wpns_2fa_with_network_security' , 1);
251
  add_option( 'mo_wpns_2fa_with_network_security_popup_visible', 1);
252
-
253
- add_option( 'mo_wpns_upgrade_onprem', 0);
254
- add_option( 'mo_wpns_plantype' , 0);
255
-
256
- //add_option( 'is_onprem' ,1);
257
  }
258
 
259
  function mo_wpns_deactivate()
260
  {
261
- global $moWpnsUtility;
262
- if( !$moWpnsUtility->check_empty_or_null( get_option('mo_wpns_registration_status') ) ) {
263
- delete_option('mo2f_email');
264
- }
265
  update_option('mo2f_activate_plugin', 1);
266
- delete_option('mo2f_customerKey');
267
- delete_option('mo2f_api_key');
268
- delete_option('mo2f_customer_token');
269
- delete_option('mo_wpns_transactionId');
270
- delete_option('mo_wpns_registration_status');
271
- delete_option('mo_wpns_upgrade_onprem',0);
272
- delete_option('mo_wpns_plantype');
273
 
274
  $two_fa_settings = new Miniorange_Authentication();
275
  $two_fa_settings->mo_auth_deactivate();
@@ -278,11 +282,36 @@
278
  function mo_wpns_settings_style($hook)
279
  {
280
  if(strpos($hook, 'page_mo_2fa')){
 
 
281
  wp_enqueue_style( 'mo_wpns_admin_settings_style' , plugins_url('includes/css/style_settings.css', __FILE__));
282
  wp_enqueue_style( 'mo_wpns_admin_settings_phone_style' , plugins_url('includes/css/phone.css', __FILE__));
283
  wp_enqueue_style( 'mo_wpns_admin_settings_datatable_style' , plugins_url('includes/css/jquery.dataTables.min.css', __FILE__));
284
  wp_enqueue_style( 'mo_wpns_button_settings_style' , plugins_url('includes/css/button_styles.css',__FILE__));
285
  wp_enqueue_style( 'mo_wpns_popup_settings_style' , plugins_url('includes/css/popup.css',__FILE__));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  }
287
 
288
  }
@@ -364,7 +393,12 @@
364
  require('database/database_functions_2fa.php');
365
  require('helper/utility.php');
366
  require('handler/ajax.php');
367
- require('api/class-customer-setup.php');
 
 
 
 
 
368
  require('api/class-rba-attributes.php');
369
  require('api/class-two-factor-setup.php');
370
  // require('api/mo2f_api.php');
@@ -390,14 +424,18 @@
390
  require('controllers/wpns-loginsecurity-ajax.php');
391
  require('controllers/malware_scanner/malware_scan_ajax.php');
392
  require('controllers/backup/backup_ajax.php');
 
393
  require('controllers/twofa/two_factor_ajax.php');
394
  require('controllers/dashboard_ajax.php');
395
  require('handler/malware_scanner/malware_scanner_cron.php');
396
  require('handler/malware_scanner/scanner_set_cron.php');
 
397
  }
398
 
399
  function miniorange_reset_users($actions, $user_object){
400
- if ( current_user_can( 'administrator', $user_object->ID ) && get_user_meta($user_object->ID,'currentMethod', true) ) {
 
 
401
  if(get_current_user_id() != $user_object->ID){
402
  $actions['miniorange_reset_users'] = "<a class='miniorange_reset_users' href='" . admin_url( "users.php?page=reset&action=reset_edit&amp;user=$user_object->ID") . "'>" . __( 'Reset 2 Factor', 'cgc_ub' ) . "</a>";
403
  }
@@ -449,34 +487,23 @@
449
  }
450
  $user_id = isset($_POST['userid']) && !empty($_POST['userid']) ? $_POST['userid'] : '';
451
  if(!empty($user_id)){
452
- if ( current_user_can( 'edit_user' ) )
453
- delete_user_meta($user_id,'currentMethod');
454
- delete_user_meta($user_id,'mo2f_kba_challenge');
455
- delete_user_meta($user_id,'mo2f_2FA_method_to_configure');
456
- delete_user_meta($user_id,'Security Questions');
457
- delete_user_meta($user_id,'Email Verification');
458
- delete_user_meta($user_id,'Google Authenticator');
459
- delete_user_meta($user_id,'kba_questions_user');
460
- delete_user_meta($user_id,'mo2f_2FA_method_to_test');
461
  }
462
  }
463
  }
464
 
465
  function mo2f_mapped_email_column_content($value, $column_name, $user_id) {
466
- if(MO2F_IS_ONPREM)
467
- {
468
- $currentMethod = get_user_meta($user_id,'currentMethod', true);
469
  if(!$currentMethod)
470
- $currentMethod = 'Not Registered for 2FA';
471
- }
472
- else
473
- {
474
- global $Mo2fdbQueries;
475
- $currentMethod = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user_id );
476
- if(!$currentMethod)
477
- $currentMethod = 'Not Registered for 2FA';
478
- }
479
-
480
  if ( 'current_method' == $column_name )
481
  return $currentMethod;
482
  return $value;
3
  * Plugin Name: miniOrange 2 Factor Authentication
4
  * Plugin URI: https://miniorange.com
5
  * Description: This plugin provides various two-factor authentication methods as an additional layer of security after the default wordpress login. We Support Google/Authy/LastPass Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA) for 1 User in the free version of the plugin.
6
+ * Version: 5.4.9
7
  * Author: miniOrange
8
  * Author URI: https://miniorange.com
9
  * License: GPL2
10
  */
11
  define( 'MO_HOST_NAME', 'https://login.xecurify.com' );
12
+ define( 'MO2F_VERSION', '5.4.9' );
13
+ define( 'MO2F_TEST_MODE', false );
14
  define( 'MO2F_IS_ONPREM', get_option('is_onprem'));
15
  class Miniorange_twoFactor{
16
 
29
 
30
  $actions = add_filter('user_row_actions' , array( $this, 'miniorange_reset_users' ),10 , 2 );
31
  add_action( 'admin_footer' , array( $this, 'feedback_request' ) );
32
+ add_action('admin_notices',array( $this, 'mo_wpns_malware_notices' ) );
33
+
34
  if(!defined("DISALLOW_FILE_EDIT") && get_option('mo2f_disable_file_editing') ) define('DISALLOW_FILE_EDIT', true);
35
  $this->includes();
36
+ $notify = new miniorange_security_notification;
37
+ add_action('wp_dashboard_setup', array($notify,'my_custom_dashboard_widgets'));
38
+
 
 
39
  }
40
  // As on plugins.php page not in the plugin
41
  function feedback_request() {
67
  if(is_array($theme_last)){
68
  if(sizeof($theme_current) == sizeof($theme_last)){
69
  foreach ($theme_current as $key => $value) {
70
+ if(isset($theme_last[$key])){
71
+ if($theme_current[$key] != $theme_last[$key]){
72
+ $flag_theme=1;
73
+ break;
74
+ }
75
+ }else{
76
+ $flag_theme = 1;
77
  break;
78
  }
79
  }
90
  if(is_array($plugin_last)){
91
  if(sizeof($plugins_found) == sizeof($plugin_last)){
92
  foreach ($plugins_found as $key => $value) {
93
+ if(isset($plugin_last[$key])){
94
+ if($plugins_found[$key] != $plugin_last[$key]){
95
+ $flag_plugin=1;
96
+ break;
97
+ }
98
+ }else{
99
  $flag_plugin=1;
100
  break;
101
  }
125
  echo MoWpnsMessages::showMessage('WEEKLY_SCAN_CHECK');
126
  }
127
  }
128
+
129
  }
130
  function mo_wpns_widget_menu()
131
  {
174
  }
175
  add_submenu_page( $menu_slug ,'miniOrange 2-Factor' ,'Troubleshooting' ,'administrator','mo_2fa_troubleshooting' , array( $this, 'mo_wpns'),10);
176
  add_submenu_page( $menu_slug ,'miniOrange 2-Factor' ,'Account' ,'administrator','mo_2fa_account' , array( $this, 'mo_wpns'),11);
177
+ add_submenu_page( $menu_slug ,'miniOrange 2-Factor' ,'Addons' ,'administrator','mo_2fa_addons' , array( $this, 'mo_wpns'),10);
178
  add_submenu_page( $menu_slug ,'miniOrange 2-Factor' ,'Upgrade' ,'administrator','mo_2fa_upgrade' , array( $this, 'mo_wpns'),12);
179
  add_submenu_page( $menu_slug ,'miniOrange 2-Factor' ,'Request for Demo' ,'administrator','mo_2fa_request_demo' , array( $this, 'mo_wpns'),13);
180
  $mo2fa_hook_page = add_users_page ('Reset 2nd Factor', null , 'manage_options', 'reset', array( $this, 'mo_reset_2fa_for_users_by_admin' ),66);
208
  add_option('Rate_limiting',0);
209
  add_option('Rate_request',240);
210
  add_option('limitAttack',10);
211
+ add_site_option(base64_encode("totalUsersCloud"),0);
212
+
213
  add_option( 'mo_wpns_check_vulnerable_code', 1);
214
  add_option( 'mo_wpns_check_sql_injection', 1);
215
  add_option( 'mo_wpns_scan_plugins', true);
240
  add_action( 'mo_auth_show_error_message', array($this, 'mo_auth_show_error_message'), 10, 1 );
241
  add_option( 'mo2f_show_sms_transaction_message', 0 );
242
  add_option( 'mo2f_enforce_strong_passswords_for_accounts' ,'all');
243
+ add_option( 'mo2f_onprem_admin' , $userid );
244
+ add_option('mo2f_planname','');
245
+ add_site_option( 'cmVtYWluaW5nT1RQ' ,30);
246
+ add_site_option( 'bGltaXRSZWFjaGVk' ,0);
247
  update_site_option('mo_file_backup_plugins',1);
248
  update_site_option('mo_file_backup_themes',1);
249
  update_site_option('mo_wpns_backup_time',12);
253
  update_site_option('scheduled_db_backup',0);
254
  add_site_option('file_backup_created_time',0);
255
  add_site_option('db_backup_created_time',0);
256
+ add_site_option('mo2f_inline_registration',1);
257
 
258
  add_option('mo_database_backup',1);
259
  add_option('mo_wpns_scan_initialize',1);
262
  add_site_option('mo_file_manual_backup_themes',1);
263
  add_site_option('mo_schedule_database_backup',1);
264
 
265
+ add_option( 'mo_wpns_2fa_with_network_security' , 0);
266
  add_option( 'mo_wpns_2fa_with_network_security_popup_visible', 1);
267
+ if(get_site_option('mo2f_activated_time') == null){
268
+ add_site_option('mo2f_activated_time', time());
269
+ }
270
+ add_option( 'mo2f_two_factor_tour', -1);
271
+ update_site_option('mo2f_plugin_redirect', true);
272
  }
273
 
274
  function mo_wpns_deactivate()
275
  {
 
 
 
 
276
  update_option('mo2f_activate_plugin', 1);
 
 
 
 
 
 
 
277
 
278
  $two_fa_settings = new Miniorange_Authentication();
279
  $two_fa_settings->mo_auth_deactivate();
282
  function mo_wpns_settings_style($hook)
283
  {
284
  if(strpos($hook, 'page_mo_2fa')){
285
+ wp_enqueue_style( 'mo_2fa_admin_settings_jquery_style' , plugins_url('includes/css/jquery.ui.css', __FILE__ ) );
286
+ wp_enqueue_style( 'mo_2fa_admin_settings_phone_style' , plugins_url('includes/css/phone.css', __FILE__ ) );
287
  wp_enqueue_style( 'mo_wpns_admin_settings_style' , plugins_url('includes/css/style_settings.css', __FILE__));
288
  wp_enqueue_style( 'mo_wpns_admin_settings_phone_style' , plugins_url('includes/css/phone.css', __FILE__));
289
  wp_enqueue_style( 'mo_wpns_admin_settings_datatable_style' , plugins_url('includes/css/jquery.dataTables.min.css', __FILE__));
290
  wp_enqueue_style( 'mo_wpns_button_settings_style' , plugins_url('includes/css/button_styles.css',__FILE__));
291
  wp_enqueue_style( 'mo_wpns_popup_settings_style' , plugins_url('includes/css/popup.css',__FILE__));
292
+ $file = plugin_dir_path( __FILE__ ) .'controllers'.DIRECTORY_SEPARATOR. 'pointers.php';
293
+
294
+ $tour_started=get_option('mo2f_tour_started',0);
295
+
296
+
297
+ $manager = new Mo2FAPointersManager( $file, '4.8.52', 'custom_admin_pointers' );
298
+ $manager->parse();
299
+ $pointers = $manager->filter( $hook );
300
+ if ( empty( $pointers ) ) {
301
+ return;
302
+ }
303
+ wp_enqueue_style( 'wp-pointer' );
304
+ $js_url = plugins_url( 'includes\js\pointers.js', __FILE__ );
305
+
306
+ if($tour_started == 3)
307
+ wp_enqueue_script( 'custom_admin_pointers', $js_url, array('wp-pointer'), NULL, TRUE );
308
+ $data = array(
309
+ 'close_label' => __('Close'),
310
+ 'next_label' => __( 'Next' ),
311
+ 'pointers' => $pointers
312
+ );
313
+ wp_localize_script( 'custom_admin_pointers', 'MOAdminPointers', $data );
314
+
315
  }
316
 
317
  }
393
  require('database/database_functions_2fa.php');
394
  require('helper/utility.php');
395
  require('handler/ajax.php');
396
+ require('api/class-customer-common-setup.php');
397
+
398
+ if(!MO2F_IS_ONPREM)
399
+ require('api/class-customer-setup.php');
400
+ else
401
+ require('api/class-customer-onprem-setup.php');
402
  require('api/class-rba-attributes.php');
403
  require('api/class-two-factor-setup.php');
404
  // require('api/mo2f_api.php');
424
  require('controllers/wpns-loginsecurity-ajax.php');
425
  require('controllers/malware_scanner/malware_scan_ajax.php');
426
  require('controllers/backup/backup_ajax.php');
427
+ require('controllers/tour/tour_ajax.php');
428
  require('controllers/twofa/two_factor_ajax.php');
429
  require('controllers/dashboard_ajax.php');
430
  require('handler/malware_scanner/malware_scanner_cron.php');
431
  require('handler/malware_scanner/scanner_set_cron.php');
432
+ require_once "controllers/PointersManager.php";
433
  }
434
 
435
  function miniorange_reset_users($actions, $user_object){
436
+ global $Mo2fdbQueries;
437
+ $mo2f_configured_2FA_method = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user_object->ID );
438
+ if ( current_user_can( 'administrator', $user_object->ID ) && $mo2f_configured_2FA_method ) {
439
  if(get_current_user_id() != $user_object->ID){
440
  $actions['miniorange_reset_users'] = "<a class='miniorange_reset_users' href='" . admin_url( "users.php?page=reset&action=reset_edit&amp;user=$user_object->ID") . "'>" . __( 'Reset 2 Factor', 'cgc_ub' ) . "</a>";
441
  }
487
  }
488
  $user_id = isset($_POST['userid']) && !empty($_POST['userid']) ? $_POST['userid'] : '';
489
  if(!empty($user_id)){
490
+ if ( current_user_can( 'edit_user' ) ){
491
+ global $Mo2fdbQueries;
492
+ delete_user_meta($user_id,'mo2f_kba_challenge');
493
+ delete_user_meta($user_id,'mo2f_2FA_method_to_configure');
494
+ delete_user_meta($user_id,'Security Questions');
495
+ $Mo2fdbQueries->delete_user_details( $user_id);
496
+ delete_user_meta($user_id,'mo2f_2FA_method_to_test');
497
+ }
 
498
  }
499
  }
500
  }
501
 
502
  function mo2f_mapped_email_column_content($value, $column_name, $user_id) {
503
+ global $Mo2fdbQueries;
504
+ $currentMethod = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user_id );
 
505
  if(!$currentMethod)
506
+ $currentMethod = 'Not Registered for 2FA';
 
 
 
 
 
 
 
 
 
507
  if ( 'current_method' == $column_name )
508
  return $currentMethod;
509
  return $value;
readme.txt CHANGED
@@ -1,4 +1,4 @@
1
- === Google Authenticator - WordPress Two Factor Authentication (2FA) ===
2
 
3
  Contributors: cyberlord92, twofactor
4
  Tags: google authenticator, two factor authentication, two factor, 2FA,two-step verification, mobile verification,OTP, two-step verification, mobile verification,two factor,Two step verification, 2FA, TFA, MFA, 2 factor authentication, Remember Device, OTP,WordPress otp, two step authentication,Clef,SMS, email, signup security, two factor auth, Mobile Authentication, strong authentication, 2 step authentication, mobile verification,Multifactor authentication, passwordless login, one time passcode, soft token Authentication, QR Code Authentication, email verification, KBA, Security Questions,2FA, login OTP, login with SMS, mobile login, phone login, OTP login, mobile verification,knowledge based authentication,authy, authy two factor,yubico,Two-Factor Authentication,WordPress otp, security,user security, ​Twilio WordPress, SMS gateway, Solutions Infini, Clickatell, BulkSMS, MSG91, Nexmo, SMS Country, message, woocommerce, website security, login security, multi factor authentication, multi factor,wordfence, IP Blocking, IP Whitelisting, login Audits, woocommerce, SMS login, passwordless login, auth, login with OTP WordPress, OTP, two-step authentication, Mobile Authentication,passwordless login, one time passcode, email verification, security, website security, login security, multi-factor authentication,, woocommerce, smartphone,WordPress otp, register with OTP, user OTP verification, SMS OTP, OTP Email, registration with OTP verification, registration verification,smartphone authentication
@@ -6,11 +6,11 @@ Donate link: https://miniorange.com/
6
  Requires at least: 3.0.1
7
  Tested up to: 5.4
8
  Requires PHP: 5.3.0
9
- Stable tag: 5.4.5
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
13
- Simple & Easy 2FA setup with any App supporting TOTP algorithm like Google, Authy, LastPass Authenticator & other 2FA methods. Supports Google Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA).
14
 
15
  == Description ==
16
 
@@ -18,9 +18,13 @@ Simple & Easy 2FA setup with any App supporting TOTP algorithm like Google, Auth
18
 
19
  Have a completely Secure login to your WordPress website using this FREE, Simple & very easy to setup plugin. It provides two factor authentication (2FA, MFA) whenever login to your WordPress website ensuring no unauthorised access to your website.
20
 
21
- <h4>supports variety of WordPress forms and plugins</h4>
 
 
 
 
22
  * Ultimate Member – User Profile & Membership Form : <a href="https://wordpress.org/plugins/ultimate-member/">Ultimate Member – User Profile & Membership Form</a>
23
- * Restrict Content Form : <a href="https://wordpress.org/plugins/restrict-content/">Restrict Content Form</a>
24
  * My theme Login Form :<a href="https://wordpress.org/plugins/theme-my-login/">My theme Login Form</a>
25
  * User Registration – Custom Registration Form : <a href="https://wordpress.org/plugins/user-registration/">User Registration – Custom Registration Form</a>
26
  * Custom Login Page Customizer Form :<a href="https://wordpress.org/plugins/loginpress/">Custom Login Page Customizer Form</a>
@@ -29,14 +33,15 @@ Have a completely Secure login to your WordPress website using this FREE, Simple
29
  and more.
30
 
31
  <h4>Prevent Account Sharing Between Users</h4>
32
- Many video sharing and E-learing platforms want to prevent sharing of account between the users. This can be done using miniOrange Two factor plugin. Also, elearning portals can use this to their advantage. It can be used on any websites which create and sell courses. It can be integrated with plugins like Learndash.
 
33
 
34
  <h4>FREE Plugin Features</h4>
35
  * Simplified & easy to user interface.
36
  * Two Factor Authentication (2FA) for **3 User** forever FREE!
37
  * **Variety of Authentication Methods:** Any App supporting TOTP algorithm like Google, Authy, LastPass Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA)
38
  * Includes Language Translation Support. Supports a wide variety of languages
39
- * Passwordless login
40
  * This plugin Supports standard TOTP + HOTP protocols for Authentication Methods.
41
  * Two Factor Authentication (2FA) allows authentication on login page itself for Google Authenticator & miniOrange Soft Token.
42
  * Brute force attack prevention & IP Blocking.
@@ -47,25 +52,28 @@ Many video sharing and E-learing platforms want to prevent sharing of account be
47
  * Two Factor Authentication (2FA) for Users as per the upgrade *( User-based pricing )*
48
  * **Available Authentication Methods:** Google, Authy, LastPass Authenticator, QR Code, Push Notification, Soft Token, Security Questions(KBA), OTP Over Email, OTP Over SMS, OTP Over SMS and Email, Email Verification. *( SMS credits need to be purchased as per the need)*
49
  * Includes language Translation Support. Supports wide variety of languages.
50
- * **Multiple Login Options:** Username + password + two-factor (or) Username + two-factor i.e. Passwordless login.
51
  * **Backup Method:** KBA(Security Questions)
52
  * Multisite compatible.
53
- * User role based redirection after Login, Customize account name in Google Authenticator app
54
- * Custom Security Questions (KBA)
55
 
56
  <h4>Premium Plugin Features</h4>
57
 
58
  * Two Factor Authentication (2FA) for Users as per the upgrade *( User-based pricing )*
59
  * **Available Authentication Methods:** Google, Authy, LastPass Authenticator, QR Code, Push Notification, Soft Token, Security Questions(KBA), OTP Over Email, OTP Over SMS, OTP Over SMS and Email, Email Verification, Hardware Token. *( SMS and Email credits need to be purchased as per the need)*
60
  * Language Translation Support
61
- * **Multiple Login Options:** Username + password + two-factor (or) Username + two-factor i.e. Passwordless login.
62
- * **Backup Methods:** KBA(Security Questions), OTP Over Email, Backup Codes
63
  * Multisite compatible.
64
- * Email notification to users asking them to set up Two Factor Authentication (2FA).
65
- * User role based redirection after Login, Custom Security Questions (KBA), Customize account name in Google Authenticator app.
66
- * Enable Two Factor Authentication (2FA) for specific Users/User Roles
67
- * Choose specific authentication methods for Users
 
 
68
  * App Specific Password to login from mobile Apps
 
69
  * **Add-Ons Included:** RBA & Trusted Devices Management Add-on, Personalization Add-on and Short Codes Add-on
70
 
71
  <h4>Enterprise Plugin Features</h4>
@@ -299,6 +307,17 @@ miniOrange authentication service has 15+ authentication methods.One time passco
299
 
300
  == Changelog ==
301
 
 
 
 
 
 
 
 
 
 
 
 
302
  = 5.4.5 =
303
  * Google Authenticator-Two Factor Authentication (2FA) : Security and MFA UI updates.
304
 
@@ -789,6 +808,17 @@ More descriptive setup messages and UI changes.
789
 
790
  == Upgrade Notice ==
791
 
 
 
 
 
 
 
 
 
 
 
 
792
  = 5.4.5 =
793
  * Google Authenticator-Two Factor Authentication (2FA) : Security and MFA UI updates.
794
 
1
+ === Google Authenticator - WordPress Two Factor Authentication (2FA , MFA) ===
2
 
3
  Contributors: cyberlord92, twofactor
4
  Tags: google authenticator, two factor authentication, two factor, 2FA,two-step verification, mobile verification,OTP, two-step verification, mobile verification,two factor,Two step verification, 2FA, TFA, MFA, 2 factor authentication, Remember Device, OTP,WordPress otp, two step authentication,Clef,SMS, email, signup security, two factor auth, Mobile Authentication, strong authentication, 2 step authentication, mobile verification,Multifactor authentication, passwordless login, one time passcode, soft token Authentication, QR Code Authentication, email verification, KBA, Security Questions,2FA, login OTP, login with SMS, mobile login, phone login, OTP login, mobile verification,knowledge based authentication,authy, authy two factor,yubico,Two-Factor Authentication,WordPress otp, security,user security, ​Twilio WordPress, SMS gateway, Solutions Infini, Clickatell, BulkSMS, MSG91, Nexmo, SMS Country, message, woocommerce, website security, login security, multi factor authentication, multi factor,wordfence, IP Blocking, IP Whitelisting, login Audits, woocommerce, SMS login, passwordless login, auth, login with OTP WordPress, OTP, two-step authentication, Mobile Authentication,passwordless login, one time passcode, email verification, security, website security, login security, multi-factor authentication,, woocommerce, smartphone,WordPress otp, register with OTP, user OTP verification, SMS OTP, OTP Email, registration with OTP verification, registration verification,smartphone authentication
6
  Requires at least: 3.0.1
7
  Tested up to: 5.4
8
  Requires PHP: 5.3.0
9
+ Stable tag: 5.4.9
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
13
+ Simple & Easy 2FA setup with any App supporting TOTP algorithm like Google, Authy, LastPass Authenticator & other 2FA methods. Supports Google Authenticator, QR Code, Push Notification, Soft Token and Security Questions.
14
 
15
  == Description ==
16
 
18
 
19
  Have a completely Secure login to your WordPress website using this FREE, Simple & very easy to setup plugin. It provides two factor authentication (2FA, MFA) whenever login to your WordPress website ensuring no unauthorised access to your website.
20
 
21
+ <h4>Supports variety of WordPress forms and plugins</h4>
22
+ * Woocommerce : <a href="https://wordpress.org/plugins/woocommerce/">Woocommerce</a>
23
+ * BuddyPress : <a href="https://wordpress.org/plugins/buddypress/">BuddyPress</a>
24
+ * bbpress : <a href="https://wordpress.org/plugins/bbpress/">bbPress</a>
25
+
26
  * Ultimate Member – User Profile & Membership Form : <a href="https://wordpress.org/plugins/ultimate-member/">Ultimate Member – User Profile & Membership Form</a>
27
+ * Restrict Content Pro Form : <a href="https://wordpress.org/plugins/restrict-content/">Restrict Content Form</a>
28
  * My theme Login Form :<a href="https://wordpress.org/plugins/theme-my-login/">My theme Login Form</a>
29
  * User Registration – Custom Registration Form : <a href="https://wordpress.org/plugins/user-registration/">User Registration – Custom Registration Form</a>
30
  * Custom Login Page Customizer Form :<a href="https://wordpress.org/plugins/loginpress/">Custom Login Page Customizer Form</a>
33
  and more.
34
 
35
  <h4>Prevent Account Sharing Between Users</h4>
36
+ Many video sharing and E-learning platforms want to prevent sharing of account between the users. This can be done using miniOrange Two factor plugin. Also, e-learning portals can use this to their advantage. It can be used on any websites which create and sell courses. It can be integrated with plugins like Learndash.
37
+ Other sites like premium video content or any premium content where you want users not to share passwords between friends and Family then you can go for this solution.
38
 
39
  <h4>FREE Plugin Features</h4>
40
  * Simplified & easy to user interface.
41
  * Two Factor Authentication (2FA) for **3 User** forever FREE!
42
  * **Variety of Authentication Methods:** Any App supporting TOTP algorithm like Google, Authy, LastPass Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA)
43
  * Includes Language Translation Support. Supports a wide variety of languages
44
+ * Passwordless login or login with phone number
45
  * This plugin Supports standard TOTP + HOTP protocols for Authentication Methods.
46
  * Two Factor Authentication (2FA) allows authentication on login page itself for Google Authenticator & miniOrange Soft Token.
47
  * Brute force attack prevention & IP Blocking.
52
  * Two Factor Authentication (2FA) for Users as per the upgrade *( User-based pricing )*
53
  * **Available Authentication Methods:** Google, Authy, LastPass Authenticator, QR Code, Push Notification, Soft Token, Security Questions(KBA), OTP Over Email, OTP Over SMS, OTP Over SMS and Email, Email Verification. *( SMS credits need to be purchased as per the need)*
54
  * Includes language Translation Support. Supports wide variety of languages.
55
+ * **Multiple Login Options:** Username + password + two-factor (or) Username + two-factor i.e. Passwordless login. [Guide](https://docs.miniorange.com/documentation/login-username-2nd-factor-2)
56
  * **Backup Method:** KBA(Security Questions)
57
  * Multisite compatible.
58
+ * User role based redirection after Login [Guide](https://docs.miniorange.com/documentation/custom-redirect-login-url), Customize account name in Google Authenticator app [Guide](https://docs.miniorange.com/documentation/google-authenticator-app-name)
59
+ * Custom Security Questions (KBA) [Guide](https://docs.miniorange.com/documentation/custom-security-questions)
60
 
61
  <h4>Premium Plugin Features</h4>
62
 
63
  * Two Factor Authentication (2FA) for Users as per the upgrade *( User-based pricing )*
64
  * **Available Authentication Methods:** Google, Authy, LastPass Authenticator, QR Code, Push Notification, Soft Token, Security Questions(KBA), OTP Over Email, OTP Over SMS, OTP Over SMS and Email, Email Verification, Hardware Token. *( SMS and Email credits need to be purchased as per the need)*
65
  * Language Translation Support
66
+ * **Multiple Login Options:** Username + password + two-factor (or) Username + two-factor i.e. Passwordless login [Guide](https://docs.miniorange.com/documentation/login-username-2nd-factor-2)
67
+ * **Backup Methods:** KBA(Security Questions), OTP Over Email, Backup Codes [Guide](https://docs.miniorange.com/documentation/want-configure-backup-methods-users-can-configure-case-locked-site-not-able-log)
68
  * Multisite compatible.
69
+ * Force Two factor for users [Guide](https://docs.miniorange.com/documentation/enforce-2fa-users)
70
+ * Email notification to users asking them to set up Two Factor Authentication (2FA) [Guide](https://docs.miniorange.com/documentation/want-send-email-notification-users-setting-2-factor).
71
+ * User role based redirection after Login [Guide](https://docs.miniorange.com/documentation/custom-redirect-login-url), Custom Security Questions (KBA) [Guide](https://docs.miniorange.com/documentation/custom-security-questions), Customize account name in Google Authenticator app [Guide](https://docs.miniorange.com/documentation/google-authenticator-app-name).
72
+ * Enable Two Factor Authentication (2FA) for specific Users/User Roles [Guide](https://docs.miniorange.com/documentation/enable-two-factor-based-roles)
73
+ * Choose specific authentication methods for Users [Guide](https://docs.miniorange.com/documentation/specific-set-authentication-methods-based-role)
74
+ * Set Privacy Policy for users [Guide](https://docs.miniorange.com/documentation/privacy-policy-site)
75
  * App Specific Password to login from mobile Apps
76
+ * Remember Device [Guide](https://docs.miniorange.com/documentation/remember-my-device)
77
  * **Add-Ons Included:** RBA & Trusted Devices Management Add-on, Personalization Add-on and Short Codes Add-on
78
 
79
  <h4>Enterprise Plugin Features</h4>
307
 
308
  == Changelog ==
309
 
310
+ = 5.4.9 =
311
+ * Google Authenticator-Two Factor Authentication (2FA) : User Experience, new support form and Security disabled by default. Added New Methods for users to choose.
312
+
313
+ = 5.4.8 =
314
+ * Google Authenticator-Two Factor Authentication (2FA) : Learning Management System support, Microsoft Authenticator and Duo Authenticator support and restrict account sharing add-on.
315
+ = 5.4.7 =
316
+ * Google Authenticator-Two Factor Authentication (2FA) : Fixing warnings and adding minor changes in the plans.
317
+
318
+ = 5.4.6 =
319
+ * Google Authenticator-Two Factor Authentication (2FA) : Improving Google Authenticator and adding Payment options.
320
+
321
  = 5.4.5 =
322
  * Google Authenticator-Two Factor Authentication (2FA) : Security and MFA UI updates.
323
 
808
 
809
  == Upgrade Notice ==
810
 
811
+ = 5.4.9 =
812
+ * Google Authenticator-Two Factor Authentication (2FA) : User Experience, new support form and Security disabled by default. Added New Methods for users to choose.
813
+
814
+ = 5.4.8 =
815
+ * Google Authenticator-Two Factor Authentication (2FA) : Learning Management System support, Microsoft Authenticator and Duo Authenticator support and restrict account sharing add-on.
816
+ = 5.4.7 =
817
+ * Google Authenticator-Two Factor Authentication (2FA) : Fixing warnings and adding minor changes in the plans.
818
+
819
+ = 5.4.6 =
820
+ * Google Authenticator-Two Factor Authentication (2FA) : Improving Google Authenticator and adding Payment options.
821
+
822
  = 5.4.5 =
823
  * Google Authenticator-Two Factor Authentication (2FA) : Security and MFA UI updates.
824
 
uninstall.php CHANGED
@@ -3,6 +3,16 @@
3
  //if uninstall not called from WordPress exit
4
  if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
5
  exit();
 
 
 
 
 
 
 
 
 
 
6
 
7
  delete_option('mo2f_customerKey');
8
  delete_option('mo2f_api_key');
@@ -23,6 +33,7 @@
23
  delete_option( 'mo_wpns_password');
24
  delete_option( 'mo2f_email');
25
  delete_option( 'mo_wpns_admin_phone');
 
26
 
27
  delete_option( 'mo_wpns_registration_status');
28
  delete_option( 'mo_wpns_block_chrome');
@@ -31,7 +42,32 @@
31
  delete_option( 'mo_wpns_block_safari');
32
  delete_option( 'mo_wpns_block_opera');
33
  delete_option( 'mo_wpns_block_edge');
34
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  delete_option( 'mo_wpns_enable_htaccess_blocking');
36
  delete_option( 'mo_wpns_enable_user_agent_blocking');
37
  delete_option( 'mo_wpns_countrycodes');
@@ -110,7 +146,7 @@
110
  delete_site_option('mo_file_manual_backup_themes');
111
  delete_site_option('mo_schedule_database_backup');
112
 
113
- if(MO2F_IS_ONPREM)
114
  {
115
  $users = get_users( array() );
116
  foreach ( $users as $user ) {
@@ -139,6 +175,12 @@
139
  delete_user_meta( $user->ID, 'mo_2factor_user_registration_status' );
140
  delete_user_meta( $user->ID, 'mo2f_external_app_type' );
141
  delete_user_meta( $user->ID, 'mo2f_user_login_attempts' );
 
 
 
 
 
 
142
  }
143
 
144
  //drop custom db tables
@@ -265,89 +307,6 @@
265
  delete_option( 'mo2fa_' . $id . '_login_url' );
266
  }
267
  }
268
- // } else {
269
- // global $wpdb;
270
-
271
- // $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
272
- // $original_blog_id = get_current_blog_id();
273
-
274
- // foreach ( $blog_ids as $blog_id ) {
275
- // switch_to_blog( $blog_id );
276
- // delete_option( 'mo2f_email' );
277
- // delete_option( 'mo2f_host_name' );
278
- // delete_option( 'user_phone' );
279
- // delete_option( 'mo2f_customerKey' );
280
- // delete_option( 'mo2f_api_key' );
281
- // delete_option( 'mo2f_customer_token' );
282
- // delete_option( 'mo2f_message' );
283
- // delete_option( 'mo_2factor_admin_registration_status' );
284
- // delete_option( 'mo2f_login_message' );
285
- // delete_option( 'mo_2f_login_type_enabled' );
286
- // delete_option( 'mo2f_admin_disabled_status' );
287
- // delete_option( 'mo2f_disabled_status' );
288
- // delete_option( 'mo2f_miniorange_admin' );
289
- // delete_option( 'mo2f_enable_forgotphone' );
290
- // delete_option( 'mo2f_enable_login_with_2nd_factor' );
291
- // delete_option( 'mo2f_activate_plugin' );
292
- // delete_option( 'mo2f_remember_device' );
293
- // delete_option( 'mo2f_app_secret' );
294
- // delete_option( 'mo2f_enable_custom' );
295
- // delete_option( 'mo2f_number_of_transactions' );
296
- // delete_option( 'mo2f_set_transactions' );
297
- // delete_option( 'mo2f_show_sms_transaction_message' );
298
- // update_option( 'mo2f_is_NC', 1 );
299
- // update_option( 'mo2f_is_NNC', 1 );
300
- // delete_option( 'mo2f_proxy_host' );
301
- // delete_option( 'mo2f_port_number' );
302
- // delete_option( 'mo2f_proxy_username' );
303
- // delete_option( 'mo2f_proxy_password' );
304
- // delete_option( 'mo2f_auth_methods_for_users' );
305
- // delete_option( 'mo2f_enable_mobile_support' );
306
- // delete_option( 'mo2f_login_policy' );
307
- // delete_option( 'mo2f_msg_counter' );
308
- // delete_option( 'mo2f_modal_display' );
309
- // delete_option( 'mo2f_disable_poweredby' );
310
- // delete_option( 'mo2f_new_customer' );
311
- // delete_option( 'mo2f_enable_2fa_for_users' );
312
- // delete_option( 'mo2f_phone' );
313
- // delete_option( 'mo2f_existing_user_values_updated' );
314
- // delete_option( 'mo2f_login_option_updated' );
315
- // delete_option( 'mo2f_dbversion' );
316
- // delete_option( 'mo2f_feedback_form' );
317
- // delete_option( 'mo2f_enable_2fa_prompt_on_login_page' );
318
- // delete_option( 'mo2f_configured_2_factor_method' );
319
- // delete_option( 'mo2f_enable_2fa' );
320
- // delete_option( 'kba_questions' );
321
- // delete_option( 'mo2f_customer_selected_plan' );
322
- // delete_option( 'mo2f_admin_first_name' );
323
- // delete_option( 'mo2_admin_last_name' );
324
- // delete_option( 'mo2f_admin_company' );
325
- // delete_option( 'mo2f_db_option_updated' );
326
- // delete_option( 'mo2f_login_option_updated' );
327
- // delete_option( 'mo2f_bug_fix_done' );
328
- // delete_option( 'mo2f_encryption_key' );
329
- // delete_option( 'mo2f_google_appname' );
330
- // //Network Security
331
- // delete_option( 'mo2f_enable_brute_force' );
332
- // delete_option( 'mo2f_ns_whitelist_ip' );
333
- // delete_option( 'mo2f_show_remaining_attempts' );
334
- // delete_option( 'mo2f_ns_blocked_ip' );
335
- // delete_option( 'mo2f_allwed_login_attempts' );
336
- // delete_option( 'mo2f_time_of_blocking_type' );
337
- // delete_option( 'mo2f_network_features' );
338
- // //delete all stored key-value pairs for the roles
339
- // global $wp_roles;
340
- // if ( ! isset( $wp_roles ) ) {
341
- // $wp_roles = new WP_Roles();
342
- // }
343
- // foreach ( $wp_roles->role_names as $id => $name ) {
344
- // delete_option( 'mo2fa_' . $id );
345
- // delete_option( 'mo2fa_' . $id . '_login_url' );
346
- // }
347
-
348
- // }
349
- // switch_to_blog( $original_blog_id );
350
- // }
351
  //delete previous version key-value pairs
352
  delete_option( 'mo_2factor_admin_mobile_registration_status' );
353
  delete_option( 'mo_2factor_registration_status' );
@@ -375,4 +334,5 @@
375
  delete_option( 'donot_show_infected_file_notice');
376
  delete_option( 'donot_show_new_plugin_theme_notice');
377
  delete_option( 'donot_show_weekly_scan_notice');
378
- ?>
 
3
  //if uninstall not called from WordPress exit
4
  if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
5
  exit();
6
+ $value = get_option('mo_wpns_registration_status');
7
+ if( isset( $value ) || !empty( $value ) ) {
8
+ delete_option('mo2f_email');
9
+ }
10
+ update_option('mo2f_activate_plugin', 1);
11
+ delete_option('mo2f_customerKey');
12
+ delete_option('mo2f_api_key');
13
+ delete_option('mo2f_customer_token');
14
+ delete_option('mo_wpns_transactionId');
15
+ delete_option('mo_wpns_registration_status');
16
 
17
  delete_option('mo2f_customerKey');
18
  delete_option('mo2f_api_key');
33
  delete_option( 'mo_wpns_password');
34
  delete_option( 'mo2f_email');
35
  delete_option( 'mo_wpns_admin_phone');
36
+ delete_option( 'mo2f_tour_started');
37
 
38
  delete_option( 'mo_wpns_registration_status');
39
  delete_option( 'mo_wpns_block_chrome');
42
  delete_option( 'mo_wpns_block_safari');
43
  delete_option( 'mo_wpns_block_opera');
44
  delete_option( 'mo_wpns_block_edge');
45
+ delete_site_option(base64_encode("totalUsersCloud"));
46
+ delete_site_option('mo2f_inline_registration');
47
+ delete_option('mo_2factor_user_registration_status');
48
+ delete_site_option( 'mo2f_GA_account_name');
49
+
50
+ delete_option( 'mo_2f_switch_all');
51
+ delete_option( 'mo2f_login_option');
52
+ delete_option( 'mo_wpns_scan_initialize');
53
+ delete_option( 'mo2f_planname');
54
+ delete_option( 'mo2f_activated_time');
55
+ delete_option( 'mo2f_number_of_transactions');
56
+ delete_option( 'mo2f_set_transactions');
57
+ delete_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z');
58
+ delete_option( 'mo2f_enable_xmlrpc');
59
+ delete_option( 'mo2f_scan_initialize');
60
+ delete_option( 'mo2f_scan_nonce');
61
+ delete_option( 'mo2f_onprem_admin');
62
+ delete_option( 'mo2f_two_factor_tour');
63
+ delete_option( 'mo2f_tour_firewall');
64
+ delete_option( 'mo2f_tour_malware_scan');
65
+ delete_option( 'mo2f_tour_advance_blocking');
66
+ delete_option( 'mo2f_tour_backup');
67
+ delete_option( 'mo2f_tour_loginSpam');
68
+ delete_option( 'mo2f_tab_count');
69
+ delete_option( 'mo2f_attempts_before_redirect');
70
+ delete_option( 'mo2f_register_with_another_email');
71
  delete_option( 'mo_wpns_enable_htaccess_blocking');
72
  delete_option( 'mo_wpns_enable_user_agent_blocking');
73
  delete_option( 'mo_wpns_countrycodes');
146
  delete_site_option('mo_file_manual_backup_themes');
147
  delete_site_option('mo_schedule_database_backup');
148
 
149
+ if(get_option('is_onprem'))
150
  {
151
  $users = get_users( array() );
152
  foreach ( $users as $user ) {
175
  delete_user_meta( $user->ID, 'mo_2factor_user_registration_status' );
176
  delete_user_meta( $user->ID, 'mo2f_external_app_type' );
177
  delete_user_meta( $user->ID, 'mo2f_user_login_attempts' );
178
+ delete_user_meta( $user->ID, 'mo2f_transactionId');
179
+ delete_user_meta( $user->ID, 'mo2f_user_phone');
180
+ delete_user_meta( $user->ID, 'miniorageqr');
181
+ delete_user_meta( $user->ID, 'mo2f_google_auth');
182
+ delete_user_meta( $user->ID, 'mo2f_email_miniOrange');
183
+ delete_user_meta( $user->ID, 'mo2f_kba_challenge');
184
  }
185
 
186
  //drop custom db tables
307
  delete_option( 'mo2fa_' . $id . '_login_url' );
308
  }
309
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
  //delete previous version key-value pairs
311
  delete_option( 'mo_2factor_admin_mobile_registration_status' );
312
  delete_option( 'mo_2factor_registration_status' );
334
  delete_option( 'donot_show_infected_file_notice');
335
  delete_option( 'donot_show_new_plugin_theme_notice');
336
  delete_option( 'donot_show_weekly_scan_notice');
337
+ delete_option( 'mo2f_user_sync');
338
+ ?>
views/account/login.php CHANGED
@@ -4,7 +4,13 @@ echo' <form name="f" method="post" action="">
4
  <input type="hidden" name="option" value="mo_wpns_verify_customer" />
5
  <div class="mo_wpns_divided_layout">
6
  <div class="mo_wpns_setting_layout">
7
- <h3>Login with miniOrange</h3>
 
 
 
 
 
 
8
  <p><b>It seems you already have an account with miniOrange. Please enter your miniOrange email and password.</td><a target="_blank" href="https://login.xecurify.com/moas/idp/resetpassword"> Click here if you forgot your password?</a></b></p>
9
  <table class="mo_wpns_settings_table">
10
  <tr>
4
  <input type="hidden" name="option" value="mo_wpns_verify_customer" />
5
  <div class="mo_wpns_divided_layout">
6
  <div class="mo_wpns_setting_layout">
7
+ <h3>Login with miniOrange
8
+ <div style="float: right;">';
9
+ if (isset( $two_fa )) {
10
+ echo '<a class="mo_wpns_button mo_wpns_button1" href="'.$two_fa.'">Back</a> ';
11
+ }
12
+ echo '</div>
13
+ </h3>
14
  <p><b>It seems you already have an account with miniOrange. Please enter your miniOrange email and password.</td><a target="_blank" href="https://login.xecurify.com/moas/idp/resetpassword"> Click here if you forgot your password?</a></b></p>
15
  <table class="mo_wpns_settings_table">
16
  <tr>
views/account/profile.php CHANGED
@@ -4,7 +4,11 @@ echo'
4
  <div class="mo_wpns_divided_layout">
5
  <div class="mo_wpns_setting_layout" >
6
  <div>
7
- <h4>Thank You for registering with miniOrange.</h4>
 
 
 
 
8
  <h3>Your Profile</h3>
9
  <table border="1" style="background-color:#FFFFFF; border:1px solid #CCCCCC; border-collapse: collapse; padding:0px 0px 0px 10px; margin:2px; width:85%">
10
  <tr>
@@ -23,8 +27,26 @@ echo'
23
  <td style="width:45%; padding: 10px;">Token Key</td>
24
  <td style="width:55%; padding: 10px;">'.$token.'</td>
25
  </tr>
 
 
 
 
 
 
 
 
 
 
26
  </table>
27
  <br/>
 
 
 
 
 
 
 
 
28
  <p><a href="#mo_wpns_forgot_password_link">Click here</a> if you forgot your password to your miniOrange account.</p>
29
  </div>
30
  </div>
@@ -39,4 +61,23 @@ echo'
39
  $("#forgot_password_form").submit();
40
  });
41
  });
42
- </script>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  <div class="mo_wpns_divided_layout">
5
  <div class="mo_wpns_setting_layout" >
6
  <div>
7
+ <h4>Thank You for registering with miniOrange.
8
+ <div style="float: right;">';
9
+
10
+ echo '</div>
11
+ </h4>
12
  <h3>Your Profile</h3>
13
  <table border="1" style="background-color:#FFFFFF; border:1px solid #CCCCCC; border-collapse: collapse; padding:0px 0px 0px 10px; margin:2px; width:85%">
14
  <tr>
27
  <td style="width:45%; padding: 10px;">Token Key</td>
28
  <td style="width:55%; padding: 10px;">'.$token.'</td>
29
  </tr>
30
+
31
+ <tr>
32
+ <td style="width:45%; padding: 10px;">Remaining Email transactions</td>
33
+ <td style="width:55%; padding: 10px;">'.$EmailTransactions.'</td>
34
+ </tr>
35
+ <tr>
36
+ <td style="width:45%; padding: 10px;">Remaining SMS transactions</td>
37
+ <td style="width:55%; padding: 10px;">'.$SMSTransactions.'</td>
38
+ </tr>
39
+
40
  </table>
41
  <br/>
42
+ <center>';
43
+ if (isset( $two_fa )) {
44
+
45
+ echo '<a class="mo_wpns_button mo_wpns_button1" href="'.$two_fa.'">Back</a> ';
46
+ }
47
+ echo '
48
+ <a id="mo_logout" class="mo_wpns_button mo_wpns_button1" >Remove Account and Reset Settings</a>
49
+ </center>
50
  <p><a href="#mo_wpns_forgot_password_link">Click here</a> if you forgot your password to your miniOrange account.</p>
51
  </div>
52
  </div>
61
  $("#forgot_password_form").submit();
62
  });
63
  });
64
+ </script>';
65
+
66
+ ?>
67
+ <script type="text/javascript">
68
+ jQuery(document).ready(function()
69
+ {
70
+
71
+ jQuery("#mo_logout").click(function()
72
+ {
73
+ var data =
74
+ {
75
+ 'action' : 'wpns_login_security',
76
+ 'wpns_loginsecurity_ajax' : 'wpns_logout_form',
77
+ };
78
+ jQuery.post(ajaxurl, data, function(response) {
79
+ window.location.reload(true);
80
+ });
81
+ });
82
+ });
83
+ </script>
views/account/register.php CHANGED
@@ -6,7 +6,13 @@ echo'<!--Register with miniOrange-->
6
  <div class="mo_wpns_divided_layout">
7
  <div class="mo_wpns_setting_layout" style="margin-bottom:30px;">
8
 
9
- <h3>Register with miniOrange</h3>
 
 
 
 
 
 
10
  <p>Just complete the short registration below to configure miniOrange 2-Factor plugin. Please enter a valid email id that you have access to. You will be able to move forward after verifying an OTP that we will send to this email.</p>
11
  <table class="mo_wpns_settings_table">
12
  <tr>
6
  <div class="mo_wpns_divided_layout">
7
  <div class="mo_wpns_setting_layout" style="margin-bottom:30px;">
8
 
9
+ <h3>Register with miniOrange
10
+ <div style="float: right;">';
11
+ if (isset( $two_fa )) {
12
+ echo '<a class="mo_wpns_button mo_wpns_button1" href="'.$two_fa.'">Back</a> ';
13
+ }
14
+ echo '</div>
15
+ </h3>
16
  <p>Just complete the short registration below to configure miniOrange 2-Factor plugin. Please enter a valid email id that you have access to. You will be able to move forward after verifying an OTP that we will send to this email.</p>
17
  <table class="mo_wpns_settings_table">
18
  <tr>
views/addons.php ADDED
@@ -0,0 +1,316 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (get_option('mo_2factor_user_registration_status') == 'MO_2_FACTOR_PLUGIN_SETTINGS') {
4
+ $is_customer_registered = 'MO_2_FACTOR_PLUGIN_SETTINGS';
5
+ }
6
+
7
+ $mo2f_feature_description_set_addon = array(
8
+ "This will allow you to set a time limit on the user's session. After that time, the user would be logged out.",
9
+ "Sharing passwords will not work. Only one user will be able to login from one account.",
10
+ "Admin can set the number of allowed deivces per user to login.",
11
+ "This will allow you to logout a Wordpress user who was inactive for a period of time.",
12
+ "Set a fixed time per user session and force log out after that time irrespective of user activity.",
13
+ "Admins can decide the number of active sessions for a particular account. Limiting active sessions prevents friends and family share and access website at the same time.",
14
+ "Users login with Email without worrying for passwords. It only works with 2fa.",
15
+ "You can login with your phone number, OTP will send on your mobile phone, you can skip password for login.",
16
+ "You can login with your username, you can skip password for login.",
17
+ );
18
+ ?>
19
+ <div id="mo_addon_features_only" style="margin-top: 3%;">
20
+
21
+ <div id="mo2f_payment_option" style="margin-top: -2%;width: 93.5%;margin-left: 0%;border: none;box-shadow: none;background: none; padding: 5px 20px 30px 20px;">
22
+ <div>
23
+ <div>
24
+
25
+ <center>
26
+ <div style="width: 92%;background-color: white;padding: 10px;border-top: 4px solid #20b2aa">
27
+ <div style="float: left;">
28
+ <?php echo '<a class="mo_wpns_button mo_wpns_button1" href="'.$two_fa.'">Back</a>';?>
29
+ </div>
30
+ <h1 style="margin-right: 8%;">AddOns</h1>
31
+ </div>
32
+ </center>
33
+ </div>
34
+ <div class="mo_2fa_container">
35
+ <div class="mo_2fa_card-deck">
36
+ <div class="mo_2fa_card mo_2fa_animation" style="border-top: 4px solid #20b2aa;
37
+ background-color: white;width: 30%;margin: 10px;">
38
+ <div class="mo_2fa_Card-header">
39
+ <h3>Learning Management System / Online Courses</h3>
40
+ </div>
41
+ <hr>
42
+ <div class="mo_2fa_card-body" style="padding-bottom: 0%;">
43
+ <h4>
44
+ <span>Session Handling</span>
45
+ <?php echo mo2f_addon_features_on_hover($mo2f_feature_description_set_addon[0]);?>
46
+
47
+ <br>
48
+ <span>Prevent Account Sharing</span>
49
+ <?php echo mo2f_addon_features_on_hover($mo2f_feature_description_set_addon[1]);?>
50
+ <br>
51
+ <span>Restrict no of device per user</span>
52
+ <?php echo mo2f_addon_features_on_hover($mo2f_feature_description_set_addon[2]);?>
53
+ </h4>
54
+ </div>
55
+ <hr>
56
+ <div style="text-align: center;">
57
+ <b><a href="mailto:2fasupport@xecurify.com" class = "mo_wpns_button mo_wpns_button1 "><i>Contact Us</i></a></b>
58
+ </div><br>
59
+ <?php echo mo2f_addon_contact_us();?>
60
+ </div>
61
+ <div class="mo_2fa_card mo_2fa_animation" style="border-top: 4px solid #20b2aa;
62
+ background-color: white;width: 30%;margin: 10px;">
63
+ <div class="mo_2fa_Card-header">
64
+ <h3>User Session Control</h3>
65
+ </div>
66
+ <hr>
67
+ <div class="mo_2fa_card-body" style="padding-bottom: 0%;">
68
+
69
+ <h4>
70
+ <span>Idle Session Control</span>
71
+ <?php echo mo2f_addon_features_on_hover($mo2f_feature_description_set_addon[3]);?>
72
+ <br>
73
+ <span>User Session Timeout</span>
74
+ <?php echo mo2f_addon_features_on_hover($mo2f_feature_description_set_addon[4]);?>
75
+ <br>
76
+ <span>Limit Simultaneous Session</span>
77
+ <?php echo mo2f_addon_features_on_hover($mo2f_feature_description_set_addon[5]);?>
78
+ </h4>
79
+ </div>
80
+ <hr>
81
+ <div style="text-align: center;">
82
+ <b><a href="mailto:2fasupport@xecurify.com" class = "mo_wpns_button mo_wpns_button1 "><i>Contact Us</i></a></b>
83
+ </div><br>
84
+ <?php echo mo2f_addon_contact_us();?>
85
+
86
+ </div>
87
+ <div class="mo_2fa_card mo_2fa_animation" style="border-top: 4px solid #20b2aa;background-color: white;width: 30%;margin: 10px;">
88
+ <div class="mo_2fa_Card-header">
89
+ <h3>Password-Less Login</h3>
90
+ </div>
91
+ <hr>
92
+ <div class="mo_2fa_card-body" style="padding-bottom: 0%;">
93
+ <h4>
94
+ <span>Login with email or</span>
95
+ <?php echo mo2f_addon_features_on_hover($mo2f_feature_description_set_addon[6]);?>
96
+ <br>
97
+ <span>Login with Phone or</span>
98
+ <?php echo mo2f_addon_features_on_hover($mo2f_feature_description_set_addon[7]);?>
99
+ <br>
100
+ <span>Login with username only</span>
101
+ <?php echo mo2f_addon_features_on_hover($mo2f_feature_description_set_addon[8]);?>
102
+ </h4>
103
+ </div><hr>
104
+ <div style="text-align: center;">
105
+ <b><a href="mailto:2fasupport@xecurify.com" class = "mo_wpns_button mo_wpns_button1 "><i>Contact Us</i></a></b>
106
+ </div><br>
107
+ <?php echo mo2f_addon_contact_us();?>
108
+ </div>
109
+ <div class="mo_2fa_card mo_2fa_animation" style="border-top: 4px solid #20b2aa;background-color: white;width: 30%;margin: 10px;">
110
+ <div class="mo_2fa_Card-header">
111
+ <h3>WooCommerce</h3>
112
+ </div>
113
+ <hr>
114
+ <div class="mo_2fa_card-body" style="padding-bottom: 0%;">
115
+ <h4>
116
+ <span>OTP on Login Page</span>
117
+ <br>
118
+ <span>OTP on Registration</span>
119
+ <br><br>
120
+ </h4>
121
+ </div><hr>
122
+ <div style="text-align: center;">
123
+ <b><a href="mailto:2fasupport@xecurify.com" class = "mo_wpns_button mo_wpns_button1 "><i>Contact Us</i></a></b>
124
+ </div><br>
125
+ <?php echo mo2f_addon_contact_us();?>
126
+ </div>
127
+ <div class="mo_2fa_card mo_2fa_animation" style="border-top: 4px solid #20b2aa;background-color: white;width: 30%;margin: 10px;">
128
+ <div class="mo_2fa_Card-header">
129
+ <h3>User Registration</h3>
130
+ </div>
131
+ <hr>
132
+ <div class="mo_2fa_card-body" style="padding-bottom: 0%;">
133
+ <h4>
134
+ <span>OTP on Login Page</span>
135
+ <br>
136
+ <span>OTP on Registration</span>
137
+ <br><br>
138
+ </h4>
139
+ </div><hr>
140
+ <div style="text-align: center;">
141
+ <b><a href="mailto:2fasupport@xecurify.com" class = "mo_wpns_button mo_wpns_button1 "><i>Contact Us</i></a></b>
142
+ </div><br>
143
+ <?php echo mo2f_addon_contact_us();?>
144
+ </div>
145
+ <div class="mo_2fa_card mo_2fa_animation" style="border-top: 4px solid #20b2aa;background-color: white;width: 30%;margin: 10px;">
146
+ <div class="mo_2fa_Card-header">
147
+ <h3>Ultimate Member</h3>
148
+ </div>
149
+ <hr>
150
+ <div class="mo_2fa_card-body" style="padding-bottom: 0%;">
151
+ <h4>
152
+ <span>OTP on Login Page</span>
153
+ <br>
154
+ <span>OTP on Registration</span>
155
+ <br>
156
+ <span>OTP on Reset Password</span>
157
+ </h4>
158
+ </div><hr>
159
+ <div style="text-align: center;">
160
+ <b><a href="mailto:2fasupport@xecurify.com" class = "mo_wpns_button mo_wpns_button1 "><i>Contact Us</i></a></b>
161
+ </div><br>
162
+ <?php echo mo2f_addon_contact_us();?>
163
+ </div>
164
+ <div class="mo_2fa_card mo_2fa_animation" style="border-top: 4px solid #20b2aa;
165
+ background-color: white;width: 30%;margin: 10px">
166
+ <div class="mo_2fa_Card-header">
167
+ <h3>RBA & Trusted Devices Management</h3>
168
+ </div>
169
+ <hr>
170
+ <h1 class="mo_wpns_upgrade_pade_pricing" style="color: #20b2aa">$49</h1>
171
+ <div class="mo_2fa_card-body" style="padding-bottom: 0%;">
172
+ <h3>Features</h3>
173
+ <h4>
174
+ Remember Device<br>
175
+ Limit users to login from specific IPs<br>
176
+ Set Device Limit for the users to login<br><br><br>
177
+
178
+ </h4>
179
+ </div>
180
+ <hr>
181
+ <div style="text-align: center;">
182
+ <?php if(isset($is_customer_registered) )
183
+ {
184
+ ?>
185
+ <button class="mo_wpns_button mo_wpns_button1 " onclick="mo2f_upgradeform('wp_2fa_addon_rba')" >Purchase</button>
186
+ <?php
187
+ }else
188
+ { ?>
189
+ <button class="mo_wpns_button mo_wpns_button1 " onclick="mo2f_register_and_upgradeform('wp_2fa_addon_rba', 'addon_plan')" >Purchase</button>
190
+ <?php
191
+ }
192
+ ?>
193
+ </div>
194
+ <br>
195
+ </div>
196
+ <div class="mo_2fa_card mo_2fa_animation" style="border-top: 4px solid #20b2aa;
197
+ background-color: white;width: 30%;margin: 10px">
198
+ <div class="mo_2fa_Card-header">
199
+ <h3>Personalization Add-on Features</h3>
200
+ </div>
201
+ <hr>
202
+ <h1 class="mo_wpns_upgrade_pade_pricing" style="color: #20b2aa">$199</h1>
203
+ <div class="mo_2fa_card-body" style="padding-bottom: 0%;">
204
+ <h3>Features</h3>
205
+ <h4>
206
+ Custom UI of 2FA popups<br>
207
+ Customize 'powered by' Logo<br>
208
+ Custom Email and SMS Templates<br>
209
+ Customize Plugin Icon and Plugin Name<br><br>
210
+ </h4>
211
+ </div>
212
+ <hr>
213
+ <div style="text-align: center;">
214
+ <?php if( isset($is_customer_registered) )
215
+ {
216
+ ?>
217
+ <button class="mo_wpns_button mo_wpns_button1 " onclick="mo2f_upgradeform('wp_2fa_addon_personalization')" >Purchase</button>
218
+ <?php
219
+ }else
220
+ { ?>
221
+ <button class="mo_wpns_button mo_wpns_button1 " onclick="mo2f_register_and_upgradeform('wp_2fa_addon_personalization')" >Purchase</button>
222
+ <?php }
223
+ ?>
224
+ </div>
225
+ <br>
226
+ </div>
227
+ <div class="mo_2fa_card mo_2fa_animation" style="border-top: 4px solid #20b2aa;
228
+ background-color: white;width: 30%;margin: 10px">
229
+ <div class="mo_2fa_Card-header">
230
+ <h3>Short Codes Add-on Features</h3>
231
+ </div>
232
+ <hr>
233
+ <h1 class="mo_wpns_upgrade_pade_pricing" style="color: #20b2aa">$99</h1>
234
+ <div class="mo_2fa_card-body" style="padding-bottom: 0%;">
235
+ <h3>Features</h3>
236
+ <h4>
237
+ Turn on/off 2-factor by user<br>
238
+ Configure Security Questions by user<br>
239
+ Remember Device from custom forms<br>
240
+ Configure Google Authenticator by user<br>
241
+ On-Demand ShortCodes for specific fuctionalities
242
+
243
+ </h4>
244
+
245
+ </div><hr>
246
+ <div style="text-align: center;">
247
+ <?php if( isset($is_customer_registered) ) {
248
+ ?>
249
+ <button class="mo_wpns_button mo_wpns_button1 " onclick="mo2f_upgradeform('wp_2fa_addon_shortcode')" >Purchase</button>
250
+ <?php
251
+ }else
252
+ { ?>
253
+ <button class="mo_wpns_button mo_wpns_button1 " onclick="mo2f_register_and_upgradeform('wp_2fa_addon_shortcode')" >Purchase</button>
254
+ <?php }
255
+ ?>
256
+ </div>
257
+ <br>
258
+ </div>
259
+ </div>
260
+ </div>
261
+ </div>
262
+ </div>
263
+
264
+ </div>
265
+ <form class="mo2f_display_none_forms" id="mo2fa_loginform"
266
+ action="<?php echo MO_HOST_NAME . '/moas/login'; ?>"
267
+ target="_blank" method="post">
268
+ <input type="email" name="username" value="<?php echo get_option( 'mo2f_email' ); ?>"/>
269
+ <input type="text" name="redirectUrl"
270
+ value="<?php echo MO_HOST_NAME . '/moas/initializepayment'; ?>"/>
271
+ <input type="text" name="requestOrigin" id="requestOrigin"/>
272
+ </form>
273
+
274
+ <form class="mo2f_display_none_forms" id="mo2fa_register_to_upgrade_form"
275
+ method="post">
276
+ <input type="hidden" name="requestOrigin" />
277
+ <input type="hidden" name="mo2fa_register_to_upgrade_nonce"
278
+ value="<?php echo wp_create_nonce( 'miniorange-2-factor-user-reg-to-upgrade-nonce' ); ?>"/>
279
+ </form>
280
+ <script type="text/javascript">
281
+ function mo2f_upgradeform(planType)
282
+ {
283
+ jQuery('#requestOrigin').val(planType);
284
+ jQuery('#mo2fa_loginform').submit();
285
+ }
286
+ function mo2f_register_and_upgradeform(planType, planname)
287
+ {
288
+ jQuery('#requestOrigin').val(planType);
289
+ jQuery('input[name="requestOrigin"]').val(planType);
290
+ jQuery('#mo2fa_register_to_upgrade_form').submit();
291
+
292
+ var data = {
293
+ 'action' : 'wpns_login_security',
294
+ 'wpns_loginsecurity_ajax' : 'wpns_all_plans',
295
+ 'planname' : planname,
296
+ }
297
+ jQuery.post(ajaxurl, data, function(response) {
298
+ });
299
+ }
300
+ </script>
301
+ <?php
302
+ function mo2f_addon_features_on_hover($mo2f_addon_feature)
303
+ {
304
+ return '<div class="mo2f_tooltip_addon">
305
+ <span class="dashicons dashicons-info mo2f_info_tab"></span>
306
+ <span class="mo2f_tooltiptext_addon" >'. $mo2f_addon_feature .'
307
+ </span>
308
+ </div>';
309
+ }
310
+ function mo2f_addon_contact_us()
311
+ {
312
+ return '<div>
313
+ <b>Contact us at <a href="mailto:2fasupport@xecurify.com">2fasupport@xecurify.com</a> or <a href="mailto:info@xecurify.com">info@xecurify.com</a></b>
314
+ </div><br>';
315
+ }
316
+ ?>
views/advanced-blocking.php CHANGED
@@ -6,13 +6,17 @@
6
 
7
  </div>
8
  </div>
9
-
 
 
 
 
10
 
11
  <div id="block_list" class="tabcontent">
12
 
13
  <div class="mo_wpns_divided_layout">
14
- <div class="mo_wpns_setting_layout">
15
- <h2>Manual IP Blocking</h2>
16
 
17
  <h4 class="mo_wpns_setting_layout_inside">Manually block an IP address here:&emsp;&emsp;
18
  <input type="text" name="ManuallyBlockIP" id="ManuallyBlockIP" required placeholder='IP address'pattern="((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}" style="width: 35%; height: 41px" />&emsp;&emsp;
@@ -49,8 +53,8 @@ echo "</td><td>".date("M j, Y, g:i:s a",$blockedip->created_timestamp)."</td>
49
  </div>
50
  </h4>
51
  </div>
52
- <div class="mo_wpns_setting_layout">
53
- <h2>IP Whitelisting</h2>
54
  <h4 class="mo_wpns_setting_layout_inside">Add new IP address to whitelist:&emsp;&emsp;
55
  <input type="text" name="IPWhitelist" id="IPWhitelist" required placeholder='IP address'pattern="((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}" style="width: 40%; height: 41px"/>&emsp;&emsp;
56
  <input type="button" name="WhiteListIP" id="WhiteListIP" value="Whitelist IP" class="mo_wpsn_button mo_wpsn_button1" />
@@ -79,8 +83,8 @@ echo' </tbody>
79
 
80
 
81
 
82
- <div class="mo_wpns_setting_layout">
83
- <h2>IP LookUp</h2>
84
  <h4 class="mo_wpns_setting_layout_inside">Enter IP address you Want to check:&emsp;&emsp;
85
  <input type="text" name="ipAddresslookup" id="ipAddresslookup" required placeholder='IP address'pattern="((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}" style="width: 40%; height: 41px"/>&emsp;&emsp;
86
  <input type="button" name="LookupIP" id="LookupIP" value="LookUp IP" class="mo_wpsn_button mo_wpsn_button1" />
@@ -97,9 +101,9 @@ echo' </tbody>
97
  <?php
98
  echo '<div id="adv_block" class="tabcontent">';
99
  echo'<div class="mo_wpns_divided_layout">
100
- <div class="mo_wpns_setting_layout">';
101
 
102
- echo' <h2>IP Address Range Blocking</h2>
103
  You can block range of IP addresses here ( Examples: 192.168.0.100 - 192.168.0.190 )
104
  <form name="f" method="post" action="" id="iprangeblockingform" >
105
  <input type="hidden" name="option" value="mo_wpns_block_ip_range" />
@@ -116,26 +120,12 @@ echo '
116
  <a style="cursor:pointer" id="add_ran">Add IP Range</a>
117
  ';
118
 
119
- /*echo '
120
-
121
-
122
- <table id="iprangeblockingtable">';*/
123
-
124
- //for($i = 1 ; $i <= $range_count ; $i++){
125
- /*echo' <tr><td style="width:300px"><input style="padding:0px 10px" class="mo_wpns_table_textbox" type="text" name="range_'.$i.'"
126
- value="'.get_option("mo_wpns_iprange_range_".$i).'" placeholder=" e.g 192.168.0.100 - 192.168.0.190" /></td></tr>';
127
- */
128
- //}
129
-
130
- /*echo' </table>
131
- <a style="cursor:pointer" id="add_range">Add More Range</a> <br><br>
132
- ';*/
133
  echo' <br><input type="submit" class="mo_wpns_button mo_wpns_button1" value="Block IP range" />
134
 
135
  </form>
136
  </div>
137
 
138
- <div class="mo_wpns_setting_layout">
139
  <h3>htaccess level blocking</h3>
140
  <p>It help you secure your website from unintended user with htaccess website security protection which blocks user request on server(apache) level before reaching your WordPress and saves lots of load on server.</p>
141
 
@@ -151,8 +141,8 @@ echo '
151
  </div>
152
 
153
 
154
- <div class="mo_wpns_setting_layout">
155
- <h3>Browser Blocking</h3>
156
  <!-- <div class="mo_wpns_subheading">This protects your site from robots and other automated scripts.</div> -->
157
  <form id="mo_wpns_enable_user_agent_blocking" method="post" action="">
158
  <input type="hidden" name="option" value="mo_wpns_enable_user_agent_blocking">
@@ -206,7 +196,7 @@ echo' </table>
206
  <br>
207
  </div>
208
 
209
- <div class="mo_wpns_setting_layout">
210
  <h2>Country Blocking</h2>
211
  <b>Select countries from below which you want to block.</b><br><br>
212
  <form name="f" method="post" action="" id="countryblockingform" >
@@ -275,7 +265,7 @@ function block_function(evt, cityName) {
275
  tablinks[i].className = tablinks[i].className.replace(" active", "");
276
  }
277
 
278
- localStorage.setItem("lastTabadv",cityName);
279
  evt.currentTarget.className += " active";
280
 
281
  if(cityName == "defaultOpen")
@@ -286,25 +276,27 @@ function block_function(evt, cityName) {
286
 
287
  }
288
 
289
- var tab = localStorage.getItem("lastTabadv");
290
 
291
  if(tab == "block_list")
292
  {
293
- document.getElementById("block_list").style.display = "block";
294
- document.getElementById("adv_block").style.display = "none";
295
- jQuery("#defaultOpen").addClass(" active");
 
296
 
297
  }
298
  else if(tab == "adv_block")
299
  {
300
- document.getElementById("adv_block").style.display = "block";
301
- document.getElementById("block_list").style.display = "none";
302
- jQuery("#adv_block_subtab").addClass(" active");
 
303
  }
304
  else
305
  {
306
  document.getElementById("defaultOpen").click();
307
- jQuery("#defaultOpen").addClass(" active");
308
  }
309
 
310
  jQuery('#BlockIP').click(function(){
@@ -540,4 +532,4 @@ function nav_popup() {
540
  document.getElementById("notice_div").style.width = "40%";
541
  setTimeout(function(){ $('#notice_div').fadeOut('slow'); }, 3000);
542
  }
543
- </script>
6
 
7
  </div>
8
  </div>
9
+ <?php
10
+ global $mo2f_dirName;
11
+ $setup_dirName = $mo2f_dirName.'views'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'link_tracer.php';
12
+ include $setup_dirName;
13
+ ?>
14
 
15
  <div id="block_list" class="tabcontent">
16
 
17
  <div class="mo_wpns_divided_layout">
18
+ <div class="mo_wpns_setting_layout" id="mo2f_manual_ip_blocking">
19
+ <h2>Manual IP Blocking <a href='<?php echo $two_factor_premium_doc['Manual IP Blocking'];?>' target="_blank"><span class="dashicons dashicons-text-page" style="font-size:30px;color:#269eb3;float: right;"></span></a></h2>
20
 
21
  <h4 class="mo_wpns_setting_layout_inside">Manually block an IP address here:&emsp;&emsp;
22
  <input type="text" name="ManuallyBlockIP" id="ManuallyBlockIP" required placeholder='IP address'pattern="((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}" style="width: 35%; height: 41px" />&emsp;&emsp;
53
  </div>
54
  </h4>
55
  </div>
56
+ <div class="mo_wpns_setting_layout" id="mo2f_ip_whitelisting">
57
+ <h2>IP Whitelisting<a href="https://developers.miniorange.com/docs/security/wordpress/wp-security/IP-blocking-whitelisting-lookup#wp-ip-whitelisting" target="_blank"><span class="dashicons dashicons-text-page" style="font-size:30px;color:#269eb3;float: right;"></span></a></h2>
58
  <h4 class="mo_wpns_setting_layout_inside">Add new IP address to whitelist:&emsp;&emsp;
59
  <input type="text" name="IPWhitelist" id="IPWhitelist" required placeholder='IP address'pattern="((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}" style="width: 40%; height: 41px"/>&emsp;&emsp;
60
  <input type="button" name="WhiteListIP" id="WhiteListIP" value="Whitelist IP" class="mo_wpsn_button mo_wpsn_button1" />
83
 
84
 
85
 
86
+ <div class="mo_wpns_setting_layout" id="mo2f_ip_lookup">
87
+ <h2>IP LookUp<a href='<?php echo $two_factor_premium_doc['IP LookUp'];?>' target="_blank"><span class="dashicons dashicons-text-page" style="font-size:30px;color:#269eb3;float: right;"></span></a></h2>
88
  <h4 class="mo_wpns_setting_layout_inside">Enter IP address you Want to check:&emsp;&emsp;
89
  <input type="text" name="ipAddresslookup" id="ipAddresslookup" required placeholder='IP address'pattern="((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}" style="width: 40%; height: 41px"/>&emsp;&emsp;
90
  <input type="button" name="LookupIP" id="LookupIP" value="LookUp IP" class="mo_wpsn_button mo_wpsn_button1" />
101
  <?php
102
  echo '<div id="adv_block" class="tabcontent">';
103
  echo'<div class="mo_wpns_divided_layout">
104
+ <div class="mo_wpns_setting_layout" id= "mo2f_ip_range_blocking">';
105
 
106
+ echo' <h2>IP Address Range Blocking<a href='.$two_factor_premium_doc['IP Address Range Blocking'].' target="_blank"><span class="dashicons dashicons-text-page" style="font-size:23px;color:#269eb3;float: right;"></span></a></h2>
107
  You can block range of IP addresses here ( Examples: 192.168.0.100 - 192.168.0.190 )
108
  <form name="f" method="post" action="" id="iprangeblockingform" >
109
  <input type="hidden" name="option" value="mo_wpns_block_ip_range" />
120
  <a style="cursor:pointer" id="add_ran">Add IP Range</a>
121
  ';
122
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  echo' <br><input type="submit" class="mo_wpns_button mo_wpns_button1" value="Block IP range" />
124
 
125
  </form>
126
  </div>
127
 
128
+ <div class="mo_wpns_setting_layout" id="mo2f_htaccess_blocking">
129
  <h3>htaccess level blocking</h3>
130
  <p>It help you secure your website from unintended user with htaccess website security protection which blocks user request on server(apache) level before reaching your WordPress and saves lots of load on server.</p>
131
 
141
  </div>
142
 
143
 
144
+ <div class="mo_wpns_setting_layout" id="mo2f_browser_blocking">
145
+ <h3>Browser Blocking<a href='.$two_factor_premium_doc['Browser Blocking'].' target="_blank"><span class="dashicons dashicons-text-page" style="font-size:30px;color:#269eb3;float: right;"></span></a></h3>
146
  <!-- <div class="mo_wpns_subheading">This protects your site from robots and other automated scripts.</div> -->
147
  <form id="mo_wpns_enable_user_agent_blocking" method="post" action="">
148
  <input type="hidden" name="option" value="mo_wpns_enable_user_agent_blocking">
196
  <br>
197
  </div>
198
 
199
+ <div class="mo_wpns_setting_layout" id="mo2f_country_blocking">
200
  <h2>Country Blocking</h2>
201
  <b>Select countries from below which you want to block.</b><br><br>
202
  <form name="f" method="post" action="" id="countryblockingform" >
265
  tablinks[i].className = tablinks[i].className.replace(" active", "");
266
  }
267
 
268
+ localStorage.setItem("last_tab",cityName);
269
  evt.currentTarget.className += " active";
270
 
271
  if(cityName == "defaultOpen")
276
 
277
  }
278
 
279
+ var tab = localStorage.getItem("last_tab");
280
 
281
  if(tab == "block_list")
282
  {
283
+ document.getElementById("defaultOpen").click();
284
+ // document.getElementById("block_list").style.display = "block";
285
+ // document.getElementById("adv_block").style.display = "none";
286
+ // jQuery("#defaultOpen").addClass(" active");
287
 
288
  }
289
  else if(tab == "adv_block")
290
  {
291
+ document.getElementById("adv_block_subtab").click();
292
+ // document.getElementById("adv_block").style.display = "block";
293
+ // document.getElementById("block_list").style.display = "none";
294
+ // jQuery("#adv_block_subtab").addClass(" active");
295
  }
296
  else
297
  {
298
  document.getElementById("defaultOpen").click();
299
+ // jQuery("#defaultOpen").addClass(" active");
300
  }
301
 
302
  jQuery('#BlockIP').click(function(){
532
  document.getElementById("notice_div").style.width = "40%";
533
  setTimeout(function(){ $('#notice_div').fadeOut('slow'); }, 3000);
534
  }
535
+ </script>
views/backup/backup.php CHANGED
@@ -58,10 +58,10 @@
58
  tablinks[i].className = tablinks[i].className.replace(" active", "");
59
  }
60
  document.getElementById(tabname).style.display = "block";
61
- localStorage.setItem("lastTabbackup", tabname);
62
  evt.currentTarget.className += " active";
63
  }
64
- var tab = localStorage.getItem("lastTabbackup");
65
 
66
  if(tab == "setting_backup"){
67
  document.getElementById("backup_set").click();
@@ -74,6 +74,6 @@
74
  }
75
 
76
  else{
77
- document.getElementById("backup").click();
78
  }
79
- </script>
58
  tablinks[i].className = tablinks[i].className.replace(" active", "");
59
  }
60
  document.getElementById(tabname).style.display = "block";
61
+ localStorage.setItem("last_tab", tabname);
62
  evt.currentTarget.className += " active";
63
  }
64
+ var tab = localStorage.getItem("last_tab");
65
 
66
  if(tab == "setting_backup"){
67
  document.getElementById("backup_set").click();
74
  }
75
 
76
  else{
77
+ document.getElementById("backup_set").click();
78
  }
79
+ </script>
views/backup/backup_schdule.php CHANGED
@@ -1,15 +1,18 @@
1
  <?php
 
 
 
2
  add_action('admin_footer','mo_wpns_schedule_backup');
3
- // mo_wpns_schedule_setting_layout
4
  ?>
5
 
6
 
7
- <div class="mo_wpns_setting_layout">
8
  <br>
9
  <table class="mo_wpns_settings_table font_class">
10
  <tr>
11
  <th>Scheduled file backup </th>
12
  <th>Scheduled database backup </th>
 
13
  </tr>
14
  <tr><td>&nbsp;</td><td></td></tr>
15
  <tr>
@@ -56,7 +59,7 @@ add_action('admin_footer','mo_wpns_schedule_backup');
56
  </table>
57
 
58
  </div>
59
- <div class="mo_wpns_setting_layout text_size" >
60
 
61
  <form id="" method="post" action="">
62
  <br>
1
  <?php
2
+ global $mo2f_dirName;
3
+ $setup_dirName = $mo2f_dirName.'views'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'link_tracer.php';
4
+ include $setup_dirName;
5
  add_action('admin_footer','mo_wpns_schedule_backup');
 
6
  ?>
7
 
8
 
9
+ <div class="mo_wpns_setting_layout" id = "mo2f_schedule_backup_status">
10
  <br>
11
  <table class="mo_wpns_settings_table font_class">
12
  <tr>
13
  <th>Scheduled file backup </th>
14
  <th>Scheduled database backup </th>
15
+ <th><a href='<?php echo $two_factor_premium_doc['Scheduled database'];?>' target="_blank"><span class="dashicons dashicons-text-page" style="font-size:23px;color:#269eb3;margin-top: 0.5em;float: right;"></span></a></th>
16
  </tr>
17
  <tr><td>&nbsp;</td><td></td></tr>
18
  <tr>
59
  </table>
60
 
61
  </div>
62
+ <div class="mo_wpns_setting_layout text_size" id= "mo2f_auto_dbbackup">
63
 
64
  <form id="" method="post" action="">
65
  <br>
views/backup/backup_setting_view.php CHANGED
@@ -3,7 +3,7 @@
3
  ?>
4
 
5
 
6
- <div class="mo_wpns_setting_layout">
7
  <div class="mo_wpns_subheading"></div>
8
  <br>
9
  <form id="abc" method="post" action="">
3
  ?>
4
 
5
 
6
+ <div class="mo_wpns_setting_layout" id="mo2f_select_files_backup">
7
  <div class="mo_wpns_subheading"></div>
8
  <br>
9
  <form id="abc" method="post" action="">
views/content-protection.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  echo'<div>
4
- <div class="mo_wpns_setting_layout">';
5
 
6
  echo' <h3>Content Protection</h3>
7
  <form id="mo_wpns_content_protection" method="post" action="">
@@ -29,7 +29,7 @@
29
 
30
 
31
  echo '
32
- <div class="mo_wpns_setting_layout">
33
  <h3>Comment SPAM</h3>
34
  <p>This plugins prevents comment spam without requiring you to moderate any comments.</p>
35
  <form id="mo_wpns_enable_comment_spam_blocking" method="post" action="">
1
  <?php
2
 
3
  echo'<div>
4
+ <div class="mo_wpns_setting_layout" id="mo2f_content_protection">';
5
 
6
  echo' <h3>Content Protection</h3>
7
  <form id="mo_wpns_content_protection" method="post" action="">
29
 
30
 
31
  echo '
32
+ <div class="mo_wpns_setting_layout" id= "mo2f_comment_protection">
33
  <h3>Comment SPAM</h3>
34
  <p>This plugins prevents comment spam without requiring you to moderate any comments.</p>
35
  <form id="mo_wpns_enable_comment_spam_blocking" method="post" action="">
views/dashboard.php CHANGED
@@ -14,13 +14,22 @@ echo '<div id="mo_switch_message" style=" padding:8px"></div>';
14
  echo '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
15
  <div class="mo_wpns_divided_layout">
16
 
17
- <div class="mo_wpns_dashboard_layout">
18
  <center>
19
- <div class ="mo_wpns_inside_dashboard_layout ">Failed Login<hr class="line"><p class ="wpns_font_size mo_wpns_dashboard_text" >'.$wpns_attacks_blocked.'</p></div>
20
- <div class ="mo_wpns_inside_dashboard_layout">Attacks Blocked <hr class="line"><p class ="wpns_font_size mo_wpns_dashboard_text">'.$totalAttacks.'</p></div>
21
- <div class ="mo_wpns_inside_dashboard_layout">Blocked IPs<hr class="line"><p class ="wpns_font_size mo_wpns_dashboard_text">'.$wpns_count_ips_blocked.'</p></div>
22
- <div class ="mo_wpns_inside_dashboard_layout">Infected Files<hr class="line"><p class ="wpns_font_size mo_wpns_dashboard_text" >'.$total_malicious.'</p></div>
23
- <div class ="mo_wpns_inside_dashboard_layout">White-listed IPs<hr class="line"><p class ="wpns_font_size mo_wpns_dashboard_text">'.$wpns_count_ips_whitelisted.'</p></div>
 
 
 
 
 
 
 
 
 
24
 
25
 
26
  </center>
@@ -29,7 +38,7 @@ echo '<meta name="viewport" content="width=device-width, initial-scale=1, maximu
29
 
30
  <div style="padding: 0px 0px 0px 5px;text-align:center" >
31
  <form name="tab_all" id="tab_all" method="post">
32
- <h3 style="text-align:right;margin-right:4.5%;">Enable All
33
  <label class="mo_wpns_switch">
34
  <input type="hidden" name="option" value="tab_all_switch"/>
35
  <input type=checkbox id="switch_all" name="switch_val" value="1" '.$all_on.' />
@@ -176,7 +185,12 @@ echo '<meta name="viewport" content="width=device-width, initial-scale=1, maximu
176
 
177
  </div>
178
 
179
- </div> ';
 
 
 
 
 
180
 
181
  function mo_2fa_dashboard_switch(){
182
  if ( ('admin.php' != basename( $_SERVER['PHP_SELF'] )) || ($_GET['page'] != 'mo_2fa_dashboard') ) {
14
  echo '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
15
  <div class="mo_wpns_divided_layout">
16
 
17
+ <div class="mo_wpns_dashboard_layout" style= "background-color: white;width: 94.5%;border: 2px solid #20b2aa;padding-bottom: 52px;">
18
  <center>
19
+ <div class ="mo_wpns_inside_dashboard_layout "><p style="font-weight: bold;">Failed Login</p><p class ="wpns_font_size mo_wpns_dashboard_text" >'.$wpns_attacks_blocked.'</p>
20
+ <a class="mo_wpns_button_info_tab" onclick="clear_Local_storage()" style="color:white;" href="admin.php?page=mo_2fa_reports&tab=default&view">Details</a>
21
+
22
+ </div>
23
+
24
+
25
+ <div class ="mo_wpns_inside_dashboard_layout"><p style="font-weight: bold;">Attacks Blocked </p><p class ="wpns_font_size mo_wpns_dashboard_text">'.$totalAttacks.'</p><a class="mo_wpns_button_info_tab" style="color:white;" onclick="clear_Local_storage()" href="admin.php?page=mo_2fa_waf">Details</a></div>
26
+
27
+
28
+ <div class ="mo_wpns_inside_dashboard_layout"><p style="font-weight: bold;">Blocked IPs</p><p class ="wpns_font_size mo_wpns_dashboard_text">'.$wpns_count_ips_blocked.'</p><a class="mo_wpns_button_info_tab" style="color:white;" onclick="clear_Local_storage()" href="admin.php?page=mo_2fa_advancedblocking">Details</a></div>
29
+
30
+ <div class ="mo_wpns_inside_dashboard_layout"><p style="font-weight: bold;">Infected Files</p><p class ="wpns_font_size mo_wpns_dashboard_text" >'.$total_malicious.'</p><a class="mo_wpns_button_info_tab" style="color:white;" onclick="clear_Local_storage()" href="admin.php?page=mo_2fa_malwarescan">Details</a></div>
31
+
32
+ <div class ="mo_wpns_inside_dashboard_layout"><p style="font-weight: bold;">White-listed IPs</p><p class ="wpns_font_size mo_wpns_dashboard_text">'.$wpns_count_ips_whitelisted.'</p><a class="mo_wpns_button_info_tab" style="color:white;" onclick="clear_Local_storage()" href="admin.php?page=mo_2fa_advancedblocking">Details</a></div>
33
 
34
 
35
  </center>
38
 
39
  <div style="padding: 0px 0px 0px 5px;text-align:center" >
40
  <form name="tab_all" id="tab_all" method="post">
41
+ <h3 style="text-align:center;margin-right:4.5%;">Enable All
42
  <label class="mo_wpns_switch">
43
  <input type="hidden" name="option" value="tab_all_switch"/>
44
  <input type=checkbox id="switch_all" name="switch_val" value="1" '.$all_on.' />
185
 
186
  </div>
187
 
188
+ </div>
189
+ <script>
190
+ function clear_Local_storage(){
191
+ localStorage.clear();
192
+ }
193
+ </script>';
194
 
195
  function mo_2fa_dashboard_switch(){
196
  if ( ('admin.php' != basename( $_SERVER['PHP_SELF'] )) || ($_GET['page'] != 'mo_2fa_dashboard') ) {
views/feedback_footer.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ echo' <div class="mo_otp_footer">
3
+ <div class="mo-2fa-mail-button">
4
+ <img id= "mo_wpns_support_layout_tour" src="'.dirname(plugin_dir_url(__FILE__)).'/includes/images/mo_support_icon.png" class="show_support_form" onclick="openForm()">
5
+ </div>
6
+ <button type="button" class="mo-2fa-help-button-text" onclick="openForm()"">Hello there!<br>Need Help? Drop us an Email</button>
7
+ </div>';
8
+ ?>
9
+
10
+
11
+ <div id="feedback_form_bg" >
12
+ <div class="mo2f-chat-popup" id="myForm" style="display:none; width: 100%;padding: 1%; padding-top: 50%;background-color: rgba(0,0,0,0.61);">
13
+
14
+ <div id ='mo_wpns_support_layout_tour_open' style="background-color: white;min-height: 370px;width: 45%; text-align: right;float: right;border-radius: 8px;">
15
+ <div style="min-height: 500px;background-image: linear-gradient(to bottom right, #dffffd, #8feeea);width: 43%;float: left;padding: 10px; border-bottom-left-radius: 8px;border-top-left-radius: 8px;">
16
+ <center>
17
+ <?php
18
+ echo '
19
+ <img src="'.dirname(plugin_dir_url(__FILE__)).'/includes/images/minirange-logo.png" style="width: 46%;">';
20
+ ?>
21
+ <h1 style=" font-family: auto;">Contact Information</h1>
22
+ </center><br>
23
+ <div style="text-align: left;padding: 3%;">
24
+ <table>
25
+ <tr>
26
+ <td>
27
+ <span class="dashicons dashicons-email"></span>
28
+ </td>
29
+ <td><h3>2fasupport@xecurify.com</h3>
30
+ </td>
31
+ </tr>
32
+ <tr>
33
+ <td>
34
+ <span class="dashicons dashicons-email"></span>
35
+ </td>
36
+ <td><h3>info@xecurify.com</h3>
37
+ </td>
38
+ </tr>
39
+ <!-- <tr>
40
+ <td>
41
+ <span class="dashicons dashicons-phone"></span>
42
+ </td>
43
+ <td><h3>+91 9876543210</h3>
44
+ </td>
45
+ </tr> -->
46
+ <tr>
47
+ <td>
48
+ <span class="dashicons dashicons-admin-site-alt3"></span>
49
+ </td>
50
+ <td><h3><a href="https://miniorange.com/" target="_blank"> www.miniorange.com</a></h3>
51
+ </td>
52
+ </tr>
53
+
54
+ </table><br>
55
+
56
+ </div>
57
+ </div>
58
+ <div class="mo2f-form-container">
59
+ <span class="mo2f_rating_close" onclick="closeForm()">×</span>
60
+ <h1 style="text-align: center; font-family: auto;">Contact Us</h1>
61
+
62
+ <form name="f" method="post" action="" id="mo_wpns_query_form_close">
63
+ <div style="width: 100%;">
64
+
65
+
66
+ <div id="low_rating" style="display: block; width: 100%;">
67
+ <div style=" float: left;">
68
+
69
+ <br>
70
+ <?php
71
+ echo '
72
+ <table class="mo_wpns_settings_table">
73
+ <tr><td>
74
+ <span class="mo_support_input_label">Your Email</span>
75
+ <input type="email" class="mo_wpns_table_textbox" id="query_email" name="query_email" style="border: none;border-bottom: 1px solid;" value="'.$email.'" placeholder="Enter your email" required />
76
+ </td>
77
+ </tr>
78
+ <tr><td>
79
+ <span class="mo_support_input_label">Your Phone Number</span>
80
+ <input type="text" class="mo_wpns_table_textbox" name="query_phone" id="query_phone" style="border: none;border-bottom: 1px solid;" value="'.$phone.'" placeholder="Enter your phone"/>
81
+ </td>
82
+ </tr>
83
+ <tr>
84
+ <td>
85
+ <textarea id="query" name="query" class="mo_wpns_settings_textarea" style="resize: vertical;width:100%;border: 1px solid;" cols="52" rows="7" onkeyup="mo_wpns_valid(this)" onblur="mo_wpns_valid(this)" onkeypress="mo_wpns_valid(this)" placeholder="Write your query here"></textarea>
86
+ </td>
87
+ </tr>
88
+ </table>
89
+ ';
90
+ ?>
91
+
92
+ <div id="send_button" style="display: block; text-align: center;">
93
+ <input type="button" name="miniorange_skip_feedback"
94
+ class="mo_wpns_button mo_wpns_button1" value="Send" onclick="document.getElementById('mo_wpns_query_form_close').submit();"/>
95
+ </div>
96
+
97
+ </div>
98
+
99
+ </div>
100
+
101
+ </div>
102
+ <input type="hidden" name="option" value="mo_wpns_send_query"/>
103
+
104
+ </form>
105
+ </div>
106
+
107
+ </div>
108
+ </div>
109
+ </div>
110
+
111
+ <script>
112
+
113
+ function openForm() {
114
+ document.getElementById("myForm").style.display = "block";
115
+ document.getElementById("feedback_form_bg").style.display = "block";
116
+ }
117
+
118
+ function closeForm() {
119
+ document.getElementById("myForm").style.display = "none";
120
+ document.getElementById("feedback_form_bg").style.display = "none";
121
+
122
+ }
123
+ </script>
views/ip-blocking.php CHANGED
@@ -3,7 +3,7 @@
3
  echo'<div class="mo_wpns_divided_layout">
4
  <div class="mo_wpns_setting_layout">';
5
 
6
- echo' <h2>IP LookUP</h2>
7
  <form name="f" method="post" action="" id="iplookup">
8
  <input type="hidden" name="option" value="mo_wpns_ip_lookup" />
9
  <table style="width:100%;">
3
  echo'<div class="mo_wpns_divided_layout">
4
  <div class="mo_wpns_setting_layout">';
5
 
6
+ echo' <h2>IP LookUP<a href="https://developers.miniorange.com/docs/security/wordpress/wp-security/IP-blocking-whitelisting-lookup#wp-ip-lookup" target="_blank"><span class="dashicons dashicons-text-page" style="font-size:30px;color:#269eb3;float: right;"></span></a></h2>
7
  <form name="f" method="post" action="" id="iplookup">
8
  <input type="hidden" name="option" value="mo_wpns_ip_lookup" />
9
  <table style="width:100%;">
views/login-security.php CHANGED
@@ -1,12 +1,16 @@
1
  <?php
 
 
 
 
2
  add_action( 'admin_footer', 'login_security_ajax' );
3
  echo '
4
  <div id="wpns_message" style=" padding-top:8px"></div>
5
  <div>
6
- <div class="mo_wpns_setting_layout">';
7
 
8
 
9
- echo ' <h3>Brute Force Protection ( Login Protection )</h3>
10
  <div class="mo_wpns_subheading">This protects your site from attacks which tries to gain access / login to a site with random usernames and passwords.</div>
11
 
12
  <input id="mo_bf_button" type="checkbox" name="enable_brute_force_protection" '.$brute_force_enabled.'> Enable Brute force protection
@@ -53,8 +57,8 @@ echo' <form id="mo_wpns_enable_brute_force_form" method="post" action="">
53
 
54
  echo'
55
  </div>
56
- <div class="mo_wpns_setting_layout">
57
- <h3>Google reCAPTCHA</h3>
58
  <div class="mo_wpns_subheading">Google reCAPTCHA protects your website from spam and abuse. reCAPTCHA uses an advanced risk analysis engine and adaptive CAPTCHAs to keep automated software from engaging in abusive activities on your site. It does this while letting your valid users pass through with ease.</div>
59
  <form id="mo_wpns_activate_recaptcha" method="post" action="">
60
  <input type="hidden" name="option" value="mo_wpns_activate_recaptcha">
@@ -91,8 +95,8 @@ echo' <p>Before you can use reCAPTCHA, you must need to register your domain/w
91
  echo '<br>
92
  </div>
93
 
94
- <div class="mo_wpns_setting_layout">
95
- <h3>Enforce Strong Passwords </h3>
96
  <div class="mo_wpns_subheading">Checks the password strength of admin and other users to enhance login security</div>
97
 
98
  <form id="mo_wpns_enable_brute_force_form" method="post" action="">
@@ -270,6 +274,4 @@ function nav_popup() {
270
  </script>
271
 
272
 
273
- <?php }
274
-
275
-
1
  <?php
2
+ global $mo2f_dirName;
3
+ $setup_dirName = $mo2f_dirName.'views'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'link_tracer.php';
4
+ include $setup_dirName;
5
+
6
  add_action( 'admin_footer', 'login_security_ajax' );
7
  echo '
8
  <div id="wpns_message" style=" padding-top:8px"></div>
9
  <div>
10
+ <div class="mo_wpns_setting_layout" id ="mo2f_bruteforce">';
11
 
12
 
13
+ echo ' <h3>Brute Force Protection ( Login Protection )<a href='.$two_factor_premium_doc['Custom url'].' target="_blank"><span class="dashicons dashicons-text-page" style="font-size:23px;color:#269eb3;float: right;"></span></a></h3>
14
  <div class="mo_wpns_subheading">This protects your site from attacks which tries to gain access / login to a site with random usernames and passwords.</div>
15
 
16
  <input id="mo_bf_button" type="checkbox" name="enable_brute_force_protection" '.$brute_force_enabled.'> Enable Brute force protection
57
 
58
  echo'
59
  </div>
60
+ <div class="mo_wpns_setting_layout" id="mo2f_google_recaptcha">
61
+ <h3>Google reCAPTCHA<a href='.$two_factor_premium_doc['Google reCAPTCHA'].' target="_blank"><span class="dashicons dashicons-text-page" style="font-size:23px;color:#269eb3;float: right;"></span></a></h3>
62
  <div class="mo_wpns_subheading">Google reCAPTCHA protects your website from spam and abuse. reCAPTCHA uses an advanced risk analysis engine and adaptive CAPTCHAs to keep automated software from engaging in abusive activities on your site. It does this while letting your valid users pass through with ease.</div>
63
  <form id="mo_wpns_activate_recaptcha" method="post" action="">
64
  <input type="hidden" name="option" value="mo_wpns_activate_recaptcha">
95
  echo '<br>
96
  </div>
97
 
98
+ <div class="mo_wpns_setting_layout" id="mo2f_enforce_strong_password_div">
99
+ <h3>Enforce Strong Passwords <a href='.$two_factor_premium_doc['Enforce Strong Passwords'].' target="_blank"><span class="dashicons dashicons-text-page" style="font-size:23px;color:#269eb3;float: right;"></span></a></h3>
100
  <div class="mo_wpns_subheading">Checks the password strength of admin and other users to enhance login security</div>
101
 
102
  <form id="mo_wpns_enable_brute_force_form" method="post" action="">
274
  </script>
275
 
276
 
277
+ <?php }
 
 
views/login_spam.php CHANGED
@@ -54,10 +54,14 @@
54
  tablinks[i].className = tablinks[i].className.replace(" active", "");
55
  }
56
  document.getElementById(tabname).style.display = "block";
57
- localStorage.setItem("tablast", tabname);
58
  evt.currentTarget.className += " active";
59
  }
60
- var tab = localStorage.getItem("tablast");
 
 
 
 
61
  if(tab == "security_login"){
62
  document.getElementById("login_sec").click();
63
  }
54
  tablinks[i].className = tablinks[i].className.replace(" active", "");
55
  }
56
  document.getElementById(tabname).style.display = "block";
57
+ localStorage.setItem("last_tab", tabname);
58
  evt.currentTarget.className += " active";
59
  }
60
+ var tour = '<?php echo get_option("mo2f_tour_loginSpam");?>';
61
+ if(tour != 1)
62
+ var tab = localStorage.getItem("last_tab");
63
+ else
64
+ var tab = '<?php echo get_option("mo2f_tour_tab");?>';
65
  if(tab == "security_login"){
66
  document.getElementById("login_sec").click();
67
  }
views/malware_scanner/malware_scan.php CHANGED
@@ -58,7 +58,7 @@
58
  tablinks[i].className = tablinks[i].className.replace(" active", "");
59
  }
60
  document.getElementById(tabname).style.display = "block";
61
- localStorage.setItem("lastTabmalware", tabname);
62
  evt.currentTarget.className += " active";
63
  if(tabname == "scan_report"){
64
  var data={
@@ -73,8 +73,11 @@
73
  document.getElementById("scan_set").click();
74
  }
75
  }
76
-
77
- var tab = localStorage.getItem("lastTabmalware");
 
 
 
78
  if(tab == "scan_view"){
79
  document.getElementById("malware_view").click();
80
  }
@@ -88,4 +91,4 @@
88
  document.getElementById("malware_view").click();
89
  }
90
 
91
- </script>
58
  tablinks[i].className = tablinks[i].className.replace(" active", "");
59
  }
60
  document.getElementById(tabname).style.display = "block";
61
+ localStorage.setItem("last_tab", tabname);
62
  evt.currentTarget.className += " active";
63
  if(tabname == "scan_report"){
64
  var data={
73
  document.getElementById("scan_set").click();
74
  }
75
  }
76
+ var tour = '<?php echo get_option("mo2f_tour_malware_scan");?>';
77
+ if(tour != 1)
78
+ var tab = localStorage.getItem("last_tab");
79
+ else
80
+ var tab = '<?php echo get_option("mo2f_tour_tab");?>';
81
  if(tab == "scan_view"){
82
  document.getElementById("malware_view").click();
83
  }
91
  document.getElementById("malware_view").click();
92
  }
93
 
94
+ </script>
views/malware_scanner/scan_settings_view.php CHANGED
@@ -1,7 +1,11 @@
1
-
2
- <div class="mo_wpns_setting_layout">
 
 
 
3
  <div class="mo_wpns_subheading"></div>
4
- <br>
 
5
  <form id="" method="post" action="">
6
  <input type="hidden" name="option" value="mo_wpns_scan_configuration">
7
  <table class="mo_wpns_settings_table">
@@ -12,6 +16,7 @@
12
  <input type="checkbox" name="mo_wpns_scan_themes" id="mo_wpns_scan_themes" value="1" <?php checked($mo_wpns_scan_themes == 1);?>> WordPress Themes folder<br>
13
  <input type="checkbox" name="mo_wpns_scan_wp_files" id="mo_wpns_scan_wp_files" value="1" <?php checked($mo_wpns_core_scan == 1);?>> WordPress files
14
  </td>
 
15
  </tr>
16
  <tr><td>&nbsp;</td><td></td></tr>
17
  <tr>
@@ -188,4 +193,4 @@
188
  });
189
  });
190
  </script>';
191
- ?>
1
+ <?php
2
+ global $mo2f_dirName;
3
+ $setup_dirName = $mo2f_dirName.'views'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'link_tracer.php';
4
+ include $setup_dirName; ?>
5
+ <div class="mo_wpns_setting_layout" id= "mo2f_select_scanning_files">
6
  <div class="mo_wpns_subheading"></div>
7
+ <h3>Custom Scan Settings<span style="text-align: right;"><a href='<?php echo $two_factor_premium_doc['Custom Scan Settings'];?>' target="_blank"><span class="dashicons dashicons-text-page" style="font-size:23px;color:#269eb3;float: right;"></span></a></span></h3>
8
+ <hr>
9
  <form id="" method="post" action="">
10
  <input type="hidden" name="option" value="mo_wpns_scan_configuration">
11
  <table class="mo_wpns_settings_table">
16
  <input type="checkbox" name="mo_wpns_scan_themes" id="mo_wpns_scan_themes" value="1" <?php checked($mo_wpns_scan_themes == 1);?>> WordPress Themes folder<br>
17
  <input type="checkbox" name="mo_wpns_scan_wp_files" id="mo_wpns_scan_wp_files" value="1" <?php checked($mo_wpns_core_scan == 1);?>> WordPress files
18
  </td>
19
+ <!-- <td> <a href="https://developers.miniorange.com/docs/security/wordpress/wp-security/scanner#custom-scan" target="_blank"><span class="dashicons dashicons-text-page" style="font-size:23px;color:#269eb3;float: right;margin-top: -1.5em;"></span></a></td> -->
20
  </tr>
21
  <tr><td>&nbsp;</td><td></td></tr>
22
  <tr>
193
  });
194
  });
195
  </script>';
196
+ ?>
views/malware_scanner/scan_summary_view.php CHANGED
@@ -1,16 +1,17 @@
1
  <?php
 
 
 
2
  add_action('admin_footer','mo_wpns_start_scan');
3
  ?>
4
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
5
-
6
  <div class="mo_wpns_dashboard_layout">
7
- <div class="malwaresummarydiv">
8
  <?php show_summary(); ?>
9
  </div>
10
  </div>
11
  <div class="mo_wpns_setting_layout" id="scan_status_table">
12
  <div>
13
- <p class="hmdiv">Scan Modes</p>
14
  </div>
15
  <div style="float: left;">
16
  <p id="scanstatus"></p>
@@ -419,7 +420,6 @@ function mo_wpns_start_scan(){
419
  jQuery('input[name="mo_stop_button"]').val("Dismiss bar");
420
  document.getElementById('mo_stop_button').style.backgroundColor = active_scan;
421
  jQuery('input[name="mo_stop_button"]').removeAttr('disabled');
422
- // document.getElementById("mo2f_files_remaining").style.display = 'none';
423
  document.getElementById("mo2f_remaining").style.display = 'none';
424
  clearInterval(progress_bar);
425
  }
@@ -501,7 +501,6 @@ function show_summary(){
501
  $total_scan=$mo_wpns_db_handler->count_files();
502
  $total_malicious=$mo_wpns_db_handler->count_malicious_files();
503
  $last_scan=$mo_wpns_db_handler->count_files_last_scan($send_id);
504
- // $malicious_last_scan=$mo_wpns_db_handler->count_malicious_last_scan($send_id);
505
  $malicious_last_scan = get_option('mo_wpns_infected_files',0);
506
  $warning_last_scan = get_option('mo_wpns_warning_files',0);
507
  if($total_scan > 999){
@@ -545,5 +544,4 @@ function show_summary(){
545
  </div>
546
 
547
  <?php
548
- }
549
-
1
  <?php
2
+ global $mo2f_dirName;
3
+ $setup_dirName = $mo2f_dirName.'views'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'link_tracer.php';
4
+ include $setup_dirName;
5
  add_action('admin_footer','mo_wpns_start_scan');
6
  ?>
 
 
7
  <div class="mo_wpns_dashboard_layout">
8
+ <div class="malwaresummarydiv" id="mo2f_scan_dash">
9
  <?php show_summary(); ?>
10
  </div>
11
  </div>
12
  <div class="mo_wpns_setting_layout" id="scan_status_table">
13
  <div>
14
+ <p class="hmdiv">Scan Modes<a href='<?php echo $two_factor_premium_doc['Scan Modes'];?>' target="_blank"><span class="dashicons dashicons-text-page" style="font-size:23px;color:#269eb3;float: right;"></span></a></p>
15
  </div>
16
  <div style="float: left;">
17
  <p id="scanstatus"></p>
420
  jQuery('input[name="mo_stop_button"]').val("Dismiss bar");
421
  document.getElementById('mo_stop_button').style.backgroundColor = active_scan;
422
  jQuery('input[name="mo_stop_button"]').removeAttr('disabled');
 
423
  document.getElementById("mo2f_remaining").style.display = 'none';
424
  clearInterval(progress_bar);
425
  }
501
  $total_scan=$mo_wpns_db_handler->count_files();
502
  $total_malicious=$mo_wpns_db_handler->count_malicious_files();
503
  $last_scan=$mo_wpns_db_handler->count_files_last_scan($send_id);
 
504
  $malicious_last_scan = get_option('mo_wpns_infected_files',0);
505
  $warning_last_scan = get_option('mo_wpns_warning_files',0);
506
  if($total_scan > 999){
544
  </div>
545
 
546
  <?php
547
+ }
 
views/navbar.php CHANGED
@@ -13,28 +13,39 @@ $security_features_nonce = wp_create_nonce('mo_2fa_security_features_nonce');
13
  $flag=1;
14
  }
15
  if($shw_feedback)
16
- echo MoWpnsMessages::showMessage('FEEDBACK');
17
  if(!$safe)
18
- echo MoWpnsMessages::showMessage('WHITELIST_SELF');
 
 
 
 
 
 
 
19
  echo'<div class="wrap">
20
  <div><img style="float:left;margin-top:5px;" src="'.$logo_url.'"></div>
21
  <h1>
22
- miniOrange 2-Factor &nbsp;
23
- <a class="add-new-h2" style="font-size:17px" href="'.$profile_url.'">Account</a>
24
- <a class="add-new-h2" style="font-size:17px" href="'.$help_url.'">FAQs</a>
25
- <a class="license-button add-new-h2" style="font-size:17px" href="'.$request_demo_url.'">Request for Demo</a>';
26
- if(get_option("mo_wpns_2fa_with_network_security"))
27
- {
28
- echo '<a class="license-button add-new-h2" id="restart-tour" href="#" style="background-color: lightblue;font-size:17px;">Restart tour</a> ';
29
- }
 
 
 
 
 
30
  echo' <span style="text-align:right;">
31
 
32
  <form id="mo_wpns_2fa_with_network_security" method="post" action="" style="margin-top: -2%; width: 30%; text-align: right; padding-left: 70%;">
33
  <input type="hidden" name="mo_security_features_nonce" value="'.$security_features_nonce.'"/>
34
 
35
  <input type="hidden" name="option" value="mo_wpns_2fa_with_network_security">
36
-
37
- <div><i>2FA + Website Security</i><span>
38
  <label class="mo_wpns_switch">
39
  <input type="checkbox" name="mo_wpns_2fa_with_network_security" '.$network_security_features.' onchange="document.getElementById(\'mo_wpns_2fa_with_network_security\').submit();">
40
  <span class="mo_wpns_slider mo_wpns_round"></span>
@@ -42,10 +53,11 @@ echo' <span style="text-align:right;">
42
  </div>
43
 
44
  </form>
45
- </span>
46
 
47
 
48
- </h1>
 
49
  </div>';
50
  //check_is_curl_installed();
51
  ?>
@@ -82,7 +94,7 @@ echo' <span style="text-align:right;">
82
  echo '<a id="adv_block_tab" class="nav-tab '.($active_tab == 'mo_2fa_advancedblocking'? 'nav-tab-active' : '').'" href="'.$advance_block .'">IP Blocking</a>';
83
  }
84
 
85
- echo '<a class="nav-tab '.($active_tab == 'mo_2fa_upgrade' ? 'nav-tab-active' : '').'" href="'.$upgrade_url .'">Upgrade</a>';
86
  }
87
  ?>
88
- </div>
13
  $flag=1;
14
  }
15
  if($shw_feedback)
16
+ //echo MoWpnsMessages::showMessage('FEEDBACK');
17
  if(!$safe)
18
+ {
19
+ if (get_option('mo_wpns_2fa_with_network_security'))
20
+ {
21
+ echo MoWpnsMessages::showMessage('WHITELIST_SELF');
22
+ }
23
+ }
24
+
25
+
26
  echo'<div class="wrap">
27
  <div><img style="float:left;margin-top:5px;" src="'.$logo_url.'"></div>
28
  <h1>
29
+ miniOrange 2-Factor
30
+ <a class="add-new-h2" style="font-size:17px;border-radius:4px;" href="'.$profile_url.'">Account</a>
31
+ <a class="add-new-h2" style="font-size:17px;border-radius:4px;" href="'.$help_url.'">FAQs</a>
32
+ <a class="license-button add-new-h2" style="font-size:17px;border-radius:4px;" href="'.$request_demo_url.'">Demo</a>
33
+ <a class="add-new-h2" style="font-size:17px;border-radius:4px;background-color:orange; color:black;" href="'.$addons_url.'">AddOns Plans</a>
34
+ <a class="add-new-h2" id ="mo_2fa_upgrade_tour" style="font-size:17px;border-radius:4px;background-color:orange; color:black;" href="'.$upgrade_url.'">See Plans and Pricing</a>';
35
+ //if(get_option("mo_wpns_2fa_with_network_security"))
36
+ // {
37
+ echo '
38
+ <a class="license-button add-new-h2" id="restart-tour" href="#" style="background-color: lightblue;font-size:17px;border-radius:4px;">Restart tour</a>
39
+ ';
40
+
41
+ // }
42
  echo' <span style="text-align:right;">
43
 
44
  <form id="mo_wpns_2fa_with_network_security" method="post" action="" style="margin-top: -2%; width: 30%; text-align: right; padding-left: 70%;">
45
  <input type="hidden" name="mo_security_features_nonce" value="'.$security_features_nonce.'"/>
46
 
47
  <input type="hidden" name="option" value="mo_wpns_2fa_with_network_security">
48
+ <div><br><i>2FA + Website Security</i><span>
 
49
  <label class="mo_wpns_switch">
50
  <input type="checkbox" name="mo_wpns_2fa_with_network_security" '.$network_security_features.' onchange="document.getElementById(\'mo_wpns_2fa_with_network_security\').submit();">
51
  <span class="mo_wpns_slider mo_wpns_round"></span>
53
  </div>
54
 
55
  </form>
56
+ </span>';
57
 
58
 
59
+ echo '<div id = "wpns_nav_message"></div>';
60
+ echo'</h1>
61
  </div>';
62
  //check_is_curl_installed();
63
  ?>
94
  echo '<a id="adv_block_tab" class="nav-tab '.($active_tab == 'mo_2fa_advancedblocking'? 'nav-tab-active' : '').'" href="'.$advance_block .'">IP Blocking</a>';
95
  }
96
 
97
+ // echo '<a class="nav-tab '.($active_tab == 'mo_2fa_upgrade' ? 'nav-tab-active' : '').'" href="'.$upgrade_url .'">Upgrade</a>';
98
  }
99
  ?>
100
+ </div>
views/rate-limiting.php CHANGED
@@ -1,5 +1,5 @@
1
  <div class="mo_wpns_divided_layout">
2
- <div class="mo_wpns_setting_layout">
3
  <div id="RL" name="RL">
4
  <table style="width:100%">
5
  <tr>
@@ -159,5 +159,4 @@ function nav_popup() {
159
  setTimeout(function(){ $('#notice_div').fadeOut('slow'); }, 3000);
160
  }
161
 
162
- </script>
163
-
1
  <div class="mo_wpns_divided_layout">
2
+ <div class="mo_wpns_setting_layout" id="mo2f_ratelimiting">
3
  <div id="RL" name="RL">
4
  <table style="width:100%">
5
  <tr>
159
  setTimeout(function(){ $('#notice_div').fadeOut('slow'); }, 3000);
160
  }
161
 
162
+ </script>
 
views/registration-security.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  echo'<div>
4
- <div class="mo_wpns_setting_layout">';
5
 
6
  echo' <h3>Block Registerations from fake users</h3>
7
  <div class="mo_wpns_subheading">
@@ -17,11 +17,8 @@ echo' <h3>Block Registerations from fake users</h3>
17
  <div class="mo_wpns_setting_layout">
18
  <h3>Advanced User Verification</h3>
19
  <div class="mo_wpns_subheading">Verify identity of user by sending One Time Password ( OTP ) on his phone number or email address.</div>
20
-
21
- <form id="mo_wpns_advanced_user_verification" method="post" action="">
22
- <input type="hidden" name="option" value="mo_wpns_advanced_user_verification">
23
- <input type="checkbox" name="mo_wpns_enable_advanced_user_verification" '.$user_verify.' onchange="document.getElementById(\'mo_wpns_advanced_user_verification\').submit();"> Enable advanced user verification<br>
24
- </form>';
25
 
26
  if($user_verify)
27
  echo $html1;
1
  <?php
2
 
3
  echo'<div>
4
+ <div class="mo_wpns_setting_layout" id="mo2f_block_registration">';
5
 
6
  echo' <h3>Block Registerations from fake users</h3>
7
  <div class="mo_wpns_subheading">
17
  <div class="mo_wpns_setting_layout">
18
  <h3>Advanced User Verification</h3>
19
  <div class="mo_wpns_subheading">Verify identity of user by sending One Time Password ( OTP ) on his phone number or email address.</div>
20
+ <p>Contact us using the plugin support form on the right or mail us directly on <a href="mailto:2fasupport@xecurify.com">2fasupport@xecurify.com</a> or <a href="mailto:info@xecurify.com">info@xecurify.com</a>
21
+ ';
 
 
 
22
 
23
  if($user_verify)
24
  echo $html1;
views/request_demo.php CHANGED
@@ -1,6 +1,10 @@
1
  <div class="mo_wpns_divided_layout">
2
  <div class="mo_wpns_setting_layout">
3
- <h3> Demo Request Form : </h3>
 
 
 
 
4
  <form method="post">
5
  <input type="hidden" name="option" value="mo_2FA_demo_request_form" />
6
  <input type="hidden" name="nonce" value="<?php echo wp_create_nonce('mo2f-Request-demo')?>">
1
  <div class="mo_wpns_divided_layout">
2
  <div class="mo_wpns_setting_layout">
3
+ <h3> Demo Request Form : <div style="float: right;">
4
+ <?php
5
+ echo '<a class="mo_wpns_button mo_wpns_button1" href="'.$two_fa.'">Back</a>';
6
+ ?>
7
+ </div></h3>
8
  <form method="post">
9
  <input type="hidden" name="option" value="mo_2FA_demo_request_form" />
10
  <input type="hidden" name="nonce" value="<?php echo wp_create_nonce('mo2f-Request-demo')?>">
views/support.php CHANGED
@@ -4,7 +4,7 @@
4
  echo'
5
  <div class="mo_wpns_divided_layout_2">
6
 
7
- <div class="mo_wpns_support_layout">
8
 
9
  <img src="'.dirname(plugin_dir_url(__FILE__)).'/includes/images/support3.png">
10
  <h1>Support</h1>
4
  echo'
5
  <div class="mo_wpns_divided_layout_2">
6
 
7
+ <div class="mo_wpns_support_layout" id="mo_wpns_support_layout_tour">
8
 
9
  <img src="'.dirname(plugin_dir_url(__FILE__)).'/includes/images/support3.png">
10
  <h1>Support</h1>
views/tour-model.php CHANGED
@@ -1,78 +1,171 @@
1
  <!-- The Modal -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  <div id="getting-started" class="modal">
3
  <!-- Modal content -->
4
- <div class="modal-content">
5
  <!-- <span class="close">&times;</span> -->
6
  <div class="modal-header">
7
- <h3 class="modal-title" style="text-align: center; font-size: 30px; color: #2980b9"></h3><span id="tour-model" class="modal-span-close">X</span>
8
  </div>
9
- <div class="modal-body">
10
-
 
 
11
  </div>
12
  <div class="modal-footer">
13
- <a href="#" style="margin-right:50%; font-size: 20px;">Skip tour</a>
14
- <button type="button" style="margin-right:50%; display: none;" class="mo_wpns_button mo_wpns_button1 modal-button" id="skip-plugin-tour" >Previous</button>
15
- <button type="button" class="mo_wpns_button mo_wpns_button1 modal-button" id="start-plugin-tour">Start a tour</button>
16
  </div>
17
  </div>
18
  </div>
19
-
20
  <script type="text/javascript">
21
  var current_pointer = 0;
22
  var site_type = '';
23
  var site_elmt = '';
24
- var waf_pointer = <?php echo json_encode($main_pointer); ?>;
25
  var display = '<?php echo $display; ?>';
26
- // jQuery('.modal-title').html('<u>Do you want to enable Cloud version</u>');
27
- // jQuery('.modal-body').html('<h2 style="text-align: center">Enable Cloud version <label class="mo_wpns_switch_small"><input type="checkbox" class="mo_wpns_slider_body_large" name="mo_wpns_enable_htaccess_blocking" checked=""><span class="mo_wpns_slider_small mo_wpns_round_small"></span> </label></h2>');
28
  jQuery('#getting-started').css('display', display);
29
- jQuery('.modal-title').html('<u>'+waf_pointer['Main'][0]+'</u>');
30
- jQuery('.modal-body').html(waf_pointer['Main'][1]);
31
  jQuery('#start-plugin-tour').html('Start a tour');
32
  jQuery('.modal-footer a').css('display', 'inline-block');
33
- // jQuery('.modal-footer a').css('display', 'none')
34
- // jQuery('.modal-content').css('width', '40%');
35
- // jQuery('#start-plugin-tour').text('Save');
36
- jQuery('#skip-plugin-tour').click(function(){
37
- if(current_pointer>=0){
38
- if(jQuery('#skip-plugin-tour').html() == 'Previous'){
39
- if(current_pointer === 0){
40
- current_pointer = current_pointer+1;
41
- }else if(current_pointer === 1){
42
- jQuery('#skip-plugin-tour').html('Skip tour');
43
- jQuery('#start-plugin-tour').html('Start a tour');
44
- }else{
45
- jQuery('#start-plugin-tour').html('Next');
46
- }
47
- current_pointer = current_pointer-1;
48
- scrolled = jQuery('.modal-body').scrollTop(0);
49
- jQuery('#body-para-instr').css('color', 'black');
50
- if(current_pointer == 0){
51
- jQuery('.modal-title').html('Step '+(current_pointer+1)+'-'+(waf_pointer[site_type].length+1)+': <u>'+waf_pointer['Main'][0]+'</u>');
52
- jQuery('.modal-body').html(waf_pointer['Main'][1]);
53
- jQuery('.modal-footer a').css('display', 'inline-block');
54
- jQuery('.modal-footer button:first-of-type').css('display', 'none');
55
- jQuery('#'+site_elmt).css({'color': '#ffffff', 'background-color': '#0073aa'});
56
- }else{
57
- jQuery('.modal-title').html('Step '+(current_pointer+1)+'-'+(waf_pointer[site_type].length+1)+': <u>'+waf_pointer[site_type][current_pointer-1][0]+'</u>');
58
- jQuery('.modal-body').html(waf_pointer[site_type][current_pointer-1][1]);
59
- }
60
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
 
 
62
  });
 
 
 
 
 
 
 
 
 
 
 
63
 
 
 
64
  jQuery('#restart-tour').click(function(){
65
  var data={
66
- 'action': 'mo_wpns_malware_redirect',
67
  'call_type': 'wpns_enable_tour'
68
  };
69
  jQuery.post(ajaxurl, data, function(response){
 
70
  current_pointer = 0;
71
- jQuery('.modal-title').html('<u>'+waf_pointer['Main'][0]+'</u>');
72
- jQuery('.modal-body').html(waf_pointer['Main'][1]);
73
- jQuery('#start-plugin-tour').html('Start a tour');
74
  jQuery('.modal-footer a').css('display', 'inline-block');
75
- jQuery('.modal-footer button:first-of-type').css('display', 'none');
76
  jQuery('#getting-started').css('display', 'block');
77
  });
78
  });
@@ -84,15 +177,13 @@
84
  close_modal();
85
  });
86
  function close_modal(){
87
- var data={
88
- 'action': 'mo_wpns_malware_redirect',
89
- 'call_type': 'wpns_disable_tour'
90
- };
91
- jQuery.post(ajaxurl, data, function(response){
92
- site_elmt = '';
93
- site_type = '';
94
- jQuery('#getting-started').css('display', 'none');
95
- });
96
  }
97
 
98
  function open_hide(gettag){
@@ -105,51 +196,4 @@
105
  }
106
  }
107
 
108
- function change_span_css(elmt){
109
- if(jQuery('#'+elmt.id).css('background-color') == 'rgb(255, 255, 255)'){
110
- jQuery('.modal-span').css({'color': '#0073aa', 'background-color': '#ffffff'});
111
- jQuery('#'+elmt.id).css({'color': '#ffffff', 'background-color': '#0073aa'});
112
- site_type = jQuery('#'+elmt.id).html();
113
- jQuery('#body-para-instr').css('color', 'black');
114
- site_elmt = elmt.id;
115
- jQuery('.modal-title').html('Step '+(current_pointer+1)+'-'+(waf_pointer[site_type].length+1)+': <u>'+waf_pointer['Main'][0]+'</u>');
116
- } else {
117
- jQuery('#'+elmt.id).css({'color': '#0073aa', 'background-color': '#ffffff'});
118
- site_elmt = '';
119
- site_type = '';
120
- jQuery('.modal-title').html('<u>'+waf_pointer['Main'][0]+'</u>');
121
- }
122
- }
123
-
124
- jQuery('#start-plugin-tour').click(function(){
125
- if(jQuery('#start-plugin-tour').text() == 'Save'){
126
- jQuery('.modal-title').html('<u>'+waf_pointer['Main'][0]+'</u>');
127
- jQuery('.modal-body').html(waf_pointer['Main'][1]);
128
- jQuery('#start-plugin-tour').html('Start a tour');
129
- jQuery('.modal-footer a').css('display', 'inline-block');
130
- }
131
- else if(site_type != ''){
132
- if (jQuery('#start-plugin-tour').text() == 'Close') {
133
- close_modal();
134
- }
135
- if(current_pointer<=waf_pointer[site_type].length+1){
136
- if(current_pointer == waf_pointer[site_type].length-1){
137
- jQuery('#start-plugin-tour').html('Close');
138
- }else if(current_pointer == waf_pointer[site_type].length){
139
- current_pointer = current_pointer-1;
140
- }else{
141
- jQuery('#skip-plugin-tour').html('Previous');
142
- jQuery('#start-plugin-tour').html('Next');
143
- }
144
- current_pointer = current_pointer+1;
145
- scrolled = jQuery('.modal-body').scrollTop(0);
146
- jQuery('.modal-footer a').css('display', 'none');
147
- jQuery('.modal-footer button:first-of-type').css('display', 'inline-block');
148
- jQuery('.modal-title').html('Step '+(current_pointer+1)+'/'+(waf_pointer[site_type].length+1)+': <u>'+waf_pointer[site_type][current_pointer-1][0]+'</u>');
149
- jQuery('.modal-body').html(waf_pointer[site_type][current_pointer-1][1]);
150
- }
151
- }else{
152
- jQuery('#body-para-instr').css('color', 'red');
153
- }
154
- })
155
  </script>
1
  <!-- The Modal -->
2
+ <form name="f" method="post" id="show_pointers">
3
+ <?php wp_nonce_field("clear_pointers");?>
4
+ <input type="hidden" name="option" value="clear_pointers"/>
5
+ <input type="hidden" name="button_name" id="button_name" />
6
+ </form>
7
+
8
+ <form name="f" method="post" id="restart-plugin-tour">
9
+ <?php wp_nonce_field("restart_plugin_tour");?>
10
+ <input type="hidden" name="option" value="restart_plugin_tour"/>
11
+ <input type="hidden" name="page" value="mo_2fa_two_fa" id="page">
12
+ </form>
13
+
14
+ <form name="f" method="post" id="skip-plugin-tour">
15
+ <?php wp_nonce_field("skip_plugin_tour");?>
16
+ <input type="hidden" name="option" value="skip_plugin_tour"/>
17
+ </form>
18
+ <?php
19
+ $tour_box_size = get_option('mo_wpns_2fa_with_network_security');
20
+ $tour_box_size = $tour_box_size == 1 ? '70%' : '50%';
21
+ ?>
22
  <div id="getting-started" class="modal">
23
  <!-- Modal content -->
24
+ <div class="modal-content" style="width: <?php echo $tour_box_size; ?>">
25
  <!-- <span class="close">&times;</span> -->
26
  <div class="modal-header">
27
+ <h3 class="modal-title" style="text-align: center; font-size: 30px; color: #2980b9">Let's Get Started</h3><span id="tour-model" class="modal-span-close">X</span>
28
  </div>
29
+ <div class="modal-body" style="height: 310px;">
30
+ <?php
31
+ echo $tour_body;
32
+ ?>
33
  </div>
34
  <div class="modal-footer">
35
+ <button type="button" class="mo_wpns_button mo_wpns_button1 modal-button modalhover" id="skip-plugin-tour" style="width: 40%;color: #111111; background: none;text-decoration: underline;font-weight: bold;border: 2px solid black;" onclick="skip_plugin_tour()" >Skip tour</button>
36
+ <button type="button" class="mo_wpns_button mo_wpns_button1 modal-button logout" id="start-plugin-tour" style= "width: 40%;background-color:#2EB150;">Start tour</button>
37
+
38
  </div>
39
  </div>
40
  </div>
41
+ <div class='overlay' id="overlay" hidden></div>
42
  <script type="text/javascript">
43
  var current_pointer = 0;
44
  var site_type = '';
45
  var site_elmt = '';
46
+ //var waf_pointer = <?php echo json_encode($main_pointer); ?>;
47
  var display = '<?php echo $display; ?>';
48
+ var getting_started_modal = document.getElementById("getting-started");
49
+
50
  jQuery('#getting-started').css('display', display);
51
+ // jQuery('.modal-title').html('<u>'+waf_pointer['Main'][0]+'</u>');
52
+ // jQuery('.modal-body').html(waf_pointer['Main'][1]);
53
  jQuery('#start-plugin-tour').html('Start a tour');
54
  jQuery('.modal-footer a').css('display', 'inline-block');
55
+
56
+ jQuery('#2fa').css("border", "5px solid #20b2aa");
57
+
58
+ jQuery('input[type=radio][name=mo2f_two_factor]').click(function(){
59
+ var ele = document.getElementsByName("mo2f_two_factor");
60
+ var selected = '';
61
+
62
+ for(i = 0; i < ele.length; i++) {
63
+ if(ele[i].checked)
64
+ {
65
+ selected = ele[i].value;
66
+ }
67
+ }
68
+
69
+ jQuery('#2fa').css("border", "1px solid black");
70
+ jQuery('#waf').css("border", "1px solid black");
71
+ jQuery('#malware').css("border", "1px solid black");
72
+ jQuery('#backup').css("border", "1px solid black");
73
+ jQuery('#login').css("border", "1px solid black");
74
+
75
+ jQuery('#'+selected).css("border", "5px solid #20b2aa");
76
+
77
+ });
78
+
79
+ jQuery('#start-plugin-tour').click(function(){
80
+
81
+ var ele = document.getElementsByName("mo2f_two_factor");
82
+ var selected = '';
83
+
84
+ for(i = 0; i < ele.length; i++) {
85
+ if(ele[i].checked)
86
+ {
87
+ selected = ele[i].value;
88
+ }
89
+ }
90
+
91
+
92
+ var pageurl = '';
93
+ switch(selected){
94
+ case '2fa':
95
+ pageurl = 'mo_2fa_two_fa';
96
+ break;
97
+ case 'waf':
98
+ pageurl = 'mo_2fa_waf';
99
+ break;
100
+ case 'malware':
101
+ pageurl = 'mo_2fa_malwarescan';
102
+ break;
103
+ case 'login':
104
+ pageurl = 'mo_2fa_login_and_spam';
105
+ break;
106
+ case 'backup':
107
+ pageurl = 'mo_2fa_backup';
108
+ break;
109
+
110
+ }
111
+ document.getElementById('page').value = pageurl;
112
+ var data = {
113
+ 'action' : 'mo_wpns_tour',
114
+ 'call_type' : 'entire_plugin_tour_started',
115
+ };
116
+ jQuery.post(ajaxurl, data, function(response) {
117
+ getting_started_modal.style.display = "none";
118
+ });
119
+
120
+ var url = '<?php echo $_REQUEST["page"]; ?>';
121
+ switch(url){
122
+ case 'mo_2fa_two_fa':
123
+ document.getElementById("setup_2fa").click();
124
+ break;
125
+
126
+ case 'mo_2fa_waf':
127
+ document.getElementById("settingsTab").click();
128
+ break;
129
+
130
+ case 'mo_2fa_login_and_spam':
131
+ document.getElementById("login_sec").click();
132
+ break;
133
+
134
+ case 'mo_2fa_malwarescan':
135
+ document.getElementById("malware_view").click();
136
+ break;
137
+
138
+ case 'mo_2fa_backup':
139
+ document.getElementById("backup_set").click();
140
+ break;
141
  }
142
+ jQuery('#restart-plugin-tour').submit();
143
+
144
  });
145
+ function skip_plugin_tour(){
146
+
147
+ var data = {
148
+ 'action' : 'mo_wpns_tour',
149
+ 'call_type' : 'skip_entire_plugin_tour',
150
+ };
151
+ jQuery.post(ajaxurl, data, function(response) {
152
+ getting_started_modal.style.display = "none";
153
+ });
154
+ }
155
+
156
 
157
+
158
+
159
  jQuery('#restart-tour').click(function(){
160
  var data={
161
+ 'action': 'mo_wpns_tour',
162
  'call_type': 'wpns_enable_tour'
163
  };
164
  jQuery.post(ajaxurl, data, function(response){
165
+
166
  current_pointer = 0;
167
+ jQuery('#start-plugin-tour').html('Start tour');
 
 
168
  jQuery('.modal-footer a').css('display', 'inline-block');
 
169
  jQuery('#getting-started').css('display', 'block');
170
  });
171
  });
177
  close_modal();
178
  });
179
  function close_modal(){
180
+ var data = {
181
+ 'action' : 'mo_wpns_tour',
182
+ 'call_type' : 'skip_entire_plugin_tour',
183
+ };
184
+ jQuery.post(ajaxurl, data, function(response) {
185
+ getting_started_modal.style.display = "none";
186
+ });
 
 
187
  }
188
 
189
  function open_hide(gettag){
196
  }
197
  }
198
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  </script>
views/troubleshooting.php CHANGED
@@ -1,100 +1,167 @@
1
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- echo'<div class="mo_wpns_divided_layout">
4
- <div class="mo_wpns_setting_layout">
5
- <table class="mo_wpns_help">
6
- <tbody><tr>
7
- <td class="mo_wpns_help_cell">
8
- <div id="mo_wpns_help_curl_title" class="mo_wpns_title_panel">
9
- <div class="mo_wpns_help_title">How to enable PHP cURL extension? (Pre-requisite)</div>
10
- </div>
11
- <div hidden="" id="mo_wpns_help_curl_desc" class="mo_wpns_help_desc" style="display: none;">
12
- <ul>
13
- <li>Step 1:&nbsp;&nbsp;&nbsp;&nbsp;Open php.ini file located under php installation folder.</li>
14
- <li>Step 2:&nbsp;&nbsp;&nbsp;&nbsp;Search for <b>extension=php_curl.dll</b>. </li>
15
- <li>Step 3:&nbsp;&nbsp;&nbsp;&nbsp;Uncomment it by removing the semi-colon(<b>;</b>) in front of it.</li>
16
- <li>Step 4:&nbsp;&nbsp;&nbsp;&nbsp;Restart the Apache Server.</li>
17
- </ul>
18
- For any further queries, please contact us.
19
- </div>
20
- </td>
21
- </tr><tr>
22
- <td class="mo_wpns_help_cell">
23
- <div id="mo_wpns_help_mobile_auth_title" class="mo_wpns_title_panel">
24
- <div class="mo_wpns_help_title">How to enable Mobile authentication ( 2 Factor ) ?</div>
25
- </div>
26
- <div hidden="" id="mo_wpns_help_mobile_auth_desc" class="mo_wpns_help_desc" style="display: none;">
27
- <ul>
28
- <li>Step 1:&nbsp;&nbsp;&nbsp;&nbsp;Go to <b>Login Security</b> Tab and go to <b>Mobile Authentication</b> section.</li>
29
- <li>Step 2:&nbsp;&nbsp;&nbsp;&nbsp;If you have not installed 2 factor plugin you wil see link <b>"Install 2 Factor Plugin"</b>. Click this link and activate miniOrange 2 factor plugin.</li>
30
- <li>Step 3:&nbsp;&nbsp;&nbsp;&nbsp;If you already have 2 factor plugin installed and its disable you wil see link <b>"Click here to activate 2 Factor Plugin"</b>. Click this link and activate miniOrange 2 factor plugin.</li>
31
- <li>Step 4:&nbsp;&nbsp;&nbsp;&nbsp;Go to <b>"miniOrange 2-Factor"</b> tab from wordpress sidebar</li>
32
- <li>Step 5:&nbsp;&nbsp;&nbsp;&nbsp;Click on <b>"Setup Two-Factor"</b> tab and configure your 2nd factor method which you want to use during login.</li>
33
- </ul>
34
- For any further queries, please contact us.
35
- </div>
36
- </td>
37
- </tr>
38
- <tr>
39
- <td class="mo_wpns_help_cell">
40
- <div id="mo_wpns_help_disposable_title" class="mo_wpns_title_panel">
41
- <div class="mo_wpns_help_title">What "Block Registerations from fake users" does ? (Premium Feature)</div>
42
- </div>
43
- <div hidden="" id="mo_wpns_help_disposable_desc" class="mo_wpns_help_desc" style="display: none;">
44
- There are many fake email provides which provides dispsable or temporary email address to users which expires in few minutes or few hours. You can block registrations from those email addresses.<br><br>
45
-
46
- For any further queries, please contact us.
47
- </div>
48
- </td>
49
- </tr>
50
- <tr>
51
- <td class="mo_wpns_help_cell">
52
- <div id="mo_wpns_help_strong_pass_title" class="mo_wpns_title_panel">
53
- <div class="mo_wpns_help_title">What "Enforce Strong Passwords" does ?</div>
54
- </div>
55
- <div hidden="" id="mo_wpns_help_strong_pass_desc" class="mo_wpns_help_desc" style="display: none;">
56
- This feature check if users are having strong passwords for their account. If No, we force users to change their passwords to strong passwords during their login to wordpress.<br><br>
57
-
58
- For any further queries, please contact us.
59
- </div>
60
- </td>
61
- </tr>
62
- <tr>
63
- <td class="mo_wpns_help_cell">
64
- <div id="mo_wpns_help_adv_user_ver_title" class="mo_wpns_title_panel">
65
- <div class="mo_wpns_help_title">What "Advanced User Verification" does ? (Premium Feature)</div>
66
- </div>
67
- <div hidden="" id="mo_wpns_help_adv_user_ver_desc" class="mo_wpns_help_desc" style="display: none;">
68
- This verifies users phone number or email address before registering users by sending One Time Password ( OTP ) on his phone number or email address. You can avoid fake registrations with it.<br><br>
69
-
70
- For any further queries, please contact us.
71
- </div>
72
- </td>
73
- </tr>
74
- <tr>
75
- <td class="mo_wpns_help_cell">
76
- <div id="mo_wpns_help_social_login_title" class="mo_wpns_title_panel">
77
- <div class="mo_wpns_help_title">What "Social Login Integration" does ? (Premium Feature)</div>
78
- </div>
79
- <div hidden="" id="mo_wpns_help_social_login_desc" class="mo_wpns_help_desc" style="display: none;">
80
- You can allow your users to login or register to your site with their existing account with supported social networks like Google, Twitter, Facebook, Vkontakte, LinkedIn, Instagram, Amazon, Salesforce, Windows Live. No need to remember multiple account credentials for users.<br><br>
81
-
82
- For any further queries, please contact us.
83
- </div>
84
- </td>
85
- </tr><tr>
86
- <td class="mo_wpns_help_cell">
87
- <div id="mo_wpns_help_custom_template_title" class="mo_wpns_title_panel">
88
- <div class="mo_wpns_help_title">What "Customized Email Templates" does ? (Premium Feature)</div>
89
- </div>
90
- <div hidden="" id="mo_wpns_help_custom_template_desc" class="mo_wpns_help_desc" style="display: none;">
91
- You can customize email templates for emails that are sent to users for unusual activities and also Administrator for blocked IP\'s. You can add your own subject, from name and email content. Also we support HTML content for email body.<br><br>
92
 
93
- For any further queries, please contact us.
94
- </div>
95
- </td>
96
- </tr>
97
-
98
- </tbody></table>
99
- </div>
100
- </div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ echo'<div class="mo_wpns_divided_layout">
4
+ <div class="mo_wpns_setting_layout">
5
+ <h3>
6
+ Frequenty Asked Questions
7
+ <div style="float: right;">
8
+ <a class="mo_wpns_button mo_wpns_button1" href="'.$two_fa.'">Back</a>
9
+ </div>
10
+ </h3><br><hr>
11
+ <table class="mo_wpns_help">
12
+ <tbody><tr>
13
+ <td class="mo_wpns_help_cell">
14
+ <div id="mo_wpns_help_curl_title" class="mo_wpns_title_panel">
15
+ <div class="mo_wpns_help_title">How to enable PHP cURL extension? (Pre-requisite)</div>
16
+ </div>
17
+ <span hidden="" id="mo_wpns_help_curl_desc" class="mo_wpns_help_desc" style="display: none;">
18
+ <ol>
19
+ <li>Open php.ini file located under the PHP installation folder.</li>
20
+ <li>Search for extension=php_curl.dll.</li>
21
+ <li>Uncomment it by removing the semi-colon(;) in front of it.
22
+ Restart the Apache Server.</li></ol>
23
+ For any further queries, please <a href="mailto:2fasupport@xecurify.com" target="blank">contact us</a>.
24
+ </span>
25
+ </td>
26
+ </tr><tr>
27
+ <td class="mo_wpns_help_cell">
28
+ <div id="mo_wpns_issue_in_scanning_QR" class="mo_wpns_title_panel">
29
+ <div class="mo_wpns_help_title">I am facing issue in scanning QR code, what is the reason behind the error?</div>
30
+ </div>
31
+ <span hidden="" id="mo_wpns_issue_in_scanning_QR_solution" class="mo_wpns_help_desc" style="display: none;">
32
+ <ol><li>Make sure that the bar-code you are scanning and the bar-code scanning app that you are using is suitable.</li>
33
+ <li>If you are configuring the Google Authenticator method, you will need the Google Authenticator App.</li>
34
+ <li>If you are configuring miniOrange authentication methods that are Push Notifications, Qr Code Authentication, or Soft Token you will need the miniOrange app and accordingly.</li><ul>
35
+ </span>
36
+ </td>
37
+ </tr>
38
+ <tr>
39
+ <td class="mo_wpns_help_cell">
40
+ <div id="mo_wpns_help_particular_use_role" class="mo_wpns_title_panel">
41
+ <div class="mo_wpns_help_title">I want to enable 2-factor for particular user roles in WordPress, how do I do that?</div>
42
+ </div>
43
+ <div hidden="" id="mo_wpns_help_particular_use_role_solution" class="mo_wpns_help_desc" style="display: none;">
44
+ We are providing 2-factor authentication for 3 admin users in the free version if you want to add it for more user roles, please upgrade to the paid version.</br> You can check our pricing from here: <a href="https://plugins.miniorange.com/2-factor-authentication-for-wordpress">https://plugins.miniorange.com/2-factor-authentication-for-wordpress</a>.</br>
45
+ OR </br>If you have paid version of the plugin, your solution is right here: <a href="https://docs.miniorange.com/documentation/enable-two-factor-based-roles" target="blank">click here</a>.</div>
46
+ </td>
47
+ </tr>
48
+ <tr>
49
+ <td class="mo_wpns_help_cell">
50
+ <div id="mo_wpns_help_enforce_MFA" class="mo_wpns_title_panel">
51
+ <div class="mo_wpns_help_title">I want to Enforce my users to configure the Two-factor authentication method how I do that?</div>
52
+ </div>
53
+ <div hidden="" id="mo_wpns_help_enforce_MFA_solution" class="mo_wpns_help_desc" style="display: none;">
54
+ This feature is supported in paid plugin. Please checkout out pricing from here: <a href="https://plugins.miniorange.com/2-factor-authentication-for-wordpress" target="blank">https://plugins.miniorange.com/2-factor-authentication-for-wordpress</a>
55
+ </br>OR</br>If you have paid version of the plugin, your solution is right here: <a href="https://docs.miniorange.com/documentation/enforce-2fa-users" target="blank">click here</a>.
56
+ </div>
57
+ </td>
58
+ </tr>
59
+ <tr>
60
+ <td class="mo_wpns_help_cell">
61
+ <div id="mo_wpns_help_reset_MFA" class="mo_wpns_title_panel">
62
+ <div class="mo_wpns_help_title">I want to reset Two Factor for my users, how I do that?</div>
63
+ </div>
64
+ <div hidden="" id="mo_wpns_help_reset_MFA_solution" class="mo_wpns_help_desc" style="display: none;">
65
+ <ol><li>Go to the WordPress <b>Users</b> tab.</li>
66
+ <li>Hover over the Username of which you want to reset two-factor. You will see �Reset 2 Factor� option, Click on that.</li>
67
+ <li>Now, whenever your user logs in again to their account user will able to reconfigure Two Factor.</li>
68
+ </div>
69
+ </td>
70
+ </tr>
71
+ <tr>
72
+ <td class="mo_wpns_help_cell">
73
+ <div id="mo_wpns_help_get_back_to_account" class="mo_wpns_title_panel">
74
+ <div class="mo_wpns_help_title">How do I gain access to my website if I get locked out?</div>
75
+ </div>
76
+ <div hidden="" id="mo_wpns_help_get_back_to_account_solution" class="mo_wpns_help_desc" style="display: none;">
77
+ We provides many alternet solutions to get back to account, <a href="https://faq.miniorange.com/knowledgebase/how-to-gain-access-to-my-website-if-i-get-locked-out/" tager="blank">click here</a>.
78
+ </div>
79
+ </td>
80
+ </tr>
81
+ <tr>
82
+ <td class="mo_wpns_help_cell">
83
+ <div id="mo_wpns_help_multisite" class="mo_wpns_title_panel">
84
+ <div class="mo_wpns_help_title">Does the miniOrange 2FA plugin support multi-site support?</div>
85
+ </div>
86
+ <div hidden="" id="mo_wpns_help_multisite_solution" class="mo_wpns_help_desc" style="display: none;">
87
+ The miniOrange Two-factor free plugin does not provide Multisite support. Please upgrade to the premium plan for the multi-site support.
88
+
89
+
90
+ </div>
91
+ </td>
92
+ </tr>
93
+ <tr>
94
+ <td class="mo_wpns_help_cell">
95
+ <div id="mo_wpns_help_forgot_password" class="mo_wpns_title_panel">
96
+ <div class="mo_wpns_help_title">I forgot the password of my miniOrange account. How can I reset it?</div>
97
+ </div>
98
+ <div hidden="" id="mo_wpns_help_forgot_password_solution" class="mo_wpns_help_desc" style="display: none;">
99
+ To reset the password of your miniOrange account, please <a href="https://login.xecurify.com/moas/idp/resetpassword" target="blank">click here</a> and reset your password using the email address registered with miniOrange.
100
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
 
102
+ </div>
103
+ </td>
104
+ </tr>
105
+ <tr>
106
+ <td class="mo_wpns_help_cell">
107
+ <div id="mo_wpns_help_MFA_propmted" class="mo_wpns_title_panel">
108
+ <div class="mo_wpns_help_title">My Users are not being prompted for 2-factor during login. Why?</div>
109
+ </div>
110
+ <div hidden="" id="mo_wpns_help_MFA_propmted_solution" class="mo_wpns_help_desc" style="display: none;">
111
+ The miniOrange Two-Factor free plugin provides the 2-factor for three users (Administrator) forever. To enable 2FA for more users, please upgrade to the Premium plan. for more details <a href="https://faq.miniorange.com/knowledgebase/users-are-not-prompted-for-2-factor-during-login/" target="blank">click here</a>.
112
+
113
+ </div>
114
+ </td>
115
+ </tr><tr>
116
+ <td class="mo_wpns_help_cell">
117
+ <div id="mo_wpns_help_redirect_back" class="mo_wpns_title_panel">
118
+ <div class="mo_wpns_help_title">When I enter my authentication code and click on Validate, I got redirected back to the login page, Why is this happening?</div>
119
+ </div>
120
+ <div hidden="" id="mo_wpns_help_redirect_back_solution" class="mo_wpns_help_desc" style="display: none;">
121
+ It might be the case that the plugin is not able to write the PHP session info (into the /var/lib/php/sessions directory ) because of permission issues, and hence it is failing at the authentication step. Please update to the latest plugin version (5.0.0) which has the bug fix for this.
122
+ </div>
123
+ </td>
124
+ </tr>
125
+ <tr>
126
+ <td class="mo_wpns_help_cell">
127
+ <div id="mo_wpns_help_alternet_login" class="mo_wpns_title_panel">
128
+ <div class="mo_wpns_help_title">I had setup QR Code Authentication/Push Notification as my 2-factor method. My phone has no internet connectivity, how can I login?</div>
129
+ </div>
130
+ <div hidden="" id="mo_wpns_help_alternet_login_solution" class="mo_wpns_help_desc" style="display: none;">
131
+ You can login using our alternate login method. Please <a href="https://faq.miniorange.com/knowledgebase/login-issue-for-two-factor/" target="blank">Click here</a>.
132
+ </div>
133
+ </td>
134
+ </tr>
135
+ <tr>
136
+ <td class="mo_wpns_help_cell">
137
+ <div id="mo_wpns_help_lost_ability" class="mo_wpns_title_panel">
138
+ <div class="mo_wpns_help_title">My phone is lost, stolen or discharged. How can I login?</div>
139
+ </div>
140
+ <div hidden="" id="mo_wpns_help_lost_ability_solution" class="mo_wpns_help_desc" style="display: none;">
141
+ To login and reconfigure authentication method <a href="" target="blank">click here</a>.
142
+
143
+ </div>
144
+ </td>
145
+ </tr>
146
+ <tr>
147
+ <td class="mo_wpns_help_cell">
148
+ <div id="mo_wpns_help_translate" class="mo_wpns_title_panel">
149
+ <div class="mo_wpns_help_title">How do I translate the plugin in a language of my choice?</div>
150
+ </div>
151
+ <div hidden="" id="mo_wpns_help_translate_solution" class="mo_wpns_help_desc" style="display: none;">
152
+ Please follow the below steps:
153
+ <ol><li>Download & open POEDIT software.</li>
154
+ <li>Click on Create New Translation.</li>
155
+ <li>In the plugin, you have a lang folder. You can find the .pot file in it. Import the file.</li>
156
+ <li>It will ask you for the translation language. Select it as Germany.</li>
157
+ <li>In the top navigation bar, Click on Update <i class="fa fa-fw fa-arrow-right"></i> Save.
158
+ Do the translations and Save them.</li>
159
+ <li>Select the WordPress site language as the same you selected in the software. ( Germany )</li></ol>
160
+
161
+ </div>
162
+ </td>
163
+ </tr>
164
+ </tbody></table>
165
+ <h4>If you have any other queries, Contact us at <a href="mailto:2fasupport@xecurify.com" target="blank">2fasupport@xecurify.com</a></h4>
166
+ </div>
167
+ </div>';
views/twofa/link_tracer.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $two_factor_premium_doc = array(
3
+ "Enble 2fa" => "https://developers.miniorange.com/docs/security/wordpress/wp-security/step-by-setup-guide-to-set-up-security-question",
4
+
5
+ "Custom url" => "https://developers.miniorange.com/docs/security/wordpress/wp-security/custom-redirect-login-url",
6
+ "Woocommerce"=> "https://developers.miniorange.com/docs/security/wordpress/wp-security/setup-custom-login-form",
7
+
8
+ "Remember Device" => "https://developers.miniorange.com/docs/security/wordpress/wp-security/remember-my-device",
9
+
10
+ "Custom plugin logo" =>"https://developers.miniorange.com/docs/security/wordpress/wp-security/add-my-powered-by-logo",
11
+
12
+ "Custom plugin name" =>"https://developers.miniorange.com/docs/security/wordpress/wp-security/customize-plugin-name",
13
+
14
+ "Custom email template" =>"https://developers.miniorange.com/docs/security/wordpress/wp-security/customize-email-template",
15
+
16
+ "custom login popup" =>"https://developers.miniorange.com/docs/security/wordpress/wp-security/customize-plugin-name",
17
+
18
+ "Shortcode" =>"https://developers.miniorange.com/docs/security/wordpress/wp-security/Shortcodes",
19
+
20
+ "Specific set of authentication methods" =>"https://developers.miniorange.com/docs/security/wordpress/wp-security/specific-set-authentication-methods-based-role",
21
+
22
+ "Invoke Inline Registration to setup 2nd factor for users"=>"https://developers.miniorange.com/docs/security/wordpress/wp-security/enforce-2fa-users",
23
+
24
+ "Email verification of Users during Inline Registration"=>"https://developers.miniorange.com/docs/security/wordpress/wp-security/enforce-email-verification",
25
+
26
+ "Select login screen option" => "https://developers.miniorange.com/docs/security/wordpress/wp-security/passwordless-login",
27
+ "What happens if my phone is lost, discharged or not with me"=> "https://developers.miniorange.com/docs/security/wordpress/wp-security/want-configure-backup-methods-users-can-configure-case-locked-site-not-able-log",
28
+
29
+ "Plugin level waf" => "https://developers.miniorange.com/docs/security/wordpress/wp-security/web-firewall/#firewall-level",
30
+
31
+ "htaccess level waf"=>"https://developers.miniorange.com/docs/security/wordpress/wp-security/web-firewall/#firewall-level",
32
+
33
+ "Rate Limiting"=>"https://developers.miniorange.com/docs/security/wordpress/wp-security/web-firewall#dos-proctection",
34
+
35
+ "Brute Force Protection"=>"https://developers.miniorange.com/docs/security/wordpress/wp-security/brute-force#Brute-Force-protection",
36
+
37
+ "Google reCAPTCHA"=>"https://developers.miniorange.com/docs/security/wordpress/wp-security/brute-force#Google-recaptcha",
38
+
39
+ "Enforce Strong Passwords"=>"https://developers.miniorange.com/docs/security/wordpress/wp-security/brute-force#Enforce-strong-password",
40
+
41
+ "Scheduled database"=>"https://developers.miniorange.com/docs/security/wordpress/wp-security/backup-restore/#schedule-backup",
42
+
43
+ "Scan Modes"=>"https://developers.miniorange.com/docs/security/wordpress/wp-security/scanner#wp-malware-scanner",
44
+
45
+ "Custom Scan Settings"=>"https://developers.miniorange.com/docs/security/wordpress/wp-security/scanner#custom-scan",
46
+ "Manual IP Blocking"=>"https://developers.miniorange.com/docs/security/wordpress/wp-security/IP-blocking-whitelisting-lookup#wordpress-ip-blocking",
47
+
48
+ "IP Whitelisting"=>"https://developers.miniorange.com/docs/security/wordpress/wp-security/IP-blocking-whitelisting-lookup#wp-ip-whitelisting",
49
+
50
+ "IP LookUp"=>"https://developers.miniorange.com/docs/security/wordpress/wp-security/IP-blocking-whitelisting-lookup#wp-ip-lookup",
51
+
52
+ "IP Address Range Blocking"=>"https://developers.miniorange.com/docs/security/wordpress/wp-security/range-blocking#ip-range-blocking",
53
+
54
+ "Browser Blocking"=>"https://developers.miniorange.com/docs/security/wordpress/wp-security/browser-blocking#wp-browser-blocking",
55
+
56
+
57
+ );?>
views/twofa/setup/setup_authy_authenticator.php CHANGED
@@ -8,7 +8,8 @@ function mo2f_configure_authy_authenticator( $user ) {
8
  <table>
9
  <tr>
10
  <td class="mo2f_authy_step1">
11
- <h3><?php echo mo2f_lt( 'Step-1: Configure Authy Authenticator App.' ); ?></h3>
 
12
  <hr/>
13
  <form name="f" method="post" id="mo2f_configure_google_authy_form1" action="">
14
  <input type="submit" name="mo2f_authy_configure" class="mo_wpns_button mo_wpns_button1"
8
  <table>
9
  <tr>
10
  <td class="mo2f_authy_step1">
11
+ <h3><?php echo mo2f_lt( 'Step-1: Configure Authy Authenticator App.' ); ?>
12
+ </h3>
13
  <hr/>
14
  <form name="f" method="post" id="mo2f_configure_google_authy_form1" action="">
15
  <input type="submit" name="mo2f_authy_configure" class="mo_wpns_button mo_wpns_button1"
views/twofa/setup/setup_google_authenticator.php CHANGED
@@ -11,50 +11,60 @@ function mo2f_configure_google_authenticator( $user ) {
11
  <table>
12
  <tr>
13
  <td class="mo2f_google_authy_step2">
14
- <?php echo '<' . $h_size . '>' . mo2f_lt( 'Step-1: Set up Google/Authy/LastPass Authenticator' ) . '</' . $h_size . '>'; ?>
 
15
 
 
 
16
  <hr>
17
 
18
- <p style="background-color:#a3e8c2;padding:5px;">
19
- <?php echo mo2f_lt( 'You can configure this method in your Google/Authy/LastPass Authenticator apps.' ); ?>
20
- </p>
21
-
22
- <h4>1. <?php echo mo2f_lt( 'Install the Authenticator App that you wish to configure, in your phone.' ); ?></h4>
23
- <div style="margin-left:40px;">
24
- <input type="radio" name="google" value="ga" checked> Google Authenticator &nbsp;&nbsp;
25
- <input type="radio" name="authy" value="aa"> Authy Authenticator &nbsp;&nbsp;
26
- <input type="radio" name="lastpass" value="lpa"> LastPass Authenticator &nbsp;&nbsp;
27
- </div>
 
 
28
 
 
29
  <span id="links_to_apps"></span>
30
- <div id="mo2f_change_app_name">
31
- <h4>2. <?php echo mo2f_lt('Choose the account name to be configured in the App:'); ?></h4>
32
- <div style="margin-left:40px;">
33
- <form name="f" id="login_settings_appname_form" method="post" action="">
34
- <input type="hidden" name="option" value="mo2f_google_appname" />
35
- <input type="hidden" name="mo2f_google_appname_nonce"
36
- value="<?php echo wp_create_nonce( "mo2f-google-appname-nonce" ) ?>"/>
37
- <input type="text" class="mo2f_table_textbox" style="width:22% !important;" pattern="[^\s][A-Z]*[a-z]*[0-9]*[^\s]" name="mo2f_google_auth_appname" placeholder="Enter the app name" value="<?php echo $gauth_name;?>" />&nbsp;&nbsp;&nbsp;
38
-
39
- <input type="submit" name="submit" value="Save App Name" class="mo_wpns_button mo_wpns_button1" />
40
-
41
- <br>
42
- </form>
43
- </div>
44
  </div>
45
  <h4><span id="step_number"></span><?php echo mo2f_lt( 'Scan the QR code from the Authenticator App.' ); ?></h4>
46
  <div style="margin-left:40px;">
47
  <ol>
48
  <li><?php echo mo2f_lt( 'In the app, tap on Menu and select "Set up account".' ); ?></li>
49
- <li><?php echo mo2f_lt( 'Select "Scan a barcode". Use your phone\'s camera to scan this barcode.' ); ?></li>
50
- <div id="displayQrCode"style="padding:10px;"><?php echo '<img src="data:image/jpg;base64,' . $data . '" />'; ?></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
  </ol>
53
 
54
  <div><a data-toggle="collapse" href="#mo2f_scanbarcode_a"
55
  aria-expanded="false"><b><?php echo mo2f_lt( 'Can\'t scan the barcode? ' ); ?></b></a>
56
  </div>
57
- <div class="mo2f_collapse" id="mo2f_scanbarcode_a">
58
  <ol class="mo2f_ol">
59
  <li><?php echo mo2f_lt( 'Tap on Menu and select' ); ?>
60
  <b> <?php echo mo2f_lt( ' Set up account ' ); ?></b>.
@@ -100,14 +110,14 @@ function mo2f_configure_google_authenticator( $user ) {
100
  <br>
101
  <form name="f" method="post" action="">
102
  <span><b><?php echo mo2f_lt( 'Code:' ); ?> </b>&nbsp;
103
- <input class="mo2f_table_textbox" style="width:200px;" autofocus="true" required="true"
104
  type="text" name="google_token" placeholder="<?php echo mo2f_lt( 'Enter OTP' ); ?>"
105
  style="width:95%;"/></span><br><br>
106
  <input type="hidden" name="google_auth_secret" value="<?php echo $ga_secret ?>"/>
107
  <input type="hidden" name="option" value="mo2f_configure_google_authenticator_validate"/>
108
  <input type="hidden" name="mo2f_configure_google_authenticator_validate_nonce"
109
  value="<?php echo wp_create_nonce( "mo2f-configure-google-authenticator-validate-nonce" ) ?>"/>
110
- <input type="submit" name="validate" id="validate" class="mo_wpns_button mo_wpns_button1"
111
  style="float:left;" value="<?php echo mo2f_lt( 'Verify and Save' ); ?>"/>
112
  </form>
113
  <form name="f" method="post" action="" id="mo2f_go_back_form">
@@ -117,8 +127,7 @@ function mo2f_configure_google_authenticator( $user ) {
117
  <input type="hidden" name="mo2f_go_back_nonce"
118
  value="<?php echo wp_create_nonce( "mo2f-go-back-nonce" ) ?>"/>
119
  </form>
120
- </div><br><br>
121
-
122
  </td>
123
  </tr>
124
  </table>
@@ -126,13 +135,13 @@ function mo2f_configure_google_authenticator( $user ) {
126
  <script>
127
  jQuery(document).ready(function(){
128
  jQuery(this).scrollTop(0);
129
- if(jQuery('input[type=radio][name=google]').is(':checked')){
130
  jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
131
- 'Get the Google Authenticator App - <a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
132
  '<a href="http://itunes.apple.com/us/app/google-authenticator/id388497605" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
133
  jQuery('#mo2f_change_app_name').show();
134
  jQuery('#links_to_apps').show();
135
- }
136
  });
137
 
138
  jQuery('input[type=radio][name=mo2f_app_type_radio]').change(function () {
@@ -143,38 +152,43 @@ function mo2f_configure_google_authenticator( $user ) {
143
  jQuery('#mo2f_change_app_name').hide();
144
  jQuery('#step_number').html('2. ');
145
 
146
- jQuery('input[type=radio][name=google]').click(function(){
147
- jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
148
- 'Get the Google Authenticator App - <a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
149
- '<a href="http://itunes.apple.com/us/app/google-authenticator/id388497605" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
150
- jQuery('#step_number').html('3. ');
151
- jQuery("input[type=radio][name=authy]").prop("checked", false);
152
- jQuery("input[type=radio][name=lastpass]").prop("checked", false);
153
- jQuery('#mo2f_change_app_name').show();
154
- jQuery('#links_to_apps').show();
155
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
 
157
- jQuery('input[type=radio][name=authy]').click(function(){
158
- jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
159
- 'Get the Authy Authenticator App - <a href="https://play.google.com/store/apps/details?id=com.authy.authy" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
160
- '<a href="https://itunes.apple.com/in/app/authy/id494168017" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
161
- jQuery("input[type=radio][name=google]").prop("checked", false);
162
- jQuery("input[type=radio][name=lastpass]").prop("checked", false);
163
- jQuery('#mo2f_change_app_name').hide();
164
- jQuery('#step_number').html('2. ');
165
- jQuery('#links_to_apps').show();
166
- });
167
-
168
- jQuery('input[type=radio][name=lastpass]').click(function(){
169
- jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
170
- 'Get the LastPass Authenticator App - <a href="https://play.google.com/store/apps/details?id=com.lastpass.authenticator" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
171
- '<a href="https://itunes.apple.com/in/app/lastpass-authenticator/id1079110004" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
172
- jQuery("input[type=radio][name=authy]").prop("checked", false);
173
- jQuery("input[type=radio][name=google]").prop("checked", false);
174
- jQuery('#mo2f_change_app_name').show();
175
- jQuery('#step_number').html('3. ');
176
- jQuery('#links_to_apps').show();
177
- });
178
  </script>
179
  <?php
180
  }
11
  <table>
12
  <tr>
13
  <td class="mo2f_google_authy_step2">
14
+ <?php echo '<' . $h_size . '>' . mo2f_lt( 'Step-1: Set up Google/Authy/LastPass Authenticator' ) . '<span style="float:right">
15
+ <a href="https://developers.miniorange.com/docs/security/wordpress/wp-security/google-authenticator" target="_blank"><span class="dashicons dashicons-text-page" style="font-size:26px;color:#269eb3;float: right;"></span></a>
16
 
17
+ <a href="https://www.youtube.com/watch?v=vVGXjedIaGs" target="_blank"><span class="dashicons dashicons-video-alt3" style="font-size:30px;color:red;float: right; margin-right: 16px;margin-top: -3px;"></span></a>
18
+ </span></' . $h_size . '>'; ?>
19
  <hr>
20
 
21
+ <div style="line-height: 5; background: white; margin-left:40px;" id="mo2f_choose_app_tour">
22
+ <label for="authenticator_type"><b>1. Choose an Authenticator app:</b></label>
23
+
24
+ <select id="authenticator_type">
25
+ <option value="google_authenticator">Google Authenticator</option>
26
+ <option value="msft_authenticator">Microsoft Authenticator</option>
27
+ <option value="authy_authenticator">Authy Authenticator</option>
28
+ <option value="last_pass_auth">LastPass Authenticator</option>
29
+ <option value="free_otp_auth">FreeOTP Authenticator</option>
30
+ <option value="duo_auth">Duo Mobile Authenticator</option>
31
+ </select>
32
+ </div>
33
 
34
+ <div id="links_to_apps_tour" style="background-color:white;padding:5px;margin-left:40px;width:75%">
35
  <span id="links_to_apps"></span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  </div>
37
  <h4><span id="step_number"></span><?php echo mo2f_lt( 'Scan the QR code from the Authenticator App.' ); ?></h4>
38
  <div style="margin-left:40px;">
39
  <ol>
40
  <li><?php echo mo2f_lt( 'In the app, tap on Menu and select "Set up account".' ); ?></li>
41
+ <li><?php echo mo2f_lt( 'Select "Scan a barcode".' ); ?></li>
42
+ <!-- div id="displayQrCode"style="padding:10px;"><?php //echo '<img src="data:image/jpg;base64,' . $data . '" />'; ?></div> -->
43
+ <form name="f" id="login_settings_appname_form" method="post" action="">
44
+ <input type="hidden" name="option" value="mo2f_google_appname" />
45
+ <input type="hidden" name="mo2f_google_appname_nonce"
46
+ value="<?php echo wp_create_nonce( "mo2f-google-appname-nonce" ) ?>"/>
47
+ <div style="margin-left: 14%;">
48
+ <div class="mo2f_gauth_column_cloud mo2f_gauth_left" >
49
+ <div id="displayQrCode"><?php echo '<img id="displayGAQrCodeTour" style="line-height: 0;background:white;" src="data:image/jpg;base64,' . $data . '" />'; ?></div>
50
+ </div>
51
+ </div>
52
+ <div >
53
+ <input type="text" class="mo2f_table_textbox" id="mo2f_change_app_name" style="margin-left: -1.5px;width: 32%;margin-top: 4%;" name="mo2f_google_auth_appname" placeholder="Enter the app name" value="<?php echo $gauth_name;?>" />
54
+
55
+ <input type="submit" name="submit" value="Save App Name" class="mo_wpns_button mo_wpns_button1" style="padding: 6px 19px;margin-top: -0.1%;margin-left: -1.5px;width: 32%;" />
56
+ </div>
57
+ <br>
58
+
59
+
60
+ </form>
61
 
62
  </ol>
63
 
64
  <div><a data-toggle="collapse" href="#mo2f_scanbarcode_a"
65
  aria-expanded="false"><b><?php echo mo2f_lt( 'Can\'t scan the barcode? ' ); ?></b></a>
66
  </div>
67
+ <div class="mo2f_collapse" id="mo2f_scanbarcode_a" style="background: white;">
68
  <ol class="mo2f_ol">
69
  <li><?php echo mo2f_lt( 'Tap on Menu and select' ); ?>
70
  <b> <?php echo mo2f_lt( ' Set up account ' ); ?></b>.
110
  <br>
111
  <form name="f" method="post" action="">
112
  <span><b><?php echo mo2f_lt( 'Code:' ); ?> </b>&nbsp;
113
+ <input id="EnterOTPGATour" class="mo2f_table_textbox" style="width:200px;" autofocus="true" required="true"
114
  type="text" name="google_token" placeholder="<?php echo mo2f_lt( 'Enter OTP' ); ?>"
115
  style="width:95%;"/></span><br><br>
116
  <input type="hidden" name="google_auth_secret" value="<?php echo $ga_secret ?>"/>
117
  <input type="hidden" name="option" value="mo2f_configure_google_authenticator_validate"/>
118
  <input type="hidden" name="mo2f_configure_google_authenticator_validate_nonce"
119
  value="<?php echo wp_create_nonce( "mo2f-configure-google-authenticator-validate-nonce" ) ?>"/>
120
+ <input type="submit" name="validate" id="SaveOTPGATour" class="mo_wpns_button mo_wpns_button1"
121
  style="float:left;" value="<?php echo mo2f_lt( 'Verify and Save' ); ?>"/>
122
  </form>
123
  <form name="f" method="post" action="" id="mo2f_go_back_form">
127
  <input type="hidden" name="mo2f_go_back_nonce"
128
  value="<?php echo wp_create_nonce( "mo2f-go-back-nonce" ) ?>"/>
129
  </form>
130
+ </div><br>
 
131
  </td>
132
  </tr>
133
  </table>
135
  <script>
136
  jQuery(document).ready(function(){
137
  jQuery(this).scrollTop(0);
138
+ // if(jQuery('input[type=radio][name=google]').is(':checked')){
139
  jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
140
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
141
  '<a href="http://itunes.apple.com/us/app/google-authenticator/id388497605" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
142
  jQuery('#mo2f_change_app_name').show();
143
  jQuery('#links_to_apps').show();
144
+ // }
145
  });
146
 
147
  jQuery('input[type=radio][name=mo2f_app_type_radio]').change(function () {
152
  jQuery('#mo2f_change_app_name').hide();
153
  jQuery('#step_number').html('2. ');
154
 
155
+ jQuery('#authenticator_type').change(function(){
156
+ var auth_type = jQuery(this).val();
157
+ if(auth_type == 'google_authenticator'){
158
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
159
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
160
+ '<a href="http://itunes.apple.com/us/app/google-authenticator/id388497605" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
161
+ jQuery('#mo2f_change_app_name').show();
162
+ jQuery('#links_to_apps').show();
163
+ }else if(auth_type == 'msft_authenticator'){
164
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
165
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=com.azure.authenticator" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
166
+ '<a href="https://apps.apple.com/us/app/microsoft-authenticator/id983156458" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
167
+ jQuery('#links_to_apps').show();
168
+ }else if(auth_type == 'free_otp_auth'){
169
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
170
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=org.fedorahosted.freeotp" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
171
+ '<a href="https://apps.apple.com/us/app/freeotp-authenticator/id872559395" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
172
+ jQuery('#links_to_apps').show();
173
+ }else if(auth_type == 'duo_auth'){
174
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
175
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=com.duosecurity.duomobile" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
176
+ '<a href="https://apps.apple.com/in/app/duo-mobile/id422663827" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
177
+ jQuery('#links_to_apps').show();
178
+ }else if(auth_type == 'authy_authenticator'){
179
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
180
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=com.authy.authy" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
181
+ '<a href="https://itunes.apple.com/in/app/authy/id494168017" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
182
+ jQuery('#links_to_apps').show();
183
+ }else{
184
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
185
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=com.lastpass.authenticator" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
186
+ '<a href="https://itunes.apple.com/in/app/lastpass-authenticator/id1079110004" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
187
+ jQuery('#mo2f_change_app_name').show();
188
+ jQuery('#links_to_apps').show();
189
+ }
190
+ });
191
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  </script>
193
  <?php
194
  }
views/twofa/setup/setup_google_authenticator_onpremise.php CHANGED
@@ -9,54 +9,63 @@ function mo2f_configure_google_authenticator_onprem( $secret,$url,$otpcode ) {
9
  <table>
10
  <tr>
11
  <td class="mo2f_google_authy_step2">
12
- <?php echo '<' . $h_size . '>' . mo2f_lt( 'Step-1: Set up Google/Authy/LastPass Authenticator' ) . '</' . $h_size . '>'; ?>
 
13
 
 
 
14
  <hr>
15
 
16
- <p style="background-color:#a3e8c2;padding:5px;">
17
- <?php echo mo2f_lt( 'You can configure this method in your Google/Authy/LastPass Authenticator apps.' ); ?>
18
- </p>
19
 
20
- <h4>1. <?php echo mo2f_lt( 'Install the Authenticator App that you wish to configure, in your phone.' ); ?></h4>
21
- <div style="margin-left:40px;">
22
- <input type="radio" name="google" value="ga" checked> Google Authenticator &nbsp;&nbsp;
23
- <input type="radio" name="authy" value="aa"> Authy Authenticator &nbsp;&nbsp;
24
- <input type="radio" name="lastpass" value="lpa"> LastPass Authenticator &nbsp;&nbsp;
 
 
 
 
 
 
25
  </div>
26
 
 
27
  <span id="links_to_apps"></span>
28
- <div id="mo2f_change_app_name">
29
- <h4>2. <?php echo mo2f_lt('Choose the account name to be configured in the App:'); ?></h4>
30
- <div style="margin-left:40px;">
31
- <form name="f" id="login_settings_appname_form" method="post" action="">
32
- <input type="hidden" name="option" value="mo2f_google_appname" />
33
- <input type="hidden" name="mo2f_google_appname_nonce"
34
- value="<?php echo wp_create_nonce( "mo2f-google-appname-nonce" ) ?>"/>
35
- <input type="text" class="mo2f_table_textbox" style="width:22% !important;" name="mo2f_google_auth_appname" placeholder="Enter the app name" value="<?php echo $gauth_name;?>" />&nbsp;&nbsp;&nbsp;
36
-
37
- <input type="submit" name="submit" value="Save App Name" class="mo_wpns_button mo_wpns_button1" />
38
-
39
- <br>
40
- </form>
41
- </div>
42
  </div>
 
43
  <h4><span id="step_number"></span><?php echo mo2f_lt( 'Scan the QR code from the Authenticator App.' ); ?></h4>
44
  <div style="margin-left:40px;">
45
  <ol>
46
  <li><?php echo mo2f_lt( 'In the app, tap on Menu and select "Set up account".' ); ?></li>
47
- <li><?php echo mo2f_lt( 'Select "Scan a barcode". Use your phone\'s camera to scan this barcode.' ); ?></li>
48
- <!-- <div id="displayQrCode"style="padding:10px;"><?php //echo '<img src="data:image/jpg;base64,' . $url . '" />'; ?></div> -->
49
- <div class="mo2f_gauth_column mo2f_gauth_left" >
50
- <div class="mo2f_gauth" data-qrcode="<?php echo $url;?>" style="float:left;margin-left:10%;"></div>
51
- </div>
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
  </ol>
55
 
56
  <div><a data-toggle="collapse" href="#mo2f_scanbarcode_a"
57
  aria-expanded="false"><b><?php echo mo2f_lt( 'Can\'t scan the barcode? ' ); ?></b></a>
58
  </div>
59
- <div class="mo2f_collapse" id="mo2f_scanbarcode_a">
60
  <ol class="mo2f_ol">
61
  <li><?php echo mo2f_lt( 'Tap on Menu and select' ); ?>
62
  <b> <?php echo mo2f_lt( ' Set up account ' ); ?></b>.
@@ -102,14 +111,14 @@ function mo2f_configure_google_authenticator_onprem( $secret,$url,$otpcode ) {
102
  <br>
103
  <form name="f" method="post" action="">
104
  <span><b><?php echo mo2f_lt( 'Code:' ); ?> </b>&nbsp;
105
- <input class="mo2f_table_textbox" style="width:200px;" autofocus="true" required="true"
106
  type="text" name="google_token" placeholder="<?php echo mo2f_lt( 'Enter OTP' ); ?>"
107
  style="width:95%;"/></span><br><br>
108
 
109
  <input type="hidden" name="option" value="mo2f_configure_google_authenticator_validate"/>
110
  <input type="hidden" name="mo2f_configure_google_authenticator_validate_nonce"
111
  value="<?php echo wp_create_nonce( "mo2f-configure-google-authenticator-validate-nonce" ) ?>"/>
112
- <input type="submit" name="validate" id="validate" class="mo_wpns_button mo_wpns_button1"
113
  style="float:left;" value="<?php echo mo2f_lt( 'Verify and Save' ); ?>"/>
114
  </form>
115
  <form name="f" method="post" action="" id="mo2f_go_back_form">
@@ -136,10 +145,7 @@ $q = $_SERVER['REQUEST_TIME']*1000;
136
  </script>
137
  <?php
138
  echo '<head>';
139
- // echo '<script type="text/javascript" src="'.plugins_url( "/includes/jquery-qrcode/jquery-qrcode.js", __FILE__ ).'"></script>';
140
- // echo '<script type="text/javascript" src="'.plugins_url( "/includes/jquery-qrcode/jquery-qrcode.min.js", __FILE__ ).'"></script>';
141
  echo '</head>';
142
- // echo '<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>';
143
  echo '<script>';
144
  echo 'jQuery(document).ready(function() {';
145
  echo "jQuery('.mo2f_gauth').qrcode({
@@ -153,56 +159,56 @@ $q = $_SERVER['REQUEST_TIME']*1000;
153
  ?>
154
  <script>
155
  jQuery(document).ready(function(){
 
156
  jQuery(this).scrollTop(0);
157
- if(jQuery('input[type=radio][name=google]').is(':checked')){
158
  jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
159
- 'Get the Google Authenticator App - <a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
160
  '<a href="http://itunes.apple.com/us/app/google-authenticator/id388497605" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
161
  jQuery('#mo2f_change_app_name').show();
162
  jQuery('#links_to_apps').show();
163
- }
164
  });
165
 
166
  jQuery('input[type=radio][name=mo2f_app_type_radio]').change(function () {
167
  jQuery('#mo2f_configure_google_authy_form1').submit();
168
  });
169
 
170
- jQuery('#links_to_apps').show();
171
- jQuery('#mo2f_change_app_name').hide();
172
- jQuery('#step_number').html('2. ');
173
-
174
- jQuery('input[type=radio][name=google]').click(function(){
175
- jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
176
- 'Get the Google Authenticator App - <a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
177
- '<a href="http://itunes.apple.com/us/app/google-authenticator/id388497605" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
178
- jQuery('#step_number').html('3. ');
179
- jQuery("input[type=radio][name=authy]").prop("checked", false);
180
- jQuery("input[type=radio][name=lastpass]").prop("checked", false);
181
- jQuery('#mo2f_change_app_name').show();
182
- jQuery('#links_to_apps').show();
183
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
 
185
- jQuery('input[type=radio][name=authy]').click(function(){
186
- jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
187
- 'Get the Authy Authenticator App - <a href="https://play.google.com/store/apps/details?id=com.authy.authy" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
188
- '<a href="https://itunes.apple.com/in/app/authy/id494168017" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
189
- jQuery("input[type=radio][name=google]").prop("checked", false);
190
- jQuery("input[type=radio][name=lastpass]").prop("checked", false);
191
- jQuery('#mo2f_change_app_name').hide();
192
- jQuery('#step_number').html('2. ');
193
- jQuery('#links_to_apps').show();
194
- });
195
-
196
- jQuery('input[type=radio][name=lastpass]').click(function(){
197
- jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
198
- 'Get the LastPass Authenticator App - <a href="https://play.google.com/store/apps/details?id=com.lastpass.authenticator" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
199
- '<a href="https://itunes.apple.com/in/app/lastpass-authenticator/id1079110004" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
200
- jQuery("input[type=radio][name=authy]").prop("checked", false);
201
- jQuery("input[type=radio][name=google]").prop("checked", false);
202
- jQuery('#mo2f_change_app_name').show();
203
- jQuery('#step_number').html('3. ');
204
- jQuery('#links_to_apps').show();
205
- });
206
  </script>
207
  <?php
208
  }
9
  <table>
10
  <tr>
11
  <td class="mo2f_google_authy_step2">
12
+ <?php echo '<' . $h_size . '>' . mo2f_lt( 'Step-1: Set up Google/Authy/LastPass Authenticator' ) . '<span style="float:right">
13
+ <a href="https://developers.miniorange.com/docs/security/wordpress/wp-security/google-authenticator" target="_blank"><span class="dashicons dashicons-text-page" style="font-size:26px;color:#269eb3;float: right;"></span></a>
14
 
15
+ <a href="https://www.youtube.com/watch?v=vVGXjedIaGs" target="_blank"><span class="dashicons dashicons-video-alt3" style="font-size:30px;color:red;float: right; margin-right: 16px;margin-top: -3px;"></span></a>
16
+ </span></' . $h_size . '>'; ?>
17
  <hr>
18
 
19
+
 
 
20
 
21
+ <div style="line-height: 5; background: white; margin-left:40px;" id = "mo2f_choose_app_tour">
22
+ <label for="authenticator_type"><b>1. Choose an Authenticator app:</b></label>
23
+
24
+ <select id="authenticator_type">
25
+ <option value="google_authenticator">Google Authenticator</option>
26
+ <option value="msft_authenticator">Microsoft Authenticator</option>
27
+ <option value="authy_authenticator">Authy Authenticator</option>
28
+ <option value="last_pass_auth">LastPass Authenticator</option>
29
+ <option value="free_otp_auth">FreeOTP Authenticator</option>
30
+ <option value="duo_auth">Duo Mobile Authenticator</option>
31
+ </select>
32
  </div>
33
 
34
+ <div id="links_to_apps_tour" style="background-color:white;padding:5px;margin-left:40px;width:75%">
35
  <span id="links_to_apps"></span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  </div>
37
+
38
  <h4><span id="step_number"></span><?php echo mo2f_lt( 'Scan the QR code from the Authenticator App.' ); ?></h4>
39
  <div style="margin-left:40px;">
40
  <ol>
41
  <li><?php echo mo2f_lt( 'In the app, tap on Menu and select "Set up account".' ); ?></li>
42
+ <li><?php echo mo2f_lt( 'Select "Scan a barcode".' ); ?></li>
 
 
 
 
43
 
44
+ <form name="f" id="login_settings_appname_form" method="post" action="">
45
+ <input type="hidden" name="option" value="mo2f_google_appname" />
46
+ <input type="hidden" name="mo2f_google_appname_nonce"
47
+ value="<?php echo wp_create_nonce( "mo2f-google-appname-nonce" ) ?>"/>
48
+ <div style="margin-left: 14%;">
49
+ <div class="mo2f_gauth_column mo2f_gauth_left" >
50
+
51
+ <div class="mo2f_gauth" id= "displayGAQrCodeTour" style="background: white;" data-qrcode="<?php echo $url;?>" ></div>
52
+ </div>
53
+ </div>
54
+
55
+ <div>
56
+ <input type="text" class="mo2f_table_textbox" style="margin-left: -1.5px;width: 32%;margin-top: 4%;" id= "mo2f_change_app_name" name="mo2f_google_auth_appname" placeholder="Enter the app name" value="<?php echo $gauth_name;?>" />
57
+
58
+ <input type="submit" name="submit" value="Save App Name" class="mo_wpns_button mo_wpns_button1" style="padding: 6px 19px;margin-top: -0.1%;margin-left: -1.5px;width: 32%;" />
59
+ <br>
60
+ </div>
61
+ </form>
62
 
63
  </ol>
64
 
65
  <div><a data-toggle="collapse" href="#mo2f_scanbarcode_a"
66
  aria-expanded="false"><b><?php echo mo2f_lt( 'Can\'t scan the barcode? ' ); ?></b></a>
67
  </div>
68
+ <div class="mo2f_collapse" id="mo2f_scanbarcode_a" style="background: white;">
69
  <ol class="mo2f_ol">
70
  <li><?php echo mo2f_lt( 'Tap on Menu and select' ); ?>
71
  <b> <?php echo mo2f_lt( ' Set up account ' ); ?></b>.
111
  <br>
112
  <form name="f" method="post" action="">
113
  <span><b><?php echo mo2f_lt( 'Code:' ); ?> </b>&nbsp;
114
+ <input class="mo2f_table_textbox" style="width:200px;" id="EnterOTPGATour" autofocus="true" required="true"
115
  type="text" name="google_token" placeholder="<?php echo mo2f_lt( 'Enter OTP' ); ?>"
116
  style="width:95%;"/></span><br><br>
117
 
118
  <input type="hidden" name="option" value="mo2f_configure_google_authenticator_validate"/>
119
  <input type="hidden" name="mo2f_configure_google_authenticator_validate_nonce"
120
  value="<?php echo wp_create_nonce( "mo2f-configure-google-authenticator-validate-nonce" ) ?>"/>
121
+ <input type="submit" name="validate" id="SaveOTPGATour" class="mo_wpns_button mo_wpns_button1"
122
  style="float:left;" value="<?php echo mo2f_lt( 'Verify and Save' ); ?>"/>
123
  </form>
124
  <form name="f" method="post" action="" id="mo2f_go_back_form">
145
  </script>
146
  <?php
147
  echo '<head>';
 
 
148
  echo '</head>';
 
149
  echo '<script>';
150
  echo 'jQuery(document).ready(function() {';
151
  echo "jQuery('.mo2f_gauth').qrcode({
159
  ?>
160
  <script>
161
  jQuery(document).ready(function(){
162
+
163
  jQuery(this).scrollTop(0);
 
164
  jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
165
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
166
  '<a href="http://itunes.apple.com/us/app/google-authenticator/id388497605" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
167
  jQuery('#mo2f_change_app_name').show();
168
  jQuery('#links_to_apps').show();
 
169
  });
170
 
171
  jQuery('input[type=radio][name=mo2f_app_type_radio]').change(function () {
172
  jQuery('#mo2f_configure_google_authy_form1').submit();
173
  });
174
 
175
+ jQuery('#authenticator_type').change(function(){
176
+ var auth_type = jQuery(this).val();
177
+ if(auth_type == 'google_authenticator'){
178
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
179
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
180
+ '<a href="http://itunes.apple.com/us/app/google-authenticator/id388497605" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
181
+ jQuery('#mo2f_change_app_name').show();
182
+ jQuery('#links_to_apps').show();
183
+ }else if(auth_type == 'msft_authenticator'){
184
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
185
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=com.azure.authenticator" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
186
+ '<a href="https://apps.apple.com/us/app/microsoft-authenticator/id983156458" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
187
+ jQuery('#links_to_apps').show();
188
+ }else if(auth_type == 'free_otp_auth'){
189
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
190
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=org.fedorahosted.freeotp" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
191
+ '<a href="https://apps.apple.com/us/app/freeotp-authenticator/id872559395" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
192
+ jQuery('#links_to_apps').show();
193
+ }else if(auth_type == 'duo_auth'){
194
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
195
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=com.duosecurity.duomobile" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
196
+ '<a href="https://apps.apple.com/in/app/duo-mobile/id422663827" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
197
+ jQuery('#links_to_apps').show();
198
+ }else if(auth_type == 'authy_authenticator'){
199
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
200
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=com.authy.authy" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
201
+ '<a href="https://itunes.apple.com/in/app/authy/id494168017" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
202
+ jQuery('#links_to_apps').show();
203
+ }else{
204
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
205
+ 'Get the App - <a href="https://play.google.com/store/apps/details?id=com.lastpass.authenticator" target="_blank"><b><?php echo mo2f_lt( "Android Play Store" ); ?></b></a>, &nbsp;' +
206
+ '<a href="https://itunes.apple.com/in/app/lastpass-authenticator/id1079110004" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
207
+ jQuery('#mo2f_change_app_name').show();
208
+ jQuery('#links_to_apps').show();
209
+ }
210
+ });
211
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
  </script>
213
  <?php
214
  }
views/twofa/setup/setup_kba_questions.php CHANGED
@@ -51,7 +51,7 @@ function mo2f_configure_kba_questions() { ?>
51
  </select>
52
  </td>
53
  <td>
54
- <input class="mo2f_table_textbox" type="text" name="mo2f_kba_ans1" id="mo2f_kba_ans1"
55
  title="<?php echo mo2f_lt( 'Only alphanumeric letters with special characters(_@.$#&amp;+-) are allowed.' ); ?>"
56
  pattern="(?=\S)[A-Za-z0-9_@.$#&amp;+\-\s]{1,100}" required="true" autofocus="true"
57
  placeholder="<?php echo mo2f_lt( 'Enter your answer' ); ?>"/>
@@ -91,7 +91,7 @@ function mo2f_configure_kba_questions() { ?>
91
  </select>
92
  </td>
93
  <td>
94
- <input class="mo2f_table_textbox" type="text" name="mo2f_kba_ans2" id="mo2f_kba_ans2"
95
  title="<?php echo mo2f_lt( 'Only alphanumeric letters with special characters(_@.$#&amp;+-) are allowed.' ); ?>"
96
  pattern="(?=\S)[A-Za-z0-9_@.$#&amp;+\-\s]{1,100}" required="true"
97
  placeholder="<?php echo mo2f_lt( 'Enter your answer' ); ?>"/>
@@ -107,7 +107,7 @@ function mo2f_configure_kba_questions() { ?>
107
  placeholder="<?php echo mo2f_lt( 'Enter your custom question here' ); ?>"/>
108
  </td>
109
  <td>
110
- <input class="mo2f_table_textbox" type="text" name="mo2f_kba_ans3" id="mo2f_kba_ans3"
111
  title="<?php echo mo2f_lt( 'Only alphanumeric letters with special characters(_@.$#&amp;+-) are allowed.' ); ?>"
112
  pattern="(?=\S)[A-Za-z0-9_@.$#&amp;+\-\s]{1,100}" required="true"
113
  placeholder="<?php echo mo2f_lt( 'Enter your answer' ); ?>"/>
@@ -156,7 +156,8 @@ function mo2f_configure_for_mobile_suppport_kba( $user ) {
156
 
157
  ?>
158
 
159
- <h3><?php echo mo2f_lt( 'Configure Second Factor - KBA (Security Questions)' ); ?></h3>
 
160
  <hr/>
161
  <form name="f" method="post" action="" id="mo2f_kba_setup_form">
162
  <?php mo2f_configure_kba_questions(); ?>
@@ -199,4 +200,4 @@ function mo2f_configure_for_mobile_suppport_kba( $user ) {
199
  <?php
200
  }
201
 
202
- ?>
51
  </select>
52
  </td>
53
  <td>
54
+ <input class="mo2f_table_textbox" type="password" name="mo2f_kba_ans1" id="mo2f_kba_ans1"
55
  title="<?php echo mo2f_lt( 'Only alphanumeric letters with special characters(_@.$#&amp;+-) are allowed.' ); ?>"
56
  pattern="(?=\S)[A-Za-z0-9_@.$#&amp;+\-\s]{1,100}" required="true" autofocus="true"
57
  placeholder="<?php echo mo2f_lt( 'Enter your answer' ); ?>"/>
91
  </select>
92
  </td>
93
  <td>
94
+ <input class="mo2f_table_textbox" type="password" name="mo2f_kba_ans2" id="mo2f_kba_ans2"
95
  title="<?php echo mo2f_lt( 'Only alphanumeric letters with special characters(_@.$#&amp;+-) are allowed.' ); ?>"
96
  pattern="(?=\S)[A-Za-z0-9_@.$#&amp;+\-\s]{1,100}" required="true"
97
  placeholder="<?php echo mo2f_lt( 'Enter your answer' ); ?>"/>
107
  placeholder="<?php echo mo2f_lt( 'Enter your custom question here' ); ?>"/>
108
  </td>
109
  <td>
110
+ <input class="mo2f_table_textbox" type="password" name="mo2f_kba_ans3" id="mo2f_kba_ans3"
111
  title="<?php echo mo2f_lt( 'Only alphanumeric letters with special characters(_@.$#&amp;+-) are allowed.' ); ?>"
112
  pattern="(?=\S)[A-Za-z0-9_@.$#&amp;+\-\s]{1,100}" required="true"
113
  placeholder="<?php echo mo2f_lt( 'Enter your answer' ); ?>"/>
156
 
157
  ?>
158
 
159
+ <h3><?php echo mo2f_lt( 'Configure Second Factor - KBA (Security Questions)' ); ?>
160
+ </h3>
161
  <hr/>
162
  <form name="f" method="post" action="" id="mo2f_kba_setup_form">
163
  <?php mo2f_configure_kba_questions(); ?>
200
  <?php
201
  }
202
 
203
+ ?>
views/twofa/setup/setup_miniorange_authenticator.php CHANGED
@@ -64,7 +64,8 @@ function mo2f_configure_miniorange_authenticator($user){?>
64
  function download_instruction_for_mobile_app( $mobile_reg_status){ ?>
65
  <div id="mo2f_app_div" class="mo_margin_left">
66
  <a class="mo_app_link" data-toggle="collapse" href="#mo2f_sub_header_app" aria-expanded="false">
67
- <h3 class="mo2f_authn_header"><?php echo mo2f_lt('Step-1 : Download the miniOrange');?> <span style="color: #F78701;"> <?php echo mo2f_lt('Authenticator');?></span> <?php echo mo2f_lt('App');?></h3>
 
68
  </a>
69
  <hr class="mo_hr">
70
  <div class="mo2f_collapse in" id="mo2f_sub_header_app">
@@ -223,4 +224,4 @@ function initialize_mobile_registration() {
223
  }, 800);
224
  </script>
225
  <?php
226
- } ?>
64
  function download_instruction_for_mobile_app( $mobile_reg_status){ ?>
65
  <div id="mo2f_app_div" class="mo_margin_left">
66
  <a class="mo_app_link" data-toggle="collapse" href="#mo2f_sub_header_app" aria-expanded="false">
67
+ <h3 class="mo2f_authn_header"><?php echo mo2f_lt('Step-1 : Download the miniOrange');?> <span style="color: #F78701;"> <?php echo mo2f_lt('Authenticator');?></span> <?php echo mo2f_lt('App');?>
68
+ </h3>
69
  </a>
70
  <hr class="mo_hr">
71
  <div class="mo2f_collapse in" id="mo2f_sub_header_app">
224
  }, 800);
225
  </script>
226
  <?php
227
+ } ?>
views/twofa/setup/setup_otp_over_sms.php CHANGED
@@ -7,7 +7,9 @@ function mo2f_configure_otp_over_sms( $user ) {
7
 
8
  ?>
9
 
10
- <h3><?php echo mo2f_lt( 'Configure OTP over SMS' ); ?></h3>
 
 
11
  <hr>
12
  <form name="f" method="post" action="" id="mo2f_verifyphone_form">
13
  <input type="hidden" name="option" value="mo2f_configure_otp_over_sms_send_otp"/>
@@ -54,4 +56,4 @@ function mo2f_configure_otp_over_sms( $user ) {
54
  <?php
55
  }
56
 
57
- ?>
7
 
8
  ?>
9
 
10
+ <h3><?php echo mo2f_lt( 'Configure OTP over SMS' ); ?>
11
+ </h3>
12
+ <h4> Remaining SMS Transaction: <?php echo get_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z');?> </h4>
13
  <hr>
14
  <form name="f" method="post" action="" id="mo2f_verifyphone_form">
15
  <input type="hidden" name="option" value="mo2f_configure_otp_over_sms_send_otp"/>
56
  <?php
57
  }
58
 
59
+ ?>
views/twofa/setup_twofa.php CHANGED
@@ -1,13 +1,12 @@
1
  <?php
2
  $user = wp_get_current_user();
3
  $mo2f_second_factor = mo2f_get_activated_second_factor( $user );
4
-
5
- global $Mo2fdbQueries;
6
 
7
  $is_customer_admin_registered = get_option( 'mo_2factor_admin_registration_status' );
8
  $configured_2FA_method = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user->ID );
9
-
10
- if ( $mo2f_second_factor == 'GOOGLE AUTHENTICATOR' ) {
11
  $app_type = get_user_meta( $user->ID, 'mo2f_external_app_type', true );
12
 
13
  if ( $app_type == 'Google Authenticator' ) {
@@ -28,7 +27,7 @@
28
  $testMethod = "Not Configured";
29
  }
30
 
31
- if ( $selectedMethod !== 'NONE' and !MO2F_IS_ONPREM) {
32
  $Mo2fdbQueries->update_user_details( $user->ID, array(
33
  'mo2f_configured_2FA_method' => $selectedMethod,
34
  'mo2f_' . str_replace( ' ', '', $selectedMethod ) . '_config_status' => true
@@ -41,7 +40,7 @@
41
  } else {
42
  update_option( 'mo2f_show_sms_transaction_message', 0 );
43
  }
44
- $is_customer_admin = current_user_can( 'manage_options' ) && get_option( 'mo2f_miniorange_admin' ) == $user->ID;
45
  $can_display_admin_features = ! $is_customer_admin_registered || $is_customer_admin ? true : false;
46
 
47
  $is_customer_registered = $Mo2fdbQueries->get_user_detail( 'user_registration_with_miniorange', $user->ID ) == 'SUCCESS' ? true : false;
@@ -62,8 +61,9 @@
62
  $is_NC = get_option( 'mo2f_is_NC' );
63
  $free_plan_existing_user = array(
64
  "Email Verification",
65
- "OTP Over SMS",
66
  "Security Questions",
 
 
67
  "miniOrange QR Code Authentication",
68
  "miniOrange Soft Token",
69
  "miniOrange Push Notification",
@@ -74,8 +74,10 @@
74
 
75
  $free_plan_new_user = array(
76
  "Google Authenticator",
77
- "Security Questions",
78
- "miniOrange Soft Token",
 
 
79
  "miniOrange QR Code Authentication",
80
  "miniOrange Push Notification"
81
  );
@@ -104,32 +106,37 @@
104
  $free_plan_existing_user = array(
105
  "Email Verification",
106
  "Security Questions",
 
 
107
  "Google Authenticator",
 
 
 
 
108
  );
109
 
110
  $free_plan_new_user = array(
111
  "Google Authenticator",
112
  "Security Questions",
113
- );
114
- $premium_plan = array(
115
- "Hardware Token",
116
  "miniOrange QR Code Authentication",
117
  "miniOrange Soft Token",
118
  "miniOrange Push Notification",
119
- "Authy Authenticator"
 
 
 
 
120
 
121
  );
122
  $standard_plan_existing_user = array(
123
  "",
124
- "OTP Over Email",
125
  "OTP Over SMS and Email",
126
- "OTP Over SMS"
127
  );
128
  $standard_plan_new_user = array(
129
  "",
130
  "Email Verification",
131
- "OTP Over SMS",
132
- "OTP Over Email",
133
  "OTP Over SMS and Email"
134
  );
135
  }
@@ -144,8 +151,8 @@
144
  $showOTP=FALSE;
145
  if(MO2F_IS_ONPREM)
146
  {
147
- $selectedMethod = get_user_meta($user->ID,'currentMethod',true);
148
-
149
  $is_customer_registered = true;
150
  $testMethod = $selectedMethod;
151
  if($selectedMethod == '')
@@ -169,7 +176,6 @@
169
 
170
 
171
  }
172
-
173
  ?>
174
  <div id="wpns_message"></div>
175
  <div class="mo_wpns_setting_layout">
@@ -179,15 +185,18 @@
179
  <img src="<?php echo plugins_url( 'includes/images/right-arrow.png"', dirname(dirname(__FILE__ ))); ?>"
180
  class="mo2f_2factor_heading_images" style="margin-top: 2px;"/>
181
  <p class="mo2f_heading_style" style="padding:0px;"><?php echo mo2f_lt( 'Authentication methods' ); ?>
182
- <?php if ( $can_display_admin_features ) { ?>
183
  <span style="color:limegreen">( <?php echo mo2f_lt( 'Current Plan' ); ?> )</span>
184
- <?php } ?>
185
- <?php if($showOTP){?>
186
- <span style="color:black">[ <?php echo mo2f_lt( 'Current OTP: ' ). $otpcode; ?> (<span style="color:blue" onclick="window.location.reload();">Refresh</span>)] </span>
187
- <?php } ?>
188
- <button class="btn btn-primary btn-large" id="test" style="float:right; margin-right: 20px; height: 36px" onclick="testAuthenticationMethod('<?php echo $selectedMethod; ?>');"
189
- <?php echo $is_customer_registered && ( $selectedMethod != 'NONE' ) ? "" : " disabled "; ?>>Test : <?php echo $testMethod;?>
190
- </button>
 
 
 
191
  </p>
192
  </a>
193
 
@@ -228,17 +237,18 @@
228
  <?php
229
  ?>
230
  <br>
 
 
 
 
 
 
231
  <?php
232
  }
233
- ?>
234
- <?php
235
- // }
236
- // else
237
- // {
238
- // update_option( 'mo2f_enable_2fa_prompt_on_login_page', 1 );
239
- // }
240
- echo mo2f_create_2fa_form( $user, "free_plan", $is_NC ? $free_plan_methods_new_user : $free_plan_methods_existing_user, $can_display_admin_features ); ?>
241
  </div>
 
242
  <hr>
243
  <?php if ( $can_display_admin_features ) { ?>
244
  <div>
@@ -269,28 +279,132 @@
269
  <input type="hidden" name="mo_2factor_resume_flow_driven_setup_nonce"
270
  value="<?php echo wp_create_nonce( "mo-2factor-resume-flow-driven-setup-nonce" ) ?>"/>
271
  </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  </div>
273
  <div id="EnterEmail" class="modal">
274
  <!-- Modal content -->
275
  <div class="modal-content">
276
  <!-- <span class="close">&times;</span> -->
277
  <div class="modal-header">
278
- <h3 class="modal-title" style="text-align: center; font-size: 20px; color: #20b2aa">Email Address</h3><span id="closeEnterEmail" class="modal-span-close">X</span>
279
  </div>
280
  <div class="modal-body" style="height: auto">
281
- <h2><i>Enter your Email address :&nbsp;&nbsp;&nbsp; <input type ='email' id='emailEntered' name='emailEntered' size= '50' required value=<?php echo $email;?>></i></h2>
282
  </div>
283
  <div class="modal-footer">
 
284
  <button type="button" class="mo_wpns_button mo_wpns_button1 modal-button" id="save_entered_email">Save</button>
285
  </div>
286
  </div>
287
  </div>
288
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
289
- <script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  jQuery('#test').click(function(){
291
  jQuery("#test").attr("disabled", true);
292
  });
293
 
 
 
 
294
  jQuery('#closeEnterEmail').click(function(){
295
  jQuery('#EnterEmail').css('display', 'none');
296
  });
@@ -305,6 +419,7 @@
305
  var email = jQuery('#emailEntered').val();
306
  var nonce = '<?php echo wp_create_nonce('EmailVerificationSaveNonce');?>';
307
  var user_id = '<?php echo get_current_user_id();?>';
 
308
  if(email != '')
309
  {
310
  var data = {
@@ -312,13 +427,17 @@
312
  'mo_2f_two_factor_ajax' : 'mo2f_save_email_verification',
313
  'nonce' : nonce,
314
  'email' : email,
315
- 'user_id' : user_id
 
316
  };
317
  jQuery.post(ajaxurl, data, function(response) {
318
  var response = response.replace(/\s+/g,' ').trim();
319
  if(response=="settingsSaved")
320
  {
321
- jQuery('#mo2f_configured_2FA_method_free_plan').val('EmailVerification');
 
 
 
322
  jQuery('#mo2f_selected_action_free_plan').val('select2factor');
323
  jQuery('#mo2f_save_free_plan_auth_methods_form').submit();
324
  }
@@ -344,90 +463,104 @@
344
  }
345
 
346
  });
347
- // function restart_tour() {
348
- // tour.restart();
349
- // }
350
-
351
- // var tour = new Tour({
352
- // name: "tour",
353
- // steps: [
354
- // {
355
- // element: "#GoogleAuthenticator_thumbnail_2_factor",
356
- // title: "Google Authenticator Method",
357
- // content: "Select the authentication method you wish to configure, for example Google Authenticator.",
358
- // backdrop:'body',
359
- // backdropPadding:'6'
360
- // }, {
361
- // element: "#GoogleAuthenticator_configuration",
362
- // title: "Configure Second Factor",
363
- // content: "Click here to Configure Google Authenticator Method on your phone.",
364
- // backdrop:'body',
365
- // backdropPadding:'6'
366
- // }, {
367
- // element: "#mo2f_selected_method",
368
- // title: "Selected Authentication Method",
369
- // content: "After the configuration, Google Authenticator will be set as your 2FA method.",
370
- // onPrev:function(tour){
371
- // jQuery("#mo2f_free_plan_auth_methods").show();
372
- // jQuery("#mo2f_standard_plan_auth_methods").hide();
373
- // jQuery("#mo2f_premium_plan_auth_methods").hide();
374
- // },
375
- // backdrop:'body',
376
- // backdropPadding:'6'
377
- // }
378
- // ,{
379
- // element: "#test",
380
- // title: "Test Configured Method",
381
- // content: "Please test the 2FA method you configured, to ensure it works.",
382
- // backdrop:'body',
383
- // backdropPadding:'6'
384
 
385
- // }
386
 
387
- // , {
388
- // element: "#mo2f_need_help",
389
- // title: "Need Any Help?",
390
- // content: "Click here to reach us anytime you need any help with the plugin.",
391
- // backdrop:'body',
392
- // placement:'bottom',
393
- // backdropPadding:'6',
394
- // onNext: function(){
395
- // mo2f_opensupport();
396
- // }
397
- // }
398
 
399
- // ,{
400
- // element: "#mo2f_upgrade",
401
- // title: "Premium Plans",
402
- // content: "For the Standard & Premium features we provide, click here to view & upgrade.",
403
- // placement: 'bottom',
404
- // backdrop:'body',
405
- // backdropPadding:'6'
406
- // }
407
- // ,
408
- // {
409
- // element: "#mo2f_restart_tour",
410
- // title: "Restart Tour",
411
- // content: "Click here to restart the tour whenever you wish.",
412
- // backdrop:'body',
413
- // backdropPadding:'6'
414
- // }
415
-
416
-
417
- // ]});
418
-
419
- // // Initialize the tour
420
- // tour.init();
421
-
422
- // // Start the tour
423
- // tour.start();
424
-
425
- // cosole.log('saasdsa');
426
- function configureOrSet2ndFactor_free_plan(authMethod, action) {
427
- if(authMethod == 'EmailVerification')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
428
  {
429
- var is_onprem = '<?php echo MO2F_IS_ONPREM;?>';
430
  var is_registered = '<?php echo $email_registered;?>';
 
 
431
  if(is_onprem == 1 && is_registered!=0 && action != 'select2factor')
432
  {
433
  jQuery('#EnterEmail').css('display', 'block');
@@ -435,6 +568,7 @@
435
  }
436
  else
437
  {
 
438
  jQuery('#mo2f_configured_2FA_method_free_plan').val(authMethod);
439
  jQuery('#mo2f_selected_action_free_plan').val(action);
440
  jQuery('#mo2f_save_free_plan_auth_methods_form').submit();
@@ -442,9 +576,15 @@
442
  }
443
  else
444
  {
 
445
  jQuery('#mo2f_configured_2FA_method_free_plan').val(authMethod);
446
  jQuery('#mo2f_selected_action_free_plan').val(action);
447
  jQuery('#mo2f_save_free_plan_auth_methods_form').submit();
 
 
 
 
 
448
  }
449
  }
450
 
@@ -476,8 +616,8 @@
476
  }
477
 
478
  function nav_popup() {
479
- document.getElementById("notice_div").style.width = "40%";
480
- setTimeout(function(){ $('#notice_div').fadeOut('slow'); }, 3000);
481
  }
482
  </script>
483
  <?php } ?>
1
  <?php
2
  $user = wp_get_current_user();
3
  $mo2f_second_factor = mo2f_get_activated_second_factor( $user );
4
+
5
+ global $Mo2fdbQueries;
6
 
7
  $is_customer_admin_registered = get_option( 'mo_2factor_admin_registration_status' );
8
  $configured_2FA_method = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user->ID );
9
+ if ( $mo2f_second_factor == 'GOOGLE AUTHENTICATOR' ) {
 
10
  $app_type = get_user_meta( $user->ID, 'mo2f_external_app_type', true );
11
 
12
  if ( $app_type == 'Google Authenticator' ) {
27
  $testMethod = "Not Configured";
28
  }
29
 
30
+ if ( $selectedMethod != 'NONE' and !MO2F_IS_ONPREM) {
31
  $Mo2fdbQueries->update_user_details( $user->ID, array(
32
  'mo2f_configured_2FA_method' => $selectedMethod,
33
  'mo2f_' . str_replace( ' ', '', $selectedMethod ) . '_config_status' => true
40
  } else {
41
  update_option( 'mo2f_show_sms_transaction_message', 0 );
42
  }
43
+ $is_customer_admin = current_user_can( 'manage_options' );
44
  $can_display_admin_features = ! $is_customer_admin_registered || $is_customer_admin ? true : false;
45
 
46
  $is_customer_registered = $Mo2fdbQueries->get_user_detail( 'user_registration_with_miniorange', $user->ID ) == 'SUCCESS' ? true : false;
61
  $is_NC = get_option( 'mo2f_is_NC' );
62
  $free_plan_existing_user = array(
63
  "Email Verification",
 
64
  "Security Questions",
65
+ "OTP Over SMS",
66
+ "OTP Over Email",
67
  "miniOrange QR Code Authentication",
68
  "miniOrange Soft Token",
69
  "miniOrange Push Notification",
74
 
75
  $free_plan_new_user = array(
76
  "Google Authenticator",
77
+ "Security Questions",
78
+ "OTP Over SMS",
79
+ "OTP Over Email",
80
+ "miniOrange Soft Token",
81
  "miniOrange QR Code Authentication",
82
  "miniOrange Push Notification"
83
  );
106
  $free_plan_existing_user = array(
107
  "Email Verification",
108
  "Security Questions",
109
+ "OTP Over SMS",
110
+ "OTP Over Email",
111
  "Google Authenticator",
112
+ "miniOrange QR Code Authentication",
113
+ "miniOrange Soft Token",
114
+ "miniOrange Push Notification"
115
+
116
  );
117
 
118
  $free_plan_new_user = array(
119
  "Google Authenticator",
120
  "Security Questions",
121
+ "OTP Over SMS",
122
+ "OTP Over Email",
 
123
  "miniOrange QR Code Authentication",
124
  "miniOrange Soft Token",
125
  "miniOrange Push Notification",
126
+
127
+ );
128
+ $premium_plan = array(
129
+ "Hardware Token",
130
+ "Authy Authenticator"
131
 
132
  );
133
  $standard_plan_existing_user = array(
134
  "",
 
135
  "OTP Over SMS and Email",
 
136
  );
137
  $standard_plan_new_user = array(
138
  "",
139
  "Email Verification",
 
 
140
  "OTP Over SMS and Email"
141
  );
142
  }
151
  $showOTP=FALSE;
152
  if(MO2F_IS_ONPREM)
153
  {
154
+ // $selectedMethod = get_user_meta($user->ID,'currentMethod',true);
155
+ $selectedMethod = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user->ID );
156
  $is_customer_registered = true;
157
  $testMethod = $selectedMethod;
158
  if($selectedMethod == '')
176
 
177
 
178
  }
 
179
  ?>
180
  <div id="wpns_message"></div>
181
  <div class="mo_wpns_setting_layout">
185
  <img src="<?php echo plugins_url( 'includes/images/right-arrow.png"', dirname(dirname(__FILE__ ))); ?>"
186
  class="mo2f_2factor_heading_images" style="margin-top: 2px;"/>
187
  <p class="mo2f_heading_style" style="padding:0px;"><?php echo mo2f_lt( 'Authentication methods' ); ?>
188
+ <?php if ( $can_display_admin_features ) { ?>
189
  <span style="color:limegreen">( <?php echo mo2f_lt( 'Current Plan' ); ?> )</span>
190
+ <?php } ?>
191
+ <?php if($showOTP){?>
192
+ <span style="color:black">[ <?php echo mo2f_lt( 'Current OTP: ' ). $otpcode; ?> (<span style="color:blue" onclick="window.location.reload();">Refresh</span>)] </span>
193
+ <?php } ?>
194
+
195
+ <button class="btn btn-primary btn-large" id="test" style="float:right; margin-right: 20px; height: 36px" onclick="testAuthenticationMethod('<?php echo $selectedMethod; ?>');"
196
+ <?php echo $is_customer_registered && ( $selectedMethod != 'NONE' ) ? "" : " disabled "; ?>>Test : <?php echo $testMethod;?>
197
+ </button>
198
+
199
+
200
  </p>
201
  </a>
202
 
237
  <?php
238
  ?>
239
  <br>
240
+ <?php
241
+ $EmailTransactions = get_site_option('cmVtYWluaW5nT1RQ')? get_site_option('cmVtYWluaW5nT1RQ') : 0;
242
+ $SMSTransactions = get_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z')?get_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z'):0;
243
+ $color_tras_sms = $SMSTransactions <= 2 ? 'red' : '#f3dbdb';
244
+ $color_tras_email = $EmailTransactions <= 2 ? 'red' : '#f3dbdb';
245
+ ?>
246
  <?php
247
  }
248
+
249
+ echo mo2f_create_2fa_form( $user, "free_plan", $is_NC ? $free_plan_methods_new_user : $free_plan_methods_existing_user, $can_display_admin_features ); ?>
 
 
 
 
 
 
250
  </div>
251
+
252
  <hr>
253
  <?php if ( $can_display_admin_features ) { ?>
254
  <div>
279
  <input type="hidden" name="mo_2factor_resume_flow_driven_setup_nonce"
280
  value="<?php echo wp_create_nonce( "mo-2factor-resume-flow-driven-setup-nonce" ) ?>"/>
281
  </form>
282
+ </div>
283
+ <div id="EnterEmailCloudVerification" class="modal">
284
+ <!-- Modal content -->
285
+ <div class="modal-content">
286
+ <!-- <span class="close">&times;</span> -->
287
+ <div class="modal-header">
288
+ <h3 class="modal-title" style="text-align: center; font-size: 20px; color: #20b2aa">Email Address for miniOrange</h3><span id="closeEnterEmailCloud" class="modal-span-close">X</span>
289
+ </div>
290
+ <div class="modal-body" style="height: auto">
291
+ <h2 style="color: red;">The email associated with your account is already registered in miniOrnage. Please Choose another email.</h2>
292
+ <h2><i>Enter your Email:&nbsp;&nbsp;&nbsp; <input type ='email' id='emailEnteredCloud' name='emailEnteredCloud' size= '40' required value="<?php echo $email;?>"/></i></h2>
293
+ </div>
294
+ <div class="modal-footer">
295
+ <button type="button" class="mo_wpns_button mo_wpns_button1 modal-button" id="save_entered_email_cloud">Save</button>
296
+ </div>
297
+ </div>
298
  </div>
299
  <div id="EnterEmail" class="modal">
300
  <!-- Modal content -->
301
  <div class="modal-content">
302
  <!-- <span class="close">&times;</span> -->
303
  <div class="modal-header">
304
+ <h3 class="modal-title" style="text-align: center; font-size: 20px; color: #20b2aa">Email Address for OTP</h3><span id="closeEnterEmail" class="modal-span-close">X</span>
305
  </div>
306
  <div class="modal-body" style="height: auto">
307
+ <h2><i>Enter your Email:&nbsp;&nbsp;&nbsp; <input type ='email' id='emailEntered' name='emailEntered' size= '40' required value="<?php echo $email;?>"/></i></h2>
308
  </div>
309
  <div class="modal-footer">
310
+ <input type="text" id="current_method" hidden value="">
311
  <button type="button" class="mo_wpns_button mo_wpns_button1 modal-button" id="save_entered_email">Save</button>
312
  </div>
313
  </div>
314
  </div>
315
+
316
+ <div id="mo2f_cloud" class = "modal" style="display: none;">
317
+ <div id="mo2f_cloud_modal" class="modal-content" style="width: 30%;overflow: hidden;" >
318
+
319
+ <div class="modal-header">
320
+ <h3 class="modal-title" style="text-align: center; font-size: 20px; color: #2980b9">
321
+ Are you sure you want to do that?
322
+ </h3>
323
+ <!-- <span class="modal-span-close" id="closeConfirmCloud">&times;</span> -->
324
+
325
+ <!-- <span id="closeConfirmCloud" class="modal-span-close">X</span>
326
+ --> </div>
327
+
328
+ <div class="modal-body" style="height: auto;background-color: beige;">
329
+
330
+ <div style="text-align: center;">
331
+
332
+ <?php
333
+ $user_id = get_current_user_id();
334
+ global $Mo2fdbQueries;
335
+ $currentMethod = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user_id );
336
+ if($currentMethod)
337
+ {
338
+ ?>
339
+
340
+
341
+ <!-- <h4 style="color: red;">NOTE: This will switch the solution to cloud solution which supports two-factor authentication for one admin user in the free plan. you can <a href="<?php echo $upgrade_url; ?>" style="color: #2980b9">Upgrade Plan</a> to add more users.</h4>
342
+ --><?php }
343
+ ?>
344
+
345
+ <br>
346
+ <h4 style="color: red;">You need to reconfigure second-factor by registering in miniOrange.</h4>
347
+ <h4 style="color: red;">It will be available for one user in free plan.</h4>
348
+
349
+ <!-- <h4>OTP OVER SMS</h4>
350
+ <h4>OTP OVER Email</h4>
351
+ <h4>miniOrange Soft-token</h4>
352
+ <h4>miniOrange Push Notification</h4>
353
+ <h4>miniOrange QR code</h4>
354
+ <h4>Google Authenticator</h4>
355
+ <h4>Security Question</h4>
356
+ -->
357
+ </div></div>
358
+ <div class="modal-footer">
359
+ <button type="button" class="mo_wpns_button mo_wpns_button1 modal-button" style="width: 30%;background-color:#61ace5;" id="ConfirmCloudButton1">Confirm</button>
360
+ <button type="button" class="mo_wpns_button mo_wpns_button1 modal-button" style="width: 30%;background-color:#ff4168;" id="closeConfirmCloud1">Cancel</button>
361
+
362
+ </div>
363
+ </div>
364
+ </div>
365
+
366
+ <!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
367
+ --> <script>
368
+ jQuery('#closeConfirmCloud1').click(function(){
369
+ jQuery('#mo2f_cloud').css('display', 'none');
370
+
371
+ });
372
+ jQuery('#ConfirmCloudButton1').click(function(){
373
+ document.getElementById('mo2f_cloud').checked = false;
374
+ document.getElementById('mo2f_cloud_modal').style.display = "none";
375
+ var nonce = '<?php echo wp_create_nonce("singleUserNonce");?>';
376
+ var data = {
377
+ 'action' : 'mo_two_factor_ajax',
378
+ 'mo_2f_two_factor_ajax' : 'mo2f_single_user',
379
+ 'nonce' : nonce
380
+
381
+ };
382
+ jQuery.post(ajaxurl, data, function(response) {
383
+ if(response == 'true')
384
+ {
385
+ location.reload(true);
386
+ //jQuery('#mo2f_save_free_plan_auth_methods_form').submit();
387
+
388
+
389
+ }
390
+ else
391
+ {
392
+ jQuery('#mo2f_cloud').css('display', 'none');
393
+ jQuery('#mo_scan_message').empty();
394
+ jQuery('#mo_scan_message').append("<div id='notice_div' class='overlay_error'><div class='popup_text'>&nbsp&nbsp <b>You are not authorized to perform this action</b>. Only <b>"+response+"</b> is allowed. For more details contact miniOrange.</div></div>");
395
+ window.onload = nav_popup();
396
+ }
397
+ });
398
+
399
+ });
400
+
401
  jQuery('#test').click(function(){
402
  jQuery("#test").attr("disabled", true);
403
  });
404
 
405
+ jQuery('#closeEnterEmailCloud').click(function(){
406
+ jQuery('#EnterEmailCloudVerification').css('display', 'none');
407
+ });
408
  jQuery('#closeEnterEmail').click(function(){
409
  jQuery('#EnterEmail').css('display', 'none');
410
  });
419
  var email = jQuery('#emailEntered').val();
420
  var nonce = '<?php echo wp_create_nonce('EmailVerificationSaveNonce');?>';
421
  var user_id = '<?php echo get_current_user_id();?>';
422
+ var current_method = jQuery('#current_method').val();
423
  if(email != '')
424
  {
425
  var data = {
427
  'mo_2f_two_factor_ajax' : 'mo2f_save_email_verification',
428
  'nonce' : nonce,
429
  'email' : email,
430
+ 'user_id' : user_id,
431
+ 'current_method' : current_method
432
  };
433
  jQuery.post(ajaxurl, data, function(response) {
434
  var response = response.replace(/\s+/g,' ').trim();
435
  if(response=="settingsSaved")
436
  {
437
+ // var method = "<?php //echo get_user_meta(get_current_user_id(),'currentMethod',true); ?>";
438
+ var method = jQuery('#current_method').val();
439
+
440
+ jQuery('#mo2f_configured_2FA_method_free_plan').val(method);
441
  jQuery('#mo2f_selected_action_free_plan').val('select2factor');
442
  jQuery('#mo2f_save_free_plan_auth_methods_form').submit();
443
  }
463
  }
464
 
465
  });
466
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
467
 
 
468
 
 
 
 
 
 
 
 
 
 
 
 
469
 
470
+
471
+
472
+
473
+
474
+
475
+ function configureOrSet2ndFactor_free_plan(authMethod, action, cloudswitch=null,allowed=null) {
476
+ var is_onprem = '<?php echo MO2F_IS_ONPREM;?>';
477
+
478
+
479
+ <?php
480
+ global $Mo2fdbQueries;
481
+ $current_user = wp_get_current_user();
482
+ $is_user_registered = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $current_user->ID ) ? true : false;
483
+
484
+ ?>
485
+ var is_user_registered = '<?php echo $is_user_registered; ?>';
486
+
487
+
488
+ if((is_onprem == 0 || authMethod=='miniOrangeSoftToken'|| authMethod=='miniOrangeQRCodeAuthentication'|| authMethod=='miniOrangePushNotification') && is_user_registered == 0)
489
+ {
490
+ var nonce = '<?php echo wp_create_nonce("checkuserinminiOrangeNonce");?>';
491
+ var data = {
492
+ 'action' : 'mo_two_factor_ajax',
493
+ 'mo_2f_two_factor_ajax' : 'mo2f_check_user_exist_miniOrange',
494
+ 'nonce' : nonce
495
+
496
+ };
497
+ jQuery.post(ajaxurl, data, function(response) {
498
+ if(response == 'alreadyExist')
499
+ {
500
+ jQuery('#EnterEmailCloudVerification').css('display', 'block');
501
+ jQuery('.modal-content').css('width', '35%');
502
+
503
+ jQuery('#save_entered_email_cloud').click(function(){
504
+
505
+ jQuery('#EnterEmailCloudVerification').css('display', 'none');
506
+ var nonce = '<?php echo wp_create_nonce("checkuserinminiOrangeNonce");?>';
507
+ var email = jQuery('#emailEnteredCloud').val();
508
+
509
+ var data = {
510
+ 'action' : 'mo_two_factor_ajax',
511
+ 'mo_2f_two_factor_ajax' : 'mo2f_check_user_exist_miniOrange',
512
+ 'email' : email,
513
+ 'nonce' : nonce
514
+
515
+ };
516
+
517
+ jQuery.post(ajaxurl, data, function(response) {
518
+
519
+ if(response == 'alreadyExist')
520
+ {
521
+
522
+ jQuery('#EnterEmailCloudVerification').css('display', 'block');
523
+ jQuery('.modal-content').css('width', '35%');
524
+ }
525
+ else if(response =="USERCANBECREATED")
526
+ {
527
+
528
+ jQuery('#mo2f_configured_2FA_method_free_plan').val(authMethod);
529
+ jQuery('#mo2f_selected_action_free_plan').val(action);
530
+ jQuery('#mo2f_save_free_plan_auth_methods_form').submit();
531
+
532
+ }
533
+ });
534
+
535
+ });
536
+
537
+ }
538
+ else if(response =="USERCANBECREATED")
539
+ {
540
+
541
+ jQuery('#mo2f_configured_2FA_method_free_plan').val(authMethod);
542
+ jQuery('#mo2f_selected_action_free_plan').val(action);
543
+ jQuery('#mo2f_save_free_plan_auth_methods_form').submit();
544
+
545
+ }
546
+ else if(response == "NOTLOGGEDIN")
547
+ {
548
+ jQuery('#mo2f_configured_2FA_method_free_plan').val(authMethod);
549
+ jQuery('#mo2f_selected_action_free_plan').val(action);
550
+ jQuery('#mo2f_save_free_plan_auth_methods_form').submit();
551
+ }else{
552
+
553
+ }
554
+
555
+ });
556
+ }
557
+ else
558
+ {
559
+ if(authMethod == 'EmailVerification' || authMethod == 'OTPOverEmail')
560
  {
 
561
  var is_registered = '<?php echo $email_registered;?>';
562
+ jQuery('#current_method').val(authMethod);
563
+
564
  if(is_onprem == 1 && is_registered!=0 && action != 'select2factor')
565
  {
566
  jQuery('#EnterEmail').css('display', 'block');
568
  }
569
  else
570
  {
571
+
572
  jQuery('#mo2f_configured_2FA_method_free_plan').val(authMethod);
573
  jQuery('#mo2f_selected_action_free_plan').val(action);
574
  jQuery('#mo2f_save_free_plan_auth_methods_form').submit();
576
  }
577
  else
578
  {
579
+
580
  jQuery('#mo2f_configured_2FA_method_free_plan').val(authMethod);
581
  jQuery('#mo2f_selected_action_free_plan').val(action);
582
  jQuery('#mo2f_save_free_plan_auth_methods_form').submit();
583
+
584
+
585
+
586
+ }
587
+
588
  }
589
  }
590
 
616
  }
617
 
618
  function nav_popup() {
619
+ document.getElementById("notice_div").style.width = "50%";
620
+ setTimeout(function(){ $('#notice_div').fadeOut('slow'); }, 5000);
621
  }
622
  </script>
623
  <?php } ?>
views/twofa/test/test_twofa_google_authy_authenticator.php CHANGED
@@ -32,4 +32,41 @@
32
  </script>
33
 
34
  <?php
35
- } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  </script>
33
 
34
  <?php
35
+ }
36
+
37
+ function mo2f_test_otp_over_email( $user,$method ) {
38
+
39
+ ?>
40
+ <h3><?php echo mo2f_lt( 'Test ' ) . mo2f_lt( $method ); ?></h3>
41
+ <h4> Remaining Email Transaction: <?php echo get_site_option('cmVtYWluaW5nT1RQ');?> </h4>
42
+
43
+ <hr>
44
+ <p><?php echo mo2f_lt( 'Enter the one time passcode sent to your registered email id.' ); ?></p>
45
+
46
+ <form name="f" method="post" action="">
47
+ <input type="hidden" name="option" value="mo2f_validate_otp_over_email"/>
48
+ <input type="hidden" name="mo2f_validate_otp_over_email_test_nonce"
49
+ value="<?php echo wp_create_nonce( "mo2f-validate-otp-over-email-test-nonce" ) ?>"/>
50
+
51
+ <input class="mo2f_table_textbox" style="width:200px;" autofocus="true" type="text" name="otp_token" required
52
+ placeholder="<?php echo mo2f_lt( 'Enter OTP' ); ?>" style="width:95%;"/>
53
+ <br><br>
54
+ <input type="button" name="back" id="go_back" class="mo_wpns_button mo_wpns_button1"
55
+ value="<?php echo mo2f_lt( 'Back' ); ?>"/>
56
+ <input type="submit" name="validate" id="validate" class="mo_wpns_button mo_wpns_button1"
57
+ value="<?php echo mo2f_lt( 'Submit' ); ?>"/>
58
+
59
+ </form>
60
+ <form name="f" method="post" action="" id="mo2f_go_back_form">
61
+ <input type="hidden" name="option" value="mo2f_go_back"/>
62
+ <input type="hidden" name="mo2f_go_back_nonce"
63
+ value="<?php echo wp_create_nonce( "mo2f-go-back-nonce" ) ?>"/>
64
+ </form>
65
+ <script>
66
+ jQuery('#go_back').click(function () {
67
+ jQuery('#mo2f_go_back_form').submit();
68
+ });
69
+ </script>
70
+
71
+ <?php
72
+ }
views/twofa/test/test_twofa_kba_questions.php CHANGED
@@ -1,63 +1,4 @@
1
- <?php function mo2f_test_kba_security_questions( $user ) {
2
- $onprem = MO2F_IS_ONPREM;
3
- if($onprem){
4
- ?>
5
- <h3><?php echo mo2f_lt( 'Test Security Questions( KBA )' ); ?></h3>
6
- <hr>
7
- <br>
8
-
9
-
10
- <form name="f" method="post" action="" id="mo2f_test_kba_form">
11
- <input type="hidden" name="option" value="mo2f_validate_kba_details"/>
12
- <input type="hidden" name="mo2f_validate_kba_details_nonce"
13
- value="<?php echo wp_create_nonce( "mo2f-validate-kba-details-nonce" ) ?>"/>
14
-
15
- <div id="mo2f_kba_content">
16
- <?php
17
- $ques = (get_user_meta($user->ID,'kba_questions_user'));
18
- $ques = $ques[0];
19
- /*if ( isset( $_SESSION['mo_2_factor_kba_questions'] ) ) {*/
20
- echo $ques[0];
21
- ?>
22
- <br>
23
- <input class="mo2f_table_textbox" style="width:227px;" type="text" name="mo2f_answer_1"
24
- id="mo2f_answer_1" required="true" autofocus="true"
25
- pattern="(?=\S)[A-Za-z0-9_@.$#&amp;+\-\s]{1,100}"
26
- title="Only alphanumeric letters with special characters(_@.$#&amp;+-) are allowed."
27
- autocomplete="off"><br><br>
28
- <?php
29
- echo $ques[1];
30
- ?>
31
- <br>
32
- <input class="mo2f_table_textbox" style="width:227px;" type="text" name="mo2f_answer_2"
33
- id="mo2f_answer_2" required="true" pattern="(?=\S)[A-Za-z0-9_@.$#&amp;+\-\s]{1,100}"
34
- title="Only alphanumeric letters with special characters(_@.$#&amp;+-) are allowed."
35
- autocomplete="off"><br><br>
36
- <?php
37
- //}
38
- ?>
39
- </div>
40
- <input type="button" name="back" id="go_back" class="mo_wpns_button mo_wpns_button1" value="<?php echo mo2f_lt( 'Back' ); ?>" />
41
- <input type="submit" name="validate" id="validate" class="mo_wpns_button mo_wpns_button1"
42
- value="<?php echo mo2f_lt( 'Validate Answers' ); ?>"/>
43
-
44
- </form>
45
- <form name="f" method="post" action="" id="mo2f_go_back_form">
46
- <input type="hidden" name="option" value="mo2f_go_back"/>
47
- <input type="hidden" name="mo2f_go_back_nonce"
48
- value="<?php echo wp_create_nonce( "mo2f-go-back-nonce" ) ?>"/>
49
- </form>
50
- <script>
51
- jQuery('#go_back').click(function () {
52
- jQuery('#mo2f_go_back_form').submit();
53
- });
54
- </script>
55
- <?php
56
- }
57
-
58
- else{
59
- ?>
60
-
61
 
62
  <h3><?php echo mo2f_lt( 'Test Security Questions( KBA )' ); ?></h3>
63
  <hr>
@@ -71,7 +12,7 @@
71
 
72
  <div id="mo2f_kba_content">
73
  <?php if ( isset( $_SESSION['mo_2_factor_kba_questions'] ) ) {
74
- echo $_SESSION['mo_2_factor_kba_questions'][0];
75
  ?>
76
  <br>
77
  <input class="mo2f_table_textbox" style="width:227px;" type="text" name="mo2f_answer_1"
@@ -80,7 +21,7 @@
80
  title="Only alphanumeric letters with special characters(_@.$#&amp;+-) are allowed."
81
  autocomplete="off"><br><br>
82
  <?php
83
- echo $_SESSION['mo_2_factor_kba_questions'][1];
84
  ?>
85
  <br>
86
  <input class="mo2f_table_textbox" style="width:227px;" type="text" name="mo2f_answer_2"
@@ -108,6 +49,5 @@
108
  </script>
109
  <?php
110
  }
111
- }
112
 
113
  ?>
1
+ <?php function mo2f_test_kba_security_questions( $user ) { ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  <h3><?php echo mo2f_lt( 'Test Security Questions( KBA )' ); ?></h3>
4
  <hr>
12
 
13
  <div id="mo2f_kba_content">
14
  <?php if ( isset( $_SESSION['mo_2_factor_kba_questions'] ) ) {
15
+ echo $_SESSION['mo_2_factor_kba_questions'][0]['question'];
16
  ?>
17
  <br>
18
  <input class="mo2f_table_textbox" style="width:227px;" type="text" name="mo2f_answer_1"
21
  title="Only alphanumeric letters with special characters(_@.$#&amp;+-) are allowed."
22
  autocomplete="off"><br><br>
23
  <?php
24
+ echo $_SESSION['mo_2_factor_kba_questions'][1]['question'];
25
  ?>
26
  <br>
27
  <input class="mo2f_table_textbox" style="width:227px;" type="text" name="mo2f_answer_2"
49
  </script>
50
  <?php
51
  }
 
52
 
53
  ?>
views/twofa/test/test_twofa_otp_over_sms.php CHANGED
@@ -3,6 +3,8 @@ function mo2f_test_otp_over_sms( $user ) {
3
 
4
  ?>
5
  <h3><?php echo mo2f_lt( 'Test OTP Over SMS' ); ?>
 
 
6
  <hr>
7
  </h3>
8
  <p><?php echo mo2f_lt( 'Enter the one time passcode sent to your registered mobile number.' ); ?></p>
@@ -36,8 +38,6 @@ function mo2f_test_otp_over_sms( $user ) {
36
  <input type="hidden" name="mo2f_configured_2FA_method_test" id="mo2f_configured_2FA_method_test"
37
  value="OTP Over SMS"/>
38
  </form>
39
-
40
-
41
 
42
  <script>
43
  jQuery('#go_back').click(function () {
3
 
4
  ?>
5
  <h3><?php echo mo2f_lt( 'Test OTP Over SMS' ); ?>
6
+ <h4> Remaining SMS Transaction: <?php echo get_site_option('cmVtYWluaW5nT1RQVHJhbnNhY3Rpb25z');?> </h4>
7
+
8
  <hr>
9
  </h3>
10
  <p><?php echo mo2f_lt( 'Enter the one time passcode sent to your registered mobile number.' ); ?></p>
38
  <input type="hidden" name="mo2f_configured_2FA_method_test" id="mo2f_configured_2FA_method_test"
39
  value="OTP Over SMS"/>
40
  </form>
 
 
41
 
42
  <script>
43
  jQuery('#go_back').click(function () {
views/twofa/two_fa.php CHANGED
@@ -7,7 +7,7 @@ if ($mo_2fa_with_network_security) {
7
  }
8
  else
9
  {
10
- ?> <div class="mo_wpns_tab" style="margin-top: -2%;"><?php
11
  }
12
  ?>
13
 
@@ -16,40 +16,38 @@ else
16
  if(current_user_can('administrator') )
17
  {
18
  ?>
19
- <button class="tablinks" onclick="openTab2fa(this)" id="unlimittedUser_2fa">Multiple Users [Free]</button>
20
  <?php
21
  }
22
  if(current_user_can('administrator'))
23
  {
 
 
24
  if( !get_option( 'mo2f_is_NC' ))
25
  {
26
  ?>
 
27
  <button class="tablinks" onclick="openTab2fa(this)" id="login_option_2fa">Login Option</button>
28
- <button class="tablinks" onclick="openTab2fa(this)" id="custom_form_2fa">Login Form Integration</button>
29
  <?php
30
  }
31
  else
32
  {
33
  ?>
34
- <button class="tablinks" onclick="openTab2fa(this)" id="rba_2fa">Remember Device</button>
35
- <button class="tablinks" onclick="openTab2fa(this)" id="custom_login_2fa">Personalization</button>
36
- <button class="tablinks" onclick="openTab2fa(this)" id="custom_form_2fa">Login Form Integration</button>
37
- <button class="tablinks" onclick="openTab2fa(this)" id="shortcode_2fa">Shortcode</button>
38
  <?php
39
  }
40
-
41
  ?>
42
 
43
 
44
- <?php } ?>
45
 
46
- <button class="tablinks" onclick="openTab2fa(this)" id="video_guide_2fa">Video Guide</button>
47
- <?php
48
 
49
  if($mo_2fa_with_network_security == 0)
50
  {
51
  ?>
52
- <button class="tablinks" onclick="openTab2fa(this)" id="upgrade_2fa">Upgrade</button>
53
  <?php
54
  }
55
  ?>
@@ -65,22 +63,29 @@ else
65
  mo2f_rba_description($mo2f_user_email);
66
  else
67
  include_once $mo2f_dirName . 'controllers'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_rba.php';
68
- ?>
69
- </div>
70
- <div class="mo_wpns_divided_layout" id="custom_login_2fa_div">
71
  <?php
72
  if ( get_option( 'mo2f_personalization_installed' ) )
73
  mo2f_personalization_description($mo2f_user_email);
74
  else
75
  include_once $mo2f_dirName . 'controllers'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_custom_login.php';
76
  ?>
77
- </div>
78
- <div class="mo_wpns_divided_layout" id="shortcode_2fa_div">
79
  <?php
80
  if ( get_option( 'mo2f_shortcode_installed' ) )
81
  mo2f_shortcode_description($mo2f_user_email);
82
  else
83
  include_once $mo2f_dirName . 'controllers'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_shortcode.php';
 
 
 
 
 
 
 
 
 
 
 
84
  ?>
85
  </div>
86
  <div class="mo_wpns_divided_layout" id="login_option_2fa_div">
@@ -89,29 +94,23 @@ else
89
  <div class="mo_wpns_divided_layout" id="custom_form_2fa_div">
90
  <?php include_once $mo2f_dirName . 'controllers'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_custom_form.php'; ?>
91
  </div>
92
- <div class="mo_wpns_divided_layout" id="video_guide_2fa_div">
93
- <?php include_once $mo2f_dirName . 'controllers'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_video_guide.php'; ?>
94
- </div>
95
  <div class="mo_wpns_divided_layout" id="unlimittedUser_2fa_div">
96
  <?php include_once $mo2f_dirName . 'controllers'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_unlimittedUser.php'; ?>
97
  </div>
98
- <div class="mo_wpns_divided_layout" id="upgrade_2fa_div" style="width: 100%;">
99
- <?php include_once $mo2f_dirName . 'controllers'.DIRECTORY_SEPARATOR.'upgrade.php'; ?>
100
- </div>
101
  <script>
102
  jQuery("#setup_2fa_div").css("display", "block");
103
- jQuery("#upgrade_2fa_div").css("display" , "none");
104
  jQuery("#rba_2fa_div").css("display", "none");
105
  jQuery("#custom_login_2fa_div").css("display", "none");
106
- jQuery("#shortcode_2fa_div").css("display", "none");
107
  jQuery("#login_option_2fa_div").css("display", "none");
108
  jQuery("#custom_form_2fa_div").css("display", "none");
109
- jQuery("#video_guide_2fa_div").css("display", "none");
110
 
111
  jQuery("#setup_2fa").addClass("active");
112
  function openTab2fa(elmt){
113
  var tabname = elmt.id;
114
- var tabarray = ["setup_2fa","rba_2fa","custom_login_2fa","shortcode_2fa","login_option_2fa", "custom_form_2fa", "video_guide_2fa","unlimittedUser_2fa","upgrade_2fa"];
115
  for (var i = 0; i < tabarray.length; i++) {
116
  if(tabarray[i] == tabname){
117
  jQuery("#"+tabarray[i]).addClass("active");
@@ -121,40 +120,35 @@ else
121
  jQuery("#"+tabarray[i]+"_div").css("display", "none");
122
  }
123
  }
124
- localStorage.setItem("lastTab2fa", tabname);
125
  }
126
- var tab = localStorage.getItem("lastTab2fa");
 
 
 
 
127
  var is_onprem = '<?php echo MO2F_IS_ONPREM;?>';
128
  if(tab == "setup_twofa"){
129
  document.getElementById("setup_2fa").click();
130
- }else if(tab == "rba_2fa"){
 
131
  document.getElementById("rba_2fa").click();
132
  }
133
  else if(tab == "custom_login_2fa"){
134
  document.getElementById("custom_login_2fa").click();
135
  }
136
- else if(tab == "shortcode_2fa"){
137
- document.getElementById("shortcode_2fa").click();
138
- }
139
  else if(tab == "login_option_2fa"){
140
  document.getElementById("login_option_2fa").click();
141
  }
142
  else if(tab == "custom_form_2fa"){
143
  document.getElementById("custom_form_2fa").click();
144
  }
145
- else if(tab == "video_guide_2fa"){
146
- document.getElementById("video_guide_2fa").click();
147
- }
148
  else if(tab == "unlimittedUser_2fa")
149
  {
150
  document.getElementById("unlimittedUser_2fa").click();
151
  }
152
- else if(tab == "upgrade_2fa")
153
- {
154
- document.getElementById("upgrade_2fa").click();
155
 
156
- }
157
  else{
158
  document.getElementById("setup_2fa").click();
159
  }
160
- </script>
7
  }
8
  else
9
  {
10
+ ?> <div class="mo_wpns_tab" style="margin-top: -1%;width: 98%;"><?php
11
  }
12
  ?>
13
 
16
  if(current_user_can('administrator') )
17
  {
18
  ?>
19
+ <button class="tablinks" onclick="openTab2fa(this)" id="unlimittedUser_2fa">Settings</button>
20
  <?php
21
  }
22
  if(current_user_can('administrator'))
23
  {
24
+ ?>
25
+ <?php
26
  if( !get_option( 'mo2f_is_NC' ))
27
  {
28
  ?>
29
+ <button class="tablinks" onclick="openTab2fa(this)" id="custom_form_2fa">Form Integration</button>
30
  <button class="tablinks" onclick="openTab2fa(this)" id="login_option_2fa">Login Option</button>
 
31
  <?php
32
  }
33
  else
34
  {
35
  ?>
36
+ <button class="tablinks" onclick="openTab2fa(this)" id="custom_form_2fa">Form Integration</button>
37
+ <button class="tablinks" onclick="openTab2fa(this)" id="custom_login_2fa">Premium Features</button>
38
+ <button class="tablinks" onclick="openTab2fa(this)" id="rba_2fa">AddOns</button>
 
39
  <?php
40
  }
 
41
  ?>
42
 
43
 
 
44
 
45
+ <?php }
 
46
 
47
  if($mo_2fa_with_network_security == 0)
48
  {
49
  ?>
50
+ <!-- <button class="tablinks" onclick="openTab2fa(this)" id="upgrade_2fa">Upgrade</button> -->
51
  <?php
52
  }
53
  ?>
63
  mo2f_rba_description($mo2f_user_email);
64
  else
65
  include_once $mo2f_dirName . 'controllers'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_rba.php';
66
+ ?>
 
 
67
  <?php
68
  if ( get_option( 'mo2f_personalization_installed' ) )
69
  mo2f_personalization_description($mo2f_user_email);
70
  else
71
  include_once $mo2f_dirName . 'controllers'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_custom_login.php';
72
  ?>
 
 
73
  <?php
74
  if ( get_option( 'mo2f_shortcode_installed' ) )
75
  mo2f_shortcode_description($mo2f_user_email);
76
  else
77
  include_once $mo2f_dirName . 'controllers'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_shortcode.php';
78
+ ?>
79
+ <?php
80
+ include_once $mo2f_dirName . 'controllers'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_session_control.php';
81
+ ?>
82
+ </div>
83
+ <div class="mo_wpns_divided_layout" id="custom_login_2fa_div">
84
+ <?php
85
+ if ( get_option( 'mo2f_personalization_installed' ) )
86
+ mo2f_personalization_description($mo2f_user_email);
87
+ else
88
+ include_once $mo2f_dirName . 'controllers'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_premium_feature.php';
89
  ?>
90
  </div>
91
  <div class="mo_wpns_divided_layout" id="login_option_2fa_div">
94
  <div class="mo_wpns_divided_layout" id="custom_form_2fa_div">
95
  <?php include_once $mo2f_dirName . 'controllers'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_custom_form.php'; ?>
96
  </div>
 
 
 
97
  <div class="mo_wpns_divided_layout" id="unlimittedUser_2fa_div">
98
  <?php include_once $mo2f_dirName . 'controllers'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'two_fa_unlimittedUser.php'; ?>
99
  </div>
100
+
101
+
 
102
  <script>
103
  jQuery("#setup_2fa_div").css("display", "block");
104
+
105
  jQuery("#rba_2fa_div").css("display", "none");
106
  jQuery("#custom_login_2fa_div").css("display", "none");
 
107
  jQuery("#login_option_2fa_div").css("display", "none");
108
  jQuery("#custom_form_2fa_div").css("display", "none");
 
109
 
110
  jQuery("#setup_2fa").addClass("active");
111
  function openTab2fa(elmt){
112
  var tabname = elmt.id;
113
+ var tabarray = ["setup_2fa","rba_2fa","custom_login_2fa","login_option_2fa", "custom_form_2fa","unlimittedUser_2fa"];
114
  for (var i = 0; i < tabarray.length; i++) {
115
  if(tabarray[i] == tabname){
116
  jQuery("#"+tabarray[i]).addClass("active");
120
  jQuery("#"+tabarray[i]+"_div").css("display", "none");
121
  }
122
  }
123
+ localStorage.setItem("last_tab", tabname);
124
  }
125
+ var tour = '<?php echo get_option("mo2f_two_factor_tour");?>';
126
+ if(tour != 1)
127
+ var tab = localStorage.getItem("last_tab");
128
+ else
129
+ var tab = '<?php echo get_option("mo2f_tour_tab");?>';
130
  var is_onprem = '<?php echo MO2F_IS_ONPREM;?>';
131
  if(tab == "setup_twofa"){
132
  document.getElementById("setup_2fa").click();
133
+ }
134
+ else if(tab == "rba_2fa"){
135
  document.getElementById("rba_2fa").click();
136
  }
137
  else if(tab == "custom_login_2fa"){
138
  document.getElementById("custom_login_2fa").click();
139
  }
 
 
 
140
  else if(tab == "login_option_2fa"){
141
  document.getElementById("login_option_2fa").click();
142
  }
143
  else if(tab == "custom_form_2fa"){
144
  document.getElementById("custom_form_2fa").click();
145
  }
 
 
 
146
  else if(tab == "unlimittedUser_2fa")
147
  {
148
  document.getElementById("unlimittedUser_2fa").click();
149
  }
 
 
 
150
 
 
151
  else{
152
  document.getElementById("setup_2fa").click();
153
  }
154
+ </script>
views/twofa/two_fa_custom_form.php CHANGED
@@ -1,38 +1,51 @@
1
- <div class="mo_wpns_setting_layout">
 
 
 
2
  <h2>Custom Login Forms</h2>
3
  <p>We support most of the login forms present on the wordpress. And our plugin is tested with almost all the forms like Woocommerce, Ultimate Member, Restrict Content Pro and so on.</p>
4
 
5
  <div>
6
  <table class="customloginform" style="width: 100%;" align="left">
7
  <tr>
8
- <th class="fontsize">
9
  Custom Login form
10
  </th>
11
- <th style="width: 50%;">
12
  Show 2FA prompt on Custom login
13
 
14
  </th>
 
 
 
15
  </tr>
16
  <tr>
17
  <td>
18
  <?php echo '<img style="width:30px; height:30px;display: inline;" src="'.dirname(plugin_dir_url(dirname(__FILE__))).'/includes/images/woocommerce.png">';?><h3 style="margin-left: 15px; font-size: large; display: inline; float: inherit; padding-right: 50px;">Woocommerce</h3>
19
  </td>
20
- <td style="align-items: right;width: 50%;">
21
  <form id="woocommerce_login_prompt_form" method="post">
22
  <div align="center">
23
- <input type="checkbox" name="woocommerce_login_prompt" onchange="document.getElementById('woocommerce_login_prompt_form').submit();" <?php if(get_site_option('mo2f_woocommerce_login_prompt')){?> checked <?php } ?> <?php if(!get_site_option('mo2f_enable_2fa_prompt_on_login_page')){?> disabled <?php } ?>/>
24
  </div>
25
  <input type="hidden" name="option" value="woocommerce_disable_login_prompt">
26
 
27
  </form>
28
  </td>
 
 
 
 
 
29
  </tr>
30
  <tr>
31
  <td>
32
  <?php echo '<img style="width:30px; height:30px;display: inline;" src="'.dirname(plugin_dir_url(dirname(__FILE__))).'/includes/images/ultimate_member.png">';?><h3 style="margin-left: 15px; font-size: large; display: inline; float: inherit;">Ultimate Member</h3>
33
  </td>
34
  <td style="text-align: center;">
35
- <input type="checkbox" name="" disabled>
 
 
36
  </td>
37
  </tr>
38
  <tr>
@@ -40,7 +53,9 @@
40
  <?php echo '<img style="width:30px; height:30px;display: inline;" src="'.dirname(plugin_dir_url(dirname(__FILE__))).'/includes/images/restrict_content_pro.png">';?><h3 style="margin-left: 15px; font-size: large; display: inline; float: inherit;">Restrict Content Pro</h3>
41
  </td>
42
  <td style="text-align: center;">
43
- <input type="checkbox" name="" disabled>
 
 
44
  </td>
45
  </tr>
46
  <tr>
@@ -48,7 +63,9 @@
48
  <?php echo '<img style="width:30px; height:30px;display: inline;" src="'.dirname(plugin_dir_url(dirname(__FILE__))).'/includes/images/theme_my_login.png">';?><h3 style="margin-left: 15px; font-size: large; display: inline; float: inherit;">My Theme Login</h3>
49
  </td>
50
  <td style="text-align: center;">
51
- <input type="checkbox" name="" disabled>
 
 
52
  </td>
53
  </tr>
54
  <tr>
@@ -56,7 +73,9 @@
56
  <?php echo '<img style="width:30px; height:30px;display: inline;" src="'.dirname(plugin_dir_url(dirname(__FILE__))).'/includes/images/user_registration.png">';?><h3 style="margin-left: 15px; font-size: large; display: inline; float: inherit;">User Registration</h3>
57
  </td>
58
  <td style="text-align: center;">
59
- <input type="checkbox" name="" disabled>
 
 
60
  </td>
61
  </tr>
62
  <tr>
@@ -64,7 +83,9 @@
64
  <?php echo '<img style="width:30px; height:30px;display: inline;" src="'.dirname(plugin_dir_url(dirname(__FILE__))).'/includes/images/Custom_Login_Page_Customizer_LoginPress.png">';?><h3 style="margin-left: 15px; font-size: large; display: inline; float: inherit;">Custom Login Page Customizer | LoginPress</h3>
65
  </td>
66
  <td style="text-align: center;">
67
- <input type="checkbox" name="" disabled>
 
 
68
  </td>
69
  </tr>
70
  <tr>
@@ -72,7 +93,9 @@
72
  <?php echo '<img style="width:30px; height:30px;display: inline;float: left;" src="'.dirname(plugin_dir_url(dirname(__FILE__))).'/includes/images/Admin_Custom_Login.png">';?><h3 style="margin-left: 15px; font-size: large; display: inline; float: inherit;">Admin Custom Login</h3>
73
  </td>
74
  <td style="text-align: center;">
75
- <input type="checkbox" name="" disabled>
 
 
76
  </td>
77
  </tr>
78
  <tr>
@@ -80,7 +103,9 @@
80
  <?php echo '<img style="width:30px; height:30px;display: inline;float: left;" src="'.dirname(plugin_dir_url(dirname(__FILE__))).'/includes/images/RegistrationMagic_Custom_Registration_Forms_and_User_Login.png">';?><h3 style="margin-left: 15px; font-size: large; display: inline; float: inherit;">RegistrationMagic – Custom Registration Forms and User Login</h3>
81
  </td>
82
  <td style="text-align: center; ">
83
- <input type="checkbox" name="" disabled>
 
 
84
  </td>
85
  </tr>
86
 
1
+ <?php
2
+ $setup_dirName = dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'link_tracer.php';
3
+ include $setup_dirName; ?>
4
+ <div class="mo_wpns_setting_layout">
5
  <h2>Custom Login Forms</h2>
6
  <p>We support most of the login forms present on the wordpress. And our plugin is tested with almost all the forms like Woocommerce, Ultimate Member, Restrict Content Pro and so on.</p>
7
 
8
  <div>
9
  <table class="customloginform" style="width: 100%;" align="left">
10
  <tr>
11
+ <th style="width: 65%">
12
  Custom Login form
13
  </th>
14
+ <th style="width: 22%">
15
  Show 2FA prompt on Custom login
16
 
17
  </th>
18
+ <th style="width: 13%">
19
+ Documents
20
+ </th>
21
  </tr>
22
  <tr>
23
  <td>
24
  <?php echo '<img style="width:30px; height:30px;display: inline;" src="'.dirname(plugin_dir_url(dirname(__FILE__))).'/includes/images/woocommerce.png">';?><h3 style="margin-left: 15px; font-size: large; display: inline; float: inherit; padding-right: 50px;">Woocommerce</h3>
25
  </td>
26
+ <td style="align-items: right;">
27
  <form id="woocommerce_login_prompt_form" method="post">
28
  <div align="center">
29
+ <input type="checkbox" name="woocommerce_login_prompt" onchange="document.getElementById('woocommerce_login_prompt_form').submit();" <?php if(get_site_option('mo2f_woocommerce_login_prompt')){?> checked <?php } ?> <?php if(!get_site_option('mo2f_enable_2fa_prompt_on_login_page')){?> checked <?php } ?>/>
30
  </div>
31
  <input type="hidden" name="option" value="woocommerce_disable_login_prompt">
32
 
33
  </form>
34
  </td>
35
+ <td>
36
+ <div style="text-align: center;">
37
+ <a href='<?php echo $two_factor_premium_doc['Woocommerce'];?>' target="blank"><span class="dashicons dashicons-text-page mo2f_doc_icon_style" style="font-size: 25px;color: #199C95"></span></a>
38
+ </div>
39
+ </td>
40
  </tr>
41
  <tr>
42
  <td>
43
  <?php echo '<img style="width:30px; height:30px;display: inline;" src="'.dirname(plugin_dir_url(dirname(__FILE__))).'/includes/images/ultimate_member.png">';?><h3 style="margin-left: 15px; font-size: large; display: inline; float: inherit;">Ultimate Member</h3>
44
  </td>
45
  <td style="text-align: center;">
46
+ <input type="checkbox" name="" checked>
47
+ </td>
48
+ <td>
49
  </td>
50
  </tr>
51
  <tr>
53
  <?php echo '<img style="width:30px; height:30px;display: inline;" src="'.dirname(plugin_dir_url(dirname(__FILE__))).'/includes/images/restrict_content_pro.png">';?><h3 style="margin-left: 15px; font-size: large; display: inline; float: inherit;">Restrict Content Pro</h3>
54
  </td>
55
  <td style="text-align: center;">
56
+ <input type="checkbox" name="" checked>
57
+ </td>
58
+ <td>
59
  </td>
60
  </tr>
61
  <tr>
63
  <?php echo '<img style="width:30px; height:30px;display: inline;" src="'.dirname(plugin_dir_url(dirname(__FILE__))).'/includes/images/theme_my_login.png">';?><h3 style="margin-left: 15px; font-size: large; display: inline; float: inherit;">My Theme Login</h3>
64
  </td>
65
  <td style="text-align: center;">
66
+ <input type="checkbox" name="" checked>
67
+ </td>
68
+ <td>
69
  </td>
70
  </tr>
71
  <tr>
73
  <?php echo '<img style="width:30px; height:30px;display: inline;" src="'.dirname(plugin_dir_url(dirname(__FILE__))).'/includes/images/user_registration.png">';?><h3 style="margin-left: 15px; font-size: large; display: inline; float: inherit;">User Registration</h3>
74
  </td>
75
  <td style="text-align: center;">
76
+ <input type="checkbox" name="" checked>
77
+ </td>
78
+ <td>
79
  </td>
80
  </tr>
81
  <tr>
83
  <?php echo '<img style="width:30px; height:30px;display: inline;" src="'.dirname(plugin_dir_url(dirname(__FILE__))).'/includes/images/Custom_Login_Page_Customizer_LoginPress.png">';?><h3 style="margin-left: 15px; font-size: large; display: inline; float: inherit;">Custom Login Page Customizer | LoginPress</h3>
84
  </td>
85
  <td style="text-align: center;">
86
+ <input type="checkbox" name="" checked>
87
+ </td>
88
+ <td>
89
  </td>
90
  </tr>
91
  <tr>
93
  <?php echo '<img style="width:30px; height:30px;display: inline;float: left;" src="'.dirname(plugin_dir_url(dirname(__FILE__))).'/includes/images/Admin_Custom_Login.png">';?><h3 style="margin-left: 15px; font-size: large; display: inline; float: inherit;">Admin Custom Login</h3>
94
  </td>
95
  <td style="text-align: center;">
96
+ <input type="checkbox" name="" checked>
97
+ </td>
98
+ <td>
99
  </td>
100
  </tr>
101
  <tr>
103
  <?php echo '<img style="width:30px; height:30px;display: inline;float: left;" src="'.dirname(plugin_dir_url(dirname(__FILE__))).'/includes/images/RegistrationMagic_Custom_Registration_Forms_and_User_Login.png">';?><h3 style="margin-left: 15px; font-size: large; display: inline; float: inherit;">RegistrationMagic – Custom Registration Forms and User Login</h3>
104
  </td>
105
  <td style="text-align: center; ">
106
+ <input type="checkbox" name="" checked>
107
+ </td>
108
+ <td>
109
  </td>
110
  </tr>
111
 
views/twofa/two_fa_custom_login.php CHANGED
@@ -1,22 +1,28 @@
1
  <?php
 
 
2
  global $current_user;
3
  $current_user = wp_get_current_user();
4
  global $Mo2fdbQueries;
5
  ?>
6
- <form name="f" id="custom_css_form_add" method="post" action="">
 
7
  <input type="hidden" name="option" value="mo_auth_custom_options_save" />
8
 
9
- <div class="mo_wpns_setting_layout">
10
  <div id="mo2f_custom_addon_hide">
11
-
12
- <h3 id="custom_description" style=" color: #20b2aa;text-align: center;">
13
- <?php echo __( 'This helps you to modify and redesign the 2FA prompt to match according to your website and various customizations in the plugin dashboard.', 'miniorange-2-factor-authentication' ); ?>
14
- <b><?php echo '<a href="'.$upgrade_url .'" style="color: red">'; ?>[ PREMIUM ]</a></b>
15
- </h3>
16
- <br>
 
17
  </div>
18
 
19
- <h3><?php echo mo2f_lt('Customize Plugin Icon');?></h3><hr><br>
 
 
 
20
  <div style="margin-left:2%">
21
  <input type="checkbox" id="mo2f_enable_custom_icon" name="mo2f_enable_custom_icon" value="1" <?php checked( get_option('mo2f_enable_custom_icon') == 1 );
22
  echo 'disabled'; ?> />
@@ -25,10 +31,12 @@
25
  <div class="mo2f_advanced_options_note" ><p style="padding:5px;"><i><?php echo mo2f_lt('
26
  Go to /wp-content/uploads/miniorange folder and upload a .png image with the name "plugin_icon" (Max Size: 20x34px).');?></i></p>
27
  </div>
28
- </div>
29
 
30
- <br>
31
- <h3><?php echo mo2f_lt('Customize Plugin Name');?></h3><hr><br>
 
 
32
  <div style="margin-left:2%">
33
  <?php echo mo2f_lt('Change Plugin Name:');?> &nbsp;
34
  <input type="text" class="mo2f_table_textbox" style="width:35% " id="mo2f_custom_plugin_name" name="mo2f_custom_plugin_name" <?php echo 'disabled'; ?> value="<?php echo get_option('mo2f_custom_plugin_name')?>" placeholder="<?php echo mo2f_lt('Enter a custom Plugin Name.');?>" />
@@ -36,25 +44,16 @@
36
  <div class="mo2f_advanced_options_note"><p style="padding:5px;"><i>
37
  <?php echo mo2f_lt('This will be the Plugin Name You and your Users see in WordPress Dashboard.');?>
38
  </i></p> </div>
39
- </div>
40
- <br>
41
-
42
- <input type="submit" name="submit" value="Save Settings" style="margin-left:2%; background-color: #20b2aa; color: white;box-shadow:none;" class="mo_wpns_button mo_wpns_button1" <?php
43
- echo 'disabled' ; ?> />
44
- </div>
45
-
46
- <br>
47
-
48
-
49
- </form>
50
-
51
  <?php show_2_factor_custom_design_options($current_user);?>
52
  <br>
53
- <div class="mo_wpns_setting_layout">
54
- <h3><?php echo mo2f_lt('Custom Email and SMS Templates');
55
-
56
- ?>
57
  </h3><hr>
 
58
  <div style="margin-left:2%">
59
  <p><?php echo mo2f_lt('You can change the templates for Email and SMS as per your requirement.');?></p>
60
  <?php if(mo2f_is_customer_registered()){
@@ -71,12 +70,15 @@
71
  </div>
72
  <br>
73
 
74
- <div class="mo_wpns_setting_layout">
75
  <h3><?php echo mo2f_lt('Integrate your websites\'s theme with the 2FA plugin\'s popups');?></h3><hr>
76
  <div style="margin-left:2%">
77
  <p><?php echo mo2f_lt('Contact Us through the support forum in the right for the UI integration.');?></p>
 
 
78
  </div>
79
 
 
80
  </div>
81
  <br>
82
  <form style="display:none;" id="mo2fa_addon_loginform" action="<?php echo get_option( 'mo2f_host_name').'/moas/login'; ?>"
@@ -93,18 +95,20 @@
93
 
94
  <?php
95
  function show_2_factor_custom_design_options($current_user){
 
96
  ?>
97
 
98
- <br>
99
- <div class="mo_wpns_setting_layout">
100
  <div id="mo2f_custom_addon_hide">
101
 
102
- <br>
103
  </div>
104
  <form name="f" id="custom_css_reset_form" method="post" action="" >
105
  <input type="hidden" name="option" value="mo_auth_custom_design_options_reset" />
106
 
107
- <h3><?php echo mo2f_lt('Customize UI of Login Pop up\'s');?></h3>
 
 
 
108
  <input type="submit" name="submit" value="Reset Settings" class="mo_wpns_button mo_wpns_button1" style="float:right; background-color: #20b2aa; color: white;box-shadow: none;"<?php
109
  echo 'disabled' ; ?> />
110
 
@@ -149,8 +153,7 @@
149
  </tr>
150
  </table>
151
  </br>
152
- <input type="submit" name="submit" style="margin-left:2%; background-color: #20b2aa; color: white; box-shadow: none;" value="Save Settings" class="mo_wpns_button mo_wpns_button1" <?php
153
- echo 'disabled' ; ?> />
154
 
155
  </form>
156
  </div>
1
  <?php
2
+ $setup_dirName = dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'link_tracer.php';
3
+ include $setup_dirName;
4
  global $current_user;
5
  $current_user = wp_get_current_user();
6
  global $Mo2fdbQueries;
7
  ?>
8
+ <div class="mo_wpns_setting_layout" id="mo2f_customization_tour">
9
+ <form name="f" id="custom_css_form_add" method="post" action="">
10
  <input type="hidden" name="option" value="mo_auth_custom_options_save" />
11
 
 
12
  <div id="mo2f_custom_addon_hide">
13
+ <h1><?php echo __('2. Personalization'); ?>
14
+ <span style="text-align: right;font-size: large;"><?php echo '<a href="'.$addons_url .'" style="color: red">'; ?>[ PREMIUM ]</a></span>
15
+ </h1>
16
+ <p id="custom_description">
17
+ <?php echo __( 'This helps you to modify and redesign the 2FA prompt to match according to your website and various customizations in the plugin dashboard.', 'miniorange-2-factor-authentication' ); ?>
18
+
19
+ </p><hr>
20
  </div>
21
 
22
+ <h3><?php echo mo2f_lt('Customize Plugin Icon');?><a href='<?php echo $two_factor_premium_doc['Custom plugin logo'];?>' target="_blank">
23
+ <span class="dashicons dashicons-text-page" style="font-size:19px;color:#269eb3;float: right;"></span>
24
+
25
+ </a></h3><br>
26
  <div style="margin-left:2%">
27
  <input type="checkbox" id="mo2f_enable_custom_icon" name="mo2f_enable_custom_icon" value="1" <?php checked( get_option('mo2f_enable_custom_icon') == 1 );
28
  echo 'disabled'; ?> />
31
  <div class="mo2f_advanced_options_note" ><p style="padding:5px;"><i><?php echo mo2f_lt('
32
  Go to /wp-content/uploads/miniorange folder and upload a .png image with the name "plugin_icon" (Max Size: 20x34px).');?></i></p>
33
  </div>
34
+ </div><hr>
35
 
36
+ <h3><?php echo mo2f_lt('Customize Plugin Name');?><a href='<?php echo $two_factor_premium_doc['Custom plugin name'];?>' target="_blank">
37
+ <span class="dashicons dashicons-text-page" style="font-size:19px;color:#269eb3;float: right;"></span>
38
+
39
+ </a></h3><br>
40
  <div style="margin-left:2%">
41
  <?php echo mo2f_lt('Change Plugin Name:');?> &nbsp;
42
  <input type="text" class="mo2f_table_textbox" style="width:35% " id="mo2f_custom_plugin_name" name="mo2f_custom_plugin_name" <?php echo 'disabled'; ?> value="<?php echo get_option('mo2f_custom_plugin_name')?>" placeholder="<?php echo mo2f_lt('Enter a custom Plugin Name.');?>" />
44
  <div class="mo2f_advanced_options_note"><p style="padding:5px;"><i>
45
  <?php echo mo2f_lt('This will be the Plugin Name You and your Users see in WordPress Dashboard.');?>
46
  </i></p> </div>
47
+ </div> <hr>
48
+
49
+ </form>
 
 
 
 
 
 
 
 
 
50
  <?php show_2_factor_custom_design_options($current_user);?>
51
  <br>
52
+ <div >
53
+ <h3><?php echo mo2f_lt('Custom Email and SMS Templates');?>
54
+ <a href="https://developers.miniorange.com/docs/security/wordpress/wp-security/customize-email-template" target="_blank"><span class="dashicons dashicons-text-page" style="font-size:19px;color:#269eb3;float: right;"></span> </a>
 
55
  </h3><hr>
56
+
57
  <div style="margin-left:2%">
58
  <p><?php echo mo2f_lt('You can change the templates for Email and SMS as per your requirement.');?></p>
59
  <?php if(mo2f_is_customer_registered()){
70
  </div>
71
  <br>
72
 
73
+ <div>
74
  <h3><?php echo mo2f_lt('Integrate your websites\'s theme with the 2FA plugin\'s popups');?></h3><hr>
75
  <div style="margin-left:2%">
76
  <p><?php echo mo2f_lt('Contact Us through the support forum in the right for the UI integration.');?></p>
77
+ <input type="submit" name="submit" style="margin-left:2%; background-color: #20b2aa; color: white; box-shadow: none;" value="Save Settings" class="mo_wpns_button mo_wpns_button1" <?php
78
+ echo 'disabled' ; ?> />
79
  </div>
80
 
81
+ </div>
82
  </div>
83
  <br>
84
  <form style="display:none;" id="mo2fa_addon_loginform" action="<?php echo get_option( 'mo2f_host_name').'/moas/login'; ?>"
95
 
96
  <?php
97
  function show_2_factor_custom_design_options($current_user){
98
+ include dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'link_tracer.php';
99
  ?>
100
 
101
+ <div>
 
102
  <div id="mo2f_custom_addon_hide">
103
 
 
104
  </div>
105
  <form name="f" id="custom_css_reset_form" method="post" action="" >
106
  <input type="hidden" name="option" value="mo_auth_custom_design_options_reset" />
107
 
108
+ <h3><?php echo mo2f_lt('Customize UI of Login Pop up\'s');?><a href='<?php echo $two_factor_premium_doc['custom login popup'];?>' target="_blank">
109
+ <span class="dashicons dashicons-text-page" style="font-size:19px;color:#269eb3;float: right;"></span>
110
+
111
+ </a></h3>
112
  <input type="submit" name="submit" value="Reset Settings" class="mo_wpns_button mo_wpns_button1" style="float:right; background-color: #20b2aa; color: white;box-shadow: none;"<?php
113
  echo 'disabled' ; ?> />
114
 
153
  </tr>
154
  </table>
155
  </br>
156
+
 
157
 
158
  </form>
159
  </div>
views/twofa/two_fa_premium_feature.php ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $setup_dirName = dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'twofa'.DIRECTORY_SEPARATOR.'link_tracer.php';
3
+ include $setup_dirName;?>
4
+
5
+ <div class="mo_wpns_setting_layout" id = "premium_feature_phone_lost">
6
+ <h3>What happens if my phone is lost, discharged or not with me<a href='<?php echo $two_factor_premium_doc['What happens if my phone is lost, discharged or not with me'];?>' target="_blank">
7
+ <span class="dashicons dashicons-text-page" style="font-size:19px;color:#269eb3;float: right;"></span>
8
+
9
+ </a></h3><hr>
10
+ <p>
11
+ <input type="checkbox" class="option_for_auth" name="mo2f_all_users_method" value="1" checked="checked" disabled>Enable Forgot Phone.
12
+ <p>Select the alternate login method in case your phone is lost, discharged or not with you.</p>
13
+ <input type="checkbox" class="option_for_auth" name="mo2f_all_users_method" value="1" checked="checked" disabled>KBA&nbsp;&nbsp;&nbsp;&nbsp;
14
+ <input type="checkbox" class="option_for_auth" name="mo2f_all_users_method" value="1" checked="checked" disabled>OTP over EMAIL
15
+ </p>
16
+ <div class="mo2f_advanced_options_note" style="background-color: #bfe5e9;padding:12px"><b>Note:</b> This option will provide you alternate way of login in case your phone is lost, discharged or not with you.</div>
17
+
18
+ </div>
19
+
20
+ <div class="mo_wpns_setting_layout" id = "premium_feature_specific_method">
21
+ <?php
22
+ $current_user = wp_get_current_user();
23
+ $opt='OUT OF BAND EMAIL';
24
+ ?>
25
+ <h3><?php echo mo2f_lt('Select the specific set of authentication methods for your users');?><a href='<?php echo $two_factor_premium_doc['Specific set of authentication methods'];?>' target="_blank"><span class="dashicons dashicons-text-page" style="font-size:19px;color:#269eb3;float: right;"></span></a></h3><hr>
26
+ <p>
27
+ <input type="radio" class="option_for_auth" name="mo2f_all_users_method" value="1" checked="checked" />
28
+ <?php echo __('For all Users','miniorange-2-factor-authentication');?>&nbsp;&nbsp;
29
+ <input type="radio" class="option_for_auth2" name="mo2f_all_users_method" value="0" />
30
+ <?php echo __('Specific Roles','miniorange-2-factor-authentication'); ?>
31
+ </p>
32
+ <table class="mo2f_for_all_users" <?php if(!get_site_option('mo2f_all_users_method')){echo 'hidden';} ?> ><tbody>
33
+ <tr>
34
+ <td>
35
+ <input type='checkbox' name='mo2f_authmethods[]' value='OUT OF BAND EMAIL' disabled/>Email Verification&nbsp;&nbsp;
36
+ </td>
37
+ <td>
38
+ <input type='checkbox' name='mo2f_authmethods[]' value='SMS' disabled />OTP Over SMS&nbsp;&nbsp;
39
+ </td>
40
+ <td>
41
+ <input type='checkbox' name='mo2f_authmethods[]' value='PHONE VERIFICATION' disabled />Phone Call Verification&nbsp;&nbsp;
42
+ </td>
43
+ </tr>
44
+ <tr>
45
+ <td>
46
+ <input type='checkbox' name='mo2f_authmethods[]' value='SOFT TOKEN' disabled />Soft Token&nbsp;&nbsp;
47
+ </td>
48
+ <td>
49
+ <input type='checkbox' name='mo2f_authmethods[]' value='MOBILE AUTHENTICATION' disabled />QR Code Authentication&nbsp;&nbsp;
50
+ </td>
51
+ <td>
52
+ <input type='checkbox' name='mo2f_authmethods[]' value='PUSH NOTIFICATIONS' disabled />Push Notifications&nbsp;&nbsp;
53
+ </td>
54
+ </tr>
55
+ <tr>
56
+ <td>
57
+ <input type='checkbox' name='mo2f_authmethods[]' value='GOOGLE AUTHENTICATOR' disabled />Google Authenticator&nbsp;&nbsp;
58
+ </td>
59
+ <td>
60
+ <input type='checkbox' name='mo2f_authmethods[]' value='AUTHY 2-FACTOR AUTHENTICATION' disabled />AUTHY 2-FACTOR AUTHENTICATION&nbsp;&nbsp;
61
+ </td>
62
+ <td>
63
+ <input type='checkbox' name='mo2f_authmethods[]' value='KBA' disabled />Security Questions (KBA)&nbsp;&nbsp;
64
+ </td>
65
+ </tr>
66
+ <tr>
67
+ <td>
68
+ <input type='checkbox' name='mo2f_authmethods[]' value='SMS AND EMAIL' disabled /><?php echo __('OTP Over SMS And Email','miniorange-2-factor-authentication');?>&nbsp;&nbsp;
69
+ </td>
70
+ <td>
71
+ <input type='checkbox' name='mo2f_authmethods[]' value='OTP_OVER_EMAIL' disabled /><?php echo __('OTP Over Email','miniorange-2-factor-authentication');?>&nbsp;&nbsp;
72
+ </td>
73
+ </tr>
74
+ </tbody>
75
+ </div>
76
+ </table>
77
+
78
+ <?php
79
+ $opt = (array) get_site_option('mo2f_auth_methods_for_users');
80
+ $copt=array();
81
+ $newcopt=array();
82
+ global $wp_roles;
83
+ if (!isset($wp_roles))
84
+ $wp_roles = new WP_Roles();
85
+ foreach($wp_roles->role_names as $id => $name)
86
+ {
87
+ $copt[$id]=get_site_option('mo2f_auth_methods_for_'.$id);
88
+ if(empty($copt[$id])){
89
+ $copt[$id]=array("No Two Factor Selected");
90
+ }?>
91
+ <span class="mo2f_display_tab mo2f_btn_premium_features" style="border-radius:6px;padding: 7px 25px;" ID="mo2f_role_<?php echo $id ?>" onclick="displayTab('<?php echo $id ?>');" value="<?php echo $id ?>" <?php if(get_site_option('mo2f_all_users_method')){echo 'hidden';}?>> <?php echo $name ?></span>
92
+
93
+ <?php
94
+ }
95
+ ?> <br><br><?php
96
+ global $wp_roles;
97
+ if (!isset($wp_roles))
98
+ $wp_roles = new WP_Roles();
99
+ print '<div> ';
100
+ foreach($wp_roles->role_names as $id => $name) {
101
+ $setting = get_site_option('mo2fa_'.$id);
102
+ $newcopt=$copt[$id];
103
+ ?>
104
+ <table class="mo2f_for_all_roles" id="mo2f_for_all_<?php echo $id ?>" hidden><tbody>
105
+ <tr>
106
+ <td>
107
+ <input type='checkbox' name="<?php echo $id ?>[]" value='OUT OF BAND EMAIL' <?php echo (in_array("OUT OF BAND EMAIL", $newcopt)) ? 'checked="checked"' : ''; ?> disabled /><?php echo __('Email Verification','miniorange-2-factor-authentication');?>&nbsp;&nbsp;
108
+ </td>
109
+ <td>
110
+ <input type='checkbox' name="<?php echo $id ?>[]" value='SMS' <?php echo (in_array("SMS", $newcopt)) ? 'checked="checked"' : ''; ?> disabled /><?php echo __('OTP Over SMS','miniorange-2-factor-authentication');?>&nbsp;&nbsp;
111
+ </td>
112
+ <td>
113
+ <input type='checkbox' name="<?php echo $id ?>[]" value='PHONE VERIFICATION' <?php echo (in_array("PHONE VERIFICATION", $newcopt)) ? 'checked="checked"' : ''; ?> disabled /><?php echo __('Phone Call Verification','miniorange-2-factor-authentication');?>&nbsp;&nbsp;
114
+ </td>
115
+ </tr>
116
+ <tr>
117
+ <td>
118
+ <input type='checkbox' name="<?php echo $id ?>[]" value='SOFT TOKEN' <?php echo (in_array("SOFT TOKEN", $newcopt)) ? 'checked="checked"' : ''; ?> disabled /><?php echo __('Soft Token','miniorange-2-factor-authentication');?>&nbsp;&nbsp;
119
+ </td>
120
+ <td>
121
+ <input type='checkbox' name="<?php echo $id ?>[]" value='MOBILE AUTHENTICATION' <?php echo (in_array("MOBILE AUTHENTICATION", $newcopt)) ? 'checked="checked"' : ''; ?> disabled /><?php echo __('QR Code Authentication','miniorange-2-factor-authentication');?>&nbsp;&nbsp;
122
+ </td>
123
+ <td>
124
+ <input type='checkbox' name="<?php echo $id ?>[]" value='PUSH NOTIFICATIONS' <?php echo (in_array("PUSH NOTIFICATIONS", $newcopt)) ? 'checked="checked"' : ''; ?> disabled /><?php echo __('Push Notifications','miniorange-2-factor-authentication');?>&nbsp;&nbsp;
125
+ </td>
126
+ </tr>
127
+ <tr>
128
+ <td>
129
+ <input type='checkbox' name="<?php echo $id ?>[]" value='GOOGLE AUTHENTICATOR' <?php echo (in_array("GOOGLE AUTHENTICATOR", $newcopt)) ? 'checked="checked"' : ''; ?> disabled /><?php echo __('Google Authenticator','miniorange-2-factor-authentication');?>&nbsp;&nbsp;
130
+ </td>
131
+ <td>
132
+ <input type='checkbox' name="<?php echo $id ?>[]" value='AUTHY 2-FACTOR AUTHENTICATION' <?php echo (in_array("AUTHY 2-FACTOR AUTHENTICATION", $newcopt)) ? 'checked="checked"' : ''; ?> disabled /><?php echo __('AUTHY 2-FACTOR AUTHENTICATION','miniorange-2-factor-authentication');?>&nbsp;&nbsp;
133
+ </td>
134
+ <td>
135
+ <input type='checkbox' name="<?php echo $id ?>[]" value='KBA' <?php echo (in_array("KBA", $newcopt)) ? 'checked="checked"' : ''; ?> disabled /><?php echo __('Security Questions (KBA)','miniorange-2-factor-authentication');?>&nbsp;&nbsp;
136
+ </td>
137
+ </tr>
138
+ <tr>
139
+ <td>
140
+ <input type='checkbox' name="<?php echo $id ?>[]" value='SMS AND EMAIL' <?php echo (in_array("SMS AND EMAIL", $newcopt)) ? 'checked="checked"' : ''; ?> disabled /><?php echo __('OTP Over SMS And Email','miniorange-2-factor-authentication');?>&nbsp;&nbsp;
141
+ </td>
142
+ <td>
143
+ <input type='checkbox' name="<?php echo $id ?>[]" value='OTP_OVER_EMAIL' <?php echo (in_array("OTP_OVER_EMAIL", $newcopt)) ? 'checked="checked"' : ''; ?> disabled /><?php echo __('OTP Over Email','miniorange-2-factor-authentication');?>&nbsp;&nbsp;
144
+ </td>
145
+ </tr>
146
+ </tbody>
147
+ </div>
148
+ </table>
149
+ <?php
150
+ }
151
+ print '</div>';
152
+
153
+ ?>
154
+ <div class="mo2f_advanced_options_note" style="background-color: #bfe5e9;padding:12px"><b>Note:</b> You can select which Two Factor methods you want to enable for your users. By default all Two Factor methods are enabled for all users of the role you have selected above.</div>
155
+ <script>
156
+ jQuery('.mo2f_display_tab').hide();
157
+ jQuery('.mo2f_for_all_roles').hide();
158
+ jQuery('.mo2f_for_all_users').show();
159
+ function displayTab(role){
160
+ jQuery('.mo2f_display_tab').removeClass("mo2f_blue_premium_features");
161
+ jQuery('.mo2f_display_tab').addClass("mo2f_btn_premium_features");
162
+ jQuery('#mo2f_role_'+role).removeClass("mo2f_btn_premium_features");
163
+ jQuery('#mo2f_role_'+role).addClass("mo2f_blue_premium_features");
164
+ jQuery('.mo2f_for_all_roles').hide();
165
+ jQuery('#mo2f_for_all_'+role).show();
166
+ }
167
+ jQuery(".option_for_auth").click(function(){
168
+ jQuery('.mo2f_display_tab').hide();
169
+ jQuery('.mo2f_for_all_roles').hide();
170
+ jQuery('.mo2f_for_all_users').show();
171
+ })
172
+ jQuery(".option_for_auth2").click(function(){
173
+ jQuery('.mo2f_display_tab').show();
174
+ jQuery('.mo2f_for_all_users').hide();
175
+ }
176
+ )
177
+ </script>
178
+ <?php
179
+ ?>
180
+ </div>
181
+
182
+ <div class="mo_wpns_setting_layout" id = "premium_feature_skip_option">
183
+ <h3>Skip Option for Users During User Enrollment</h3><hr>
184
+ <p>
185
+ <input type="checkbox" class="option_for_auth" name=" Skip Option for users." value="1" checked="checked" disabled> Skip Option for users.
186
+ </p>
187
+ <div class="mo2f_advanced_options_note" style="background-color: #bfe5e9;padding:12px"><b>Note:</b> If this option is enabled then users will have an option to skip User Enrollment.</div>
188
+
189
+ </div>
190
+
191
+ <div class="mo_wpns_setting_layout" id = "premium_feature_user_enrollment">
192
+ <h3>Email verification of Users during User Enrollment<a href='<?php echo $two_factor_premium_doc['Email verification of Users during Inline Registration'];?>' target="_blank">
193
+ <span class="dashicons dashicons-text-page" style="font-size:19px;color:#269eb3;float: right;"></span>
194
+ </a></h3><hr>
195
+ <p>
196
+ <input type="radio" class="option_for_auth" name="mo2f_all_users_method" value="1" checked="checked" disabled> Enable users to edit their email address for registration with miniOrange.<br><br>
197
+ <input type="radio" class="option_for_auth" name="mo2f_all_users_method" value="1" checked="checked" disabled>Skip e-mail verification by user.
198
+ </p>
199
+ <div class="mo2f_advanced_options_note" style="background-color: #bfe5e9;padding:12px"><b>Note:</b> If this option is enabled then users can edit their email during User Enrollment with miniOrange, and they will be prompted for e-mail verification. By selecting second option, the user will be silently registered with miniOrange without the need of e-mail verification.</div>
200
+
201
+ </div>
202
+
203
+ <div class="mo_wpns_setting_layout" id = "premium_feature_login_screen_option">
204
+ <h3>Select Login Screen Options<a href='<?php echo $two_factor_premium_doc['Select login screen option'];?>' target="_blank">
205
+ <span class="dashicons dashicons-text-page" style="font-size:19px;color:#269eb3;float: right;"></span>
206
+ </a></h3><hr>
207
+ <p>
208
+ <input type="radio" class="option_for_auth" name="mo2f_all_users_method" value="1" checked="checked" disabled> Login with password + 2nd Factor <span style="color: red">(Recommended)</span>
209
+ </p>
210
+
211
+ <div class="mo2f_advanced_options_note" style="background-color: #bfe5e9;padding:12px"><b>Note:</b> By default 2nd Factor is enabled after password authentication. If you do not want to remember passwords anymore and just login with 2nd Factor, please select 2nd option.</div><br>
212
+ <p>
213
+ <input type="radio"