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

Version Description

  • Google Authenticator-Two Factor Authentication (2FA) : Database Error Fix and Custom Redirect.
Download this release

Release Info

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

Code changes from version 5.1.11 to 5.1.14

class-customer-setup.php CHANGED
@@ -103,7 +103,6 @@ class Customer_Setup {
103
 
104
  global $user;
105
  $user = wp_get_current_user();
106
- $is_nc_with_unlimited_users = get_option( 'mo2f_is_NC' ) && ! get_option( 'mo2f_is_NNC' );
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
 
@@ -112,13 +111,11 @@ class Customer_Setup {
112
 
113
  if ( $is_ec_with_1_user ) {
114
  $customer_feature = "V1";
115
- } else if ( $is_nc_with_unlimited_users ) {
116
- $customer_feature = "V2";
117
- } else if ( $is_nc_with_1_user ) {
118
  $customer_feature = "V3";
119
  }
120
 
121
- $query = '[WordPress 2 Factor Authentication Plugin: ' . $customer_feature . ' - V 5.1.11]: ' . $message;
122
 
123
  $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>';
124
 
@@ -604,7 +601,6 @@ class Customer_Setup {
604
  $ch = curl_init( $url );
605
  global $user;
606
  $user = wp_get_current_user();
607
- $is_nc_with_unlimited_users = get_option( 'mo2f_is_NC' ) && ! get_option( 'mo2f_is_NNC' );
608
  $is_nc_with_1_user = get_option( 'mo2f_is_NC' ) && get_option( 'mo2f_is_NNC' );
609
  $is_ec_with_1_user = ! get_option( 'mo2f_is_NC' );
610
 
@@ -613,13 +609,11 @@ class Customer_Setup {
613
 
614
  if ( $is_ec_with_1_user ) {
615
  $customer_feature = "V1";
616
- } else if ( $is_nc_with_unlimited_users ) {
617
- $customer_feature = "V2";
618
  } else if ( $is_nc_with_1_user ) {
619
  $customer_feature = "V3";
620
  }
621
 
622
- $query = '[WordPress 2 Factor Authentication Plugin: ' . $customer_feature . ' - V 5.1.11]: ' . $query;
623
  $fields = array(
624
  'firstName' => $user->user_firstname,
625
  'lastName' => $user->user_lastname,
103
 
104
  global $user;
105
  $user = wp_get_current_user();
 
106
  $is_nc_with_1_user = get_option( 'mo2f_is_NC' ) && get_option( 'mo2f_is_NNC' );
107
  $is_ec_with_1_user = ! get_option( 'mo2f_is_NC' );
108
 
111
 
112
  if ( $is_ec_with_1_user ) {
113
  $customer_feature = "V1";
114
+ }else if ( $is_nc_with_1_user ) {
 
 
115
  $customer_feature = "V3";
116
  }
117
 
118
+ $query = '[WordPress 2 Factor Authentication Plugin: ' . $customer_feature . ' - V 5.1.14]: ' . $message;
119
 
120
  $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>';
121
 
601
  $ch = curl_init( $url );
602
  global $user;
603
  $user = wp_get_current_user();
 
604
  $is_nc_with_1_user = get_option( 'mo2f_is_NC' ) && get_option( 'mo2f_is_NNC' );
605
  $is_ec_with_1_user = ! get_option( 'mo2f_is_NC' );
606
 
609
 
610
  if ( $is_ec_with_1_user ) {
611
  $customer_feature = "V1";
 
 
612
  } else if ( $is_nc_with_1_user ) {
613
  $customer_feature = "V3";
614
  }
615
 
616
+ $query = '[WordPress 2 Factor Authentication Plugin: ' . $customer_feature . ' - V 5.1.14]: ' . $query;
617
  $fields = array(
618
  'firstName' => $user->user_firstname,
619
  'lastName' => $user->user_lastname,
class-miniorange-2-factor-login.php CHANGED
@@ -38,12 +38,10 @@ class Miniorange_Mobile_Login {
38
  $pass2fa_login_session = new Miniorange_Password_2Factor_Login();
39
  $session_id=$pass2fa_login_session->create_session();
40
 
41
- $current_roles = miniorange_get_user_role( $currentuser );
42
-
43
- $enabled = miniorange_check_if_2fa_enabled_for_roles( $current_roles );
44
  $redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : null;
45
 
46
- if ( $enabled ) {
47
 
48
  $mo2f_user_email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $currentuser->ID );
49
  $mo2f_user_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $currentuser->ID );
@@ -177,8 +175,8 @@ class Miniorange_Mobile_Login {
177
  }
178
 
179
  function mo_2_factor_hide_login() {
180
- wp_register_style( 'hide-login', plugins_url( 'includes/css/hide-login.css?version=5.1.11', __FILE__ ) );
181
- wp_register_style( 'bootstrap', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.11', __FILE__ ) );
182
 
183
  wp_enqueue_style( 'hide-login' );
184
  wp_enqueue_style( 'bootstrap' );
@@ -240,7 +238,7 @@ class Miniorange_Mobile_Login {
240
  }
241
 
242
  function mo_2_factor_show_login_with_password_when_phonelogin_enabled() {
243
- wp_register_style( 'show-login', plugins_url( 'includes/css/show-login.css?version=5.1.11', __FILE__ ) );
244
  wp_enqueue_style( 'show-login' );
245
  }
246
 
@@ -262,9 +260,9 @@ class Miniorange_Mobile_Login {
262
 
263
  function mo_2_factor_show_login() {
264
  if ( get_option( 'mo2f_enable_login_with_2nd_factor' ) ) {
265
- wp_register_style( 'show-login', plugins_url( 'includes/css/hide-login-form.css?version=5.1.11', __FILE__ ) );
266
  } else {
267
- wp_register_style( 'show-login', plugins_url( 'includes/css/show-login.css?version=5.1.11', __FILE__ ) );
268
  }
269
  wp_enqueue_style( 'show-login' );
270
  }
38
  $pass2fa_login_session = new Miniorange_Password_2Factor_Login();
39
  $session_id=$pass2fa_login_session->create_session();
40
 
41
+ $mo2f_configured_2FA_method = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $currentuser->ID );
 
 
42
  $redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : null;
43
 
44
+ if ( $mo2f_configured_2FA_method ) {
45
 
46
  $mo2f_user_email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $currentuser->ID );
47
  $mo2f_user_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $currentuser->ID );
175
  }
176
 
177
  function mo_2_factor_hide_login() {
178
+ wp_register_style( 'hide-login', plugins_url( 'includes/css/hide-login.css?version=5.1.14', __FILE__ ) );
179
+ wp_register_style( 'bootstrap', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.14', __FILE__ ) );
180
 
181
  wp_enqueue_style( 'hide-login' );
182
  wp_enqueue_style( 'bootstrap' );
238
  }
239
 
240
  function mo_2_factor_show_login_with_password_when_phonelogin_enabled() {
241
+ wp_register_style( 'show-login', plugins_url( 'includes/css/show-login.css?version=5.1.14', __FILE__ ) );
242
  wp_enqueue_style( 'show-login' );
243
  }
244
 
260
 
261
  function mo_2_factor_show_login() {
262
  if ( get_option( 'mo2f_enable_login_with_2nd_factor' ) ) {
263
+ wp_register_style( 'show-login', plugins_url( 'includes/css/hide-login-form.css?version=5.1.14', __FILE__ ) );
264
  } else {
265
+ wp_register_style( 'show-login', plugins_url( 'includes/css/show-login.css?version=5.1.14', __FILE__ ) );
266
  }
267
  wp_enqueue_style( 'show-login' );
268
  }
class-miniorange-2-factor-pass2fa-login.php CHANGED
@@ -70,11 +70,14 @@ class Miniorange_Password_2Factor_Login {
70
  MO2f_Utility::set_user_values($session_id, 'mo2f_1stfactor_status', 'VALIDATE_SUCCESS' );
71
 
72
  $current_roles = miniorange_get_user_role( $user );
73
- $enabled = miniorange_check_if_2fa_enabled_for_roles( $current_roles );
 
74
  $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
75
  $mo_2factor_user_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $user->ID );
76
  $kba_configuration_status = $Mo2fdbQueries->get_user_detail( 'mo2f_SecurityQuestions_config_status', $user->ID );
77
- if ( $enabled ) {
 
 
78
  if ( $email && $mo_2factor_user_registration_status == 'MO_2_FACTOR_PLUGIN_SETTINGS' ) {
79
  if ( MO2f_Utility::check_if_request_is_from_mobile_device( $_SERVER['HTTP_USER_AGENT'] ) && $kba_configuration_status ) {
80
  $this->mo2f_pass2login_kba_verification( $user->ID, $redirect_to, $session_id );
@@ -99,12 +102,13 @@ class Miniorange_Password_2Factor_Login {
99
  }
100
  }
101
  } else {
102
-
103
  MO2f_Utility::set_user_values($session_id, 'mo2f_login_message', 'Please login into your account using password.' );
104
  $mobile_login->mo_auth_show_success_message();
105
  $mobile_login->mo2f_redirectto_wp_login();
106
  }
107
  } else {
 
108
  MO2f_Utility::set_user_values( $session_id, "mo2f_login_message", 'Please login into your account using password.' );
109
  $mobile_login->mo_auth_show_success_message();
110
  $mobile_login->mo2f_redirectto_wp_login();
@@ -788,9 +792,8 @@ class Miniorange_Password_2Factor_Login {
788
  wp_enqueue_script( 'miniorange_script', plugins_url( 'includes/js/rba/js/miniorange-fp.js', __FILE__ ) );
789
  }else{
790
 
791
- $is_nc_with_unlimited_users = get_option( 'mo2f_is_NC' ) && !get_option( 'mo2f_is_NNC' );
792
 
793
- if( get_option('mo2f_enable_2fa_prompt_on_login_page') && ! $is_nc_with_unlimited_users &&
794
  in_array(get_option('mo2f_configured_2_factor_method'), array("Google Authenticator", "miniOrange Soft Token", "Authy Authenticator"))){
795
  echo "\t<p>\n";
796
  echo "\t\t<label class=\"mo2f_instuction1\" title=\"".__('If you don\'t have 2-factor authentication enabled for your WordPress account, leave this field empty.','google-authenticator')."\">".__('2 Factor Authentication code*','google-authenticator')."<span id=\"google-auth-info\"></span><br />\n";
@@ -902,7 +905,7 @@ class Miniorange_Password_2Factor_Login {
902
  $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN';
903
  $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to, null,$session_id );
904
  } else if ( $mo2f_second_factor == 'GOOGLE AUTHENTICATOR' ) {
905
- $mo2fa_login_message = $mo2f_external_app_type == 'Authy Authenticator' ? 'Please enter the one time passcode shown in the <b>Authy Authenticator</b> app.' : 'Please enter the one time passcode shown in the <b>Google Authenticator</b> app.';
906
  $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_GOOGLE_AUTHENTICATION';
907
  $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to, null,$session_id );
908
  } else {
@@ -980,13 +983,10 @@ class Miniorange_Password_2Factor_Login {
980
  MO2f_Utility::set_user_values($session_id_encrypt, 'mo2f_1stfactor_status', 'VALIDATE_SUCCESS');
981
 
982
  $is_customer_admin = get_option( 'mo2f_miniorange_admin' ) == $currentuser->ID ? true : false;
983
- $is_2fa_enabled_for_users = get_option( 'mo2f_enable_2fa_for_users' );
984
- $is_2fa_enabled_by_users = get_option( 'mo2f_enable_2fa' );
985
 
986
-
987
  //if ( $enabled_2fa_byusers ) {
988
 
989
- if ( $is_customer_admin || ( ! $is_customer_admin && $is_2fa_enabled_for_users && $is_2fa_enabled_by_users ) ) {
990
  $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $currentuser->ID );
991
  $mo_2factor_user_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $currentuser->ID );
992
  $kba_configuration_status = $Mo2fdbQueries->get_user_detail( 'mo2f_SecurityQuestions_config_status', $currentuser->ID );
@@ -1009,9 +1009,8 @@ class Miniorange_Password_2Factor_Login {
1009
  exit;
1010
  } else {
1011
  $mo2f_second_factor = mo2f_get_user_2ndfactor( $currentuser );
1012
- $is_nc_with_unlimited_users = get_option( 'mo2f_is_NC' ) && !get_option( 'mo2f_is_NNC' );
1013
 
1014
- if(!$is_nc_with_unlimited_users && get_option('mo2f_enable_2fa_prompt_on_login_page')&& !get_option('mo2f_remember_device')&&
1015
  in_array(get_option('mo2f_configured_2_factor_method'), array("Google Authenticator", "miniOrange Soft Token", "Authy Authenticator"))){
1016
  $error=$this->mo2f_validate_soft_token($currentuser, $redirect_to, $mo2f_second_factor, $otp_token,$session_id_encrypt);
1017
 
@@ -1093,6 +1092,7 @@ class Miniorange_Password_2Factor_Login {
1093
  }
1094
 
1095
  function mo2f_check_username_password( $user, $username, $password, $redirect_to = null ) {
 
1096
  if ( is_a( $user, 'WP_Error' ) && ! empty( $user ) ) {
1097
  return $user;
1098
  }
@@ -1118,9 +1118,8 @@ class Miniorange_Password_2Factor_Login {
1118
  } else {
1119
  global $Mo2fdbQueries;
1120
  $mo2f_configured_2FA_method = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $currentuser->ID );
1121
- $is_nc_with_unlimited_users = get_option( 'mo2f_is_NC' ) && !get_option( 'mo2f_is_NNC' );
1122
 
1123
- if ( !$is_nc_with_unlimited_users && empty( $_POST['mo_softtoken'] ) && get_option('mo2f_enable_2fa_prompt_on_login_page') && $mo2f_configured_2FA_method && !get_option('mo2f_remember_device')&&
1124
  in_array(get_option('mo2f_configured_2_factor_method'), array("Google Authenticator", "miniOrange Soft Token", "Authy Authenticator"))) { // Prevent PHP notices when using app password login
1125
  return new WP_Error( 'one_time_passcode_empty', '<strong>ERROR</strong>: Please enter the One Time Passcode.');
1126
  } else {
@@ -1136,7 +1135,6 @@ class Miniorange_Password_2Factor_Login {
1136
  $session_id=$this->create_session();
1137
  }
1138
 
1139
-
1140
  $error=$this->miniorange_initiate_2nd_factor( $currentuser, $attributes, $redirect_to, $otp_token, $session_id );
1141
 
1142
 
70
  MO2f_Utility::set_user_values($session_id, 'mo2f_1stfactor_status', 'VALIDATE_SUCCESS' );
71
 
72
  $current_roles = miniorange_get_user_role( $user );
73
+
74
+ $mo2f_configured_2FA_method = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user->ID );
75
  $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
76
  $mo_2factor_user_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $user->ID );
77
  $kba_configuration_status = $Mo2fdbQueries->get_user_detail( 'mo2f_SecurityQuestions_config_status', $user->ID );
78
+
79
+
80
+ if ( $mo2f_configured_2FA_method ) {
81
  if ( $email && $mo_2factor_user_registration_status == 'MO_2_FACTOR_PLUGIN_SETTINGS' ) {
82
  if ( MO2f_Utility::check_if_request_is_from_mobile_device( $_SERVER['HTTP_USER_AGENT'] ) && $kba_configuration_status ) {
83
  $this->mo2f_pass2login_kba_verification( $user->ID, $redirect_to, $session_id );
102
  }
103
  }
104
  } else {
105
+
106
  MO2f_Utility::set_user_values($session_id, 'mo2f_login_message', 'Please login into your account using password.' );
107
  $mobile_login->mo_auth_show_success_message();
108
  $mobile_login->mo2f_redirectto_wp_login();
109
  }
110
  } else {
111
+
112
  MO2f_Utility::set_user_values( $session_id, "mo2f_login_message", 'Please login into your account using password.' );
113
  $mobile_login->mo_auth_show_success_message();
114
  $mobile_login->mo2f_redirectto_wp_login();
792
  wp_enqueue_script( 'miniorange_script', plugins_url( 'includes/js/rba/js/miniorange-fp.js', __FILE__ ) );
793
  }else{
794
 
 
795
 
796
+ if( get_option('mo2f_enable_2fa_prompt_on_login_page') &&
797
  in_array(get_option('mo2f_configured_2_factor_method'), array("Google Authenticator", "miniOrange Soft Token", "Authy Authenticator"))){
798
  echo "\t<p>\n";
799
  echo "\t\t<label class=\"mo2f_instuction1\" title=\"".__('If you don\'t have 2-factor authentication enabled for your WordPress account, leave this field empty.','google-authenticator')."\">".__('2 Factor Authentication code*','google-authenticator')."<span id=\"google-auth-info\"></span><br />\n";
905
  $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN';
906
  $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to, null,$session_id );
907
  } else if ( $mo2f_second_factor == 'GOOGLE AUTHENTICATOR' ) {
908
+ $mo2fa_login_message ='Please enter the one time passcode shown in the <b> Authenticator</b> app.';
909
  $mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_GOOGLE_AUTHENTICATION';
910
  $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to, null,$session_id );
911
  } else {
983
  MO2f_Utility::set_user_values($session_id_encrypt, 'mo2f_1stfactor_status', 'VALIDATE_SUCCESS');
984
 
985
  $is_customer_admin = get_option( 'mo2f_miniorange_admin' ) == $currentuser->ID ? true : false;
 
 
986
 
 
987
  //if ( $enabled_2fa_byusers ) {
988
 
989
+ if ( $is_customer_admin ) {
990
  $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $currentuser->ID );
991
  $mo_2factor_user_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $currentuser->ID );
992
  $kba_configuration_status = $Mo2fdbQueries->get_user_detail( 'mo2f_SecurityQuestions_config_status', $currentuser->ID );
1009
  exit;
1010
  } else {
1011
  $mo2f_second_factor = mo2f_get_user_2ndfactor( $currentuser );
 
1012
 
1013
+ if(get_option('mo2f_enable_2fa_prompt_on_login_page')&& !get_option('mo2f_remember_device')&&
1014
  in_array(get_option('mo2f_configured_2_factor_method'), array("Google Authenticator", "miniOrange Soft Token", "Authy Authenticator"))){
1015
  $error=$this->mo2f_validate_soft_token($currentuser, $redirect_to, $mo2f_second_factor, $otp_token,$session_id_encrypt);
1016
 
1092
  }
1093
 
1094
  function mo2f_check_username_password( $user, $username, $password, $redirect_to = null ) {
1095
+
1096
  if ( is_a( $user, 'WP_Error' ) && ! empty( $user ) ) {
1097
  return $user;
1098
  }
1118
  } else {
1119
  global $Mo2fdbQueries;
1120
  $mo2f_configured_2FA_method = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $currentuser->ID );
 
1121
 
1122
+ if ( empty( $_POST['mo_softtoken'] ) && get_option('mo2f_enable_2fa_prompt_on_login_page') && $mo2f_configured_2FA_method && !get_option('mo2f_remember_device')&&
1123
  in_array(get_option('mo2f_configured_2_factor_method'), array("Google Authenticator", "miniOrange Soft Token", "Authy Authenticator"))) { // Prevent PHP notices when using app password login
1124
  return new WP_Error( 'one_time_passcode_empty', '<strong>ERROR</strong>: Please enter the One Time Passcode.');
1125
  } else {
1135
  $session_id=$this->create_session();
1136
  }
1137
 
 
1138
  $error=$this->miniorange_initiate_2nd_factor( $currentuser, $attributes, $redirect_to, $otp_token, $session_id );
1139
 
1140
 
class-miniorange-2-factor-user-registration.php DELETED
@@ -1,292 +0,0 @@
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
- class Miniorange_User_Register {
26
-
27
- function __construct() {
28
- add_action( 'admin_init', array( $this, 'miniorange_user_save_settings' ) );
29
- add_action( 'admin_enqueue_scripts', array( $this, 'plugin_settings_style' ) );
30
- }
31
-
32
- function plugin_settings_style() {
33
- wp_enqueue_style( 'mo_2_factor_admin_settings_style', plugins_url( 'includes/css/style_settings.css?version=5.1.11', __FILE__ ) );
34
- }
35
-
36
- function mo_auth_success_message() {
37
- $message = get_option( 'mo2f_message' ); ?>
38
- <script>
39
-
40
- jQuery(document).ready(function () {
41
-
42
- var message = "<?php echo $message; ?>";
43
- jQuery('#messages').append("<div class='error notice is-dismissible mo2f_error_container'> <p class='mo2f_msgs'>" + message + "</p></div>");
44
- });
45
- </script>
46
- <?php
47
- }
48
-
49
- function mo_auth_error_message() {
50
- $message = get_option( 'mo2f_message' ); ?>
51
- <script>
52
- jQuery(document).ready(function () {
53
-
54
- var message = "<?php echo $message; ?>";
55
- jQuery('#messages').append("<div class='updated notice is-dismissible mo2f_success_container'> <p class='mo2f_msgs'>" + message + "</p></div>");
56
-
57
- jQuery('a[href=\"#test\"]').click(function () {
58
- var currentMethod = jQuery(this).data("method");
59
-
60
- if (currentMethod == 'MOBILE AUTHENTICATION') {
61
- jQuery('#mo2f_2factor_test_mobile_form').submit();
62
- } else if (currentMethod == 'PUSH NOTIFICATIONS') {
63
- jQuery('#mo2f_2factor_test_push_form').submit();
64
- } else if (currentMethod == 'SOFT TOKEN') {
65
- jQuery('#mo2f_2factor_test_softtoken_form').submit();
66
- } else if (currentMethod == 'SMS' || currentMethod == 'PHONE VERIFICATION') {
67
- jQuery('#mo2f_test_2factor_method').val(currentMethod);
68
- jQuery('#mo2f_2factor_test_smsotp_form').submit();
69
- } else if (currentMethod == 'OUT OF BAND EMAIL') {
70
- jQuery('#mo2f_2factor_test_out_of_band_email_form').submit();
71
- } else if (currentMethod == 'GOOGLE AUTHENTICATOR') {
72
- jQuery('#mo2f_2factor_test_google_auth_form').submit();
73
- }
74
- });
75
-
76
- });
77
- </script>
78
- <?php
79
- }
80
-
81
- public function mo2f_register_user() {
82
- global $wpdb;
83
- global $Mo2fdbQueries;
84
- global $user;
85
- $user = wp_get_current_user();
86
- if ( mo_2factor_is_curl_installed() == 0 ) { ?>
87
- <p style="color:red;"> (<?php echo mo2f_lt( 'Warning: ' ); ?><a
88
- href="http://php.net/manual/en/curl.installation.php"
89
- target="_blank"> <?php echo mo2f_lt( 'PHP CURL extension' ); ?></a> <?php echo mo2f_lt( 'is not installed or disabled' ); ?>
90
- )</p>
91
- <?php
92
- }
93
-
94
-
95
- $mo2f_active_tab = isset( $_GET['mo2f_tab'] ) ? $_GET['mo2f_tab'] : '2factor_setup';
96
- $mo_2factor_user_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $user->ID );
97
-
98
- ?>
99
-
100
- <div class="wrap">
101
- <div><img style="float:left;" src="<?php echo plugins_url( 'includes/images/logo.png"', __FILE__ ); ?>"></div>
102
- <div style="display:block;font-size:23px;padding:9px 0 10px;line-height:29px; margin-left:3%">
103
- <a class="add-new-h2" href="https://faq.miniorange.com/kb/two-factor-authentication"
104
- target="_blank"><?php echo mo2f_lt( 'FAQ' ); ?></a>
105
- </div>
106
- <div id="tab">
107
- <h2 class="nav-tab-wrapper">
108
- <a href="admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=2factor_setup"
109
- class="nav-tab <?php echo $mo2f_active_tab == '2factor_setup' ? 'nav-tab-active' : ''; ?>"
110
- id="mo2f_tab1"><?php if ( in_array( $mo_2factor_user_registration_status, array(
111
- 'MO_2_FACTOR_INITIALIZE_TWO_FACTOR',
112
- 'MO_2_FACTOR_INITIALIZE_MOBILE_REGISTRATION',
113
- 'MO_2_FACTOR_PLUGIN_SETTINGS'
114
- ) ) ) { ?><?php echo mo2f_lt( 'User Profile ' ); ?><?php } else { ?><?php echo mo2f_lt( 'Account Setup ' ); ?><?php } ?></a>
115
- <a href="admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=mobile_configure"
116
- class="nav-tab <?php echo $mo2f_active_tab == 'mobile_configure' ? 'nav-tab-active' : ''; ?>"
117
- id="mo2f_tab2"><?php echo mo2f_lt( 'Setup Two-Factor' ); ?></a>
118
- </h2>
119
- </div>
120
-
121
- <div class="mo2f_container">
122
- <div id="messages"></div>
123
- <table style="width:100%;padding:20px;">
124
- <tr>
125
- <td style="width:60%;vertical-align:top;">
126
- <?php
127
- $session_variables = array( 'mo2f_google_auth', 'mo2f_mobile_support' );
128
- if ( $mo2f_active_tab == 'mobile_configure' ) {
129
- $mo2f_second_factor = mo2f_get_activated_second_factor( $user );
130
-
131
- mo2f_select_2_factor_method( $user, $mo2f_second_factor );
132
- ?>
133
- <script>
134
- jQuery(document).ready(function () {
135
- jQuery("#mo2f_support_table").hide();
136
- });
137
- </script>
138
- <?php
139
- } else if ( get_option( 'mo2f_remember_device' ) && $mo2f_active_tab == 'advance_option' ) {
140
- MO2f_Utility::unset_session_variables( $session_variables );
141
- show_2_factor_advanced_options( $user ); //Login Settings tab
142
- } else {
143
- MO2f_Utility::unset_session_variables( $session_variables );
144
- if ( in_array( $mo_2factor_user_registration_status, array(
145
- 'MO_2_FACTOR_OTP_DELIVERED_SUCCESS',
146
- 'MO_2_FACTOR_OTP_DELIVERED_FAILURE'
147
- ) ) ) {
148
- mo2f_show_user_otp_validation_page();
149
- } else if ( $mo_2factor_user_registration_status == 'MO_2_FACTOR_INITIALIZE_MOBILE_REGISTRATION' ) {
150
- $mo2f_second_factor = mo2f_get_activated_second_factor( $user );
151
- mo2f_show_instruction_to_allusers( $user, $mo2f_second_factor );
152
- } else if ( $mo_2factor_user_registration_status == 'MO_2_FACTOR_INITIALIZE_TWO_FACTOR' ) {
153
- mo2f_show_instruction_to_allusers( $user, 'NONE' );
154
- } else if ( $mo_2factor_user_registration_status == 'MO_2_FACTOR_PLUGIN_SETTINGS' ) {
155
- $mo2f_second_factor = mo2f_get_activated_second_factor( $user );
156
- mo2f_show_instruction_to_allusers( $user, $mo2f_second_factor );
157
- } else {
158
- show_user_welcome_page( $user );
159
- }
160
- }
161
- ?>
162
- </td>
163
- <td style="vertical-align:top;padding-left:1%;" id="mo2f_support_table">
164
- </td>
165
- </tr>
166
- </table>
167
- </div>
168
- <?php
169
- }
170
-
171
- function miniorange_user_save_settings() {
172
- global $wpdb;
173
- global $Mo2fdbQueries;
174
- global $user;
175
- $user = wp_get_current_user();
176
-
177
- if ( ! current_user_can( 'manage_options' ) ) {
178
- if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_2factor_validate_user_otp" ) { //validate OTP
179
- //validation and sanitization
180
- $otp_token = '';
181
- if ( MO2f_Utility::mo2f_check_empty_or_null( $_POST['otp_token'] ) ) {
182
- update_option( 'mo2f_message', Mo2fConstants::langTranslate( "INVALID_ENTRY" ) );
183
- $this->mo_auth_show_error_message();
184
-
185
- return;
186
- } else {
187
- $otp_token = sanitize_text_field( $_POST['otp_token'] );
188
- }
189
- $email = get_user_meta( $user->ID, 'user_email', true );
190
- if ( ! MO2f_Utility::check_if_email_is_already_registered( $email ) ) {
191
- $customer = new Customer_Setup();
192
- $transactionId = get_user_meta( $user->ID, 'mo_2fa_verify_otp_create_account', true );
193
-
194
- $content = json_decode( $customer->validate_otp_token( 'EMAIL', null, $transactionId, $otp_token, get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
195
- if ( $content['status'] == 'ERROR' ) {
196
- update_option( 'mo2f_message', Mo2fConstants:: langTranslate( $content['message'] ) );
197
- delete_user_meta( $user->ID, 'mo_2fa_verify_otp_create_account' );
198
- $this->mo_auth_show_error_message();
199
- } else {
200
- if ( strcasecmp( $content['status'], 'SUCCESS' ) == 0 ) { //OTP validated and generate QRCode
201
- $this->mo2f_create_user( $user, get_user_meta( $user->ID, 'user_email', true ) );
202
- delete_user_meta( $user->ID, 'mo_2fa_verify_otp_create_account' );
203
- } else { // OTP Validation failed.
204
- update_option( 'mo2f_message', Mo2fConstants::langTranslate( "INVALID_OTP" ) );
205
- $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_OTP_DELIVERED_FAILURE' ) );
206
- $this->mo_auth_show_error_message();
207
- }
208
- }
209
-
210
- } else {
211
- update_option( 'mo2f_message', Mo2fConstants::langTranslate( "EMAIL_IN_USE" ) );
212
- $this->mo_auth_show_error_message();
213
- }
214
- }
215
- }
216
-
217
- }
218
-
219
- private function mo_auth_show_error_message() {
220
- remove_action( 'admin_notices', array( $this, 'mo_auth_error_message' ) );
221
- add_action( 'admin_notices', array( $this, 'mo_auth_success_message' ) );
222
- }
223
-
224
- function mo2f_create_user( $user, $email ) { //creating user in miniOrange of wordpress non-admin
225
- global $Mo2fdbQueries;
226
- $email = strtolower( $email );
227
- $enduser = new Two_Factor_Setup();
228
- $check_user = json_decode( $enduser->mo_check_user_already_exist( $email ), true );
229
- if ( json_last_error() == JSON_ERROR_NONE ) {
230
- if ( $check_user['status'] == 'ERROR' ) {
231
- update_option( 'mo2f_message', Mo2fConstants::langTranslate( $check_user['message'] ) );
232
- $this->mo_auth_show_error_message();
233
- } else {
234
- if ( strcasecmp( $check_user['status'], 'USER_FOUND' ) == 0 ) {
235
- delete_user_meta( $user->ID, 'user_email' );
236
-
237
- $Mo2fdbQueries->update_user_details( $user->ID, array(
238
- 'user_registration_with_miniorange' => 'SUCCESS',
239
- 'mo2f_user_email' => $email,
240
- 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_INITIALIZE_TWO_FACTOR',
241
- ) );
242
- $enduser->mo2f_update_userinfo( $email, 'OUT OF BAND EMAIL', null, null, null );
243
- $message = Mo2fConstants::langTranslate( "REGISTRATION_SUCCESS" ) . ' <a href=\"admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=mobile_configure\" >' . Mo2fConstants::langTranslate( "CLICK_HERE" ) . '</a> ' . Mo2fConstants::langTranslate( "CONFIGURE_2FA" );
244
- update_option( 'mo2f_message', $message );
245
- $this->mo_auth_show_success_message();
246
- header( 'Location: admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mobile_configure' );
247
-
248
- } else if ( strcasecmp( $check_user['status'], 'USER_NOT_FOUND' ) == 0 ) {
249
- $content = json_decode( $enduser->mo_create_user( $user, $email ), true );
250
- if ( json_last_error() == JSON_ERROR_NONE ) {
251
- if ( $content['status'] == 'ERROR' ) {
252
- update_option( 'mo2f_message', Mo2fConstants::langTranslate( $content['message'] ) );
253
- } else {
254
- if ( strcasecmp( $content['status'], 'SUCCESS' ) == 0 ) {
255
- delete_user_meta( $user->ID, 'user_email' );
256
- $Mo2fdbQueries->update_user_details( $user->ID, array(
257
- 'user_registration_with_miniorange' => 'SUCCESS',
258
- 'mo2f_user_email' => $email,
259
- 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_INITIALIZE_TWO_FACTOR',
260
- ) );
261
- $enduser->mo2f_update_userinfo( $email, 'OUT OF BAND EMAIL', null, null, null );
262
- $message = Mo2fConstants::langTranslate( "REGISTRATION_SUCCESS" ) . ' <a href=\"admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=mobile_configure\" > ' . Mo2fConstants::langTranslate( "CLICK_HERE" ) . '</a> ' . Mo2fConstants::langTranslate( "CONFIGURE_2FA" );
263
- update_option( 'mo2f_message', $message );
264
- $this->mo_auth_show_success_message();
265
- header( 'Location: admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mobile_configure' );
266
-
267
- } else {
268
- update_option( 'mo2f_message', Mo2fConstants::langTranslate( "ERROR_DURING_USER_REGISTRATION" ) );
269
- $this->mo_auth_show_error_message();
270
- }
271
- }
272
- } else {
273
- update_option( 'mo2f_message', Mo2fConstants::langTranslate( "ERROR_DURING_USER_REGISTRATION_ADMIN" ) );
274
- $this->mo_auth_show_error_message();
275
- }
276
- } else {
277
- update_option( 'mo2f_message', Mo2fConstants::langTranslate( "ERROR_DURING_USER_REGISTRATION" ) );
278
- $this->mo_auth_show_error_message();
279
- }
280
- }
281
- } else {
282
- update_option( 'mo2f_message', Mo2fConstants::langTranslate( "ERROR_DURING_USER_REGISTRATION" ) );
283
- $this->mo_auth_show_error_message();
284
- }
285
- }
286
-
287
- private function mo_auth_show_success_message() {
288
- remove_action( 'admin_notices', array( $this, 'mo_auth_success_message' ) );
289
- add_action( 'admin_notices', array( $this, 'mo_auth_error_message' ) );
290
- }
291
-
292
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
class-utility.php CHANGED
@@ -305,7 +305,7 @@ class MO2f_Utility {
305
  $cookievalue_encrypted = MO2f_Utility::encrypt_data( $cookievalue, $key );
306
  // setcookie( $cookiename, base64_encode( $cookievalue_encrypted ) );
307
  setcookie( $cookiename, base64_encode( $cookievalue_encrypted ),NULL,NULL,NULL,NULL, TRUE );
308
-
309
  }
310
 
311
  /**
305
  $cookievalue_encrypted = MO2f_Utility::encrypt_data( $cookievalue, $key );
306
  // setcookie( $cookiename, base64_encode( $cookievalue_encrypted ) );
307
  setcookie( $cookiename, base64_encode( $cookievalue_encrypted ),NULL,NULL,NULL,NULL, TRUE );
308
+ $_COOKIE[$cookiename] = base64_encode( $cookievalue_encrypted );
309
  }
310
 
311
  /**
database/database_functions.php CHANGED
@@ -17,12 +17,12 @@ class Mo2fDB {
17
 
18
  global $wpdb;
19
  if ( ! get_option( 'mo2f_dbversion' ) ) {
20
- update_option( 'mo2f_dbversion', 141 );
21
  $this->generate_tables();
22
  } else {
23
  $current_db_version = get_option( 'mo2f_dbversion' );
24
- if ( $current_db_version < 141 ) {
25
- update_option( 'mo2f_dbversion', 141 );
26
  $this->generate_tables();
27
  }
28
  //update the tables based on DB_VERSION.
@@ -62,25 +62,25 @@ class Mo2fDB {
62
 
63
  if($wpdb->get_var("show tables like '$tableName'") != $tableName) {
64
 
65
- $sql = "CREATE TABLE IF NOT EXISTS " . $tableName . " (
66
- `session_id` MEDIUMTEXT NOT NULL,
67
- `mo2f_login_message` VARCHAR(500) NOT NULL ,
68
- `mo2f_current_user_id` INT(50) NOT NULL ,
69
- `mo2f_1stfactor_status` VARCHAR(100) NOT NULL ,
70
- `mo_2factor_login_status` VARCHAR(100) NOT NULL ,
71
- `mo2f_transactionId` VARCHAR(100) NOT NULL ,
72
- `mo_2_factor_kba_questions` LONGTEXT NOT NULL ,
73
- `mo2f_rba_status` LONGTEXT NOT NULL ,
74
  `ts_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
75
- PRIMARY KEY (`session_id`(500)));";
76
-
77
  dbDelta( $sql );
78
  }
79
 
80
  $check_if_column_exists = $this->check_if_column_exists( "user_login_info_table", "mo_2factor_login_status" );
81
 
82
  if ( ! $check_if_column_exists ) {
83
- $query = "ALTER TABLE `$tableName` ADD COLUMN `mo_2factor_login_status` VARCHAR(100) NOT NULL";
84
  $this->execute_add_column( $query );
85
 
86
  }
@@ -91,28 +91,27 @@ class Mo2fDB {
91
 
92
  global $wpdb;
93
  $tableName = $this->userLoginInfoTable;
94
-
95
  if($wpdb->get_var("show tables like '$tableName'") != $tableName) {
96
 
97
  $sql = "CREATE TABLE IF NOT EXISTS " . $tableName . " (
98
- `session_id` MEDIUMTEXT NOT NULL,
99
- `mo2f_login_message` VARCHAR(500) NOT NULL ,
100
- `mo2f_current_user_id` INT(50) NOT NULL ,
101
- `mo2f_1stfactor_status` VARCHAR(100) NOT NULL ,
102
- `mo_2factor_login_status` VARCHAR(100) NOT NULL ,
103
- `mo2f_transactionId` VARCHAR(100) NOT NULL ,
104
- `mo_2_factor_kba_questions` LONGTEXT NOT NULL ,
105
- `mo2f_rba_status` LONGTEXT NOT NULL ,
106
  `ts_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
107
- PRIMARY KEY (`session_id`(500)));";
108
-
109
- dbDelta( $sql );
110
  }
111
-
112
- $check_if_column_exists = $this->check_if_column_exists( "user_login_info_table", "mo_2factor_login_status" );
113
 
114
  if ( ! $check_if_column_exists ) {
115
- $query = "ALTER TABLE `$tableName` ADD COLUMN `mo_2factor_login_status` VARCHAR(100) NOT NULL";
116
  $this->execute_add_column( $query );
117
 
118
  }
17
 
18
  global $wpdb;
19
  if ( ! get_option( 'mo2f_dbversion' ) ) {
20
+ update_option( 'mo2f_dbversion', 143 );
21
  $this->generate_tables();
22
  } else {
23
  $current_db_version = get_option( 'mo2f_dbversion' );
24
+ if ( $current_db_version < 143 ) {
25
+ update_option( 'mo2f_dbversion', 143 );
26
  $this->generate_tables();
27
  }
28
  //update the tables based on DB_VERSION.
62
 
63
  if($wpdb->get_var("show tables like '$tableName'") != $tableName) {
64
 
65
+ $sql = "CREATE TABLE IF NOT EXISTS " . $tableName . " (
66
+ `session_id` mediumtext NOT NULL,
67
+ `mo2f_login_message` mediumtext NOT NULL ,
68
+ `mo2f_current_user_id` tinyint NOT NULL ,
69
+ `mo2f_1stfactor_status` mediumtext NOT NULL ,
70
+ `mo_2factor_login_status` mediumtext NOT NULL ,
71
+ `mo2f_transactionId` mediumtext NOT NULL ,
72
+ `mo_2_factor_kba_questions` longtext NOT NULL ,
73
+ `mo2f_rba_status` longtext NOT NULL ,
74
  `ts_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
75
+ PRIMARY KEY (`session_id`(100)));";
76
+
77
  dbDelta( $sql );
78
  }
79
 
80
  $check_if_column_exists = $this->check_if_column_exists( "user_login_info_table", "mo_2factor_login_status" );
81
 
82
  if ( ! $check_if_column_exists ) {
83
+ $query = "ALTER TABLE `$tableName` ADD COLUMN `mo_2factor_login_status` mediumtext NOT NULL";
84
  $this->execute_add_column( $query );
85
 
86
  }
91
 
92
  global $wpdb;
93
  $tableName = $this->userLoginInfoTable;
94
+
95
  if($wpdb->get_var("show tables like '$tableName'") != $tableName) {
96
 
97
  $sql = "CREATE TABLE IF NOT EXISTS " . $tableName . " (
98
+ `session_id` mediumtext NOT NULL,
99
+ `mo2f_login_message` mediumtext NOT NULL ,
100
+ `mo2f_current_user_id` tinyint NOT NULL ,
101
+ `mo2f_1stfactor_status` mediumtext NOT NULL ,
102
+ `mo_2factor_login_status` mediumtext NOT NULL ,
103
+ `mo2f_transactionId` mediumtext NOT NULL ,
104
+ `mo_2_factor_kba_questions` longtext NOT NULL ,
105
+ `mo2f_rba_status` longtext NOT NULL ,
106
  `ts_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
107
+ PRIMARY KEY (`session_id`(100)));";
108
+ dbDelta( $sql );
 
109
  }
110
+
111
+ $check_if_column_exists = $this->check_if_column_exists( "user_login_info_table", "mo_2factor_login_status" );
112
 
113
  if ( ! $check_if_column_exists ) {
114
+ $query = "ALTER TABLE `$tableName` ADD COLUMN `mo_2factor_login_status` mediumtext NOT NULL";
115
  $this->execute_add_column( $query );
116
 
117
  }
includes/css/style_settings.css CHANGED
@@ -308,8 +308,8 @@ a {
308
  .mo2f_setup_2factor_tab {
309
  align-content: center;
310
  width: 98%;
311
- padding: 20px;
312
  min-height: 400px;
 
313
  }
314
 
315
  .mo2f_2factor_heading_images {
308
  .mo2f_setup_2factor_tab {
309
  align-content: center;
310
  width: 98%;
 
311
  min-height: 400px;
312
+ padding:5px;
313
  }
314
 
315
  .mo2f_2factor_heading_images {
includes/guides/Guide for Premium Plugin.pdf ADDED
Binary file
includes/guides/Guide for Standard plugin.pdf ADDED
Binary file
miniorange_2_factor_common_login.php CHANGED
@@ -45,20 +45,6 @@ function miniorange_get_user_role( $user ) {
45
  return $user->roles;
46
  }
47
 
48
- function miniorange_check_if_2fa_enabled_for_roles( $current_roles ) {
49
- if ( empty( $current_roles ) ) {
50
- return 0;
51
- }
52
-
53
- foreach ( $current_roles as $value ) {
54
- if ( get_option( 'mo2fa_' . $value ) ) {
55
- return 1;
56
- }
57
- }
58
-
59
- return 0;
60
- }
61
-
62
  function redirect_user_to( $user, $redirect_to ) {
63
  $roles = $user->roles;
64
  $current_role = array_shift( $roles );
@@ -72,6 +58,21 @@ function redirect_user_to( $user, $redirect_to ) {
72
  }
73
  }
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
  function mo2f_register_profile( $email, $deviceKey, $mo2f_rba_status ) {
77
 
@@ -317,7 +318,12 @@ function mo2f_get_kba_authentication_prompt( $login_message, $redirect_to, $sess
317
  </form>
318
  <br>
319
  </div>
320
- <?php mo2f_customize_logo() ?>
 
 
 
 
 
321
  </div>
322
  </div>
323
  </div>
@@ -407,6 +413,11 @@ function mo2f_get_push_notification_oobemail_prompt( $id, $login_status, $login_
407
  </center>
408
  <?php } ?>
409
  </span>
 
 
 
 
 
410
  </div>
411
 
412
  <?php mo2f_customize_logo() ?>
@@ -551,6 +562,9 @@ function mo2f_get_qrcode_authentication_prompt( $login_status, $login_message, $
551
  value="<?php echo mo2f_lt( 'Phone is Offline?' ); ?>"/>
552
  </center>
553
  </span>
 
 
 
554
  </div>
555
  <?php mo2f_customize_logo() ?>
556
  </div>
@@ -689,16 +703,16 @@ function mo2f_get_otp_authentication_prompt( $login_status, $login_message, $red
689
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
690
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
691
  </form>
692
- <br>
693
  <?php if ( ! $mo2f_is_new_customer ) { ?>
694
  <?php if ( $mo2f_enable_forgotphone && isset( $login_status ) && $login_status != 'MO_2_FACTOR_CHALLENGE_OTP_OVER_EMAIL' ) { ?>
695
  <a name="miniorange_login_forgotphone" onclick="mologinforgotphone();"
696
  id="miniorange_login_forgotphone"
697
  class="mo2f-link"><?php echo mo2f_lt( 'Forgot Phone ?' ); ?></a>
698
  <?php } ?>
699
-
700
- <br><br>
701
  <?php } ?>
 
 
 
702
  </div>
703
  </div>
704
  </center>
@@ -838,10 +852,10 @@ function mo2f_customize_logo() { ?>
838
  function echo_js_css_files() {
839
  echo '<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>';
840
  echo '<script src="' . plugins_url( 'includes/js/bootstrap.min.js', __FILE__ ) . '" ></script>';
841
- echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/bootstrap.min.css?version=5.1.11', __FILE__ ) . '" />';
842
- echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/front_end_login.css?version=5.1.11', __FILE__ ) . '" />';
843
- echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/style_settings.css?version=5.1.11', __FILE__ ) . '" />';
844
- echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/hide-login.css?version=5.1.11', __FILE__ ) . '" />';
845
 
846
  if ( get_option( 'mo2f_personalization_ui' ) ) {
847
  echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/mo2f_login_popup_ui.css', __FILE__ ) . '" />';
45
  return $user->roles;
46
  }
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  function redirect_user_to( $user, $redirect_to ) {
49
  $roles = $user->roles;
50
  $current_role = array_shift( $roles );
58
  }
59
  }
60
 
61
+ // used in shortcode addon
62
+
63
+ function miniorange_check_if_2fa_enabled_for_roles( $current_roles ) {
64
+ if ( empty( $current_roles ) ) {
65
+ return 0;
66
+ }
67
+
68
+ foreach ( $current_roles as $value ) {
69
+ if ( get_option( 'mo2fa_' . $value ) ) {
70
+ return 1;
71
+ }
72
+ }
73
+
74
+ return 0;
75
+ }
76
 
77
  function mo2f_register_profile( $email, $deviceKey, $mo2f_rba_status ) {
78
 
318
  </form>
319
  <br>
320
  </div>
321
+ <div style="padding:10px;">
322
+ <p><a href="https://faq.miniorange.com/knowledgebase/gain-access-to-website-if-locked-out/" target="_blank" style="color:#ca2963;font-weight:bold;">I'm locked out & unable to login.</a></p>
323
+ </div>
324
+
325
+ <?php mo2f_customize_logo() ?>
326
+
327
  </div>
328
  </div>
329
  </div>
413
  </center>
414
  <?php } ?>
415
  </span>
416
+ <center>
417
+ <div style="padding:10px;">
418
+ <p><a href="https://faq.miniorange.com/knowledgebase/gain-access-to-website-if-locked-out/" target="_blank" style="color:#ca2963;font-weight:bold;">I'm locked out & unable to login.</a></p>
419
+ </div>
420
+ </center>
421
  </div>
422
 
423
  <?php mo2f_customize_logo() ?>
562
  value="<?php echo mo2f_lt( 'Phone is Offline?' ); ?>"/>
563
  </center>
564
  </span>
565
+ <div style="padding:10px;">
566
+ <p><a href="https://faq.miniorange.com/knowledgebase/gain-access-to-website-if-locked-out/" target="_blank" style="color:#ca2963;font-weight:bold;">I'm locked out & unable to login.</a></p>
567
+ </div>
568
  </div>
569
  <?php mo2f_customize_logo() ?>
570
  </div>
703
  <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>"/>
704
  <input type="hidden" name="session_id" value="<?php echo $session_id_encrypt; ?>"/>
705
  </form>
 
706
  <?php if ( ! $mo2f_is_new_customer ) { ?>
707
  <?php if ( $mo2f_enable_forgotphone && isset( $login_status ) && $login_status != 'MO_2_FACTOR_CHALLENGE_OTP_OVER_EMAIL' ) { ?>
708
  <a name="miniorange_login_forgotphone" onclick="mologinforgotphone();"
709
  id="miniorange_login_forgotphone"
710
  class="mo2f-link"><?php echo mo2f_lt( 'Forgot Phone ?' ); ?></a>
711
  <?php } ?>
 
 
712
  <?php } ?>
713
+ <div style="padding:10px;">
714
+ <p><a href="https://faq.miniorange.com/knowledgebase/gain-access-to-website-if-locked-out/" target="_blank" style="color:#ca2963;font-weight:bold;">I'm locked out & unable to login.</a></p>
715
+ </div>
716
  </div>
717
  </div>
718
  </center>
852
  function echo_js_css_files() {
853
  echo '<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>';
854
  echo '<script src="' . plugins_url( 'includes/js/bootstrap.min.js', __FILE__ ) . '" ></script>';
855
+ echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/bootstrap.min.css?version=5.1.14', __FILE__ ) . '" />';
856
+ echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/front_end_login.css?version=5.1.14', __FILE__ ) . '" />';
857
+ echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/style_settings.css?version=5.1.14', __FILE__ ) . '" />';
858
+ echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/hide-login.css?version=5.1.14', __FILE__ ) . '" />';
859
 
860
  if ( get_option( 'mo2f_personalization_ui' ) ) {
861
  echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/mo2f_login_popup_ui.css', __FILE__ ) . '" />';
miniorange_2_factor_configuration.php CHANGED
@@ -40,14 +40,12 @@ function mo_2_factor_register( $user ) {
40
  class="add-new-h2" <?php echo $mo2f_active_tab == '2factor_setup' ? 'nav-tab-active' : ''; ?>
41
  id="mo2f_tab1" >
42
  <?php echo $account_tab_name; ?></a>
43
- <a id="mo2f_faq" class="add-new-h2" href="https://faq.miniorange.com/kb/two-factor-authentication"
44
- target="_blank"><?php echo mo2f_lt( 'FAQ' ); ?></a>
45
- <a id="mo2f_faq" class="add-new-h2" href="https://wordpress.org/support/plugin/miniorange-2-factor-authentication"
46
- target="_blank"><?php echo mo2f_lt( 'WordPress Forum' ); ?></a>
47
  <?php if ( $can_display_admin_features ) { ?>
48
  <a id="mo2f_upgrade" class="twofa-license add-new-h2" id="mo2f_tab6"
49
  href="admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=mo2f_pricing"
50
- ><?php echo mo2f_lt( 'Upgrade to Standard/Premium' ); ?></a>
51
 
52
  <?php } ?>
53
 
@@ -62,16 +60,15 @@ function mo_2_factor_register( $user ) {
62
  class="nav-tab <?php echo $mo2f_active_tab == 'mobile_configure' ? 'nav-tab-active' : ''; ?>"
63
  id="mo2f_tab3"><?php echo mo2f_lt( 'Setup Two-Factor' ); ?></a>
64
  <?php if ( $can_display_admin_features ) { ?>
 
 
 
65
  <?php if ( get_option( 'mo2f_is_NC' ) ) { ?><a
66
  href="admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=mo2f_addon&amp;mo2f_sub_tab=mo2f_sub_tab_rba"
67
  class="nav-tab <?php echo $mo2f_active_tab == 'mo2f_addon' ? 'nav-tab-active' : ''; ?>"
68
- id="mo2f_tab4"><?php echo mo2f_lt( 'Add-ons' ); ?></a><?php } ?>
69
- <a href="admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=proxy_setup"
70
- class="nav-tab <?php echo $mo2f_active_tab == 'proxy_setup' ? 'nav-tab-active' : ''; ?>"
71
- id="mo2f_tab5"><?php echo mo2f_lt( 'Proxy Setup' ); ?></a>
72
- <a href="admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=mo2f_login"
73
- class="nav-tab <?php echo $mo2f_active_tab == 'mo2f_login' ? 'nav-tab-active' : ''; ?>"
74
- id="mo2f_tab2"><?php echo get_option( 'mo2f_is_NC' ) ? mo2f_lt( 'Standard/Premium Features' ) : mo2f_lt( 'Login Options' ); ?></a>
75
  <a href="admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=mo2f_support"
76
  class="nav-tab <?php echo $mo2f_active_tab == 'mo2f_support' ? 'nav-tab-active' : ''; ?>"
77
  id="mo2f_tab7"><?php echo mo2f_lt( 'Support' ) ; ?></a>
@@ -180,17 +177,17 @@ function mo2f_show_registration_page( $user ) {
180
  <!--Register with miniOrange-->
181
  <form name="f" method="post" action="">
182
  <input type="hidden" name="option" value="mo_auth_register_customer"/>
183
- <input type="hidden" name="miniorange_register_customer_nonce"
184
- value="<?php echo wp_create_nonce( "miniorange-register-customer-nonce" ) ?>"/>
185
  <div <?php if($is_registration) { ?>class="mo2f_proxy_setup" <?php } ?>>
186
- <?php if($is_registration) { ?>
187
  <h3><span><?php echo mo2f_lt( 'Register with miniOrange' ); ?></span></h3><hr>
188
- <?php } ?>
189
  <div id="panel1">
190
  <br>
191
- <div><?php echo mo2f_lt( 'Already have an account?' ) . '&nbsp;&nbsp;<a style="font-weight:bold; color:limegreen" href="#mo2f_account_exist">' . mo2f_lt( 'SIGN IN' ) ?></a></div>
192
  <br>
193
- <table class="mo2f_settings_table" style="border-collapse: separate; border-spacing: 0 1em;">
194
  <tr>
195
 
196
  <td style="width:30%"><b><span class="impt">*</span><?php echo mo2f_lt( 'Email :' ); ?></b></td>
@@ -203,15 +200,15 @@ function mo2f_show_registration_page( $user ) {
203
  </tr>
204
  <tr>
205
  <td ><b><span class="impt">*</span><?php echo mo2f_lt( 'Password :' ); ?></b></td>
206
- <td rowspan="2"><input class="mo2f_table_textbox" type="password" required name="password" pattern="^[(\w)*(!@#$.%^&*-_)*]+$" title="Minimum 6 characters should be present. Maximum 15 characters should be present. Only following symbols (!@#.$%^&*) should be present."/><label style="font-size:11px;color:red;">(Minimum 6 and Maximum 15 characters should be present. Only following symbols ()!@#.$%^&* are allowed.)</label><br></td>
207
-
208
  </tr>
209
  <tr ><td></td><td></td></tr>
210
- <tr>
211
  <td><b><span class="impt">*</span><?php echo mo2f_lt( 'Confirm Password :' ); ?></b></td>
212
- <td><input class="mo2f_table_textbox" type="password" required name="confirmPassword" pattern="^[(\w)*(!@#$.%^&*-_)*]+$" title="Minimum 6 characters should be present. Maximum 15 characters should be present. Only following symbols (!@#.$%^&*) should be present." /></td>
213
  </tr>
214
- <tr>
215
  <td>&nbsp;</td>
216
  <td><input type="submit" name="submit" style="float:right;"
217
  value="<?php echo mo2f_lt( 'Continue' ); ?>"
@@ -220,13 +217,13 @@ function mo2f_show_registration_page( $user ) {
220
  </table>
221
  <br>
222
 
223
- </div>
224
  </div>
225
  </form>
226
  <form name="f" method="post" action="" id="mo2f_verify_customerform">
227
  <input type="hidden" name="option" value="mo2f_goto_verifycustomer">
228
- <input type="hidden" name="mo2f_goto_verifycustomer_nonce"
229
- value="<?php echo wp_create_nonce( "mo2f-goto-verifycustomer-nonce" ) ?>"/>
230
  </form>
231
 
232
  <script>
@@ -237,6 +234,7 @@ function mo2f_show_registration_page( $user ) {
237
  <?php
238
  }
239
 
 
240
  function mo2f_show_otp_validation_page( $user ) {
241
  global $Mo2fdbQueries;
242
  $phone = $Mo2fdbQueries->get_user_detail( 'mo2f_user_phone', $user->ID );
@@ -901,70 +899,6 @@ function show_2_factor_login_settings( $user ) {
901
  <?php
902
  }
903
 
904
- function mo2f_show_verify_password_page() {
905
- $mo2f_active_tab = isset( $_GET['mo2f_tab'] ) ? $_GET['mo2f_tab'] : '';
906
- $is_registration = ($mo2f_active_tab =='2factor_setup') ? true : false;
907
- ?>
908
- <!--Verify password with miniOrange-->
909
- <form name="f" method="post" action="">
910
- <input type="hidden" name="option" value="mo_auth_verify_customer"/>
911
- <input type="hidden" name="miniorange_verify_customer_nonce"
912
- value="<?php echo wp_create_nonce( "miniorange-verify-customer-nonce" ) ?>"/>
913
-
914
- <div <?php if($is_registration) { ?>class="mo2f_proxy_setup" <?php } ?>>
915
- <?php if($is_registration) { ?>
916
- <h2><?php echo mo2f_lt( 'Sign In to your miniOrange Account' ); ?></h2><hr>
917
- <?php } ?>
918
- <div id="panel1">
919
- <p><a style="float:right;font-weight:bold; color:orange" target="_blank"
920
- href="https://auth.miniorange.com/moas/idp/resetpassword"><?php echo mo2f_lt( 'FORGOT PASSWORD?' ); ?></a>
921
- </p>
922
- <br>
923
- <table class="mo2f_settings_table">
924
- <tr>
925
- <td><b><font color="#FF0000">*</font><?php echo mo2f_lt( 'Email:' ); ?></b></td>
926
- <td><input class="mo2f_table_textbox" type="email" name="email" id="email" required
927
- value="<?php echo get_option( 'mo2f_email' ); ?>"/></td>
928
- </tr>
929
- <tr>
930
- <td><b><font color="#FF0000">*</font><?php echo mo2f_lt( 'Password:' ); ?></b></td>
931
- <td><input class="mo2f_table_textbox" type="password" name="password" required/></td>
932
- </tr>
933
-
934
- <tr>
935
- <td colspan="2">&nbsp;</td>
936
- </tr>
937
-
938
- <tr>
939
- <td>&nbsp;</td>
940
- <td>
941
- <input type="button" name="mo2f_goback" id="mo2f_go_back"
942
- value="<?php echo mo2f_lt( 'Back' ); ?>" class="button button-primary button-large"/>
943
-
944
- <input type="submit" name="submit" value="<?php echo mo2f_lt( 'Submit' ); ?>"
945
- class="button button-primary button-large"/></td>
946
-
947
- </tr>
948
-
949
- </table>
950
-
951
- </div>
952
- <br><br>
953
- </div>
954
- </form>
955
- <form name="f" method="post" action="" id="gobackform">
956
- <input type="hidden" name="option" value="mo_2factor_gobackto_registration_page"/>
957
- <input type="hidden" name="mo_2factor_gobackto_registration_page_nonce"
958
- value="<?php echo wp_create_nonce( "mo-2factor-gobackto-registration-page-nonce" ) ?>"/>
959
- </form>
960
- <script>
961
- jQuery('#mo2f_go_back').click(function () {
962
- jQuery('#gobackform').submit();
963
- });
964
-
965
- </script>
966
- <?php }
967
-
968
  function get_standard_premium_options( $user ) {
969
  $is_NC = get_option( 'mo2f_is_NC' );
970
 
@@ -1249,4 +1183,67 @@ function get_standard_premium_options( $user ) {
1249
  <?php
1250
  }
1251
 
1252
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  class="add-new-h2" <?php echo $mo2f_active_tab == '2factor_setup' ? 'nav-tab-active' : ''; ?>
41
  id="mo2f_tab1" >
42
  <?php echo $account_tab_name; ?></a>
43
+ <a id="mo2f_faq" class="add-new-h2" href="https://wordpress.org/support/plugin/miniorange-2-factor-authentication"
44
+ target="_blank" ><?php echo mo2f_lt( 'WP Forum' ); ?></a>
 
 
45
  <?php if ( $can_display_admin_features ) { ?>
46
  <a id="mo2f_upgrade" class="twofa-license add-new-h2" id="mo2f_tab6"
47
  href="admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=mo2f_pricing"
48
+ ><?php echo mo2f_lt( 'Upgrade to Standard/Premium Plans' ); ?></a>
49
 
50
  <?php } ?>
51
 
60
  class="nav-tab <?php echo $mo2f_active_tab == 'mobile_configure' ? 'nav-tab-active' : ''; ?>"
61
  id="mo2f_tab3"><?php echo mo2f_lt( 'Setup Two-Factor' ); ?></a>
62
  <?php if ( $can_display_admin_features ) { ?>
63
+ <a href="admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=mo2f_login"
64
+ class="nav-tab <?php echo $mo2f_active_tab == 'mo2f_login' ? 'nav-tab-active' : ''; ?>"
65
+ id="mo2f_tab2"><?php echo get_option( 'mo2f_is_NC' ) ? mo2f_lt( 'Standard/Premium Features' ) : mo2f_lt( 'Login Options' ); ?></a>
66
  <?php if ( get_option( 'mo2f_is_NC' ) ) { ?><a
67
  href="admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=mo2f_addon&amp;mo2f_sub_tab=mo2f_sub_tab_rba"
68
  class="nav-tab <?php echo $mo2f_active_tab == 'mo2f_addon' ? 'nav-tab-active' : ''; ?>"
69
+ id="mo2f_tab4"><?php echo mo2f_lt( 'Add-ons' ); ?></a>
70
+ <?php } ?>
71
+
 
 
 
 
72
  <a href="admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=mo2f_support"
73
  class="nav-tab <?php echo $mo2f_active_tab == 'mo2f_support' ? 'nav-tab-active' : ''; ?>"
74
  id="mo2f_tab7"><?php echo mo2f_lt( 'Support' ) ; ?></a>
177
  <!--Register with miniOrange-->
178
  <form name="f" method="post" action="">
179
  <input type="hidden" name="option" value="mo_auth_register_customer"/>
180
+ <input type="hidden" name="miniorange_register_customer_nonce"
181
+ value="<?php echo wp_create_nonce( "miniorange-register-customer-nonce" ) ?>"/>
182
  <div <?php if($is_registration) { ?>class="mo2f_proxy_setup" <?php } ?>>
183
+ <?php if($is_registration) { ?>
184
  <h3><span><?php echo mo2f_lt( 'Register with miniOrange' ); ?></span></h3><hr>
185
+ <?php } ?>
186
  <div id="panel1">
187
  <br>
188
+ <div><?php echo mo2f_lt( 'Already have an account?' ) . '&nbsp;&nbsp;<a style="font-weight:bold; color:limegreen" href="#mo2f_account_exist">' . mo2f_lt( 'SIGN IN' ) ?></a></div>
189
  <br>
190
+ <table class="mo2f_settings_table" style="border-collapse: separate; border-spacing: 0 1em;">
191
  <tr>
192
 
193
  <td style="width:30%"><b><span class="impt">*</span><?php echo mo2f_lt( 'Email :' ); ?></b></td>
200
  </tr>
201
  <tr>
202
  <td ><b><span class="impt">*</span><?php echo mo2f_lt( 'Password :' ); ?></b></td>
203
+ <td rowspan="2"><input class="mo2f_table_textbox" type="password" required name="password" pattern="^[(\w)*(!@#$.%^&*-_)*]+$" title="Password length between 6 - 15 characters. Only following symbols (!@#.$%^&*) should be present."/><label style="font-size:11px;color:red;">(Minimum 6 and Maximum 15 characters should be present. Only following symbols ()!@#.$%^&* are allowed.)</label><br></td>
204
+
205
  </tr>
206
  <tr ><td></td><td></td></tr>
207
+ <tr>
208
  <td><b><span class="impt">*</span><?php echo mo2f_lt( 'Confirm Password :' ); ?></b></td>
209
+ <td><input class="mo2f_table_textbox" type="password" required name="confirmPassword" pattern="^[(\w)*(!@#$.%^&*-_)*]+$" title="Password length between 6 - 15 characters. Only following symbols (!@#.$%^&*) should be present." /></td>
210
  </tr>
211
+ <tr>
212
  <td>&nbsp;</td>
213
  <td><input type="submit" name="submit" style="float:right;"
214
  value="<?php echo mo2f_lt( 'Continue' ); ?>"
217
  </table>
218
  <br>
219
 
220
+ </div>
221
  </div>
222
  </form>
223
  <form name="f" method="post" action="" id="mo2f_verify_customerform">
224
  <input type="hidden" name="option" value="mo2f_goto_verifycustomer">
225
+ <input type="hidden" name="mo2f_goto_verifycustomer_nonce"
226
+ value="<?php echo wp_create_nonce( "mo2f-goto-verifycustomer-nonce" ) ?>"/>
227
  </form>
228
 
229
  <script>
234
  <?php
235
  }
236
 
237
+
238
  function mo2f_show_otp_validation_page( $user ) {
239
  global $Mo2fdbQueries;
240
  $phone = $Mo2fdbQueries->get_user_detail( 'mo2f_user_phone', $user->ID );
899
  <?php
900
  }
901
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
902
  function get_standard_premium_options( $user ) {
903
  $is_NC = get_option( 'mo2f_is_NC' );
904
 
1183
  <?php
1184
  }
1185
 
1186
+ function mo2f_show_verify_password_page() {
1187
+ $mo2f_active_tab = isset( $_GET['mo2f_tab'] ) ? $_GET['mo2f_tab'] : '';
1188
+ $is_registration = ($mo2f_active_tab =='2factor_setup') ? true : false;
1189
+ ?>
1190
+ <!--Verify password with miniOrange-->
1191
+ <form name="f" method="post" action="">
1192
+ <input type="hidden" name="option" value="mo_auth_verify_customer"/>
1193
+ <input type="hidden" name="miniorange_verify_customer_nonce"
1194
+ value="<?php echo wp_create_nonce( "miniorange-verify-customer-nonce" ) ?>"/>
1195
+
1196
+ <div <?php if($is_registration) { ?>class="mo2f_proxy_setup" <?php } ?>>
1197
+ <?php if($is_registration) { ?>
1198
+ <h2><?php echo mo2f_lt( 'Sign In to your miniOrange Account' ); ?></h2><hr>
1199
+ <?php } ?>
1200
+ <div id="panel1">
1201
+ <p><a style="float:right;font-weight:bold; color:orange" target="_blank"
1202
+ href="https://auth.miniorange.com/moas/idp/resetpassword"><?php echo mo2f_lt( 'FORGOT PASSWORD?' ); ?></a>
1203
+ </p>
1204
+ <br>
1205
+ <table class="mo2f_settings_table">
1206
+ <tr>
1207
+ <td><b><font color="#FF0000">*</font><?php echo mo2f_lt( 'Email:' ); ?></b></td>
1208
+ <td><input class="mo2f_table_textbox" type="email" name="email" id="email" required
1209
+ value="<?php echo get_option( 'mo2f_email' ); ?>"/></td>
1210
+ </tr>
1211
+ <tr>
1212
+ <td><b><font color="#FF0000">*</font><?php echo mo2f_lt( 'Password:' ); ?></b></td>
1213
+ <td><input class="mo2f_table_textbox" type="password" name="password" required/></td>
1214
+ </tr>
1215
+
1216
+ <tr>
1217
+ <td colspan="2">&nbsp;</td>
1218
+ </tr>
1219
+
1220
+ <tr>
1221
+ <td>&nbsp;</td>
1222
+ <td>
1223
+ <input type="button" name="mo2f_goback" id="mo2f_go_back"
1224
+ value="<?php echo mo2f_lt( 'Back' ); ?>" class="button button-primary button-large"/>
1225
+
1226
+ <input type="submit" name="submit" value="<?php echo mo2f_lt( 'Submit' ); ?>"
1227
+ class="button button-primary button-large"/></td>
1228
+
1229
+ </tr>
1230
+
1231
+ </table>
1232
+
1233
+ </div>
1234
+ <br><br>
1235
+ </div>
1236
+ </form>
1237
+ <form name="f" method="post" action="" id="gobackform">
1238
+ <input type="hidden" name="option" value="mo_2factor_gobackto_registration_page"/>
1239
+ <input type="hidden" name="mo_2factor_gobackto_registration_page_nonce"
1240
+ value="<?php echo wp_create_nonce( "mo-2factor-gobackto-registration-page-nonce" ) ?>"/>
1241
+ </form>
1242
+ <script>
1243
+ jQuery('#mo2f_go_back').click(function () {
1244
+ jQuery('#gobackform').submit();
1245
+ });
1246
+
1247
+ </script>
1248
+
1249
+ <?php } ?>
miniorange_2_factor_mobile_configuration.php CHANGED
@@ -310,95 +310,10 @@ function mo2f_show_instruction_to_allusers( $user, $mo2f_second_factor ) {
310
 
311
  </table>
312
  <br>
313
- <?php if ( get_option( 'mo2f_is_NC' ) && !get_option( 'mo2f_is_NNC' ) && current_user_can( 'manage_options' ) && get_option( 'mo2f_miniorange_admin' ) == $user->ID ) { ?>
314
- <button type="button" class="button button-primary button-large" style="float:right;" data-toggle="modal"
315
- data-target="#deactivateAccount"><?php echo mo2f_lt( 'Deactivate plugin' ); ?></button>
316
 
317
- <button type="button" class="button button-primary button-large" style="float:left;" data-toggle="modal"
318
- data-target="#deactivateAndRegisterWithAnotherAccount"><?php echo mo2f_lt( 'Register with Another Email Address' ); ?></button>
319
-
320
- <?php } ?>
321
-
322
- </div>
323
- <?php if ( current_user_can( 'manage_options' ) == false ) { ?>
324
- </div><?php } ?>
325
- <br><br>
326
-
327
-
328
- <div id="deactivateAndRegisterWithAnotherAccount" class="mo2f_modal mo2f_modal_inner fade" role="dialog">
329
- <div class="mo2f_modal-dialog">
330
- <div class="login mo_customer_validation-modal-content"
331
- style="width:660px !important;min-height:390px !important;">
332
- <div class="mo2f_modal-header">
333
- <button type="button" class="mo2f_close" data-dismiss="modal">&times;</button>
334
- <h2 class="mo2f_modal-title">Please Note!</h2>
335
- </div>
336
- <div class="mo2f_modal-body">
337
- <p style="font-size:15px;font-weight:bold">If you wish to register into the plugin with an different
338
- email address,
339
- please make a note of the following: </p>
340
- <ol>
341
- <li>All the users of your Wordpress Site who have setup 2-factor will lose their configurations,
342
- and will have to set up 2-factor again after you register with your new email address.
343
- </li>
344
- <li>In miniOrange, all the users under your current account - <b><?php echo $user_email ?></b>
345
- will have to be deleted manually since they will have to register for 2-factor
346
- authentication again under your new account.<br>
347
- You can do this from the <a href="https://auth.miniorange.com" target="_blank">miniOrange
348
- Console</a> >> Users tab by logging in with <b><?php echo $user_email ?></b>.
349
- </li>
350
-
351
- </ol>
352
- </div>
353
- <div class="mo2f_modal-footer">
354
- <form name="f" method="post" action="">
355
- <input type="submit" style="float:right"
356
- value="<?php echo mo2f_lt( 'Continue' ); ?>"
357
- class="button button-primary button-large"/>
358
- <input type="hidden" name="mo_auth_remove_account_nonce"
359
- value="<?php echo wp_create_nonce( "mo-auth-remove-account-nonce" ) ?>"/>
360
- <input type="hidden" name="option" value="mo_auth_remove_account"/>
361
- </form>
362
- </div>
363
- </div>
364
- </div>
365
- </div>
366
-
367
- <div id="deactivateAccount" class="mo2f_modal mo2f_modal_inner fade" role="dialog">
368
- <div class="mo2f_modal-dialog">
369
- <div class="login mo_customer_validation-modal-content"
370
- style="width:660px !important;min-height:350px !important;">
371
- <div class="mo2f_modal-header">
372
- <button type="button" class="mo2f_close" data-dismiss="modal">&times;</button>
373
- <h2 class="mo2f_modal-title">Please Note!</h2>
374
- </div>
375
- <div class="mo2f_modal-body">
376
- <p style="font-size:15px;font-weight:bold">Deactivating the plugin will have the following
377
- impacts: </p>
378
- <ol>
379
- <li>The 2-factor configuration setup of the users of your Wordpress Site will be retained, and
380
- when you activate the plugin again, they will be prompted for 2-factor.
381
- </li>
382
- <li>If you wish to register with a different email address upon reactivation, please contact us
383
- via the support forum at the right.
384
- </li>
385
-
386
- </ol>
387
- </div>
388
- <div class="mo2f_modal-footer">
389
- <form name="f" method="post" action="">
390
- <input type="submit" style="float:right"
391
- value="<?php echo mo2f_lt( 'Continue' ); ?>"
392
- class="button button-primary button-large"/>
393
- <input type="hidden" name="option" value="mo_auth_deactivate_account"/>
394
- <input type="hidden" name="mo_auth_deactivate_account_nonce"
395
- value="<?php echo wp_create_nonce( "mo-auth-deactivate-account-nonce" ) ?>"/>
396
- </form>
397
- </div>
398
- </div>
399
- </div>
400
  </div>
401
-
402
  <?php
403
  }
404
 
@@ -534,21 +449,25 @@ function mo2f_select_2_factor_method( $user, $mo2f_second_factor ) {
534
  ?>
535
  <div class="mo2f_setup_2_factor_tab">
536
 
537
- <p style="float:right;">If you could not complete the setup process, <a style="font-weight:bold; color:limegreen" id="mo2f_support_form" href="admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=mo2f_support">CLICK HERE</a> for help.</p>
 
 
 
 
 
 
 
 
 
538
 
539
  <?php if( $selectedMethod == 'NONE' ) { ?>
540
  <p style="float:left;" ><span style="color:limegreen;font-weight:bold"><?php echo mo2f_lt( 'HOW DO I CONFIGURE 2FA?' ); ?></span>
541
- <br>Just click on <b>Configure</b> of your preferred authentication method below.</p><br>
542
 
543
  <?php } ?>
544
- <br><br><br>
545
- <?php if(get_option( 'mo2f_is_NC' ) && get_option( 'mo2f_is_NNC' )){?>
546
- <button type="button" id="mo2f_restart_tour" class="button button-primary button-large"style="float:right;" onclick="restart_tour();"><i class="fa fa-refresh"></i> Restart Tour</button>
547
- <br><br>
548
- <?php } ?>
549
  <div style="text-align: center;">
550
-
551
- <p style="font-size:20px;color:darkorange;padding:10px;" ><span id="mo2f_selected_method"><?php echo mo2f_lt( 'Selected Method - ' ); ?><?php echo $selectedMethod; ?></span></p>
552
  <button class="button button-primary button-large" id="test"
553
  onclick="testAuthenticationMethod('<?php echo $selectedMethod; ?>');"
554
  <?php echo $is_customer_registered && ( $selectedMethod != 'NONE' ) ? "" : " disabled "; ?>>Test
@@ -556,7 +475,7 @@ function mo2f_select_2_factor_method( $user, $mo2f_second_factor ) {
556
  </button>
557
  </div>
558
  <br>
559
- <?php if ( ! ( get_option( 'mo2f_is_NC' ) && ! get_option( 'mo2f_is_NNC' ) ) ) {
560
  if ( in_array( $selectedMethod, array(
561
  "Google Authenticator",
562
  "miniOrange Soft Token",
@@ -584,7 +503,7 @@ function mo2f_select_2_factor_method( $user, $mo2f_second_factor ) {
584
  <br>
585
  <?php
586
  }
587
- }
588
  $free_plan_existing_user = array(
589
  "Email Verification",
590
  "OTP Over SMS",
@@ -598,11 +517,11 @@ function mo2f_select_2_factor_method( $user, $mo2f_second_factor ) {
598
  );
599
 
600
  $free_plan_new_user = array(
601
- "miniOrange QR Code Authentication",
602
- "miniOrange Soft Token",
603
- "miniOrange Push Notification",
604
  "Google Authenticator",
605
- "Security Questions"
 
 
 
606
  );
607
 
608
  $standard_plan_existing_user = array(
@@ -633,43 +552,6 @@ function mo2f_select_2_factor_method( $user, $mo2f_second_factor ) {
633
  $premium_plan_methods_new_user = array_chunk( array_merge( $standard_plan_new_user, $premium_plan ), 3 );
634
  ?>
635
  <hr>
636
- <?php if ( $is_NC && ! get_option( 'mo2f_is_NNC' ) ) {
637
- if ( $can_display_admin_features ) { ?>
638
- <br>
639
- <div style="float:right;">
640
- <form name="f" method="post" action="" id="mo2f_enable_2FA_for_users_form">
641
- <input type="hidden" name="option" value="mo2f_enable_2FA_for_users_option"/>
642
- <input type="hidden" name="mo2f_enable_2FA_for_users_option_nonce"
643
- value="<?php echo wp_create_nonce( "mo2f-enable-2FA-for-users-option-nonce" ) ?>"/>
644
- <input type="checkbox" id="mo2f_enable_2fa_for_users" name="mo2f_enable_2fa_for_users"
645
- value="1" <?php checked( get_option( 'mo2f_enable_2fa_for_users' ) == 1 );
646
-
647
- if ( $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $user->ID ) != 'MO_2_FACTOR_PLUGIN_SETTINGS' ) {
648
- echo 'disabled';
649
- } ?> onChange="this.form.submit()"/>
650
- <?php echo mo2f_lt( 'Enable 2-factor Authentication for Users' ); ?>
651
- </form>
652
- </div>
653
- <?php } else { ?>
654
- <div style="float:right;">
655
- <form name="f" method="post" action="" id="mo2f_enable_2FA_form">
656
- <input type="hidden" name="option" value="mo2f_enable_2FA_option"/>
657
- <input type="hidden" name="mo2f_enable_2FA_option_nonce"
658
- value="<?php echo wp_create_nonce( "mo2f-enable-2FA-option-nonce" ) ?>"/>
659
- <input type="checkbox" id="mo2f_enable_2fa" name="mo2f_enable_2fa"
660
- value="1" <?php checked( get_option( 'mo2f_enable_2fa' ) == 1 );
661
-
662
- if ( ! in_array( $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $user->ID ), array(
663
- 'MO_2_FACTOR_PLUGIN_SETTINGS',
664
- 'MO_2_FACTOR_INITIALIZE_TWO_FACTOR'
665
- ) ) ) {
666
- echo 'disabled';
667
- } ?> onChange="this.form.submit()"/>
668
- <?php echo mo2f_lt( 'Enable 2-factor Authentication' ); ?>
669
- </form>
670
- </div>
671
- <?php }
672
- } ?>
673
  <div class="mo2f_setup_2factor_tab">
674
 
675
  <div>
@@ -738,9 +620,8 @@ function mo2f_select_2_factor_method( $user, $mo2f_second_factor ) {
738
  </div>
739
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
740
  <script>
741
- <?php if(get_option( 'mo2f_is_NC' ) && get_option( 'mo2f_is_NNC' )){?>
742
- function restart_tour() {
743
 
 
744
  tour.restart();
745
  }
746
 
@@ -779,7 +660,7 @@ function mo2f_select_2_factor_method( $user, $mo2f_second_factor ) {
779
  backdropPadding:'6'
780
  }
781
  , {
782
- element: "#mo2f_support_form",
783
  title: "Need Any Help?",
784
  content: "Click here to reach us anytime you need any help with the plugin.",
785
  backdrop:'body',
@@ -811,8 +692,6 @@ function mo2f_select_2_factor_method( $user, $mo2f_second_factor ) {
811
  // Start the tour
812
  tour.start();
813
 
814
- <?php } ?>
815
-
816
 
817
  function configureOrSet2ndFactor_free_plan(authMethod, action) {
818
  jQuery('#mo2f_configured_2FA_method_free_plan').val(authMethod);
@@ -886,7 +765,7 @@ function mo2f_create_2fa_form( $user, $category, $auth_methods, $can_display_adm
886
  "miniOrange QR Code Authentication" => "Scan the QR code from the account in your miniOrange Authenticator App to login.",
887
  "miniOrange Soft Token" => "Enter the soft token from the account in your miniOrange Authenticator App to login.",
888
  "miniOrange Push Notification" => "Accept a push notification in your miniOrange Authenticator App to login.",
889
- "Google Authenticator" => "Enter the soft token from the account in your Google Authenticator App to login.",
890
  "Security Questions" => "Answer the three security questions you had set, to login.",
891
  "Authy Authenticator" => "Enter the soft token from the account in your Authy Authenticator App to login.",
892
  "Email Verification" => "Accept the verification link sent to your email to login.",
@@ -1043,7 +922,7 @@ function show_2_factor_pricing_page( $user ) {
1043
  );
1044
 
1045
  $two_factor_methods_EC = array_slice( $two_factor_methods, 0, 7 );
1046
- $user_plan = get_option( 'mo2f_is_NC' ) && ! get_option( 'mo2f_is_NNC' ) ? "Unlimited" : "1";
1047
  $mo2f_feature_set_with_plans_NC = array(
1048
  "Authentication Methods" => array(
1049
  array_slice( $two_factor_methods, 0, 5 ),
@@ -1051,7 +930,7 @@ function show_2_factor_pricing_page( $user ) {
1051
  array_slice( $two_factor_methods, 0, 11 )
1052
  ),
1053
  "No. of Users" => array(
1054
- $user_plan,
1055
  "User Based Pricing",
1056
  "User Based Pricing"
1057
  ),
310
 
311
  </table>
312
  <br>
 
 
 
313
 
314
+ <a href="admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=proxy_setup"
315
+ id="mo2f_tab5"><?php echo mo2f_lt( 'Click here' ); ?></a><?php echo mo2f_lt( ' if you need to setup a Proxy.' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
316
  </div>
 
317
  <?php
318
  }
319
 
449
  ?>
450
  <div class="mo2f_setup_2_factor_tab">
451
 
452
+
453
+ <div style="display:block;font-size:23px;padding:9px 0 10px;line-height:29px; margin-left:3%">
454
+ <a id="mo2f_need_help" class="add-new-h2" href="admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=mo2f_support"
455
+ style="float:right;background-color:#48b74b;color:white;"><?php echo mo2f_lt( 'NEED HELP?' ); ?></a>
456
+ <a id="mo2f_restart_tour" class="add-new-h2" onclick="restart_tour();"
457
+ style="float:right;background-color:#006799;color:white;"><?php echo mo2f_lt( 'RESTART TOUR' ); ?></a>
458
+
459
+
460
+
461
+ </div>
462
 
463
  <?php if( $selectedMethod == 'NONE' ) { ?>
464
  <p style="float:left;" ><span style="color:limegreen;font-weight:bold"><?php echo mo2f_lt( 'HOW DO I CONFIGURE 2FA?' ); ?></span>
465
+ <br>Just click on <b>Configure</b> of your preferred authentication method below.</p><br><br>
466
 
467
  <?php } ?>
468
+ <br>
 
 
 
 
469
  <div style="text-align: center;">
470
+ <p style="font-size:20px;color:darkorange;" ><span id="mo2f_selected_method"><?php echo mo2f_lt( 'Selected Method - ' ); ?><?php echo $selectedMethod; ?></span></p>
 
471
  <button class="button button-primary button-large" id="test"
472
  onclick="testAuthenticationMethod('<?php echo $selectedMethod; ?>');"
473
  <?php echo $is_customer_registered && ( $selectedMethod != 'NONE' ) ? "" : " disabled "; ?>>Test
475
  </button>
476
  </div>
477
  <br>
478
+ <?php
479
  if ( in_array( $selectedMethod, array(
480
  "Google Authenticator",
481
  "miniOrange Soft Token",
503
  <br>
504
  <?php
505
  }
506
+
507
  $free_plan_existing_user = array(
508
  "Email Verification",
509
  "OTP Over SMS",
517
  );
518
 
519
  $free_plan_new_user = array(
 
 
 
520
  "Google Authenticator",
521
+ "Security Questions",
522
+ "miniOrange Soft Token",
523
+ "miniOrange QR Code Authentication",
524
+ "miniOrange Push Notification"
525
  );
526
 
527
  $standard_plan_existing_user = array(
552
  $premium_plan_methods_new_user = array_chunk( array_merge( $standard_plan_new_user, $premium_plan ), 3 );
553
  ?>
554
  <hr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
555
  <div class="mo2f_setup_2factor_tab">
556
 
557
  <div>
620
  </div>
621
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
622
  <script>
 
 
623
 
624
+ function restart_tour() {
625
  tour.restart();
626
  }
627
 
660
  backdropPadding:'6'
661
  }
662
  , {
663
+ element: "#mo2f_need_help",
664
  title: "Need Any Help?",
665
  content: "Click here to reach us anytime you need any help with the plugin.",
666
  backdrop:'body',
692
  // Start the tour
693
  tour.start();
694
 
 
 
695
 
696
  function configureOrSet2ndFactor_free_plan(authMethod, action) {
697
  jQuery('#mo2f_configured_2FA_method_free_plan').val(authMethod);
765
  "miniOrange QR Code Authentication" => "Scan the QR code from the account in your miniOrange Authenticator App to login.",
766
  "miniOrange Soft Token" => "Enter the soft token from the account in your miniOrange Authenticator App to login.",
767
  "miniOrange Push Notification" => "Accept a push notification in your miniOrange Authenticator App to login.",
768
+ "Google Authenticator" => "Enter the soft token from the account in your <b>Google/Authy/LastPass Authenticator App</b> to login.",
769
  "Security Questions" => "Answer the three security questions you had set, to login.",
770
  "Authy Authenticator" => "Enter the soft token from the account in your Authy Authenticator App to login.",
771
  "Email Verification" => "Accept the verification link sent to your email to login.",
922
  );
923
 
924
  $two_factor_methods_EC = array_slice( $two_factor_methods, 0, 7 );
925
+
926
  $mo2f_feature_set_with_plans_NC = array(
927
  "Authentication Methods" => array(
928
  array_slice( $two_factor_methods, 0, 5 ),
930
  array_slice( $two_factor_methods, 0, 11 )
931
  ),
932
  "No. of Users" => array(
933
+ "1",
934
  "User Based Pricing",
935
  "User Based Pricing"
936
  ),
miniorange_2_factor_settings.php CHANGED
@@ -2,8 +2,8 @@
2
  /**
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 Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA) for 1 User in the free version of the plugin.
6
- * Version: 5.1.11
7
  * Author: miniOrange
8
  * Author URI: https://miniorange.com
9
  * License: GPL2
@@ -21,7 +21,6 @@ require( 'class-utility.php' );
21
  require( 'class-mo2f-constants.php' );
22
  require( 'class-miniorange-2-factor-login.php' );
23
  require( 'miniorange_2_factor_support.php' );
24
- require( 'class-miniorange-2-factor-user-registration.php' );
25
  require( 'class-miniorange-2-factor-pass2fa-login.php' );
26
  define( 'MOAUTH_PATH', plugins_url( __FILE__ ) );
27
 
@@ -33,7 +32,6 @@ class Miniorange_Authentication {
33
 
34
  function __construct() {
35
 
36
- add_option( 'mo2f_inline_registration', 0 );
37
  add_option( 'mo2f_activate_plugin', 1 );
38
  add_option( 'mo2f_login_option', 1 );
39
  add_option( 'mo2f_number_of_transactions', 1 );
@@ -43,7 +41,6 @@ class Miniorange_Authentication {
43
  add_option( 'mo2f_enable_2fa_prompt_on_login_page', 0 );
44
  add_option( 'mo2f_enable_xmlrpc', 0 );
45
  add_option( 'mo2f_show_sms_transaction_message', 0 );
46
- add_option( 'mo2f_custom_plugin_name', 'miniOrange 2-Factor' );
47
  add_action( 'admin_menu', array( $this, 'miniorange_auth_menu' ) );
48
  add_action( 'admin_init', array( $this, 'miniorange_auth_save_settings' ) );
49
  add_action( 'admin_enqueue_scripts', array( $this, 'plugin_settings_style' ) );
@@ -67,21 +64,6 @@ class Miniorange_Authentication {
67
  $wp_roles = new WP_Roles();
68
  }
69
 
70
- if ( get_option( 'mo2f_admin_disabled_status' ) == 1 || get_option( 'mo2f_admin_disabled_status' ) == 0 ) {
71
- if ( get_option( 'mo2f_admin_disabled_status' ) == 1 ) {
72
- add_option( 'mo2fa_administrator', 1 );
73
- } else {
74
- foreach ( $wp_roles->role_names as $id => $name ) {
75
- add_option( 'mo2fa_' . $id, 1 );
76
- }
77
- }
78
- delete_option( 'mo2f_admin_disabled_status' );
79
- } else {
80
- foreach ( $wp_roles->role_names as $id => $name ) {
81
- add_option( 'mo2fa_' . $id, 1 );
82
- }
83
- }
84
-
85
  if ( get_option( 'mo2f_activate_plugin' ) == 1 ) {
86
 
87
  $mo2f_rba_attributes = new Miniorange_Rba_Attributes();
@@ -181,8 +163,8 @@ class Miniorange_Authentication {
181
  $user_id = get_option( 'mo2f_miniorange_admin' );
182
  $current_db_version = get_option( 'mo2f_dbversion' );
183
 
184
- if ( $current_db_version < 141 ) {
185
- update_option( 'mo2f_dbversion', 141 );
186
  $Mo2fdbQueries->generate_tables();
187
 
188
  }
@@ -274,9 +256,8 @@ class Miniorange_Authentication {
274
  $check_if_user_column_exists = $Mo2fdbQueries->check_if_user_column_exists( $user_id );
275
  if ( $check_if_user_column_exists ) {
276
  $selected_2FA_method = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user_id );
277
- $is_nc_with_unlimited_users = get_option( 'mo2f_is_NC' ) && ! get_option( 'mo2f_is_NNC' );
278
 
279
- if ( ! $is_nc_with_unlimited_users && in_array( $selected_2FA_method, array(
280
  "Google Authenticator",
281
  "miniOrange Soft Token",
282
  "Authy Authenticator"
@@ -374,16 +355,8 @@ class Miniorange_Authentication {
374
  function miniorange_auth_menu() {
375
  global $user;
376
  $user = wp_get_current_user();
377
- if ( get_option( 'mo2f_enable_custom_icon' ) != 1 ) {
378
- $iconurl = plugin_dir_url( __FILE__ ) . 'includes/images/miniorange_icon.png';
379
- } else {
380
- $icon = apply_filters( 'mo2f_icon', 'icon' );
381
- if ( isset( $icon ) ) {
382
- $iconurl = $icon;
383
- } else {
384
- $iconurl = site_url() . '/wp-content/uploads/plugin_icon.png';
385
- }
386
- }
387
  $roles = $user->roles;
388
  $miniorange_role = array_shift( $roles );
389
 
@@ -395,37 +368,19 @@ class Miniorange_Authentication {
395
  ? true : false;
396
 
397
 
398
- if ( get_option( 'mo2f_is_NC' ) && ! get_option( 'mo2f_is_NNC' ) ) {
399
- if ( ! $can_current_user_manage_options && get_option( 'mo2fa_' . $miniorange_role ) &&
400
- $admin_registration_status && ! $is_customer_admin && $is_plugin_activated && $is_2fa_enabled_for_users ) {
401
- $user_register = new Miniorange_User_Register();
402
- $mo2fa_hook_page = add_menu_page( 'miniOrange 2 Factor Auth', get_option( 'mo2f_custom_plugin_name' ), 'read', 'miniOrange_2_factor_settings', array(
403
- $user_register,
404
- 'mo2f_register_user'
405
- ), $iconurl );
406
- } else if ( $can_current_user_manage_options ) {
407
- if ( $is_customer_admin || ( ! $is_customer_admin && $is_2fa_enabled_for_users ) ) {
408
- $mo2fa_hook_page = add_menu_page( 'miniOrange 2 Factor Auth', get_option( 'mo2f_custom_plugin_name' ), 'manage_options', 'miniOrange_2_factor_settings', array(
409
- $this,
410
- 'mo_auth_login_options'
411
- ), $iconurl );
412
- }
413
 
414
- }
415
- } else {
416
- if ( $admin_registration_status ) {
417
- if ( $can_current_user_manage_options && $is_customer_admin ) {
418
- $mo2fa_hook_page = add_menu_page( 'miniOrange 2 Factor Auth', get_option( 'mo2f_custom_plugin_name' ), 'manage_options', 'miniOrange_2_factor_settings', array(
419
- $this,
420
- 'mo_auth_login_options'
421
- ), $iconurl );
422
- }
423
- } else if ( $can_current_user_manage_options ) {
424
- $mo2fa_hook_page = add_menu_page( 'miniOrange 2 Factor Auth', get_option( 'mo2f_custom_plugin_name' ), 'manage_options', 'miniOrange_2_factor_settings', array(
425
  $this,
426
  'mo_auth_login_options'
427
  ), $iconurl );
428
  }
 
 
 
 
 
429
  }
430
 
431
 
@@ -439,21 +394,21 @@ class Miniorange_Authentication {
439
  }
440
 
441
  function mo_2_factor_enable_frontend_style() {
442
- wp_enqueue_style( 'mo2f_frontend_login_style', plugins_url( 'includes/css/front_end_login.css?version=5.1.11', __FILE__ ) );
443
- wp_enqueue_style( 'bootstrap_style', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.11', __FILE__ ) );
444
- wp_enqueue_style( 'mo_2_factor_admin_settings_phone_style', plugins_url( 'includes/css/phone.css?version=5.1.11', __FILE__ ) );
445
  wp_enqueue_style( 'mo_2_factor_wpb-fa', plugins_url( 'includes/css/font-awesome.min.css', __FILE__ ) );
446
- wp_enqueue_style( 'mo2f_login_popup_style', plugins_url( 'includes/css/mo2f_login_popup_ui.css?version=5.1.11', __FILE__ ) );
447
  }
448
 
449
  function plugin_settings_style( $mo2fa_hook_page ) {
450
  if ( 'toplevel_page_miniOrange_2_factor_settings' != $mo2fa_hook_page ) {
451
  return;
452
  }
453
- wp_enqueue_style( 'mo_2_factor_admin_settings_style', plugins_url( 'includes/css/style_settings.css?version=5.1.11', __FILE__ ) );
454
- wp_enqueue_style( 'mo_2_factor_admin_settings_phone_style', plugins_url( 'includes/css/phone.css?version=5.1.11', __FILE__ ) );
455
- wp_enqueue_style( 'bootstrap_style', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.11', __FILE__ ) );
456
- wp_enqueue_style( 'bootstrap_style_ass', plugins_url( 'includes/css/bootstrap-tour-standalone.css?version=5.1.11', __FILE__ ) );
457
  wp_enqueue_style( 'mo_2_factor_wpb-fa', plugins_url( 'includes/css/font-awesome.min.css', __FILE__ ) );
458
  }
459
 
@@ -535,13 +490,13 @@ class Miniorange_Authentication {
535
  }
536
  if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_register_customer" ) { //register the admin to miniOrange
537
  //miniorange_register_customer_nonce
538
- $nonce = $_POST['miniorange_register_customer_nonce'];
539
- if ( ! wp_verify_nonce( $nonce, 'miniorange-register-customer-nonce' ) ) {
540
- $error = new WP_Error();
541
- $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
542
 
543
- return $error;
544
- } else {
545
  //validate and sanitize
546
  $email = '';
547
  $password = '';
@@ -556,22 +511,22 @@ class Miniorange_Authentication {
556
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "MIN_PASS_LENGTH" ) );
557
 
558
  } else {
559
- $email = sanitize_email( $_POST['email'] );
560
- $password = sanitize_text_field( $_POST['password'] );
561
- $confirmPassword = sanitize_text_field( $_POST['confirmPassword'] );
562
-
563
  $email = strtolower( $email );
564
  update_option( 'mo2f_email', $email );
565
 
566
  $Mo2fdbQueries->insert_user( $user_id, array( 'user_id' => $user_id ) );
567
  $pattern = '/^[(\w)*(\!\@\#\$\%\^\&\*\.\-\_)*]+$/';
568
-
569
  if(preg_match($pattern,$password)){
570
  if ( strcmp( $password, $confirmPassword ) == 0 ) {
571
  update_option( 'mo2f_password', stripslashes( $password ) );
572
  $customer = new Customer_Setup();
573
  $customerKey = json_decode( $customer->check_customer(), true );
574
-
575
  if ( strcasecmp( $customerKey['status'], 'CUSTOMER_NOT_FOUND' ) == 0 ) {
576
  if ( $customerKey['status'] == 'ERROR' ) {
577
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( $customerKey['message'] ) );
@@ -596,13 +551,12 @@ class Miniorange_Authentication {
596
  }
597
  }
598
  else{
599
- update_option( 'mo2f_message', "Minimum 6 characters should be present. Maximum 15 characters should be present. Only following symbols (!@#.$%^&*-_) should be present." );
600
- $this->mo_auth_show_error_message();
601
  }
602
  }
603
  }
604
  }
605
-
606
  if ( isset( $_POST['option'] ) and $_POST['option'] == "mo2f_goto_verifycustomer" ) {
607
  $nonce = $_POST['mo2f_goto_verifycustomer_nonce'];
608
  if ( ! wp_verify_nonce( $nonce, 'mo2f-goto-verifycustomer-nonce' ) ) {
@@ -992,9 +946,6 @@ class Miniorange_Authentication {
992
  }
993
 
994
  if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo_auth_advanced_options_save' ) {
995
- update_option( 'mo2f_enable_2fa_for_woocommerce', isset( $_POST['mo2f_enable_2fa_for_woocommerce'] ) ? $_POST['mo2f_enable_2fa_for_woocommerce'] : 0 );
996
- update_option( 'mo2f_enable_custom_icon', isset( $_POST['mo2f_enable_custom_icon'] ) ? $_POST['mo2f_enable_custom_icon'] : 0 );
997
- update_option( 'mo2f_custom_plugin_name', isset( $_POST['mo2f_custom_plugin_name'] ) ? $_POST['mo2f_custom_plugin_name'] : 'miniOrange 2-Factor' );
998
  update_option( 'mo2f_message', 'Your settings are saved successfully.' );
999
  $this->mo_auth_show_success_message();
1000
  }
@@ -1112,7 +1063,7 @@ class Miniorange_Authentication {
1112
 
1113
  return $error;
1114
  } else {
1115
- $reasons_not_to_worry_about = array( "Upgrading to Premium", "Temporary deactivation - Testing" );
1116
 
1117
  $message = 'Plugin Deactivated:';
1118
 
@@ -1252,16 +1203,12 @@ class Miniorange_Authentication {
1252
  'mo_2factor_user_registration_status' => 'MO_2_FACTOR_PLUGIN_SETTINGS'
1253
  ) );
1254
 
1255
- $is_nc_with_unlimited_users = get_option( 'mo2f_is_NC' ) && ! get_option( 'mo2f_is_NNC' );
1256
-
1257
-
1258
  delete_user_meta( $user->ID, 'configure_2FA' );
1259
  mo2f_display_test_2fa_notification($user);
1260
 
1261
  } else {
1262
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "ERROR_DURING_PROCESS" ) );
1263
  $this->mo_auth_show_error_message();
1264
-
1265
  }
1266
 
1267
  } else {
@@ -1269,7 +1216,6 @@ class Miniorange_Authentication {
1269
  $this->mo_auth_show_error_message();
1270
  }
1271
  }
1272
-
1273
  }
1274
 
1275
  if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo2f_mobile_authenticate_success' ) { // mobile registration for all users(common)
@@ -2105,8 +2051,7 @@ class Miniorange_Authentication {
2105
  }
2106
 
2107
  // user clicks on Set 2-Factor method
2108
- if ( ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_save_free_plan_auth_methods' ) ||
2109
- ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_save_standard_plan_auth_methods' ) ) {
2110
 
2111
  $nonce = $_POST['miniorange_save_form_auth_methods_nonce'];
2112
 
@@ -2124,7 +2069,6 @@ class Miniorange_Authentication {
2124
  if ( $is_customer_registered ) {
2125
  $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" );
2126
  $selected_action = isset( $_POST['mo2f_selected_action_free_plan'] ) ? $_POST['mo2f_selected_action_free_plan'] : $_POST['mo2f_selected_action_standard_plan'];
2127
- $is_nc_with_unlimited_users = get_option( 'mo2f_is_NC' ) && ! get_option( 'mo2f_is_NNC' );
2128
  $user_phone = '';
2129
 
2130
  if ( isset( $_SESSION['user_phone'] ) ) {
@@ -2144,7 +2088,7 @@ class Miniorange_Authentication {
2144
  // update the server
2145
  $this->mo2f_save_2_factor_method( $user, $selected_2FA_method );
2146
 
2147
- if ( ! $is_nc_with_unlimited_users && in_array( $selected_2FA_method, array(
2148
  "Google Authenticator",
2149
  "miniOrange Soft Token",
2150
  "Authy Authenticator"
2
  /**
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.1.14
7
  * Author: miniOrange
8
  * Author URI: https://miniorange.com
9
  * License: GPL2
21
  require( 'class-mo2f-constants.php' );
22
  require( 'class-miniorange-2-factor-login.php' );
23
  require( 'miniorange_2_factor_support.php' );
 
24
  require( 'class-miniorange-2-factor-pass2fa-login.php' );
25
  define( 'MOAUTH_PATH', plugins_url( __FILE__ ) );
26
 
32
 
33
  function __construct() {
34
 
 
35
  add_option( 'mo2f_activate_plugin', 1 );
36
  add_option( 'mo2f_login_option', 1 );
37
  add_option( 'mo2f_number_of_transactions', 1 );
41
  add_option( 'mo2f_enable_2fa_prompt_on_login_page', 0 );
42
  add_option( 'mo2f_enable_xmlrpc', 0 );
43
  add_option( 'mo2f_show_sms_transaction_message', 0 );
 
44
  add_action( 'admin_menu', array( $this, 'miniorange_auth_menu' ) );
45
  add_action( 'admin_init', array( $this, 'miniorange_auth_save_settings' ) );
46
  add_action( 'admin_enqueue_scripts', array( $this, 'plugin_settings_style' ) );
64
  $wp_roles = new WP_Roles();
65
  }
66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  if ( get_option( 'mo2f_activate_plugin' ) == 1 ) {
68
 
69
  $mo2f_rba_attributes = new Miniorange_Rba_Attributes();
163
  $user_id = get_option( 'mo2f_miniorange_admin' );
164
  $current_db_version = get_option( 'mo2f_dbversion' );
165
 
166
+ if ( $current_db_version < 143 ) {
167
+ update_option( 'mo2f_dbversion', 143 );
168
  $Mo2fdbQueries->generate_tables();
169
 
170
  }
256
  $check_if_user_column_exists = $Mo2fdbQueries->check_if_user_column_exists( $user_id );
257
  if ( $check_if_user_column_exists ) {
258
  $selected_2FA_method = $Mo2fdbQueries->get_user_detail( 'mo2f_configured_2FA_method', $user_id );
 
259
 
260
+ if ( in_array( $selected_2FA_method, array(
261
  "Google Authenticator",
262
  "miniOrange Soft Token",
263
  "Authy Authenticator"
355
  function miniorange_auth_menu() {
356
  global $user;
357
  $user = wp_get_current_user();
358
+ $iconurl = plugin_dir_url( __FILE__ ) . 'includes/images/miniorange_icon.png';
359
+
 
 
 
 
 
 
 
 
360
  $roles = $user->roles;
361
  $miniorange_role = array_shift( $roles );
362
 
368
  ? true : false;
369
 
370
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
371
 
372
+ if ( $admin_registration_status ) {
373
+ if ( $can_current_user_manage_options && $is_customer_admin ) {
374
+ $mo2fa_hook_page = add_menu_page( 'miniOrange 2 Factor Auth', 'miniOrange 2-Factor', 'manage_options', 'miniOrange_2_factor_settings', array(
 
 
 
 
 
 
 
 
375
  $this,
376
  'mo_auth_login_options'
377
  ), $iconurl );
378
  }
379
+ } else if ( $can_current_user_manage_options ) {
380
+ $mo2fa_hook_page = add_menu_page( 'miniOrange 2 Factor Auth', 'miniOrange 2-Factor', 'manage_options', 'miniOrange_2_factor_settings', array(
381
+ $this,
382
+ 'mo_auth_login_options'
383
+ ), $iconurl );
384
  }
385
 
386
 
394
  }
395
 
396
  function mo_2_factor_enable_frontend_style() {
397
+ wp_enqueue_style( 'mo2f_frontend_login_style', plugins_url( 'includes/css/front_end_login.css?version=5.1.14', __FILE__ ) );
398
+ wp_enqueue_style( 'bootstrap_style', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.14', __FILE__ ) );
399
+ wp_enqueue_style( 'mo_2_factor_admin_settings_phone_style', plugins_url( 'includes/css/phone.css?version=5.1.14', __FILE__ ) );
400
  wp_enqueue_style( 'mo_2_factor_wpb-fa', plugins_url( 'includes/css/font-awesome.min.css', __FILE__ ) );
401
+ wp_enqueue_style( 'mo2f_login_popup_style', plugins_url( 'includes/css/mo2f_login_popup_ui.css?version=5.1.14', __FILE__ ) );
402
  }
403
 
404
  function plugin_settings_style( $mo2fa_hook_page ) {
405
  if ( 'toplevel_page_miniOrange_2_factor_settings' != $mo2fa_hook_page ) {
406
  return;
407
  }
408
+ wp_enqueue_style( 'mo_2_factor_admin_settings_style', plugins_url( 'includes/css/style_settings.css?version=5.1.14', __FILE__ ) );
409
+ wp_enqueue_style( 'mo_2_factor_admin_settings_phone_style', plugins_url( 'includes/css/phone.css?version=5.1.14', __FILE__ ) );
410
+ wp_enqueue_style( 'bootstrap_style', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.14', __FILE__ ) );
411
+ wp_enqueue_style( 'bootstrap_style_ass', plugins_url( 'includes/css/bootstrap-tour-standalone.css?version=5.1.14', __FILE__ ) );
412
  wp_enqueue_style( 'mo_2_factor_wpb-fa', plugins_url( 'includes/css/font-awesome.min.css', __FILE__ ) );
413
  }
414
 
490
  }
491
  if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_register_customer" ) { //register the admin to miniOrange
492
  //miniorange_register_customer_nonce
493
+ $nonce = $_POST['miniorange_register_customer_nonce'];
494
+ if ( ! wp_verify_nonce( $nonce, 'miniorange-register-customer-nonce' ) ) {
495
+ $error = new WP_Error();
496
+ $error->add( 'empty_username', '<strong>' . mo2f_lt( 'ERROR' ) . '</strong>: ' . mo2f_lt( 'Invalid Request.' ) );
497
 
498
+ return $error;
499
+ } else {
500
  //validate and sanitize
501
  $email = '';
502
  $password = '';
511
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "MIN_PASS_LENGTH" ) );
512
 
513
  } else {
514
+ $email = sanitize_email( $_POST['email'] );
515
+ $password = sanitize_text_field( $_POST['password'] );
516
+ $confirmPassword = sanitize_text_field( $_POST['confirmPassword'] );
517
+
518
  $email = strtolower( $email );
519
  update_option( 'mo2f_email', $email );
520
 
521
  $Mo2fdbQueries->insert_user( $user_id, array( 'user_id' => $user_id ) );
522
  $pattern = '/^[(\w)*(\!\@\#\$\%\^\&\*\.\-\_)*]+$/';
523
+
524
  if(preg_match($pattern,$password)){
525
  if ( strcmp( $password, $confirmPassword ) == 0 ) {
526
  update_option( 'mo2f_password', stripslashes( $password ) );
527
  $customer = new Customer_Setup();
528
  $customerKey = json_decode( $customer->check_customer(), true );
529
+
530
  if ( strcasecmp( $customerKey['status'], 'CUSTOMER_NOT_FOUND' ) == 0 ) {
531
  if ( $customerKey['status'] == 'ERROR' ) {
532
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( $customerKey['message'] ) );
551
  }
552
  }
553
  else{
554
+ update_option( 'mo2f_message', "Password length between 6 - 15 characters. Only following symbols (!@#.$%^&*-_) should be present." );
555
+ $this->mo_auth_show_error_message();
556
  }
557
  }
558
  }
559
  }
 
560
  if ( isset( $_POST['option'] ) and $_POST['option'] == "mo2f_goto_verifycustomer" ) {
561
  $nonce = $_POST['mo2f_goto_verifycustomer_nonce'];
562
  if ( ! wp_verify_nonce( $nonce, 'mo2f-goto-verifycustomer-nonce' ) ) {
946
  }
947
 
948
  if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo_auth_advanced_options_save' ) {
 
 
 
949
  update_option( 'mo2f_message', 'Your settings are saved successfully.' );
950
  $this->mo_auth_show_success_message();
951
  }
1063
 
1064
  return $error;
1065
  } else {
1066
+ $reasons_not_to_worry_about = array( "Upgrading to Standard / Premium", "Temporary deactivation - Testing" );
1067
 
1068
  $message = 'Plugin Deactivated:';
1069
 
1203
  'mo_2factor_user_registration_status' => 'MO_2_FACTOR_PLUGIN_SETTINGS'
1204
  ) );
1205
 
 
 
 
1206
  delete_user_meta( $user->ID, 'configure_2FA' );
1207
  mo2f_display_test_2fa_notification($user);
1208
 
1209
  } else {
1210
  update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "ERROR_DURING_PROCESS" ) );
1211
  $this->mo_auth_show_error_message();
 
1212
  }
1213
 
1214
  } else {
1216
  $this->mo_auth_show_error_message();
1217
  }
1218
  }
 
1219
  }
1220
 
1221
  if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo2f_mobile_authenticate_success' ) { // mobile registration for all users(common)
2051
  }
2052
 
2053
  // user clicks on Set 2-Factor method
2054
+ if ( ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_save_free_plan_auth_methods' ) ) {
 
2055
 
2056
  $nonce = $_POST['miniorange_save_form_auth_methods_nonce'];
2057
 
2069
  if ( $is_customer_registered ) {
2070
  $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" );
2071
  $selected_action = isset( $_POST['mo2f_selected_action_free_plan'] ) ? $_POST['mo2f_selected_action_free_plan'] : $_POST['mo2f_selected_action_standard_plan'];
 
2072
  $user_phone = '';
2073
 
2074
  if ( isset( $_SESSION['user_phone'] ) ) {
2088
  // update the server
2089
  $this->mo2f_save_2_factor_method( $user, $selected_2FA_method );
2090
 
2091
+ if ( in_array( $selected_2FA_method, array(
2092
  "Google Authenticator",
2093
  "miniOrange Soft Token",
2094
  "Authy Authenticator"
miniorange_2_factor_support.php CHANGED
@@ -10,7 +10,13 @@ function mo2f_support() {
10
  $user_phone = $phone != 'false' ? $phone : '';
11
  ?>
12
  <div class="mo2f_support_layout">
13
- <h3><?php echo mo2f_lt( 'Support' ); ?></h3>
 
 
 
 
 
 
14
  <hr width="100%">
15
  <br>
16
  <form name="f" method="post" action="">
10
  $user_phone = $phone != 'false' ? $phone : '';
11
  ?>
12
  <div class="mo2f_support_layout">
13
+
14
+ <h3><?php echo mo2f_lt( 'Support' ); ?>
15
+ <a id="mo2f_faq" class="add-new-h2" href="https://wordpress.org/support/plugin/miniorange-2-factor-authentication"
16
+ target="_blank" style="float:right"><?php echo mo2f_lt( 'Ask questions on the WP Forum' ); ?></a>
17
+ <a id="mo2f_faq" class="add-new-h2" href="https://faq.miniorange.com/kb/two-factor-authentication"
18
+ target="_blank" style="float:right"><?php echo mo2f_lt( 'FAQ' ); ?></a>
19
+ </h3>
20
  <hr width="100%">
21
  <br>
22
  <form name="f" method="post" action="">
readme.txt CHANGED
@@ -3,18 +3,17 @@ Contributors: cyberlord92, twofactor
3
  Tags: google authenticator, two factor authentication, two factor, 2FA, TFA, 2 factor authentication, two step verification, 1 google authenticator, login, authy, authy two factor, Clef, 2 Factor, yubico, Two-Factor Authentication, Mobile Authentication, otp, strong authentication, 2 step authentication, smartphone authentication, Multifactor authentication, multi factor authentication, multi factor, no password, passwordless login, security, website security, one time passcode, password, soft token, woocommerce, authenticate, two factor auth, two-factor, duo, QR Code, QR Code Authentication, scan QR Code, wordfence, login security, google authenticator, google , email verification, trusted device, device Id , KBA , knowledge based authentication
4
  Donate link: https://miniorange.com/
5
  Requires at least: 3.0.1
6
- Tested up to: 5.0.0
7
  Requires PHP: 5.3.0
8
- Stable tag: 5.1.11
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
- Google Authenticator and Best Enterprise Grade Two Factor Authentication (2FA). Supports Google Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA) for Unlimited Users in the free version of the plugin.
13
 
14
  == Description ==
15
 
16
-
17
- **Note: The miniOrange 2-factor authentication plugin for Wordpress is GDPR Compliant now**
18
 
19
  Secure your WordPress login with an additional layer of security from us! The setup takes minutes, yet protects your site forever.
20
  This plugin provides two factor authentication (TFA) during login. If you are looking for OTP Verification of users during <b>Registration</b> then we have a separate plugin for this. <a href="https://wordpress.org/plugins/miniorange-otp-verification/"> Click Here </a> to learn more.
@@ -22,14 +21,14 @@ This plugin provides two factor authentication (TFA) during login. If you are lo
22
  <h4>Free Plugin Features</h4>
23
 
24
  * Two Factor Authentication (2FA) for **1 User** forever
25
- * **Available Authentication Methods:** Google Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA)
26
  * Language Translation Support
27
  * Two Factor Authentication (2FA) allows authentication on login page itself for Google Authenticator & miniOrange Soft Token.
28
 
29
  <h4>Standard Plugin Features</h4>
30
 
31
  * Two Factor Authentication (2FA) for Users as per the upgrade *( User-based pricing )*
32
- * **Available Authentication Methods:** Google Authenticator, QR Code, Push Notification, Soft Token, Security Questions(KBA), Authy Authenticator, OTP Over Email, OTP Over SMS, OTP Over SMS and Email, Email Verification. *( SMS and Email credits need to be purchased as per the need)*
33
  * Language Translation Support
34
  * **Multiple Login Options:** Username + password + two-factor (or) Username + two-factor
35
  * **Backup Method:** KBA(Security Questions)
@@ -39,7 +38,7 @@ This plugin provides two factor authentication (TFA) during login. If you are lo
39
  <h4>Premium Plugin Features</h4>
40
 
41
  * Two Factor Authentication (2FA) for Users as per the upgrade *( User-based pricing )*
42
- * **Available Authentication Methods:** Google Authenticator, QR Code, Push Notification, Soft Token, Security Questions(KBA), Authy Authenticator, 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)*
43
  * Language Translation Support
44
  * **Multiple Login Options:** Username + password + two-factor (or) Username + two-factor
45
  * **Backup Methods:** KBA(Security Questions), OTP Over Email, Backup Codes
@@ -51,7 +50,7 @@ This plugin provides two factor authentication (TFA) during login. If you are lo
51
  * App Specific Password to login from mobile Apps
52
  * **Add-Ons Included:** RBA & Trusted Devices Management Add-on, Personalization Add-on and Short Codes Add-on
53
 
54
- <h4>Add Ons [Free and Standard Plans, Inclusive in the Premium Plan]</h4>
55
 
56
  * RBA & Trusted Devices Management Add-on Features
57
  * Remember Device
@@ -222,6 +221,12 @@ miniOrange authentication service has 15+ authentication methods.One time passco
222
 
223
  == Changelog ==
224
 
 
 
 
 
 
 
225
  = 5.1.11 =
226
  * Google Authenticator-Two Factor Authentication (2FA) : Password Pattern Fix.
227
 
@@ -559,6 +564,12 @@ More descriptive setup messages and UI changes.
559
 
560
  == Upgrade Notice ==
561
 
 
 
 
 
 
 
562
  = 5.1.11 =
563
  * Google Authenticator-Two Factor Authentication (2FA) : Password Pattern Fix.
564
 
3
  Tags: google authenticator, two factor authentication, two factor, 2FA, TFA, 2 factor authentication, two step verification, 1 google authenticator, login, authy, authy two factor, Clef, 2 Factor, yubico, Two-Factor Authentication, Mobile Authentication, otp, strong authentication, 2 step authentication, smartphone authentication, Multifactor authentication, multi factor authentication, multi factor, no password, passwordless login, security, website security, one time passcode, password, soft token, woocommerce, authenticate, two factor auth, two-factor, duo, QR Code, QR Code Authentication, scan QR Code, wordfence, login security, google authenticator, google , email verification, trusted device, device Id , KBA , knowledge based authentication
4
  Donate link: https://miniorange.com/
5
  Requires at least: 3.0.1
6
+ Tested up to: 5.0.2
7
  Requires PHP: 5.3.0
8
+ Stable tag: 5.1.14
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
+ Easy 2FA setup with Google/Authy/LastPass Authenticator & other 2FA methods. Supports Google Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA).
13
 
14
  == Description ==
15
 
16
+ **Note: The plugin is GDPR Compliant and supports Language Translation**
 
17
 
18
  Secure your WordPress login with an additional layer of security from us! The setup takes minutes, yet protects your site forever.
19
  This plugin provides two factor authentication (TFA) during login. If you are looking for OTP Verification of users during <b>Registration</b> then we have a separate plugin for this. <a href="https://wordpress.org/plugins/miniorange-otp-verification/"> Click Here </a> to learn more.
21
  <h4>Free Plugin Features</h4>
22
 
23
  * Two Factor Authentication (2FA) for **1 User** forever
24
+ * **Available Authentication Methods:** Google/Authy/LastPass Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA)
25
  * Language Translation Support
26
  * Two Factor Authentication (2FA) allows authentication on login page itself for Google Authenticator & miniOrange Soft Token.
27
 
28
  <h4>Standard Plugin Features</h4>
29
 
30
  * Two Factor Authentication (2FA) for Users as per the upgrade *( User-based pricing )*
31
+ * **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)*
32
  * Language Translation Support
33
  * **Multiple Login Options:** Username + password + two-factor (or) Username + two-factor
34
  * **Backup Method:** KBA(Security Questions)
38
  <h4>Premium Plugin Features</h4>
39
 
40
  * Two Factor Authentication (2FA) for Users as per the upgrade *( User-based pricing )*
41
+ * **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)*
42
  * Language Translation Support
43
  * **Multiple Login Options:** Username + password + two-factor (or) Username + two-factor
44
  * **Backup Methods:** KBA(Security Questions), OTP Over Email, Backup Codes
50
  * App Specific Password to login from mobile Apps
51
  * **Add-Ons Included:** RBA & Trusted Devices Management Add-on, Personalization Add-on and Short Codes Add-on
52
 
53
+ <h4>Add Ons [Applicable for Free and Standard Plans, Inclusive in the Premium Plan]</h4>
54
 
55
  * RBA & Trusted Devices Management Add-on Features
56
  * Remember Device
221
 
222
  == Changelog ==
223
 
224
+ = 5.1.14 =
225
+ * Google Authenticator-Two Factor Authentication (2FA) : Database Error Fix and Custom Redirect.
226
+
227
+ = 5.1.12 =
228
+ * Google Authenticator-Two Factor Authentication (2FA) : Removing redundant code.
229
+
230
  = 5.1.11 =
231
  * Google Authenticator-Two Factor Authentication (2FA) : Password Pattern Fix.
232
 
564
 
565
  == Upgrade Notice ==
566
 
567
+ = 5.1.14 =
568
+ * Google Authenticator-Two Factor Authentication (2FA) : Database Error Fix and Custom Redirect.
569
+
570
+ = 5.1.12 =
571
+ * Google Authenticator-Two Factor Authentication (2FA) : Removing redundant code.
572
+
573
  = 5.1.11 =
574
  * Google Authenticator-Two Factor Authentication (2FA) : Password Pattern Fix.
575
 
uninstall.php CHANGED
@@ -32,13 +32,9 @@ if ( ! is_multisite() ) {
32
  delete_option( 'mo2f_enable_forgotphone' );
33
  delete_option( 'mo2f_enable_login_with_2nd_factor' );
34
  delete_option( 'mo2f_activate_plugin' );
35
- delete_option( 'mo2f_enable_2fa_for_woocommerce' );
36
  delete_option( 'mo2f_remember_device' );
37
  delete_option( 'mo2f_app_secret' );
38
- delete_option( 'mo2f_inline_registration' );
39
  delete_option( 'mo2f_enable_custom' );
40
- delete_option( 'mo2f_custom_plugin_name' );
41
- delete_option( 'mo2f_enable_custom_icon' );
42
  delete_option( 'mo2f_show_sms_transaction_message' );
43
  update_option( 'mo2f_is_NC', 1 );
44
  update_option( 'mo2f_is_NNC', 1 );
@@ -109,13 +105,9 @@ if ( ! is_multisite() ) {
109
  delete_option( 'mo2f_enable_forgotphone' );
110
  delete_option( 'mo2f_enable_login_with_2nd_factor' );
111
  delete_option( 'mo2f_activate_plugin' );
112
- delete_option( 'mo2f_enable_2fa_for_woocommerce' );
113
  delete_option( 'mo2f_remember_device' );
114
  delete_option( 'mo2f_app_secret' );
115
- delete_option( 'mo2f_inline_registration' );
116
  delete_option( 'mo2f_enable_custom' );
117
- delete_option( 'mo2f_custom_plugin_name' );
118
- delete_option( 'mo2f_enable_custom_icon' );
119
  delete_option( 'mo2f_number_of_transactions' );
120
  delete_option( 'mo2f_set_transactions' );
121
  delete_option( 'mo2f_show_sms_transaction_message' );
32
  delete_option( 'mo2f_enable_forgotphone' );
33
  delete_option( 'mo2f_enable_login_with_2nd_factor' );
34
  delete_option( 'mo2f_activate_plugin' );
 
35
  delete_option( 'mo2f_remember_device' );
36
  delete_option( 'mo2f_app_secret' );
 
37
  delete_option( 'mo2f_enable_custom' );
 
 
38
  delete_option( 'mo2f_show_sms_transaction_message' );
39
  update_option( 'mo2f_is_NC', 1 );
40
  update_option( 'mo2f_is_NNC', 1 );
105
  delete_option( 'mo2f_enable_forgotphone' );
106
  delete_option( 'mo2f_enable_login_with_2nd_factor' );
107
  delete_option( 'mo2f_activate_plugin' );
 
108
  delete_option( 'mo2f_remember_device' );
109
  delete_option( 'mo2f_app_secret' );
 
110
  delete_option( 'mo2f_enable_custom' );
 
 
111
  delete_option( 'mo2f_number_of_transactions' );
112
  delete_option( 'mo2f_set_transactions' );
113
  delete_option( 'mo2f_show_sms_transaction_message' );
views/configure_google_authenticator CHANGED
@@ -12,41 +12,43 @@ function mo2f_configure_google_authenticator( $user ) {
12
  <table>
13
  <tr>
14
  <td class="mo2f_google_authy_step2">
15
- <?php echo '<' . $h_size . '>' . mo2f_lt( 'Step-1: Set up Google Authenticator' ) . '</' . $h_size . '>'; ?>
16
 
17
  <hr>
18
 
19
- <h4><?php echo mo2f_lt( 'Install the Google Authenticator App in your phone.' ); ?></h4>
20
- <ol style="margin-left:6%">
21
- <li><?php echo mo2f_lt( 'Navigate to App/Play Store in your phone.' ); ?>
22
- </li>
23
- <li><?php echo mo2f_lt( 'Search for Google Authenticator.' ); ?>
24
- <b>Android</b>: <a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2"
25
- target="_blank"><?php echo mo2f_lt( 'Play Store ' ); ?></a>&nbsp; <b>iPhone</b>: <a href="http://itunes.apple.com/us/app/google-authenticator/id388497605?mt=8"
26
- target="_blank"><?php echo mo2f_lt( 'App Store' ); ?></a>.
27
- </li>
28
 
29
- </ol>
30
- <?php if(!(get_option( 'mo2f_is_NC' ) && ! get_option( 'mo2f_is_NNC' ))){?>
31
- <h4>Choose your name on Google Authenicator:</h4>
32
- <form name="f" id="login_settings_appname_form" method="post" action="">
 
 
 
 
 
 
 
 
33
  <input type="hidden" name="option" value="mo2f_google_appname" />
34
  <input type="hidden" name="mo2f_google_appname_nonce"
35
  value="<?php echo wp_create_nonce( "mo2f-google-appname-nonce" ) ?>"/>
36
- <input type="text" class="mo2f_table_textbox" style="width:27% !important;" name="mo2f_google_auth_appname" placeholder="Enter the app name" value="<?php echo $gauth_name;?>" />&nbsp;&nbsp;&nbsp;
37
 
38
- <input type="submit" name="submit" value="Change App Name" class="button button-primary button-large" />
39
 
40
  <br>
41
  </form>
42
- <?php }?>
43
- <h4><?php echo mo2f_lt( 'Open Google Authenticator.' ); ?></h4>
 
 
44
  <ol>
45
  <li><?php echo mo2f_lt( 'In the app, tap on Menu and select "Set up account".' ); ?></li>
46
  <li><?php echo mo2f_lt( 'Select "Scan a barcode". Use your phone\'s camera to scan this barcode.' ); ?></li>
47
- <center>
48
- <div id="displayQrCode"><?php echo '<img src="data:image/jpg;base64,' . $data . '" />'; ?></div>
49
- </center>
50
 
51
  </ol>
52
  <br>
@@ -87,6 +89,7 @@ function mo2f_configure_google_authenticator( $user ) {
87
  </ol>
88
  </div>
89
  <br>
 
90
 
91
  </td>
92
  <td class="mo2f_vertical_line"></td>
@@ -120,12 +123,59 @@ function mo2f_configure_google_authenticator( $user ) {
120
  </tr>
121
  </table>
122
  <script>
 
 
 
 
 
 
 
 
 
 
 
123
  jQuery('input[type=radio][name=mo2f_app_type_radio]').change(function () {
124
  jQuery('#mo2f_configure_google_authy_form1').submit();
125
  });
126
- jQuery('html,body').animate({scrollTop: jQuery(document).height()}, 600);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  </script>
128
  <?php
129
  }
130
 
131
- ?>
12
  <table>
13
  <tr>
14
  <td class="mo2f_google_authy_step2">
15
+ <?php echo '<' . $h_size . '>' . mo2f_lt( 'Step-1: Set up Google/Authy/LastPass Authenticator' ) . '</' . $h_size . '>'; ?>
16
 
17
  <hr>
18
 
19
+ <p style="background-color:#a3e8c2;padding:5px;">
20
+ <?php echo mo2f_lt( 'You can configure this method in your Google/Authy/LastPass Authenticator apps.' ); ?>
21
+ </p>
 
 
 
 
 
 
22
 
23
+ <h4>1. <?php echo mo2f_lt( 'Install the Authenticator App that you wish to configure, in your phone.' ); ?></h4>
24
+ <div style="margin-left:40px;">
25
+ <input type="radio" name="google" value="ga" checked> Google Authenticator &nbsp;&nbsp;
26
+ <input type="radio" name="authy" value="aa"> Authy Authenticator &nbsp;&nbsp;
27
+ <input type="radio" name="lastpass" value="lpa"> LastPass Authenticator &nbsp;&nbsp;
28
+ </div>
29
+
30
+ <span id="links_to_apps"></span>
31
+ <div id="mo2f_change_app_name">
32
+ <h4>2. <?php echo mo2f_lt('Choose the account name to be configured in the App:'); ?></h4>
33
+ <div style="margin-left:40px;">
34
+ <form name="f" id="login_settings_appname_form" method="post" action="">
35
  <input type="hidden" name="option" value="mo2f_google_appname" />
36
  <input type="hidden" name="mo2f_google_appname_nonce"
37
  value="<?php echo wp_create_nonce( "mo2f-google-appname-nonce" ) ?>"/>
38
+ <input type="text" class="mo2f_table_textbox" style="width:17% !important;" name="mo2f_google_auth_appname" placeholder="Enter the app name" value="<?php echo $gauth_name;?>" />&nbsp;&nbsp;&nbsp;
39
 
40
+ <input type="submit" name="submit" value="Save App Name" class="button button-primary button-medium" />
41
 
42
  <br>
43
  </form>
44
+ </div>
45
+ </div>
46
+ <h4><span id="step_number"></span><?php echo mo2f_lt( 'Scan the QR code from the Authenticator App.' ); ?></h4>
47
+ <div style="margin-left:40px;">
48
  <ol>
49
  <li><?php echo mo2f_lt( 'In the app, tap on Menu and select "Set up account".' ); ?></li>
50
  <li><?php echo mo2f_lt( 'Select "Scan a barcode". Use your phone\'s camera to scan this barcode.' ); ?></li>
51
+ <div id="displayQrCode"style="padding:10px;"><?php echo '<img src="data:image/jpg;base64,' . $data . '" />'; ?></div>
 
 
52
 
53
  </ol>
54
  <br>
89
  </ol>
90
  </div>
91
  <br>
92
+ </div>
93
 
94
  </td>
95
  <td class="mo2f_vertical_line"></td>
123
  </tr>
124
  </table>
125
  <script>
126
+ jQuery(document).ready(function(){
127
+ jQuery(this).scrollTop(0);
128
+ if(jQuery('input[type=radio][name=google]').is(':checked')){
129
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
130
+ '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;' +
131
+ '<a href="http://itunes.apple.com/us/app/google-authenticator/id388497605" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
132
+ jQuery('#mo2f_change_app_name').show();
133
+ jQuery('#links_to_apps').show();
134
+ }
135
+ });
136
+
137
  jQuery('input[type=radio][name=mo2f_app_type_radio]').change(function () {
138
  jQuery('#mo2f_configure_google_authy_form1').submit();
139
  });
140
+
141
+ jQuery('#links_to_apps').show();
142
+ jQuery('#mo2f_change_app_name').hide();
143
+ jQuery('#step_number').html('2. ');
144
+
145
+ jQuery('input[type=radio][name=google]').click(function(){
146
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
147
+ '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;' +
148
+ '<a href="http://itunes.apple.com/us/app/google-authenticator/id388497605" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
149
+ jQuery('#step_number').html('3. ');
150
+ jQuery("input[type=radio][name=authy]").prop("checked", false);
151
+ jQuery("input[type=radio][name=lastpass]").prop("checked", false);
152
+ jQuery('#mo2f_change_app_name').show();
153
+ jQuery('#links_to_apps').show();
154
+ });
155
+
156
+ jQuery('input[type=radio][name=authy]').click(function(){
157
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
158
+ '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;' +
159
+ '<a href="https://itunes.apple.com/in/app/authy/id494168017" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
160
+ jQuery("input[type=radio][name=google]").prop("checked", false);
161
+ jQuery("input[type=radio][name=lastpass]").prop("checked", false);
162
+ jQuery('#mo2f_change_app_name').hide();
163
+ jQuery('#step_number').html('2. ');
164
+ jQuery('#links_to_apps').show();
165
+ });
166
+
167
+ jQuery('input[type=radio][name=lastpass]').click(function(){
168
+ jQuery('#links_to_apps').html('<p style="background-color:#e8e4e4;padding:5px;margin-left:40px;width:65%">' +
169
+ '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;' +
170
+ '<a href="https://itunes.apple.com/in/app/lastpass-authenticator/id1079110004" target="_blank"><b><?php echo mo2f_lt( "iOS App Store" ); ?>.</b>&nbsp;</p>');
171
+ jQuery("input[type=radio][name=authy]").prop("checked", false);
172
+ jQuery("input[type=radio][name=google]").prop("checked", false);
173
+ jQuery('#mo2f_change_app_name').show();
174
+ jQuery('#step_number').html('3. ');
175
+ jQuery('#links_to_apps').show();
176
+ });
177
  </script>
178
  <?php
179
  }
180
 
181
+ ?>
views/feedback_form.php CHANGED
@@ -3,13 +3,14 @@
3
  return;
4
  }
5
 
6
- $setup_guide_link = plugins_url( '/../includes/guides/Instructions for premium customers.pdf', __FILE__ );
 
7
  $plugins = MO2f_Utility::get_all_plugins_installed();
8
 
9
  wp_enqueue_style( 'wp-pointer' );
10
  wp_enqueue_script( 'wp-pointer' );
11
  wp_enqueue_script( 'utils' );
12
- wp_enqueue_style( 'mo_2_factor_admin_plugins_page_style', plugins_url( '/../includes/css/mo2f_plugins_page.css?version=5.1.11', __FILE__ ) );
13
 
14
  $action = 'install-plugin';
15
  $slug = 'miniorange-google-authenticator';
@@ -40,7 +41,7 @@
40
  $deactivate_reasons = array(
41
  "Temporary deactivation - Testing",
42
  "Did not want to create an account",
43
- "Upgrading to Premium",
44
  "Conflicts with other plugins",
45
  "Redirecting back to login page after Authentication",
46
  "Database Error",
@@ -131,11 +132,11 @@
131
  ', without the need of creating an account with miniOrange. To get the plugin, ' +
132
  '<a href="<?php echo $install_link?>" target="_blank" onclick="handledeactivateplugin()"><b>CLICK HERE.</b></a></p>');
133
  jQuery('#link_id').show();
134
- }else if (reason == "Upgrading to Premium") {
135
  jQuery('#other_plugins_installed').hide();
136
  jQuery('#query_feedback').attr("placeholder", "Write your query here.");
137
- jQuery('#link_id').html('<p style="background-color:#a3e8c2;padding:5px;">Thanks for upgrading. For setup instructions, please follow this guide' +
138
- ', <a href="<?php echo $setup_guide_link?>" download><b>DOWNLOAD GUIDE.</b></a></p>');
139
  jQuery('#link_id').show();
140
  }else if(reason=="Database Error"){
141
  jQuery('#query_feedback').attr("placeholder", "Can you please mention the plugin name, and the issue?");
3
  return;
4
  }
5
 
6
+ $setup_guide_link_std = plugins_url( '/../includes/guides/Guide for Standard Plugin.pdf', __FILE__ );
7
+ $setup_guide_link_prem = plugins_url( '/../includes/guides/Guide for Premium Plugin.pdf', __FILE__ );
8
  $plugins = MO2f_Utility::get_all_plugins_installed();
9
 
10
  wp_enqueue_style( 'wp-pointer' );
11
  wp_enqueue_script( 'wp-pointer' );
12
  wp_enqueue_script( 'utils' );
13
+ wp_enqueue_style( 'mo_2_factor_admin_plugins_page_style', plugins_url( '/../includes/css/mo2f_plugins_page.css?version=5.1.14', __FILE__ ) );
14
 
15
  $action = 'install-plugin';
16
  $slug = 'miniorange-google-authenticator';
41
  $deactivate_reasons = array(
42
  "Temporary deactivation - Testing",
43
  "Did not want to create an account",
44
+ "Upgrading to Standard / Premium",
45
  "Conflicts with other plugins",
46
  "Redirecting back to login page after Authentication",
47
  "Database Error",
132
  ', without the need of creating an account with miniOrange. To get the plugin, ' +
133
  '<a href="<?php echo $install_link?>" target="_blank" onclick="handledeactivateplugin()"><b>CLICK HERE.</b></a></p>');
134
  jQuery('#link_id').show();
135
+ }else if (reason == "Upgrading to Standard / Premium") {
136
  jQuery('#other_plugins_installed').hide();
137
  jQuery('#query_feedback').attr("placeholder", "Write your query here.");
138
+ jQuery('#link_id').html('<p style="background-color:#a3e8c2;padding:5px;">Thanks for upgrading. For Standard plugin guide,' +
139
+ ' <a href="<?php echo $setup_guide_link_std; ?>" download><b>click here.</b></a> For Premium plugin guide, <a href="<?php echo $setup_guide_link_prem; ?>" download><b>click here.</b></a></p>');
140
  jQuery('#link_id').show();
141
  }else if(reason=="Database Error"){
142
  jQuery('#query_feedback').attr("placeholder", "Can you please mention the plugin name, and the issue?");
views/test_miniorange_qr_code_authentication CHANGED
@@ -25,7 +25,7 @@ function mo2f_test_miniorange_qr_code_authentication( $user ) {
25
  <br><br>
26
  <table class="mo2f_settings_table">
27
  <div id="qr-success"></div>
28
- <div id="displayQrCode" style="margin-left:250px;">
29
  <br><?php echo '<img style="width:165px;" src="data:image/jpg;base64,' . $_SESSION['mo2f_qrCode'] . '" />'; ?>
30
  </div>
31
 
25
  <br><br>
26
  <table class="mo2f_settings_table">
27
  <div id="qr-success"></div>
28
+ <div id="displayQrCode" >
29
  <br><?php echo '<img style="width:165px;" src="data:image/jpg;base64,' . $_SESSION['mo2f_qrCode'] . '" />'; ?>
30
  </div>
31