Version Description
- Google Authenticator-Two Factor Authentication (2FA) : Adding basic Security Features Monitorning, IP blocking and login transaction report.
Download this release
Release Info
Developer | cyberlord92 |
Plugin | Google Authenticator – WordPress Two Factor Authentication (2FA) |
Version | 5.1.19 |
Comparing to | |
See all releases |
Code changes from version 5.1.17 to 5.1.19
- class-customer-setup.php +2 -2
- class-miniorange-2-factor-login.php +5 -5
- class-miniorange-2-factor-pass2fa-login.php +66 -59
- class-utility.php +38 -18
- includes/css/bootstrap.min.css +1 -1
- includes/css/jquery.dataTables.min.css +143 -0
- includes/css/style_settings.css +972 -14
- includes/images/captchaimage.jpeg +0 -0
- includes/images/easy.PNG +0 -0
- includes/images/enforce_password.png +0 -0
- includes/images/google.PNG +0 -0
- includes/images/normal.PNG +0 -0
- includes/images/sort_asc.png +0 -0
- includes/images/sort_both.png +0 -0
- includes/images/sort_desc.png +0 -0
- includes/js/jquery.dataTables.min.js +164 -0
- includes/js/menu.js +3 -0
- includes/js/rba/js/device_attributes.js +1 -1
- miniorange_2_factor_common_login.php +9 -5
- miniorange_2_factor_configuration.php +702 -520
- miniorange_2_factor_mobile_configuration.php +99 -68
- miniorange_2_factor_settings.php +110 -179
- miniorange_2_factor_support.php +5 -4
- network_security/class_miniorange_2fa_network_security.php +257 -0
- network_security/integrations/class_buddypress.php +44 -0
- network_security/miniorange_2_factor_network_security_view.php +7 -0
- network_security/miniorange_handler.php +271 -0
- network_security/templates/403.php +7 -0
- network_security/views/miniorange_network_security_brute_force.php +79 -0
- network_security/views/miniorange_network_security_ip_blocking.php +82 -0
- network_security/views/miniorange_network_security_monitoring.php +79 -0
- readme.txt +16 -4
- resources/constants.php +17 -0
- resources/messages.php +22 -0
- templates/403.php +4 -0
- uninstall.php +33 -0
- views/configure_google_authenticator +2 -2
- views/configure_miniorange_authenticator +4 -3
- views/feedback_form.php +1 -1
- views/test_miniorange_push_notification +3 -3
- views/test_miniorange_qr_code_authentication +1 -1
- views/test_miniorange_soft_token +27 -26
class-customer-setup.php
CHANGED
@@ -115,7 +115,7 @@ class Customer_Setup {
|
|
115 |
$customer_feature = "V3";
|
116 |
}
|
117 |
|
118 |
-
$query = '[WordPress 2 Factor Authentication Plugin: ' . $customer_feature . ' - V 5.1.
|
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 |
|
@@ -613,7 +613,7 @@ class Customer_Setup {
|
|
613 |
$customer_feature = "V3";
|
614 |
}
|
615 |
|
616 |
-
$query = '[WordPress 2 Factor Authentication Plugin: ' . $customer_feature . ' - V 5.1.
|
617 |
$fields = array(
|
618 |
'firstName' => $user->user_firstname,
|
619 |
'lastName' => $user->user_lastname,
|
115 |
$customer_feature = "V3";
|
116 |
}
|
117 |
|
118 |
+
$query = '[WordPress 2 Factor Authentication Plugin: ' . $customer_feature . ' - V 5.1.19]: ' . $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 |
|
613 |
$customer_feature = "V3";
|
614 |
}
|
615 |
|
616 |
+
$query = '[WordPress 2 Factor Authentication Plugin: ' . $customer_feature . ' - V 5.1.19]: ' . $query;
|
617 |
$fields = array(
|
618 |
'firstName' => $user->user_firstname,
|
619 |
'lastName' => $user->user_lastname,
|
class-miniorange-2-factor-login.php
CHANGED
@@ -145,8 +145,8 @@ class Miniorange_Mobile_Login {
|
|
145 |
}
|
146 |
|
147 |
function mo_2_factor_hide_login() {
|
148 |
-
wp_register_style( 'hide-login', plugins_url( 'includes/css/hide-login.css?version=5.1.
|
149 |
-
wp_register_style( 'bootstrap', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.
|
150 |
wp_enqueue_style( 'hide-login' );
|
151 |
wp_enqueue_style( 'bootstrap' );
|
152 |
|
@@ -198,7 +198,7 @@ class Miniorange_Mobile_Login {
|
|
198 |
}
|
199 |
|
200 |
function mo_2_factor_show_login_with_password_when_phonelogin_enabled() {
|
201 |
-
wp_register_style( 'show-login', plugins_url( 'includes/css/show-login.css?version=5.1.
|
202 |
wp_enqueue_style( 'show-login' );
|
203 |
}
|
204 |
|
@@ -220,9 +220,9 @@ class Miniorange_Mobile_Login {
|
|
220 |
|
221 |
function mo_2_factor_show_login() {
|
222 |
if ( get_option( 'mo2f_enable_login_with_2nd_factor' ) ) {
|
223 |
-
wp_register_style( 'show-login', plugins_url( 'includes/css/hide-login-form.css?version=5.1.
|
224 |
} else {
|
225 |
-
wp_register_style( 'show-login', plugins_url( 'includes/css/show-login.css?version=5.1.
|
226 |
}
|
227 |
wp_enqueue_style( 'show-login' );
|
228 |
}
|
145 |
}
|
146 |
|
147 |
function mo_2_factor_hide_login() {
|
148 |
+
wp_register_style( 'hide-login', plugins_url( 'includes/css/hide-login.css?version=5.1.19', __FILE__ ) );
|
149 |
+
wp_register_style( 'bootstrap', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.19', __FILE__ ) );
|
150 |
wp_enqueue_style( 'hide-login' );
|
151 |
wp_enqueue_style( 'bootstrap' );
|
152 |
|
198 |
}
|
199 |
|
200 |
function mo_2_factor_show_login_with_password_when_phonelogin_enabled() {
|
201 |
+
wp_register_style( 'show-login', plugins_url( 'includes/css/show-login.css?version=5.1.19', __FILE__ ) );
|
202 |
wp_enqueue_style( 'show-login' );
|
203 |
}
|
204 |
|
220 |
|
221 |
function mo_2_factor_show_login() {
|
222 |
if ( get_option( 'mo2f_enable_login_with_2nd_factor' ) ) {
|
223 |
+
wp_register_style( 'show-login', plugins_url( 'includes/css/hide-login-form.css?version=5.1.19', __FILE__ ) );
|
224 |
} else {
|
225 |
+
wp_register_style( 'show-login', plugins_url( 'includes/css/show-login.css?version=5.1.19', __FILE__ ) );
|
226 |
}
|
227 |
wp_enqueue_style( 'show-login' );
|
228 |
}
|
class-miniorange-2-factor-pass2fa-login.php
CHANGED
@@ -24,17 +24,17 @@
|
|
24 |
include_once dirname( __FILE__ ) . '/miniorange_2_factor_common_login.php';
|
25 |
include_once dirname( __FILE__ ) . '/class-rba-attributes.php';
|
26 |
|
27 |
-
|
28 |
class Miniorange_Password_2Factor_Login {
|
29 |
|
30 |
private $mo2f_kbaquestions;
|
31 |
private $mo2f_userID;
|
32 |
private $mo2f_rbastatus;
|
33 |
private $mo2f_transactionid;
|
34 |
-
|
35 |
public function miniorange_pass2login_redirect() {
|
36 |
-
|
37 |
global $Mo2fdbQueries;
|
|
|
38 |
if ( ! get_option( 'mo2f_login_option' ) ) {
|
39 |
if ( isset( $_POST['miniorange_login_nonce'] ) ) {
|
40 |
$nonce = $_POST['miniorange_login_nonce'];
|
@@ -130,9 +130,7 @@ class Miniorange_Password_2Factor_Login {
|
|
130 |
$redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
|
131 |
$this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
|
132 |
}
|
133 |
-
}
|
134 |
-
|
135 |
-
if ( isset( $_POST['mo2f_trust_device_cancel_nonce'] ) ) { /*do not register device as rba profile */
|
136 |
$nonce = $_POST['mo2f_trust_device_cancel_nonce'];
|
137 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-trust-device-cancel-nonce' ) ) {
|
138 |
$error = new WP_Error();
|
@@ -144,9 +142,7 @@ class Miniorange_Password_2Factor_Login {
|
|
144 |
$redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
|
145 |
$this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
|
146 |
}
|
147 |
-
}
|
148 |
-
|
149 |
-
if ( isset( $_POST['miniorange_challenge_forgotphone_nonce'] ) ) { /*check kba validation*/
|
150 |
$nonce = $_POST['miniorange_challenge_forgotphone_nonce'];
|
151 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-challenge-forgotphone-nonce' ) ) {
|
152 |
$error = new WP_Error();
|
@@ -191,9 +187,7 @@ class Miniorange_Password_2Factor_Login {
|
|
191 |
}
|
192 |
}
|
193 |
}
|
194 |
-
}
|
195 |
-
|
196 |
-
if ( isset( $_POST['miniorange_alternate_login_kba_nonce'] ) ) { /*check kba validation*/
|
197 |
$nonce = $_POST['miniorange_alternate_login_kba_nonce'];
|
198 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-alternate-login-kba-nonce' ) ) {
|
199 |
$error = new WP_Error();
|
@@ -206,9 +200,7 @@ class Miniorange_Password_2Factor_Login {
|
|
206 |
$redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
|
207 |
$this->mo2f_pass2login_kba_verification( $user_id, $redirect_to,$session_id_encrypt );
|
208 |
}
|
209 |
-
}
|
210 |
-
|
211 |
-
if ( isset( $_POST['miniorange_kba_nonce'] ) ) { /*check kba validation*/
|
212 |
$nonce = $_POST['miniorange_kba_nonce'];
|
213 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-kba-nonce' ) ) {
|
214 |
$error = new WP_Error();
|
@@ -262,9 +254,7 @@ class Miniorange_Password_2Factor_Login {
|
|
262 |
return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Please try again..' ) );
|
263 |
}
|
264 |
}
|
265 |
-
}
|
266 |
-
|
267 |
-
if ( isset( $_POST['miniorange_mobile_validation_nonce'] ) ) { /*check mobile validation */
|
268 |
$nonce = $_POST['miniorange_mobile_validation_nonce'];
|
269 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-mobile-validation-nonce' ) ) {
|
270 |
$error = new WP_Error();
|
@@ -296,9 +286,7 @@ class Miniorange_Password_2Factor_Login {
|
|
296 |
return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Please try again.' ) );
|
297 |
}
|
298 |
}
|
299 |
-
}
|
300 |
-
|
301 |
-
if ( isset( $_POST['miniorange_mobile_validation_failed_nonce'] ) ) { /*Back to miniOrange Login Page if mobile validation failed and from back button of mobile challenge, soft token and default login*/
|
302 |
$nonce = $_POST['miniorange_mobile_validation_failed_nonce'];
|
303 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-mobile-validation-failed-nonce' ) ) {
|
304 |
$error = new WP_Error();
|
@@ -309,9 +297,7 @@ class Miniorange_Password_2Factor_Login {
|
|
309 |
$session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
|
310 |
$this->remove_current_activity($session_id_encrypt);
|
311 |
}
|
312 |
-
}
|
313 |
-
|
314 |
-
if ( isset( $_POST['miniorange_forgotphone'] ) ) { /*Click on the link of forgotphone */
|
315 |
$nonce = $_POST['miniorange_forgotphone'];
|
316 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-forgotphone' ) ) {
|
317 |
$error = new WP_Error();
|
@@ -356,9 +342,7 @@ class Miniorange_Password_2Factor_Login {
|
|
356 |
$pass2fa_login = new Miniorange_Password_2Factor_Login();
|
357 |
$pass2fa_login->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
|
358 |
}
|
359 |
-
}
|
360 |
-
|
361 |
-
if ( isset( $_POST['miniorange_softtoken'] ) ) { /*Click on the link of phone is offline */
|
362 |
$nonce = $_POST['miniorange_softtoken'];
|
363 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-softtoken' ) ) {
|
364 |
$error = new WP_Error();
|
@@ -376,10 +360,7 @@ class Miniorange_Password_2Factor_Login {
|
|
376 |
$mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN';
|
377 |
$this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
|
378 |
}
|
379 |
-
}
|
380 |
-
|
381 |
-
|
382 |
-
if ( isset( $_POST['miniorange_soft_token_nonce'] ) ) { /*Validate Soft Token,OTP over SMS,OTP over EMAIL,Phone verification */
|
383 |
$nonce = $_POST['miniorange_soft_token_nonce'];
|
384 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-soft-token-nonce' ) ) {
|
385 |
$error = new WP_Error();
|
@@ -391,18 +372,39 @@ class Miniorange_Password_2Factor_Login {
|
|
391 |
$mo2fa_login_status = isset( $_POST['request_origin_method'] ) ? $_POST['request_origin_method'] : null;
|
392 |
$redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
|
393 |
$softtoken = '';
|
|
|
|
|
|
|
394 |
if ( MO2f_utility::mo2f_check_empty_or_null( $_POST['mo2fa_softtoken'] ) ) {
|
|
|
|
|
|
|
395 |
$mo2fa_login_message = 'Please enter OTP to proceed.';
|
396 |
$this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
|
|
|
|
|
|
|
|
|
|
|
397 |
} else {
|
|
|
398 |
$softtoken = sanitize_text_field( $_POST['mo2fa_softtoken'] );
|
399 |
if ( ! MO2f_utility::mo2f_check_number_length( $softtoken ) ) {
|
400 |
-
$
|
401 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
402 |
}
|
403 |
}
|
404 |
|
405 |
-
|
406 |
$user_email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user_id );
|
407 |
|
408 |
if ( isset( $user_id ) ) {
|
@@ -433,9 +435,16 @@ class Miniorange_Password_2Factor_Login {
|
|
433 |
$this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
|
434 |
}
|
435 |
} else {
|
436 |
-
|
437 |
-
|
438 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
439 |
}
|
440 |
|
441 |
} else {
|
@@ -443,9 +452,7 @@ class Miniorange_Password_2Factor_Login {
|
|
443 |
return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Please try again..' ) );
|
444 |
}
|
445 |
}
|
446 |
-
}
|
447 |
-
|
448 |
-
if ( isset( $_POST['miniorange_inline_skip_registration_nonce'] ) ) { /*Validate Soft Token,OTP over SMS,OTP over EMAIL,Phone verification */
|
449 |
$nonce = $_POST['miniorange_inline_skip_registration_nonce'];
|
450 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-inline-skip-registration-nonce' ) ) {
|
451 |
$error = new WP_Error();
|
@@ -458,9 +465,7 @@ class Miniorange_Password_2Factor_Login {
|
|
458 |
$user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id);
|
459 |
$this->mo2fa_pass2login(null, $session_id );
|
460 |
}
|
461 |
-
}
|
462 |
-
|
463 |
-
if ( isset( $_POST['miniorange_attribute_collection_nonce'] ) ) { /*Handling Rba Attributes from other plugins */
|
464 |
$nonce = $_POST['miniorange_attribute_collection_nonce'];
|
465 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-login-attribute-collection-nonce' ) ) {
|
466 |
$error = new WP_Error();
|
@@ -481,6 +486,7 @@ class Miniorange_Password_2Factor_Login {
|
|
481 |
}
|
482 |
}
|
483 |
}
|
|
|
484 |
|
485 |
function remove_current_activity($session_id) {
|
486 |
global $Mo2fdbQueries;
|
@@ -539,7 +545,6 @@ class Miniorange_Password_2Factor_Login {
|
|
539 |
'mo_2_factor_kba_questions' => '',
|
540 |
'mo2f_rba_status' => '',
|
541 |
'ts_created' => ''
|
542 |
-
|
543 |
) );
|
544 |
|
545 |
|
@@ -602,12 +607,13 @@ class Miniorange_Password_2Factor_Login {
|
|
602 |
mo2f_get_qrcode_authentication_prompt( $login_status, $login_message, $redirect_to, $qrCode, $session_id_encrypt, $transactionid );
|
603 |
exit;
|
604 |
} else if ( $this->miniorange_pass2login_check_otp_status( $login_status ) ) { //for soft-token,otp over email,sms,phone verification,google auth
|
605 |
-
|
|
|
606 |
exit;
|
607 |
} else if ( $this->miniorange_pass2login_check_forgotphone_status( $login_status ) ) { // forgot phone page if both KBA and Email are configured.
|
608 |
mo2f_get_forgotphone_form( $login_status, $login_message, $redirect_to, $session_id_encrypt );
|
609 |
exit;
|
610 |
-
}
|
611 |
$transactionid = $this->mo2f_transactionid ? $this->mo2f_transactionid : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_transactionId',$session_id_encrypt );
|
612 |
$user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
|
613 |
mo2f_get_push_notification_oobemail_prompt( $user_id, $login_status, $login_message, $redirect_to, $session_id_encrypt, $transactionid );
|
@@ -711,12 +717,11 @@ class Miniorange_Password_2Factor_Login {
|
|
711 |
if(is_null($session_id_encrypt)) {
|
712 |
$session_id_encrypt=$this->create_session();
|
713 |
}
|
714 |
-
|
715 |
?>
|
716 |
<p><input type="hidden" name="miniorange_login_nonce"
|
717 |
value="<?php echo wp_create_nonce( 'miniorange-2-factor-login-nonce' ); ?>"/>
|
718 |
|
719 |
-
<input type="hidden" name="miniorange_user_session"
|
720 |
value="<?php echo $session_id_encrypt; ?>"/>
|
721 |
|
722 |
</p>
|
@@ -845,7 +850,7 @@ class Miniorange_Password_2Factor_Login {
|
|
845 |
$mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN';
|
846 |
$this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to, null,$session_id );
|
847 |
} else if ( $mo2f_second_factor == 'GOOGLE AUTHENTICATOR' ) {
|
848 |
-
$mo2fa_login_message ='Please enter the one time passcode shown in the <b>
|
849 |
$mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_GOOGLE_AUTHENTICATION';
|
850 |
$this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to, null,$session_id );
|
851 |
} else {
|
@@ -889,7 +894,8 @@ class Miniorange_Password_2Factor_Login {
|
|
889 |
if ( $user_id && $mo2f_1stfactor_status && ( $mo2f_1stfactor_status == 'VALIDATE_SUCCESS' ) ) {
|
890 |
$currentuser = get_user_by( 'id', $user_id );
|
891 |
wp_set_current_user( $user_id, $currentuser->user_login );
|
892 |
-
|
|
|
893 |
wp_set_auth_cookie( $user_id, true );
|
894 |
do_action( 'wp_login', $currentuser->user_login, $currentuser );
|
895 |
redirect_user_to( $currentuser, $redirect_to );
|
@@ -923,12 +929,11 @@ class Miniorange_Password_2Factor_Login {
|
|
923 |
|
924 |
$is_customer_admin = get_option( 'mo2f_miniorange_admin' ) == $currentuser->ID ? true : false;
|
925 |
|
926 |
-
//if ( $enabled_2fa_byusers ) {
|
927 |
-
|
928 |
if ( $is_customer_admin ) {
|
929 |
$email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $currentuser->ID );
|
930 |
$mo_2factor_user_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $currentuser->ID );
|
931 |
$kba_configuration_status = $Mo2fdbQueries->get_user_detail( 'mo2f_SecurityQuestions_config_status', $currentuser->ID );
|
|
|
932 |
if ( $email && $mo_2factor_user_registration_status == 'MO_2_FACTOR_PLUGIN_SETTINGS' ) { //checking if user has configured any 2nd factor method
|
933 |
try {
|
934 |
$mo2f_rba_status = mo2f_collect_attributes( $email, stripslashes( $attributes ) ); // Rba flow
|
@@ -938,7 +943,6 @@ class Miniorange_Password_2Factor_Login {
|
|
938 |
echo $e->getMessage();
|
939 |
}
|
940 |
|
941 |
-
|
942 |
if ( $mo2f_rba_status['status'] == 'SUCCESS' && $mo2f_rba_status['decision_flag'] ) {
|
943 |
$this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
|
944 |
} else if ( ($mo2f_rba_status['status'] == 'DENY' ) && get_option( 'mo2f_rba_installed' ) ) {
|
@@ -949,9 +953,11 @@ class Miniorange_Password_2Factor_Login {
|
|
949 |
$this->mo2f_restrict_access( 'Access_denied' );
|
950 |
exit;
|
951 |
} else {
|
952 |
-
$mo2f_second_factor =
|
953 |
-
|
954 |
-
|
|
|
|
|
955 |
$error=$this->mo2f_validate_soft_token($currentuser, $redirect_to, $mo2f_second_factor, $otp_token,$session_id_encrypt);
|
956 |
|
957 |
if(is_wp_error( $error)){
|
@@ -971,7 +977,7 @@ class Miniorange_Password_2Factor_Login {
|
|
971 |
$this->mo2f_pass2login_otp_verification( $currentuser, $mo2f_second_factor, $redirect_to, $session_id_encrypt );
|
972 |
} else if ( $mo2f_second_factor == 'KBA' ) {
|
973 |
$this->mo2f_pass2login_kba_verification( $currentuser->ID, $redirect_to , $session_id_encrypt );
|
974 |
-
}
|
975 |
$this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
|
976 |
} else {
|
977 |
$this->remove_current_activity($session_id_encrypt);
|
@@ -1033,7 +1039,6 @@ class Miniorange_Password_2Factor_Login {
|
|
1033 |
}
|
1034 |
|
1035 |
function mo2f_check_username_password( $user, $username, $password, $redirect_to = null ) {
|
1036 |
-
|
1037 |
if ( is_a( $user, 'WP_Error' ) && ! empty( $user ) ) {
|
1038 |
return $user;
|
1039 |
}
|
@@ -1076,6 +1081,8 @@ class Miniorange_Password_2Factor_Login {
|
|
1076 |
$session_id=$this->create_session();
|
1077 |
}
|
1078 |
|
|
|
|
|
1079 |
$error=$this->miniorange_initiate_2nd_factor( $currentuser, $attributes, $redirect_to, $otp_token, $session_id );
|
1080 |
|
1081 |
|
@@ -1114,4 +1121,4 @@ class Miniorange_Password_2Factor_Login {
|
|
1114 |
|
1115 |
}
|
1116 |
|
1117 |
-
?>
|
24 |
include_once dirname( __FILE__ ) . '/miniorange_2_factor_common_login.php';
|
25 |
include_once dirname( __FILE__ ) . '/class-rba-attributes.php';
|
26 |
|
|
|
27 |
class Miniorange_Password_2Factor_Login {
|
28 |
|
29 |
private $mo2f_kbaquestions;
|
30 |
private $mo2f_userID;
|
31 |
private $mo2f_rbastatus;
|
32 |
private $mo2f_transactionid;
|
33 |
+
|
34 |
public function miniorange_pass2login_redirect() {
|
35 |
+
do_action('mo2f_network_init');
|
36 |
global $Mo2fdbQueries;
|
37 |
+
|
38 |
if ( ! get_option( 'mo2f_login_option' ) ) {
|
39 |
if ( isset( $_POST['miniorange_login_nonce'] ) ) {
|
40 |
$nonce = $_POST['miniorange_login_nonce'];
|
130 |
$redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
|
131 |
$this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
|
132 |
}
|
133 |
+
}else if ( isset( $_POST['mo2f_trust_device_cancel_nonce'] ) ) { /*do not register device as rba profile */
|
|
|
|
|
134 |
$nonce = $_POST['mo2f_trust_device_cancel_nonce'];
|
135 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-trust-device-cancel-nonce' ) ) {
|
136 |
$error = new WP_Error();
|
142 |
$redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
|
143 |
$this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
|
144 |
}
|
145 |
+
}else if ( isset( $_POST['miniorange_challenge_forgotphone_nonce'] ) ) { /*check kba validation*/
|
|
|
|
|
146 |
$nonce = $_POST['miniorange_challenge_forgotphone_nonce'];
|
147 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-challenge-forgotphone-nonce' ) ) {
|
148 |
$error = new WP_Error();
|
187 |
}
|
188 |
}
|
189 |
}
|
190 |
+
}else if ( isset( $_POST['miniorange_alternate_login_kba_nonce'] ) ) { /*check kba validation*/
|
|
|
|
|
191 |
$nonce = $_POST['miniorange_alternate_login_kba_nonce'];
|
192 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-alternate-login-kba-nonce' ) ) {
|
193 |
$error = new WP_Error();
|
200 |
$redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
|
201 |
$this->mo2f_pass2login_kba_verification( $user_id, $redirect_to,$session_id_encrypt );
|
202 |
}
|
203 |
+
}else if ( isset( $_POST['miniorange_kba_nonce'] ) ) { /*check kba validation*/
|
|
|
|
|
204 |
$nonce = $_POST['miniorange_kba_nonce'];
|
205 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-kba-nonce' ) ) {
|
206 |
$error = new WP_Error();
|
254 |
return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Please try again..' ) );
|
255 |
}
|
256 |
}
|
257 |
+
}else if ( isset( $_POST['miniorange_mobile_validation_nonce'] ) ) { /*check mobile validation */
|
|
|
|
|
258 |
$nonce = $_POST['miniorange_mobile_validation_nonce'];
|
259 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-mobile-validation-nonce' ) ) {
|
260 |
$error = new WP_Error();
|
286 |
return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Please try again.' ) );
|
287 |
}
|
288 |
}
|
289 |
+
}else if ( isset( $_POST['miniorange_mobile_validation_failed_nonce'] ) ) { /*Back to miniOrange Login Page if mobile validation failed and from back button of mobile challenge, soft token and default login*/
|
|
|
|
|
290 |
$nonce = $_POST['miniorange_mobile_validation_failed_nonce'];
|
291 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-mobile-validation-failed-nonce' ) ) {
|
292 |
$error = new WP_Error();
|
297 |
$session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
|
298 |
$this->remove_current_activity($session_id_encrypt);
|
299 |
}
|
300 |
+
}else if ( isset( $_POST['miniorange_forgotphone'] ) ) { /*Click on the link of forgotphone */
|
|
|
|
|
301 |
$nonce = $_POST['miniorange_forgotphone'];
|
302 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-forgotphone' ) ) {
|
303 |
$error = new WP_Error();
|
342 |
$pass2fa_login = new Miniorange_Password_2Factor_Login();
|
343 |
$pass2fa_login->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
|
344 |
}
|
345 |
+
}else if ( isset( $_POST['miniorange_softtoken'] ) ) { /*Click on the link of phone is offline */
|
|
|
|
|
346 |
$nonce = $_POST['miniorange_softtoken'];
|
347 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-softtoken' ) ) {
|
348 |
$error = new WP_Error();
|
360 |
$mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN';
|
361 |
$this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
|
362 |
}
|
363 |
+
}else if ( isset( $_POST['miniorange_soft_token_nonce'] ) ) { /*Validate Soft Token,OTP over SMS,OTP over EMAIL,Phone verification */
|
|
|
|
|
|
|
364 |
$nonce = $_POST['miniorange_soft_token_nonce'];
|
365 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-soft-token-nonce' ) ) {
|
366 |
$error = new WP_Error();
|
372 |
$mo2fa_login_status = isset( $_POST['request_origin_method'] ) ? $_POST['request_origin_method'] : null;
|
373 |
$redirect_to = isset( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : null;
|
374 |
$softtoken = '';
|
375 |
+
$user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
|
376 |
+
$attempts=get_user_meta( $user_id, 'mo2f_user_login_attempts', true );
|
377 |
+
|
378 |
if ( MO2f_utility::mo2f_check_empty_or_null( $_POST['mo2fa_softtoken'] ) ) {
|
379 |
+
if($attempts>1)
|
380 |
+
{
|
381 |
+
update_user_meta( $user_id , 'mo2f_user_login_attempts', $attempts-1 );
|
382 |
$mo2fa_login_message = 'Please enter OTP to proceed.';
|
383 |
$this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
|
384 |
+
}else{
|
385 |
+
$session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
|
386 |
+
$this->remove_current_activity($session_id_encrypt);
|
387 |
+
return new WP_Error( 'limit_exceeded', '<strong>ERROR</strong>: Number of attempts exceeded.');
|
388 |
+
}
|
389 |
} else {
|
390 |
+
|
391 |
$softtoken = sanitize_text_field( $_POST['mo2fa_softtoken'] );
|
392 |
if ( ! MO2f_utility::mo2f_check_number_length( $softtoken ) ) {
|
393 |
+
if($attempts>1)
|
394 |
+
{
|
395 |
+
update_user_meta( $user_id , 'mo2f_user_login_attempts', $attempts-1 );
|
396 |
+
$mo2fa_login_message = 'Invalid OTP. Only digits within range 4-8 are allowed. Please try again.';
|
397 |
+
$this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
|
398 |
+
|
399 |
+
}else{
|
400 |
+
$session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
|
401 |
+
$this->remove_current_activity($session_id_encrypt);
|
402 |
+
return new WP_Error( 'limit_exceeded', '<strong>ERROR</strong>: Number of attempts exceeded.');
|
403 |
+
}
|
404 |
}
|
405 |
}
|
406 |
|
407 |
+
|
408 |
$user_email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user_id );
|
409 |
|
410 |
if ( isset( $user_id ) ) {
|
435 |
$this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
|
436 |
}
|
437 |
} else {
|
438 |
+
if($attempts>1)
|
439 |
+
{
|
440 |
+
update_user_meta( $user_id , 'mo2f_user_login_attempts', $attempts-1 );
|
441 |
+
$message = $mo2fa_login_status == 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN' ? 'You have entered an invalid OTP.<br>Please click on <b>Sync Time</b> in the miniOrange Authenticator app to sync your phone time with the miniOrange servers and try again.' : 'Invalid OTP. Please try again.';
|
442 |
+
$this->miniorange_pass2login_form_fields( $mo2fa_login_status, $message, $redirect_to,null,$session_id_encrypt );
|
443 |
+
}else{
|
444 |
+
$session_id_encrypt = isset( $_POST['session_id'] ) ? $_POST['session_id'] : null;
|
445 |
+
$this->remove_current_activity($session_id_encrypt);
|
446 |
+
return new WP_Error( 'limit_exceeded', '<strong>ERROR</strong>: Number of attempts exceeded.');
|
447 |
+
}
|
448 |
}
|
449 |
|
450 |
} else {
|
452 |
return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Please try again..' ) );
|
453 |
}
|
454 |
}
|
455 |
+
}else if ( isset( $_POST['miniorange_inline_skip_registration_nonce'] ) ) { /*Validate Soft Token,OTP over SMS,OTP over EMAIL,Phone verification */
|
|
|
|
|
456 |
$nonce = $_POST['miniorange_inline_skip_registration_nonce'];
|
457 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-inline-skip-registration-nonce' ) ) {
|
458 |
$error = new WP_Error();
|
465 |
$user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id);
|
466 |
$this->mo2fa_pass2login(null, $session_id );
|
467 |
}
|
468 |
+
}else if ( isset( $_POST['miniorange_attribute_collection_nonce'] ) ) { /*Handling Rba Attributes from other plugins */
|
|
|
|
|
469 |
$nonce = $_POST['miniorange_attribute_collection_nonce'];
|
470 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-login-attribute-collection-nonce' ) ) {
|
471 |
$error = new WP_Error();
|
486 |
}
|
487 |
}
|
488 |
}
|
489 |
+
|
490 |
|
491 |
function remove_current_activity($session_id) {
|
492 |
global $Mo2fdbQueries;
|
545 |
'mo_2_factor_kba_questions' => '',
|
546 |
'mo2f_rba_status' => '',
|
547 |
'ts_created' => ''
|
|
|
548 |
) );
|
549 |
|
550 |
|
607 |
mo2f_get_qrcode_authentication_prompt( $login_status, $login_message, $redirect_to, $qrCode, $session_id_encrypt, $transactionid );
|
608 |
exit;
|
609 |
} else if ( $this->miniorange_pass2login_check_otp_status( $login_status ) ) { //for soft-token,otp over email,sms,phone verification,google auth
|
610 |
+
$user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
|
611 |
+
mo2f_get_otp_authentication_prompt( $login_status, $login_message, $redirect_to, $session_id_encrypt,$user_id );
|
612 |
exit;
|
613 |
} else if ( $this->miniorange_pass2login_check_forgotphone_status( $login_status ) ) { // forgot phone page if both KBA and Email are configured.
|
614 |
mo2f_get_forgotphone_form( $login_status, $login_message, $redirect_to, $session_id_encrypt );
|
615 |
exit;
|
616 |
+
}else if ( $this->miniorange_pass2login_check_push_oobemail_status( $login_status ) ) { //for push and out of band email.
|
617 |
$transactionid = $this->mo2f_transactionid ? $this->mo2f_transactionid : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_transactionId',$session_id_encrypt );
|
618 |
$user_id = $this->mo2f_userID ? $this->mo2f_userID : MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
|
619 |
mo2f_get_push_notification_oobemail_prompt( $user_id, $login_status, $login_message, $redirect_to, $session_id_encrypt, $transactionid );
|
717 |
if(is_null($session_id_encrypt)) {
|
718 |
$session_id_encrypt=$this->create_session();
|
719 |
}
|
|
|
720 |
?>
|
721 |
<p><input type="hidden" name="miniorange_login_nonce"
|
722 |
value="<?php echo wp_create_nonce( 'miniorange-2-factor-login-nonce' ); ?>"/>
|
723 |
|
724 |
+
<input type="hidden" id="sessid" name="miniorange_user_session"
|
725 |
value="<?php echo $session_id_encrypt; ?>"/>
|
726 |
|
727 |
</p>
|
850 |
$mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN';
|
851 |
$this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to, null,$session_id );
|
852 |
} else if ( $mo2f_second_factor == 'GOOGLE AUTHENTICATOR' ) {
|
853 |
+
$mo2fa_login_message ='Please enter the one time passcode shown in the <b> Authenticator</b> app.';
|
854 |
$mo2fa_login_status = 'MO_2_FACTOR_CHALLENGE_GOOGLE_AUTHENTICATION';
|
855 |
$this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to, null,$session_id );
|
856 |
} else {
|
894 |
if ( $user_id && $mo2f_1stfactor_status && ( $mo2f_1stfactor_status == 'VALIDATE_SUCCESS' ) ) {
|
895 |
$currentuser = get_user_by( 'id', $user_id );
|
896 |
wp_set_current_user( $user_id, $currentuser->user_login );
|
897 |
+
$mobile_login = new Miniorange_Mobile_Login();
|
898 |
+
$mobile_login->remove_current_activity($session_id_encrypted);
|
899 |
wp_set_auth_cookie( $user_id, true );
|
900 |
do_action( 'wp_login', $currentuser->user_login, $currentuser );
|
901 |
redirect_user_to( $currentuser, $redirect_to );
|
929 |
|
930 |
$is_customer_admin = get_option( 'mo2f_miniorange_admin' ) == $currentuser->ID ? true : false;
|
931 |
|
|
|
|
|
932 |
if ( $is_customer_admin ) {
|
933 |
$email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $currentuser->ID );
|
934 |
$mo_2factor_user_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $currentuser->ID );
|
935 |
$kba_configuration_status = $Mo2fdbQueries->get_user_detail( 'mo2f_SecurityQuestions_config_status', $currentuser->ID );
|
936 |
+
update_user_meta( $currentuser->ID, 'mo2f_user_login_attempts', get_option('mo2f_allwed_login_attempts') );
|
937 |
if ( $email && $mo_2factor_user_registration_status == 'MO_2_FACTOR_PLUGIN_SETTINGS' ) { //checking if user has configured any 2nd factor method
|
938 |
try {
|
939 |
$mo2f_rba_status = mo2f_collect_attributes( $email, stripslashes( $attributes ) ); // Rba flow
|
943 |
echo $e->getMessage();
|
944 |
}
|
945 |
|
|
|
946 |
if ( $mo2f_rba_status['status'] == 'SUCCESS' && $mo2f_rba_status['decision_flag'] ) {
|
947 |
$this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
|
948 |
} else if ( ($mo2f_rba_status['status'] == 'DENY' ) && get_option( 'mo2f_rba_installed' ) ) {
|
953 |
$this->mo2f_restrict_access( 'Access_denied' );
|
954 |
exit;
|
955 |
} else {
|
956 |
+
$mo2f_second_factor = '';
|
957 |
+
|
958 |
+
$mo2f_second_factor = mo2f_get_user_2ndfactor( $currentuser );
|
959 |
+
|
960 |
+
if(get_option('mo2f_enable_2fa_prompt_on_login_page')&& !get_option('mo2f_remember_device') && in_array(get_option('mo2f_configured_2_factor_method'), array("Google Authenticator", "miniOrange Soft Token", "Authy Authenticator"))){
|
961 |
$error=$this->mo2f_validate_soft_token($currentuser, $redirect_to, $mo2f_second_factor, $otp_token,$session_id_encrypt);
|
962 |
|
963 |
if(is_wp_error( $error)){
|
977 |
$this->mo2f_pass2login_otp_verification( $currentuser, $mo2f_second_factor, $redirect_to, $session_id_encrypt );
|
978 |
} else if ( $mo2f_second_factor == 'KBA' ) {
|
979 |
$this->mo2f_pass2login_kba_verification( $currentuser->ID, $redirect_to , $session_id_encrypt );
|
980 |
+
}else if ( $mo2f_second_factor == 'NONE' ) {
|
981 |
$this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
|
982 |
} else {
|
983 |
$this->remove_current_activity($session_id_encrypt);
|
1039 |
}
|
1040 |
|
1041 |
function mo2f_check_username_password( $user, $username, $password, $redirect_to = null ) {
|
|
|
1042 |
if ( is_a( $user, 'WP_Error' ) && ! empty( $user ) ) {
|
1043 |
return $user;
|
1044 |
}
|
1081 |
$session_id=$this->create_session();
|
1082 |
}
|
1083 |
|
1084 |
+
$key = get_option('mo2f_customer_token');
|
1085 |
+
|
1086 |
$error=$this->miniorange_initiate_2nd_factor( $currentuser, $attributes, $redirect_to, $otp_token, $session_id );
|
1087 |
|
1088 |
|
1121 |
|
1122 |
}
|
1123 |
|
1124 |
+
?>
|
class-utility.php
CHANGED
@@ -170,7 +170,22 @@ class MO2f_Utility {
|
|
170 |
}
|
171 |
}
|
172 |
}
|
|
|
173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
/*
|
175 |
|
176 |
Returns Random string with length provided in parameter.
|
@@ -183,15 +198,19 @@ class MO2f_Utility {
|
|
183 |
* @return string
|
184 |
*/
|
185 |
public static function decrypt_data( $data, $key ) {
|
186 |
-
$
|
187 |
-
$
|
188 |
-
$
|
189 |
-
$
|
190 |
-
$
|
191 |
-
$
|
192 |
-
$
|
193 |
-
|
194 |
-
|
|
|
|
|
|
|
|
|
195 |
}
|
196 |
|
197 |
public static function random_str( $length, $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ) {
|
@@ -351,7 +370,7 @@ class MO2f_Utility {
|
|
351 |
* @return string
|
352 |
*/
|
353 |
public static function mo2f_set_cookie_values( $cookiename, $cookievalue ) {
|
354 |
-
|
355 |
$key = get_option( 'mo2f_encryption_key' );
|
356 |
|
357 |
$current_time = new DateTime( 'now' );
|
@@ -370,13 +389,13 @@ class MO2f_Utility {
|
|
370 |
* @return string
|
371 |
*/
|
372 |
public static function encrypt_data( $data, $key ) {
|
373 |
-
$
|
374 |
-
$
|
375 |
-
$
|
376 |
-
$
|
377 |
-
$
|
378 |
-
|
379 |
-
return
|
380 |
}
|
381 |
|
382 |
/**
|
@@ -478,7 +497,8 @@ class MO2f_Utility {
|
|
478 |
"Security Questions" => "KBA",
|
479 |
"Email Verification" => "OUT OF BAND EMAIL",
|
480 |
"OTP Over SMS" => "SMS",
|
481 |
-
"EMAIL" => "OTP Over Email"
|
|
|
482 |
);
|
483 |
|
484 |
$server_to_wpdb_2fa_methods = array(
|
170 |
}
|
171 |
}
|
172 |
}
|
173 |
+
public static function get_client_ipaddress(){
|
174 |
|
175 |
+
$ip = null;
|
176 |
+
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
|
177 |
+
|
178 |
+
$ip = $_SERVER['HTTP_CLIENT_IP'];
|
179 |
+
|
180 |
+
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
181 |
+
|
182 |
+
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
183 |
+
|
184 |
+
} else {
|
185 |
+
$ip = $_SERVER['REMOTE_ADDR'];
|
186 |
+
}
|
187 |
+
return $ip;
|
188 |
+
}
|
189 |
/*
|
190 |
|
191 |
Returns Random string with length provided in parameter.
|
198 |
* @return string
|
199 |
*/
|
200 |
public static function decrypt_data( $data, $key ) {
|
201 |
+
$c = base64_decode($data);
|
202 |
+
$ivlen = openssl_cipher_iv_length($cipher="AES-128-CBC");
|
203 |
+
$iv = substr($c, 0, $ivlen);
|
204 |
+
$hmac = substr($c, $ivlen, $sha2len=32);
|
205 |
+
$ciphertext_raw = substr($c, $ivlen+$sha2len);
|
206 |
+
$original_plaintext = openssl_decrypt($ciphertext_raw, $cipher, $key, $options=OPENSSL_RAW_DATA, $iv);
|
207 |
+
$calcmac = hash_hmac('sha256', $ciphertext_raw, $key, $as_binary=true);
|
208 |
+
if (hash_equals($hmac, $calcmac))//PHP 5.6+ timing attack safe comparison
|
209 |
+
{
|
210 |
+
$decrypted_text=$original_plaintext;
|
211 |
+
}
|
212 |
+
|
213 |
+
return $decrypted_text;
|
214 |
}
|
215 |
|
216 |
public static function random_str( $length, $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ) {
|
370 |
* @return string
|
371 |
*/
|
372 |
public static function mo2f_set_cookie_values( $cookiename, $cookievalue ) {
|
373 |
+
|
374 |
$key = get_option( 'mo2f_encryption_key' );
|
375 |
|
376 |
$current_time = new DateTime( 'now' );
|
389 |
* @return string
|
390 |
*/
|
391 |
public static function encrypt_data( $data, $key ) {
|
392 |
+
$plaintext = $data;
|
393 |
+
$ivlen = openssl_cipher_iv_length($cipher="AES-128-CBC");
|
394 |
+
$iv = openssl_random_pseudo_bytes($ivlen);
|
395 |
+
$ciphertext_raw = openssl_encrypt($plaintext, $cipher, $key, $options=OPENSSL_RAW_DATA, $iv);
|
396 |
+
$hmac = hash_hmac('sha256', $ciphertext_raw, $key, $as_binary=true);
|
397 |
+
$ciphertext = base64_encode( $iv.$hmac.$ciphertext_raw );
|
398 |
+
return $ciphertext;
|
399 |
}
|
400 |
|
401 |
/**
|
497 |
"Security Questions" => "KBA",
|
498 |
"Email Verification" => "OUT OF BAND EMAIL",
|
499 |
"OTP Over SMS" => "SMS",
|
500 |
+
"EMAIL" => "OTP Over Email",
|
501 |
+
|
502 |
);
|
503 |
|
504 |
$server_to_wpdb_2fa_methods = array(
|
includes/css/bootstrap.min.css
CHANGED
@@ -290,7 +290,7 @@
|
|
290 |
}
|
291 |
|
292 |
.mo2f_thumbnail {
|
293 |
-
width:
|
294 |
margin-bottom: 10px;
|
295 |
position: relative;
|
296 |
background-color: #fff;
|
290 |
}
|
291 |
|
292 |
.mo2f_thumbnail {
|
293 |
+
width: 295px;
|
294 |
margin-bottom: 10px;
|
295 |
position: relative;
|
296 |
background-color: #fff;
|
includes/css/jquery.dataTables.min.css
ADDED
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
table.dataTable
|
2 |
+
{
|
3 |
+
width:100%;margin:0
|
4 |
+
auto;
|
5 |
+
clear:both;
|
6 |
+
border-collapse:separate;
|
7 |
+
border-spacing:0
|
8 |
+
}
|
9 |
+
table.dataTable thead th,table.dataTable tfoot th
|
10 |
+
{
|
11 |
+
font-weight:bold
|
12 |
+
}
|
13 |
+
table.dataTable thead th,table.dataTable thead td
|
14 |
+
{
|
15 |
+
padding:10px 18px;border-bottom:1px solid #111
|
16 |
+
}
|
17 |
+
table.dataTable thead th:active,table.dataTable thead td:active
|
18 |
+
{
|
19 |
+
outline:none
|
20 |
+
}
|
21 |
+
table.dataTable tfoot th,table.dataTable tfoot td
|
22 |
+
{
|
23 |
+
padding:10px 18px 6px 18px;border-top:1px solid #111
|
24 |
+
}
|
25 |
+
table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc
|
26 |
+
{
|
27 |
+
cursor:pointer;*cursor:hand
|
28 |
+
}
|
29 |
+
table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled
|
30 |
+
{
|
31 |
+
background-repeat:no-repeat;background-position:center right
|
32 |
+
}
|
33 |
+
table.dataTable thead .sorting
|
34 |
+
{
|
35 |
+
background-image:url("../images/sort_both.png")
|
36 |
+
}
|
37 |
+
table.dataTable thead .sorting_asc
|
38 |
+
{
|
39 |
+
background-image:url("../images/sort_asc.png")
|
40 |
+
}
|
41 |
+
table.dataTable thead .sorting_desc
|
42 |
+
{
|
43 |
+
background-image:url("../images/sort_desc.png")
|
44 |
+
}
|
45 |
+
table.dataTable thead .sorting_asc_disabled
|
46 |
+
{
|
47 |
+
background-image:url("../images/sort_asc_disabled.png")
|
48 |
+
}
|
49 |
+
table.dataTable thead .sorting_desc_disabled
|
50 |
+
{
|
51 |
+
background-image:url("../images/sort_desc_disabled.png")
|
52 |
+
}
|
53 |
+
table.dataTable tbody tr
|
54 |
+
{
|
55 |
+
background-color:#ffffff
|
56 |
+
}
|
57 |
+
table.dataTable tbody tr.selected
|
58 |
+
{
|
59 |
+
background-color:#B0BED9
|
60 |
+
}
|
61 |
+
table.dataTable tbody th,table.dataTable tbody td
|
62 |
+
{
|
63 |
+
padding:8px 10px
|
64 |
+
}
|
65 |
+
table.dataTable.row-border tbody th,table.dataTable.row-border tbody td,table.dataTable.display tbody th,table.dataTable.display tbody td
|
66 |
+
{
|
67 |
+
border-top:1px solid #ddd
|
68 |
+
}
|
69 |
+
table.dataTable.row-border tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.display tbody tr:first-child td
|
70 |
+
{
|
71 |
+
border-top:none
|
72 |
+
}
|
73 |
+
table.dataTable.cell-border tbody th,table.dataTable.cell-border tbody td
|
74 |
+
{
|
75 |
+
border-top:1px solid #ddd;border-right:1px solid #ddd
|
76 |
+
}
|
77 |
+
table.dataTable.cell-border tbody tr th:first-child,table.dataTable.cell-border tbody tr td:first-child
|
78 |
+
{
|
79 |
+
border-left:1px solid #ddd
|
80 |
+
}
|
81 |
+
table.dataTable.cell-border tbody tr:first-child th,table.dataTable.cell-border tbody tr:first-child td
|
82 |
+
{
|
83 |
+
border-top:none
|
84 |
+
}
|
85 |
+
table.dataTable.stripe tbody tr.odd,table.dataTable.display tbody tr.odd
|
86 |
+
{
|
87 |
+
background-color:#f9f9f9
|
88 |
+
}
|
89 |
+
table.dataTable.stripe tbody tr.odd.selected,table.dataTable.display tbody tr.odd.selected
|
90 |
+
{
|
91 |
+
background-color:#acbad4
|
92 |
+
}
|
93 |
+
table.dataTable.hover tbody tr:hover,table.dataTable.display tbody tr:hover
|
94 |
+
{
|
95 |
+
background-color:#f6f6f6
|
96 |
+
}
|
97 |
+
table.dataTable.hover tbody tr:hover.selected,table.dataTable.display tbody tr:hover.selected
|
98 |
+
{
|
99 |
+
background-color:#aab7d1
|
100 |
+
}
|
101 |
+
table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3
|
102 |
+
{
|
103 |
+
background-color:#fafafa
|
104 |
+
}
|
105 |
+
table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3
|
106 |
+
{
|
107 |
+
background-color:#acbad5
|
108 |
+
}
|
109 |
+
table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1
|
110 |
+
{
|
111 |
+
background-color:#f1f1f1
|
112 |
+
}
|
113 |
+
table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:whitesmoke}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#fafafa}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fcfcfc}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fefefe}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ececec}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#efefef}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a5b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th,table.dataTable.compact thead td{padding:4px 17px 4px 4px}table.dataTable.compact tfoot th,table.dataTable.compact tfoot td{padding:4px}table.dataTable.compact tbody th,table.dataTable.compact tbody td{padding:4px}table.dataTable th.dt-left,table.dataTable td.dt-left{text-align:left}table.dataTable th.dt-center,table.dataTable td.dt-center,table.dataTable td.dataTables_empty{text-align:center}table.dataTable th.dt-right,table.dataTable td.dt-right{text-align:right}table.dataTable th.dt-justify,table.dataTable td.dt-justify{text-align:justify}table.dataTable th.dt-nowrap,table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable thead th.dt-head-left,table.dataTable thead td.dt-head-left,table.dataTable tfoot th.dt-head-left,table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center,table.dataTable thead td.dt-head-center,table.dataTable tfoot th.dt-head-center,table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right,table.dataTable thead td.dt-head-right,table.dataTable tfoot th.dt-head-right,table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify,table.dataTable thead td.dt-head-justify,table.dataTable tfoot th.dt-head-justify,table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap,table.dataTable thead td.dt-head-nowrap,table.dataTable tfoot th.dt-head-nowrap,table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody th.dt-body-left,table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center,table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right,table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify,table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap,table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable,table.dataTable th,table.dataTable td{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both;*zoom:1;zoom:1}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{margin-left:0.5em}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:0.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top:0.25em}.dataTables_wrapper .dataTables_paginate .paginate_button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:0.5em 1em;margin-left:2px;text-align:center;text-decoration:none !important;cursor:pointer;*cursor:hand;color:#333 !important;border:1px solid transparent;border-radius:2px}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{color:#333 !important;border:1px solid #979797;background-color:white;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #dcdcdc));background:-webkit-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-moz-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-ms-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-o-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:linear-gradient(to bottom, #fff 0%, #dcdcdc 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active{cursor:default;color:#666 !important;border:1px solid transparent;background:transparent;box-shadow:none}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{color:white !important;border:1px solid #111;background-color:#585858;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));background:-webkit-linear-gradient(top, #585858 0%, #111 100%);background:-moz-linear-gradient(top, #585858 0%, #111 100%);background:-ms-linear-gradient(top, #585858 0%, #111 100%);background:-o-linear-gradient(top, #585858 0%, #111 100%);background:linear-gradient(to bottom, #585858 0%, #111 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button:active{outline:none;background-color:#2b2b2b;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));background:-webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);box-shadow:inset 0 0 3px #111}.dataTables_wrapper .dataTables_paginate .ellipsis{padding:0 1em}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:white;background:-webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0)));background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%)}.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}
|
114 |
+
.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td{vertical-align:middle}
|
115 |
+
.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td>div.dataTables_sizing{height:0;overflow:hidden;margin:0 !important;padding:0 !important}
|
116 |
+
.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}
|
117 |
+
.dataTables_wrapper.no-footer div.dataTables_scrollHead table,.dataTables_wrapper.no-footer div.dataTables_scrollBody table{border-bottom:none}
|
118 |
+
.dataTables_wrapper:after
|
119 |
+
{
|
120 |
+
visibility:hidden;display:block;content:"";clear:both;height:0
|
121 |
+
}
|
122 |
+
@media screen and (max-width: 767px)
|
123 |
+
{
|
124 |
+
.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate
|
125 |
+
{
|
126 |
+
float:none;text-align:center
|
127 |
+
}
|
128 |
+
.dataTables_wrapper .dataTables_paginate
|
129 |
+
{
|
130 |
+
margin-top:0.5em
|
131 |
+
}
|
132 |
+
}
|
133 |
+
@media screen and (max-width: 640px)
|
134 |
+
{
|
135 |
+
.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter
|
136 |
+
{
|
137 |
+
float:none;text-align:center
|
138 |
+
}
|
139 |
+
.dataTables_wrapper .dataTables_filter
|
140 |
+
{
|
141 |
+
margin-top:0.5em
|
142 |
+
}
|
143 |
+
}
|
includes/css/style_settings.css
CHANGED
@@ -2,7 +2,749 @@
|
|
2 |
background-color: #FFFFFF;
|
3 |
border: 1px solid #CCCCCC;
|
4 |
padding: 0px 24px 0px 20px;
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
}
|
7 |
|
8 |
.impt {
|
@@ -16,10 +758,16 @@
|
|
16 |
}
|
17 |
|
18 |
.mo2f_support_layout {
|
19 |
-
width:
|
|
|
20 |
background-color: #FFFFFF;
|
21 |
-
border: 1px solid #CCCCCC;
|
22 |
padding: 0px 24px 0px 20px;
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
24 |
|
25 |
.mo2f_help_layout {
|
@@ -307,7 +1055,7 @@ a {
|
|
307 |
|
308 |
.mo2f_setup_2factor_tab {
|
309 |
align-content: center;
|
310 |
-
width:
|
311 |
min-height: 400px;
|
312 |
padding:5px;
|
313 |
}
|
@@ -638,13 +1386,10 @@ a {
|
|
638 |
|
639 |
.mo2f_proxy_setup {
|
640 |
background-color: white;
|
641 |
-
border-style: solid;
|
642 |
-
border-color: lightgrey;
|
643 |
-
border-radius: 4px;
|
644 |
-
border-width: 1px;
|
645 |
padding: 30px;
|
646 |
-
|
647 |
-
|
|
|
648 |
|
649 |
}
|
650 |
|
@@ -652,11 +1397,10 @@ a {
|
|
652 |
background-color: white;
|
653 |
border-style: solid;
|
654 |
border-color: lightgrey;
|
655 |
-
border-radius: 4px;
|
656 |
-
border-width: 1px;
|
657 |
padding: 20px;
|
658 |
-
width:
|
659 |
-
align-content: center
|
|
|
660 |
|
661 |
}
|
662 |
|
@@ -672,6 +1416,7 @@ a {
|
|
672 |
color: black
|
673 |
}
|
674 |
|
|
|
675 |
.mo2f_advanced_options_a:hover {
|
676 |
curosr: pointer
|
677 |
}
|
@@ -789,4 +1534,217 @@ a {
|
|
789 |
}
|
790 |
|
791 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
792 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
background-color: #FFFFFF;
|
3 |
border: 1px solid #CCCCCC;
|
4 |
padding: 0px 24px 0px 20px;
|
5 |
+
}
|
6 |
+
|
7 |
+
.impt {
|
8 |
+
color: #FF0000
|
9 |
+
}
|
10 |
+
|
11 |
+
.mo2f_container{
|
12 |
+
margin-left: -1%;
|
13 |
+
width: 100%;
|
14 |
+
}
|
15 |
+
|
16 |
+
.mo2f_small_layout {
|
17 |
+
background-color: #FFFFFF;
|
18 |
+
border: 1px solid #CCCCCC;
|
19 |
+
padding: 0px 24px 10px 20px;
|
20 |
+
}
|
21 |
+
|
22 |
+
.mo2f_help_layout {
|
23 |
+
background-color: #FFFFFF;
|
24 |
+
border: 1px solid #CCCCCC;
|
25 |
+
padding-left: 20px;
|
26 |
+
min-height: 550px;
|
27 |
+
}
|
28 |
+
|
29 |
+
.mo2f_table_layout td strong {
|
30 |
+
margin-left: 10px;
|
31 |
+
}
|
32 |
+
|
33 |
+
.col1 {
|
34 |
+
width: 20%;
|
35 |
+
}
|
36 |
+
|
37 |
+
#panel1 {
|
38 |
+
width: 100%;
|
39 |
+
}
|
40 |
+
|
41 |
+
.panel_toggle {
|
42 |
+
cursor: pointer;
|
43 |
+
}
|
44 |
+
|
45 |
+
.panel_toggle:hover {
|
46 |
+
text-decoration: underline;
|
47 |
+
}
|
48 |
+
|
49 |
+
.mo2f_authy_step1 {
|
50 |
+
vertical-align: top;
|
51 |
+
padding-right: 15px;
|
52 |
+
width: 26%;
|
53 |
+
}
|
54 |
+
|
55 |
+
.mo2f_authy_step2 {
|
56 |
+
vertical-align: top;
|
57 |
+
padding-right: 15px;
|
58 |
+
width: 46%;
|
59 |
+
}
|
60 |
+
|
61 |
+
.mo2f_table_textbox {
|
62 |
+
width: 100%;
|
63 |
+
height: 30px;
|
64 |
+
}
|
65 |
+
|
66 |
+
.mo2f_settings_table {
|
67 |
+
width: 100%;
|
68 |
+
}
|
69 |
+
|
70 |
+
#mo2f_note {
|
71 |
+
background-color: #d9edf7;
|
72 |
+
border-radius: 4px;
|
73 |
+
padding: 5px;
|
74 |
+
color: #31708f;
|
75 |
+
font-style: italic;
|
76 |
+
}
|
77 |
+
|
78 |
+
.button-green {
|
79 |
+
background: #95D387 !important;
|
80 |
+
color: #ffffff !important;
|
81 |
+
border: 1px solid #95D387 !important;
|
82 |
+
}
|
83 |
+
|
84 |
+
.mo2f_user_layout {
|
85 |
+
margin-top: 20px;
|
86 |
+
margin-right: 20px;
|
87 |
+
}
|
88 |
+
|
89 |
+
.header2 {
|
90 |
+
font-size: 1.6em;
|
91 |
+
color: #00A0D2;
|
92 |
+
}
|
93 |
+
|
94 |
+
.alert-box {
|
95 |
+
margin-top: 21px;
|
96 |
+
}
|
97 |
+
|
98 |
+
.extra-large {
|
99 |
+
padding: 10px !important;
|
100 |
+
font-size: 2em !important;
|
101 |
+
height: 46px !important;
|
102 |
+
border-radius: 5px !important;
|
103 |
+
line-height: 25px !important;
|
104 |
+
}
|
105 |
+
|
106 |
+
.mo2f_account_header {
|
107 |
+
margin: 0px !important;
|
108 |
+
|
109 |
+
}
|
110 |
+
|
111 |
+
a {
|
112 |
+
text-decoration: none !important;
|
113 |
+
|
114 |
+
}
|
115 |
+
|
116 |
+
.mo2f_help_container {
|
117 |
+
background-color: #ccc !important;
|
118 |
+
}
|
119 |
+
|
120 |
+
.mo2f_faqs > h3, .mo2f_faqs > div {
|
121 |
+
margin-left: 15px !important;
|
122 |
+
margin-right: 5px !important;
|
123 |
+
|
124 |
+
}
|
125 |
+
|
126 |
+
.mo2f_faqs > div {
|
127 |
+
padding: 5px 20px !important;
|
128 |
+
border-left: 2px solid grey;
|
129 |
+
}
|
130 |
+
|
131 |
+
.mo2f_faqs > hr {
|
132 |
+
border-top: 1px solid rgb(135, 129, 129) !important;
|
133 |
+
margin-right: 20px !important;
|
134 |
+
}
|
135 |
+
|
136 |
+
.mo2f_faqs > h3 > a:focus {
|
137 |
+
box-shadow: 0px 0px 0px 0px #fff !important;
|
138 |
+
}
|
139 |
+
|
140 |
+
.mo2f_msgs {
|
141 |
+
font-size: 14px !important;
|
142 |
+
}
|
143 |
+
|
144 |
+
.mo2f_row {
|
145 |
+
|
146 |
+
display: -webkit-inline-box !important;
|
147 |
+
}
|
148 |
+
|
149 |
+
.configuredBasic {
|
150 |
+
background: url(../images/feat_smart.png) rgba(99, 143, 223, 0.42) no-repeat right;
|
151 |
+
padding: 10px;
|
152 |
+
margin-bottom: 0px;
|
153 |
+
}
|
154 |
+
|
155 |
+
.configuredSmart {
|
156 |
+
background: url(../images/Smartphone-24.png) rgba(99, 143, 223, 0.42) no-repeat right;
|
157 |
+
padding: 10px;
|
158 |
+
margin-bottom: 0px;
|
159 |
+
}
|
160 |
+
|
161 |
+
.notConfiguredBasic {
|
162 |
+
background: url(../images/feat_smart.png) rgba(221, 221, 221, 0.66) no-repeat right;
|
163 |
+
padding: 10px;
|
164 |
+
margin-bottom: 0px;
|
165 |
+
}
|
166 |
+
|
167 |
+
.notConfiguredSmart {
|
168 |
+
background: url(../images/Smartphone-24.png) rgba(221, 221, 221, 0.66) no-repeat right;
|
169 |
+
padding: 10px;
|
170 |
+
margin-bottom: 0px;
|
171 |
+
}
|
172 |
+
|
173 |
+
.configuredLandline {
|
174 |
+
background: url(../images/landline_sprite.png) rgba(99, 143, 223, 0.42) no-repeat right;
|
175 |
+
padding: 10px;
|
176 |
+
margin-bottom: 0px;
|
177 |
+
}
|
178 |
+
|
179 |
+
.notConfiguredLandline {
|
180 |
+
background: url(../images/landline_sprite.png) rgba(221, 221, 221, 0.66) no-repeat right;
|
181 |
+
padding: 10px;
|
182 |
+
margin-bottom: 0px;
|
183 |
+
}
|
184 |
+
|
185 |
+
.selectedMethod {
|
186 |
+
background-color: rgba(54, 157, 4, 0.42) !important;
|
187 |
+
}
|
188 |
+
|
189 |
+
.color-icon {
|
190 |
+
vertical-align: middle;
|
191 |
+
display: inline-block;
|
192 |
+
width: 15px;
|
193 |
+
height: 15px;
|
194 |
+
margin-left: 20px;
|
195 |
+
}
|
196 |
+
|
197 |
+
.activeMethod {
|
198 |
+
background-color: rgba(99, 143, 223, 0.42) !important;
|
199 |
+
margin-left: 23%;
|
200 |
+
|
201 |
+
}
|
202 |
+
|
203 |
+
.inactiveMethod {
|
204 |
+
background-color: rgba(221, 221, 221, 0.66) !important;
|
205 |
+
margin-left: 20.5%;
|
206 |
+
|
207 |
+
}
|
208 |
+
|
209 |
+
.configuredLaptop {
|
210 |
+
background: url(../images/laptop-24.png) rgba(99, 143, 223, 0.42) no-repeat right;
|
211 |
+
padding: 10px;
|
212 |
+
margin-bottom: 0px;
|
213 |
+
}
|
214 |
+
|
215 |
+
.notConfiguredLaptop {
|
216 |
+
background: url(../images/laptop-24.png) rgba(221, 221, 221, 0.66) no-repeat right;
|
217 |
+
padding: 20px;
|
218 |
+
margin-bottom: 0px;
|
219 |
+
}
|
220 |
+
|
221 |
+
.mo2f_column_padding {
|
222 |
+
padding-right: 10px;
|
223 |
+
|
224 |
+
}
|
225 |
+
|
226 |
+
.mo2f_td_show {
|
227 |
+
display: table-cell;
|
228 |
+
}
|
229 |
+
|
230 |
+
.mo2f_td_hide {
|
231 |
+
display: none !important;
|
232 |
+
}
|
233 |
+
|
234 |
+
.mo2f_pricing_table {
|
235 |
+
text-align: center;
|
236 |
+
font-size: 15px !important;
|
237 |
+
}
|
238 |
+
|
239 |
+
.mo2f_pricing_header {
|
240 |
+
color: #fff !important;
|
241 |
+
margin: 8px !important;
|
242 |
+
}
|
243 |
+
|
244 |
+
.mo2f_pricing_sub_header {
|
245 |
+
margin: 4px !important;
|
246 |
+
color: #fff !important;
|
247 |
+
}
|
248 |
+
|
249 |
+
.mo2f_pricing_text {
|
250 |
+
font-size: 15px !important;
|
251 |
+
color: #fff !important;
|
252 |
+
font-weight: bold !important;
|
253 |
+
}
|
254 |
+
|
255 |
+
.mo2f_pricing_free_tab {
|
256 |
+
background-color: rgba(34, 153, 221, 0.82) !important;
|
257 |
+
}
|
258 |
+
|
259 |
+
.mo2f_pricing_paid_tab {
|
260 |
+
background-color: #1a71a4 !important;
|
261 |
+
}
|
262 |
+
|
263 |
+
.mo2f_kba_ques {
|
264 |
+
width: 412px !important;
|
265 |
+
border-radius: 4px;
|
266 |
+
height: 30px;
|
267 |
+
font-size: 13px !important;
|
268 |
+
}
|
269 |
+
|
270 |
+
.mo2f_kba_table {
|
271 |
+
padding-left: 10px;
|
272 |
+
width: 80%;
|
273 |
+
}
|
274 |
+
|
275 |
+
.mo2f_kba_tb_data {
|
276 |
+
padding-left: 80px;
|
277 |
+
}
|
278 |
+
|
279 |
+
.mo2f_grayed_out {
|
280 |
+
background-color: rgba(128, 128, 128, 0.05) !important;
|
281 |
+
opacity: .5;
|
282 |
+
}
|
283 |
+
|
284 |
+
.mo2f_grayed_out_link {
|
285 |
+
position: absolute;
|
286 |
+
float: right;
|
287 |
+
margin: 0.5% 0 0 24%;
|
288 |
+
z-index: 99;
|
289 |
+
}
|
290 |
+
|
291 |
+
.black_overlay {
|
292 |
+
display: none;
|
293 |
+
position: absolute;
|
294 |
+
top: 0%;
|
295 |
+
left: 0%;
|
296 |
+
width: 100%;
|
297 |
+
height: 100%;
|
298 |
+
background-color: black;
|
299 |
+
z-index: 1001;
|
300 |
+
-moz-opacity: 0.8;
|
301 |
+
opacity: .80;
|
302 |
+
filter: alpha(opacity=80);
|
303 |
+
}
|
304 |
+
|
305 |
+
.mo2f_2factor_heading_images {
|
306 |
+
display: inline-block;
|
307 |
+
padding: 15px;
|
308 |
+
width: 20px;
|
309 |
+
height: 20px;
|
310 |
+
float: left
|
311 |
+
}
|
312 |
+
|
313 |
+
.mo2f_advanced_options_images {
|
314 |
+
display: inline-block;
|
315 |
+
padding: 15px;
|
316 |
+
width: 20px;
|
317 |
+
height: 20px;
|
318 |
+
float: left
|
319 |
+
}
|
320 |
+
|
321 |
+
.mo2f_view_premium_plan_auth_methods, .mo2f_view_standard_plan_auth_methods, .mo2f_view_backup_options, .mo2f_view_backup_options_prem,
|
322 |
+
.mo2f_view_login_options, .mo2f_view_inline_registration_options, .mo2f_view_customizations, .mo2f_advanced_options_a,
|
323 |
+
.mo2f_view_customizations_prem {
|
324 |
+
color: navy;
|
325 |
+
cursor: pointer;
|
326 |
+
}
|
327 |
+
|
328 |
+
.mo2f_view_free_plan_auth_methods {
|
329 |
+
color: black;
|
330 |
+
cursor: pointer;
|
331 |
+
}
|
332 |
+
|
333 |
+
.mo2f_view_free_plan_auth_methods:hover {
|
334 |
+
color: black;
|
335 |
+
}
|
336 |
+
|
337 |
+
.mo2f_view_premium_plan_auth_methods:hover, .mo2f_view_standard_plan_auth_methods:hover, .mo2f_view_backup_options:hover,
|
338 |
+
.mo2f_view_backup_options_prem:hover, .mo2f_view_customizations_prem:hover, .mo2f_view_login_options:hover, .mo2f_view_inline_registration_options:hover, .mo2f_view_customizations:hover {
|
339 |
+
color: limegreen;
|
340 |
+
}
|
341 |
+
|
342 |
+
.mo2f_heading_style {
|
343 |
+
font-size: 18px;
|
344 |
+
font-family: Segoe UI;
|
345 |
+
padding: 11px;
|
346 |
+
}
|
347 |
+
|
348 |
+
.mo2f_auth_methods_table {
|
349 |
+
border-spacing: 15px;
|
350 |
+
border-collapse: separate;
|
351 |
+
}
|
352 |
+
|
353 |
+
.mo2f_auth_methods_thumbnail {
|
354 |
+
width: 50px;
|
355 |
+
height: 50px;
|
356 |
+
padding: 20px;
|
357 |
+
line-height: 80px;
|
358 |
+
}
|
359 |
+
|
360 |
+
.mo2f_auth_method_title {
|
361 |
+
font-size: 15px;
|
362 |
+
font-weight: bold;
|
363 |
+
}
|
364 |
+
|
365 |
+
.mo2f_configure_2_factor {
|
366 |
+
padding: 10px;
|
367 |
+
float: left;
|
368 |
+
line-height: 20px;
|
369 |
+
}
|
370 |
+
|
371 |
+
.mo2f_set_2_factor {
|
372 |
+
padding: 10px;
|
373 |
+
float: right;
|
374 |
+
line-height: 20px;
|
375 |
+
}
|
376 |
+
|
377 |
+
.mo2f_configure_set_2_factor {
|
378 |
+
background-color: Transparent;
|
379 |
+
background-repeat: no-repeat;
|
380 |
+
border: none;
|
381 |
+
cursor: pointer;
|
382 |
+
overflow: hidden;
|
383 |
+
outline: none;
|
384 |
+
color: white;
|
385 |
+
}
|
386 |
+
|
387 |
+
.mo2f_configure_set_2_factor:hover {
|
388 |
+
font-weight: bold;
|
389 |
+
font-size: 14px;
|
390 |
+
}
|
391 |
+
|
392 |
+
.mo_table-bordered, .mo_table-bordered > tbody > tr > td {
|
393 |
+
border: 1px solid #ddd;
|
394 |
+
}
|
395 |
+
|
396 |
+
.mo_table-striped > tbody > tr:nth-of-type(odd) {
|
397 |
+
background-color: #f9f9f9;
|
398 |
+
}
|
399 |
+
|
400 |
+
.mo_table-bordered > thead > tr > th {
|
401 |
+
vertical-align: top !important;
|
402 |
+
}
|
403 |
+
|
404 |
+
.mo_plan-desc {
|
405 |
+
font-size: 14px !important;
|
406 |
+
}
|
407 |
+
|
408 |
+
.mo_align-center > tr > td {
|
409 |
+
text-align: center !important;
|
410 |
+
}
|
411 |
+
|
412 |
+
.mo-fa-icon > tr > td > i.fa {
|
413 |
+
color: #5b8a0f;
|
414 |
+
|
415 |
+
}
|
416 |
+
|
417 |
+
.dropbtn {
|
418 |
+
background-color: #4CAF50;
|
419 |
+
color: white;
|
420 |
+
padding: 16px;
|
421 |
+
font-size: 16px;
|
422 |
+
border: none;
|
423 |
+
cursor: pointer;
|
424 |
+
border-radius: 5px;
|
425 |
+
}
|
426 |
+
|
427 |
+
.dropdown {
|
428 |
+
position: relative;
|
429 |
+
display: inline-block;
|
430 |
+
|
431 |
+
}
|
432 |
+
|
433 |
+
.dropdown-content {
|
434 |
+
display: none;
|
435 |
+
position: absolute;
|
436 |
+
background-color: #f9f9f9;
|
437 |
+
min-width: 160px;
|
438 |
+
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
|
439 |
+
z-index: 1;
|
440 |
+
}
|
441 |
+
|
442 |
+
.dropdown-content a {
|
443 |
+
color: black;
|
444 |
+
padding: 12px 16px;
|
445 |
+
text-decoration: none;
|
446 |
+
display: block;
|
447 |
+
}
|
448 |
+
|
449 |
+
.dropdown-content a:hover {
|
450 |
+
background-color: #f1f1f1
|
451 |
+
}
|
452 |
+
|
453 |
+
.dropdown:hover .dropdown-content {
|
454 |
+
display: block;
|
455 |
+
}
|
456 |
+
|
457 |
+
.dropdown:hover .dropbtn {
|
458 |
+
background-color: #3e8e41;
|
459 |
+
}
|
460 |
+
|
461 |
+
/* added by gayathri */
|
462 |
+
|
463 |
+
.mo2f_google_authy_step2 {
|
464 |
+
vertical-align: top;
|
465 |
+
padding-right: 15px;
|
466 |
+
width: 70%;
|
467 |
+
}
|
468 |
+
|
469 |
+
.mo2f_google_authy_step3 {
|
470 |
+
vertical-align: top;
|
471 |
+
width: 30%
|
472 |
+
}
|
473 |
+
|
474 |
+
.mo2f_vertical_line {
|
475 |
+
border-left: 1px solid #EBECEC;
|
476 |
+
padding: 5px
|
477 |
+
}
|
478 |
+
|
479 |
+
.mo2f_ol li {
|
480 |
+
padding: 1px;
|
481 |
+
}
|
482 |
+
|
483 |
+
.mo2f_google_authy_secret_outer_div {
|
484 |
+
padding: 10px;
|
485 |
+
background-color: #f9edbe;
|
486 |
+
width: 20em;
|
487 |
+
text-align: center;
|
488 |
+
}
|
489 |
+
|
490 |
+
.mo2f_google_authy_secret_text {
|
491 |
+
font-size: 80%;
|
492 |
+
color: #666666;
|
493 |
+
}
|
494 |
+
|
495 |
+
.mo2f_google_authy_secret_inner_div {
|
496 |
+
font-size: 14px;
|
497 |
+
font-weight: bold;
|
498 |
+
line-height: 1.5;
|
499 |
+
}
|
500 |
+
|
501 |
+
.mo2f_backup_options, .kbaSectiondiv {
|
502 |
+
padding-left: 10px;
|
503 |
+
padding-right: 10px;
|
504 |
+
}
|
505 |
+
|
506 |
+
.mo2f_backup_options_div {
|
507 |
+
padding-left: 10px;
|
508 |
+
padding-right: 40px;
|
509 |
+
}
|
510 |
+
|
511 |
+
.mo2f_rememberdevice {
|
512 |
+
float: left;
|
513 |
+
font-size: 15px;
|
514 |
+
padding-right: 10px;
|
515 |
+
}
|
516 |
+
|
517 |
+
.mo2f_trust_device {
|
518 |
+
vertical-align: text-top;
|
519 |
+
}
|
520 |
+
|
521 |
+
.mo2f_push_oob_message {
|
522 |
+
font-size: 16px;
|
523 |
+
font-weight: bold;
|
524 |
+
color: #34495E;
|
525 |
+
}
|
526 |
+
|
527 |
+
.mo2f_login_prompt_messages {
|
528 |
+
font-size: 16px;
|
529 |
+
font-weight: bold;
|
530 |
+
color: #2980B9;
|
531 |
+
|
532 |
+
}
|
533 |
+
|
534 |
+
.mo2f_display_none_forms {
|
535 |
+
display: none
|
536 |
+
}
|
537 |
+
|
538 |
+
.mo2f_licensing_plans {
|
539 |
+
background-color: white;
|
540 |
+
border-style: solid;
|
541 |
+
border-color: lightgrey;
|
542 |
+
border-radius: 4px;
|
543 |
+
border-width: 1px;
|
544 |
+
padding: 10px;
|
545 |
+
}
|
546 |
+
|
547 |
+
.mo2f_licensing_plans_tr {
|
548 |
+
background-color: #bbccdd;
|
549 |
+
}
|
550 |
+
|
551 |
+
.mo2f_licensing_plans_plan_desc {
|
552 |
+
color: white;
|
553 |
+
font-size: 16px
|
554 |
+
}
|
555 |
+
|
556 |
+
.mo2f_licensing_plans_ol {
|
557 |
+
margin-left: 3%
|
558 |
+
}
|
559 |
+
|
560 |
+
.mo2f_container_views {
|
561 |
+
background-color: white;
|
562 |
+
border-style: solid;
|
563 |
+
border-color: lightgray;
|
564 |
+
border-width: 1px;
|
565 |
+
border-radius: 2px;
|
566 |
+
padding: 20px;
|
567 |
+
min-height: 400px;
|
568 |
+
}
|
569 |
+
|
570 |
+
.mo2f_register_with_mo_message {
|
571 |
+
display: block;
|
572 |
+
color: red;
|
573 |
+
background-color: rgba(251, 232, 0, 0.15);
|
574 |
+
padding: 5px;
|
575 |
+
border: solid 1px rgba(255, 0, 9, 0.36)
|
576 |
+
}
|
577 |
+
|
578 |
+
.mo2f_advanced_options_outer_div {
|
579 |
+
background-color: white;
|
580 |
+
border-style: solid;
|
581 |
+
border-color: lightgrey;
|
582 |
+
border-radius: 4px;
|
583 |
+
border-width: 1px;
|
584 |
+
padding: 20px;
|
585 |
+
align-content: center
|
586 |
+
}
|
587 |
+
|
588 |
+
.mo2f_advanced_options {
|
589 |
+
font-family: 'Segoe UI';
|
590 |
+
background-color: white;
|
591 |
+
min-width: 750px;
|
592 |
+
padding: 5px;
|
593 |
+
}
|
594 |
+
|
595 |
+
.mo2f_advanced_options_div {
|
596 |
+
font-family: 'Segoe UI';
|
597 |
+
background-color: white;
|
598 |
+
border-color: #CACFD2;
|
599 |
+
min-height: 350px;
|
600 |
+
border-style: solid;
|
601 |
+
border-width: 2px;
|
602 |
+
padding: 20px;
|
603 |
+
}
|
604 |
+
|
605 |
+
.mo2f_advanced_options_note {
|
606 |
+
background-color: #bbccdd;
|
607 |
+
border-radius: 2px;
|
608 |
+
}
|
609 |
+
|
610 |
+
.mo2f_advanced_options_a {
|
611 |
+
cursor: pointer;
|
612 |
+
font-size: 15px;
|
613 |
+
color: #333;
|
614 |
+
font-weight: bold;
|
615 |
+
}
|
616 |
+
|
617 |
+
.mo2f_advanced_options_EC {
|
618 |
+
background-color: white;
|
619 |
+
border-style: solid;
|
620 |
+
border-color: lightgrey;
|
621 |
+
border-radius: 4px;
|
622 |
+
border-width: 1px;
|
623 |
+
padding: 30px;
|
624 |
+
width: 700px;
|
625 |
+
align-content: center
|
626 |
+
|
627 |
+
}
|
628 |
+
|
629 |
+
.mo2f_setup_2_factor_tab {
|
630 |
+
background-color: white;
|
631 |
+
border-style: solid;
|
632 |
+
border-color: lightgrey;
|
633 |
+
border-radius: 4px;
|
634 |
+
border-width: 1px;
|
635 |
+
padding: 20px;
|
636 |
+
width: 93%;
|
637 |
+
align-content: center
|
638 |
+
|
639 |
+
}
|
640 |
+
|
641 |
+
#step1_skip, #step2_skip, #step3_skip, #step5_skip_test, #step4_skip_test {
|
642 |
+
float: left;
|
643 |
+
}
|
644 |
+
|
645 |
+
.mo2f_advanced_options_a {
|
646 |
+
font-family: "Segoe UI";;
|
647 |
+
padding: 20px;
|
648 |
+
font-weight: bold;
|
649 |
+
font-size: medium;
|
650 |
+
color: black
|
651 |
+
}
|
652 |
+
|
653 |
+
.mo2f_advanced_options_a:hover {
|
654 |
+
curosr: pointer
|
655 |
+
}
|
656 |
+
|
657 |
+
.mo2f_vertical-submenu {
|
658 |
+
margin: 0;
|
659 |
+
padding: 0;
|
660 |
+
width: 100%;
|
661 |
+
border-spacing: auto;
|
662 |
+
|
663 |
+
}
|
664 |
+
|
665 |
+
.mo2f_vertical-submenu a {
|
666 |
+
display: inline;
|
667 |
+
background-color: #cce;
|
668 |
+
color: black;
|
669 |
+
margin-left: 6px;
|
670 |
+
width: 28%;
|
671 |
+
margin-top: 15px;
|
672 |
+
text-decoration: none;
|
673 |
+
text-align: center;
|
674 |
+
padding: 11px;
|
675 |
+
}
|
676 |
+
|
677 |
+
.mo2f_vertical-submenu a:hover {
|
678 |
+
background-color: #ccc;
|
679 |
+
}
|
680 |
+
|
681 |
+
.mo2f_vertical-submenu a.active {
|
682 |
+
background-color: #4CAF50;
|
683 |
+
color: white;
|
684 |
+
}
|
685 |
+
|
686 |
+
.mo2f_box {
|
687 |
+
border: 1px solid #DCDCDC;
|
688 |
+
padding: 20px;
|
689 |
+
}
|
690 |
+
|
691 |
+
.mo2f_pointer {
|
692 |
+
cursor: pointer;
|
693 |
+
}
|
694 |
+
|
695 |
+
.mo2f_addon_spacing {
|
696 |
+
margin-left: 1%;
|
697 |
+
padding: 1px 16px;
|
698 |
+
}
|
699 |
+
|
700 |
+
.mo2f_std_prem_p {
|
701 |
+
font-size: 20px;
|
702 |
+
font-family: Segoe UI;
|
703 |
+
color: darkblue;
|
704 |
+
}
|
705 |
+
|
706 |
+
.mo2f_push_oob_backup {
|
707 |
+
font-size: 17px;
|
708 |
+
font-family: Segoe UI;
|
709 |
+
color: cornflowerblue;
|
710 |
+
}
|
711 |
+
|
712 |
+
.twofa-license {
|
713 |
+
background-color: orange !important;
|
714 |
+
color: #000 !important
|
715 |
+
}
|
716 |
+
|
717 |
+
.twofa-license:hover {
|
718 |
+
color: #fff !important;
|
719 |
+
border-color: #c28f37 !important
|
720 |
+
}
|
721 |
+
|
722 |
+
/* The alert message box */
|
723 |
+
.alert {
|
724 |
+
font-style: italic;
|
725 |
+
padding: 10px;
|
726 |
+
background-color: yellowgreen; /* Red */
|
727 |
+
color: white;
|
728 |
+
margin-bottom: 15px;
|
729 |
+
border-radius:5px;
|
730 |
+
}
|
731 |
+
|
732 |
+
/* The close button */
|
733 |
+
.closebtn {
|
734 |
+
margin-left: 15px;
|
735 |
+
color: white;
|
736 |
+
font-weight: bold;
|
737 |
+
float: right;
|
738 |
+
font-size: 22px;
|
739 |
+
line-height: 10px;
|
740 |
+
cursor: pointer;
|
741 |
+
height: 8px;
|
742 |
+
transition: 0.3s;
|
743 |
+
}
|
744 |
+
|
745 |
+
/* When moving the mouse over the close button */
|
746 |
+
.closebtn:hover {
|
747 |
+
color: black;
|
748 |
}
|
749 |
|
750 |
.impt {
|
758 |
}
|
759 |
|
760 |
.mo2f_support_layout {
|
761 |
+
width: 40%;
|
762 |
+
height: 78%;
|
763 |
background-color: #FFFFFF;
|
|
|
764 |
padding: 0px 24px 0px 20px;
|
765 |
+
display: none;
|
766 |
+
position: fixed;
|
767 |
+
bottom: 14%;
|
768 |
+
right: 15px;
|
769 |
+
z-index: 99999;
|
770 |
+
border-radius: 6px;
|
771 |
}
|
772 |
|
773 |
.mo2f_help_layout {
|
1055 |
|
1056 |
.mo2f_setup_2factor_tab {
|
1057 |
align-content: center;
|
1058 |
+
width: 107%;
|
1059 |
min-height: 400px;
|
1060 |
padding:5px;
|
1061 |
}
|
1386 |
|
1387 |
.mo2f_proxy_setup {
|
1388 |
background-color: white;
|
|
|
|
|
|
|
|
|
1389 |
padding: 30px;
|
1390 |
+
align-content: center;
|
1391 |
+
border:0px;
|
1392 |
+
width:130%;
|
1393 |
|
1394 |
}
|
1395 |
|
1397 |
background-color: white;
|
1398 |
border-style: solid;
|
1399 |
border-color: lightgrey;
|
|
|
|
|
1400 |
padding: 20px;
|
1401 |
+
width: 93% !important;
|
1402 |
+
align-content: center;
|
1403 |
+
border: 0px;
|
1404 |
|
1405 |
}
|
1406 |
|
1416 |
color: black
|
1417 |
}
|
1418 |
|
1419 |
+
|
1420 |
.mo2f_advanced_options_a:hover {
|
1421 |
curosr: pointer
|
1422 |
}
|
1534 |
}
|
1535 |
|
1536 |
|
1537 |
+
.sidenav {
|
1538 |
+
height: 100%;
|
1539 |
+
z-index: 1;
|
1540 |
+
float:left;
|
1541 |
+
background-color: #111;
|
1542 |
+
overflow-x: hidden;
|
1543 |
+
padding-top: 5px;
|
1544 |
+
}
|
1545 |
+
|
1546 |
+
.sidenav a {
|
1547 |
+
padding: 6px 6px 6px 32px;
|
1548 |
+
text-decoration: none;
|
1549 |
+
font-size: 25px;
|
1550 |
+
color: #818181;
|
1551 |
+
display: block;
|
1552 |
+
}
|
1553 |
+
|
1554 |
+
.sidenav a:hover {
|
1555 |
+
color: #f1f1f1;
|
1556 |
+
}
|
1557 |
+
|
1558 |
+
.main {
|
1559 |
+
margin-left: 200px; /* Same as the width of the sidenav */
|
1560 |
+
|
1561 |
+
}
|
1562 |
+
|
1563 |
+
@media screen and (max-height: 450px) {
|
1564 |
+
.sidenav {padding-top: 15px;}
|
1565 |
+
.sidenav a {font-size: 18px;}
|
1566 |
+
}
|
1567 |
+
.mo2f_content{
|
1568 |
+
float:Right;
|
1569 |
+
width:90%;
|
1570 |
+
}
|
1571 |
+
|
1572 |
+
* {
|
1573 |
+
box-sizing: border-box;
|
1574 |
+
}
|
1575 |
+
|
1576 |
+
/* Create two unequal columns that floats next to each other */
|
1577 |
+
.column {
|
1578 |
+
float: left;
|
1579 |
+
padding: 10px;
|
1580 |
+
height: 300px; /* Should be removed. Only for demonstration */
|
1581 |
+
}
|
1582 |
+
|
1583 |
+
.left {
|
1584 |
+
width: 13%;
|
1585 |
+
}
|
1586 |
+
|
1587 |
+
.right {
|
1588 |
+
width: 87%;
|
1589 |
+
}
|
1590 |
+
|
1591 |
+
/* Clear floats after the columns */
|
1592 |
+
.row:after {
|
1593 |
+
content: "";
|
1594 |
+
display: table;
|
1595 |
+
clear: both;
|
1596 |
+
}
|
1597 |
+
|
1598 |
+
----------------
|
1599 |
+
* {box-sizing: border-box}
|
1600 |
+
body {font-family: "Lato", sans-serif;}
|
1601 |
+
|
1602 |
+
/* Style the tab */
|
1603 |
+
.tab {
|
1604 |
+
float: left;
|
1605 |
+
background-color: #23282D;
|
1606 |
+
width: 15%;
|
1607 |
+
height: 350px;
|
1608 |
+
box-shadow: -1px 0px 5px #777777;
|
1609 |
+
}
|
1610 |
+
|
1611 |
+
/* Style the buttons inside the tab */
|
1612 |
+
.tab button {
|
1613 |
+
display: block;
|
1614 |
+
background-color: inherit;
|
1615 |
+
color: black;
|
1616 |
+
padding: 18px 16px;
|
1617 |
+
width: 100%;
|
1618 |
+
border: none;
|
1619 |
+
outline: none;
|
1620 |
+
text-align: left;
|
1621 |
+
cursor: pointer;
|
1622 |
+
transition: 0.3s;
|
1623 |
+
font-size: 17px;
|
1624 |
+
border: 1px solid Black;
|
1625 |
+
}
|
1626 |
+
.tab a {
|
1627 |
+
display: block;
|
1628 |
+
background-color: #23282D;
|
1629 |
+
color: white;
|
1630 |
+
padding: 18px 16px;
|
1631 |
+
width: 100%;
|
1632 |
+
|
1633 |
+
outline: none;
|
1634 |
+
text-align: left;
|
1635 |
+
cursor: pointer;
|
1636 |
+
transition: 0.3s;
|
1637 |
+
font-size: 15px;
|
1638 |
+
}
|
1639 |
+
.tab a:hover {
|
1640 |
+
background-color: #F6821F;
|
1641 |
+
color: white;
|
1642 |
+
}
|
1643 |
|
1644 |
+
.nav-tab-active, .nav-tab-active:focus, .nav-tab-active:focus:active, .nav-tab-active:hover {
|
1645 |
+
border-bottom: 1px solid #f1f1f1;
|
1646 |
+
background: #fff;
|
1647 |
+
color: #000;
|
1648 |
+
transform: scale(1,1.03);
|
1649 |
+
border-bottom: 0px;
|
1650 |
+
}
|
1651 |
+
|
1652 |
+
/* Create an active/current "tab button" class */
|
1653 |
+
.tab a.active {
|
1654 |
+
background-color: white;
|
1655 |
+
color:#F6821F;
|
1656 |
+
|
1657 |
+
box-shadow: 0px 0px 5px #aaaaaa;
|
1658 |
+
font-weight: bold;
|
1659 |
+
}
|
1660 |
+
|
1661 |
+
/* Change background color of buttons on hover */
|
1662 |
+
.tab button:hover {
|
1663 |
+
background-color: #ddd;
|
1664 |
+
}
|
1665 |
+
|
1666 |
+
/* Create an active/current "tab button" class */
|
1667 |
+
.tab button.active {
|
1668 |
+
background-color: #ccc;
|
1669 |
+
|
1670 |
+
}
|
1671 |
+
|
1672 |
+
/* Style the tab content */
|
1673 |
+
.tabcontent {
|
1674 |
+
float: left;
|
1675 |
+
border: 1px solid #ccc;
|
1676 |
+
width: 85%;
|
1677 |
+
border-left: none;
|
1678 |
+
min-height: 350px;
|
1679 |
+
background-color: #fff;
|
1680 |
+
}
|
1681 |
+
|
1682 |
+
----------------------------
|
1683 |
+
.tooltip {
|
1684 |
+
position: relative;
|
1685 |
+
display: inline-block;
|
1686 |
+
border-bottom: 1px dotted black;
|
1687 |
+
}
|
1688 |
+
|
1689 |
+
.tooltip .tooltiptext {
|
1690 |
+
visibility: visible;
|
1691 |
+
width: 120px;
|
1692 |
+
background-color: black;
|
1693 |
+
color: #fff;
|
1694 |
+
text-align: center;
|
1695 |
+
border-radius: 6px;
|
1696 |
+
padding: 5px 0;
|
1697 |
+
position: absolute;
|
1698 |
+
z-index: 1;
|
1699 |
+
bottom: 150%;
|
1700 |
+
left: 50%;
|
1701 |
+
margin-left: -60px;
|
1702 |
+
}
|
1703 |
+
|
1704 |
+
.tooltip .tooltiptext::after {
|
1705 |
+
content: "";
|
1706 |
+
position: absolute;
|
1707 |
+
top: 175%;
|
1708 |
+
left: 200%;
|
1709 |
+
margin-left: -5px;
|
1710 |
+
border-width: 13px;
|
1711 |
+
border-style: solid;
|
1712 |
+
border-color: transparent white transparent transparent;
|
1713 |
+
}
|
1714 |
+
|
1715 |
+
.tooltip:hover .tooltiptext {
|
1716 |
+
|
1717 |
+
visibility: visible;
|
1718 |
+
}
|
1719 |
+
.arrow-left {
|
1720 |
+
visibility: hidden;
|
1721 |
+
left: 10%;
|
1722 |
+
width: 0;
|
1723 |
+
height: 0;
|
1724 |
+
border-top: 10px solid transparent;
|
1725 |
+
border-bottom: 10px solid transparent;
|
1726 |
+
position: relative;
|
1727 |
+
border-right: 10px solid white;
|
1728 |
+
}
|
1729 |
+
.active .arrow-left{
|
1730 |
+
visibility: visible;
|
1731 |
+
}
|
1732 |
+
----------------------------------------------
|
1733 |
+
/* with network security features.*/
|
1734 |
+
.mo2f_backdrop{
|
1735 |
+
top: 0;
|
1736 |
+
left: 0;
|
1737 |
+
position: fixed;
|
1738 |
+
width: 100% !important;
|
1739 |
+
background-color: #000 !important;
|
1740 |
+
opacity: 0.96 !important;
|
1741 |
+
height: 100% !important;
|
1742 |
+
z-index: 99999;
|
1743 |
+
}
|
1744 |
+
|
1745 |
+
.mo2f_fixed_support{
|
1746 |
+
position:fixed;
|
1747 |
+
top: 90%;
|
1748 |
+
left: 85%;
|
1749 |
+
z-index: 1;
|
1750 |
+
}
|
includes/images/captchaimage.jpeg
ADDED
Binary file
|
includes/images/easy.PNG
ADDED
Binary file
|
includes/images/enforce_password.png
ADDED
Binary file
|
includes/images/google.PNG
ADDED
Binary file
|
includes/images/normal.PNG
ADDED
Binary file
|
includes/images/sort_asc.png
ADDED
Binary file
|
includes/images/sort_both.png
ADDED
Binary file
|
includes/images/sort_desc.png
ADDED
Binary file
|
includes/js/jquery.dataTables.min.js
ADDED
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
DataTables 1.10.10
|
3 |
+
©2008-2015 SpryMedia Ltd - datatables.net/license
|
4 |
+
*/
|
5 |
+
(function(h){"function"===typeof define&&define.amd?define(["jquery"],function(E){return h(E,window,document)}):"object"===typeof exports?module.exports=function(E,H){E||(E=window);H||(H="undefined"!==typeof window?require("jquery"):require("jquery")(E));return h(H,E,E.document)}:h(jQuery,window,document)})(function(h,E,H,k){function Y(a){var b,c,d={};h.each(a,function(e){if((b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" "))c=e.replace(b[0],b[2].toLowerCase()),
|
6 |
+
d[c]=e,"o"===b[1]&&Y(a[e])});a._hungarianMap=d}function J(a,b,c){a._hungarianMap||Y(a);var d;h.each(b,function(e){d=a._hungarianMap[e];if(d!==k&&(c||b[d]===k))"o"===d.charAt(0)?(b[d]||(b[d]={}),h.extend(!0,b[d],b[e]),J(a[d],b[d],c)):b[d]=b[e]})}function Fa(a){var b=m.defaults.oLanguage,c=a.sZeroRecords;!a.sEmptyTable&&(c&&"No data available in table"===b.sEmptyTable)&&F(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(c&&"Loading..."===b.sLoadingRecords)&&F(a,a,"sZeroRecords","sLoadingRecords");
|
7 |
+
a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&db(a)}function eb(a){A(a,"ordering","bSort");A(a,"orderMulti","bSortMulti");A(a,"orderClasses","bSortClasses");A(a,"orderCellsTop","bSortCellsTop");A(a,"order","aaSorting");A(a,"orderFixed","aaSortingFixed");A(a,"paging","bPaginate");A(a,"pagingType","sPaginationType");A(a,"pageLength","iDisplayLength");A(a,"searching","bFilter");"boolean"===typeof a.sScrollX&&(a.sScrollX=a.sScrollX?"100%":"");"boolean"===typeof a.scrollX&&(a.scrollX=
|
8 |
+
a.scrollX?"100%":"");if(a=a.aoSearchCols)for(var b=0,c=a.length;b<c;b++)a[b]&&J(m.models.oSearch,a[b])}function fb(a){A(a,"orderable","bSortable");A(a,"orderData","aDataSort");A(a,"orderSequence","asSorting");A(a,"orderDataType","sortDataType");var b=a.aDataSort;b&&!h.isArray(b)&&(a.aDataSort=[b])}function gb(a){if(!m.__browser){var b={};m.__browser=b;var c=h("<div/>").css({position:"fixed",top:0,left:0,height:1,width:1,overflow:"hidden"}).append(h("<div/>").css({position:"absolute",top:1,left:1,
|
9 |
+
width:100,overflow:"scroll"}).append(h("<div/>").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}h.extend(a.oBrowser,m.__browser);a.oScroll.iBarWidth=m.__browser.barWidth}function hb(a,b,c,d,e,f){var g,j=!1;c!==k&&(g=c,j=!0);for(;d!==e;)a.hasOwnProperty(d)&&
|
10 |
+
(g=j?b(g,a[d],d,a):a[d],j=!0,d+=f);return g}function Ga(a,b){var c=m.defaults.column,d=a.aoColumns.length,c=h.extend({},m.models.oColumn,c,{nTh:b?b:H.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;c[d]=h.extend({},m.models.oSearch,c[d]);la(a,d,h(b).data())}function la(a,b,c){var b=a.aoColumns[b],d=a.oClasses,e=h(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=e.attr("width")||null;var f=
|
11 |
+
(e.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);f&&(b.sWidthOrig=f[1])}c!==k&&null!==c&&(fb(c),J(m.defaults.column,c),c.mDataProp!==k&&!c.mData&&(c.mData=c.mDataProp),c.sType&&(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),h.extend(b,c),F(b,c,"sWidth","sWidthOrig"),c.iDataSort!==k&&(b.aDataSort=[c.iDataSort]),F(b,c,"aDataSort"));var g=b.mData,j=Q(g),i=b.mRender?Q(b.mRender):null,c=function(a){return"string"===typeof a&&-1!==a.indexOf("@")};b._bAttrSrc=h.isPlainObject(g)&&
|
12 |
+
(c(g.sort)||c(g.type)||c(g.filter));b.fnGetData=function(a,b,c){var d=j(a,b,k,c);return i&&b?i(d,b,a,c):d};b.fnSetData=function(a,b,c){return R(g)(a,b,c)};"number"!==typeof g&&(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,e.addClass(d.sSortableNone));a=-1!==h.inArray("asc",b.asSorting);c=-1!==h.inArray("desc",b.asSorting);!b.bSortable||!a&&!c?(b.sSortingClass=d.sSortableNone,b.sSortingClassJUI=""):a&&!c?(b.sSortingClass=d.sSortableAsc,b.sSortingClassJUI=d.sSortJUIAscAllowed):!a&&c?(b.sSortingClass=
|
13 |
+
d.sSortableDesc,b.sSortingClassJUI=d.sSortJUIDescAllowed):(b.sSortingClass=d.sSortable,b.sSortingClassJUI=d.sSortJUI)}function U(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;Ha(a);for(var c=0,d=b.length;c<d;c++)b[c].nTh.style.width=b[c].sWidth}b=a.oScroll;(""!==b.sY||""!==b.sX)&&Z(a);v(a,null,"column-sizing",[a])}function $(a,b){var c=aa(a,"bVisible");return"number"===typeof c[b]?c[b]:null}function ba(a,b){var c=aa(a,"bVisible"),c=h.inArray(b,c);return-1!==c?c:null}function ca(a){return aa(a,
|
14 |
+
"bVisible").length}function aa(a,b){var c=[];h.map(a.aoColumns,function(a,e){a[b]&&c.push(e)});return c}function Ia(a){var b=a.aoColumns,c=a.aoData,d=m.ext.type.detect,e,f,g,j,i,h,l,q,u;e=0;for(f=b.length;e<f;e++)if(l=b[e],u=[],!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){g=0;for(j=d.length;g<j;g++){i=0;for(h=c.length;i<h;i++){u[i]===k&&(u[i]=B(a,i,e,"type"));q=d[g](u[i],a);if(!q&&g!==d.length-1)break;if("html"===q)break}if(q){l.sType=q;break}}l.sType||(l.sType="string")}}function ib(a,
|
15 |
+
b,c,d){var e,f,g,j,i,o,l=a.aoColumns;if(b)for(e=b.length-1;0<=e;e--){o=b[e];var q=o.targets!==k?o.targets:o.aTargets;h.isArray(q)||(q=[q]);f=0;for(g=q.length;f<g;f++)if("number"===typeof q[f]&&0<=q[f]){for(;l.length<=q[f];)Ga(a);d(q[f],o)}else if("number"===typeof q[f]&&0>q[f])d(l.length+q[f],o);else if("string"===typeof q[f]){j=0;for(i=l.length;j<i;j++)("_all"==q[f]||h(l[j].nTh).hasClass(q[f]))&&d(j,o)}}if(c){e=0;for(a=c.length;e<a;e++)d(e,c[e])}}function N(a,b,c,d){var e=a.aoData.length,f=h.extend(!0,
|
16 |
+
{},m.models.oRow,{src:c?"dom":"data",idx:e});f._aData=b;a.aoData.push(f);for(var g=a.aoColumns,j=0,i=g.length;j<i;j++)g[j].sType=null;a.aiDisplayMaster.push(e);b=a.rowIdFn(b);b!==k&&(a.aIds[b]=f);(c||!a.oFeatures.bDeferRender)&&Ja(a,e,c,d);return e}function ma(a,b){var c;b instanceof h||(b=h(b));return b.map(function(b,e){c=Ka(a,e);return N(a,c.data,e,c.cells)})}function B(a,b,c,d){var e=a.iDraw,f=a.aoColumns[c],g=a.aoData[b]._aData,j=f.sDefaultContent,i=f.fnGetData(g,d,{settings:a,row:b,col:c});
|
17 |
+
if(i===k)return a.iDrawError!=e&&null===j&&(K(a,0,"Requested unknown parameter "+("function"==typeof f.mData?"{function}":"'"+f.mData+"'")+" for row "+b+", column "+c,4),a.iDrawError=e),j;if((i===g||null===i)&&null!==j)i=j;else if("function"===typeof i)return i.call(g);return null===i&&"display"==d?"":i}function jb(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d,{settings:a,row:b,col:c})}function La(a){return h.map(a.match(/(\\.|[^\.])+/g)||[""],function(a){return a.replace(/\\./g,".")})}function Q(a){if(h.isPlainObject(a)){var b=
|
18 |
+
{};h.each(a,function(a,c){c&&(b[a]=Q(c))});return function(a,c,f,g){var j=b[c]||b._;return j!==k?j(a,c,f,g):a}}if(null===a)return function(a){return a};if("function"===typeof a)return function(b,c,f,g){return a(b,c,f,g)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var c=function(a,b,f){var g,j;if(""!==f){j=La(f);for(var i=0,o=j.length;i<o;i++){f=j[i].match(da);g=j[i].match(V);if(f){j[i]=j[i].replace(da,"");""!==j[i]&&(a=a[j[i]]);g=[];j.splice(0,i+1);j=
|
19 |
+
j.join(".");if(h.isArray(a)){i=0;for(o=a.length;i<o;i++)g.push(c(a[i],b,j))}a=f[0].substring(1,f[0].length-1);a=""===a?g:g.join(a);break}else if(g){j[i]=j[i].replace(V,"");a=a[j[i]]();continue}if(null===a||a[j[i]]===k)return k;a=a[j[i]]}}return a};return function(b,e){return c(b,e,a)}}return function(b){return b[a]}}function R(a){if(h.isPlainObject(a))return R(a._);if(null===a)return function(){};if("function"===typeof a)return function(b,d,e){a(b,"set",d,e)};if("string"===typeof a&&(-1!==a.indexOf(".")||
|
20 |
+
-1!==a.indexOf("[")||-1!==a.indexOf("("))){var b=function(a,d,e){var e=La(e),f;f=e[e.length-1];for(var g,j,i=0,o=e.length-1;i<o;i++){g=e[i].match(da);j=e[i].match(V);if(g){e[i]=e[i].replace(da,"");a[e[i]]=[];f=e.slice();f.splice(0,i+1);g=f.join(".");if(h.isArray(d)){j=0;for(o=d.length;j<o;j++)f={},b(f,d[j],g),a[e[i]].push(f)}else a[e[i]]=d;return}j&&(e[i]=e[i].replace(V,""),a=a[e[i]](d));if(null===a[e[i]]||a[e[i]]===k)a[e[i]]={};a=a[e[i]]}if(f.match(V))a[f.replace(V,"")](d);else a[f.replace(da,"")]=
|
21 |
+
d};return function(c,d){return b(c,d,a)}}return function(b,d){b[a]=d}}function Ma(a){return D(a.aoData,"_aData")}function na(a){a.aoData.length=0;a.aiDisplayMaster.length=0;a.aiDisplay.length=0;a.aIds={}}function oa(a,b,c){for(var d=-1,e=0,f=a.length;e<f;e++)a[e]==b?d=e:a[e]>b&&a[e]--; -1!=d&&c===k&&a.splice(d,1)}function ea(a,b,c,d){var e=a.aoData[b],f,g=function(c,d){for(;c.childNodes.length;)c.removeChild(c.firstChild);c.innerHTML=B(a,b,d,"display")};if("dom"===c||(!c||"auto"===c)&&"dom"===e.src)e._aData=
|
22 |
+
Ka(a,e,d,d===k?k:e._aData).data;else{var j=e.anCells;if(j)if(d!==k)g(j[d],d);else{c=0;for(f=j.length;c<f;c++)g(j[c],c)}}e._aSortData=null;e._aFilterData=null;g=a.aoColumns;if(d!==k)g[d].sType=null;else{c=0;for(f=g.length;c<f;c++)g[c].sType=null;Na(a,e)}}function Ka(a,b,c,d){var e=[],f=b.firstChild,g,j,i=0,o,l=a.aoColumns,q=a._rowReadObject,d=d!==k?d:q?{}:[],u=function(a,b){if("string"===typeof a){var c=a.indexOf("@");-1!==c&&(c=a.substring(c+1),R(a)(d,b.getAttribute(c)))}},S=function(a){if(c===k||
|
23 |
+
c===i)j=l[i],o=h.trim(a.innerHTML),j&&j._bAttrSrc?(R(j.mData._)(d,o),u(j.mData.sort,a),u(j.mData.type,a),u(j.mData.filter,a)):q?(j._setter||(j._setter=R(j.mData)),j._setter(d,o)):d[i]=o;i++};if(f)for(;f;){g=f.nodeName.toUpperCase();if("TD"==g||"TH"==g)S(f),e.push(f);f=f.nextSibling}else{e=b.anCells;f=0;for(g=e.length;f<g;f++)S(e[f])}if(b=b.firstChild?b:b.nTr)(b=b.getAttribute("id"))&&R(a.rowId)(d,b);return{data:d,cells:e}}function Ja(a,b,c,d){var e=a.aoData[b],f=e._aData,g=[],j,i,h,l,q;if(null===
|
24 |
+
e.nTr){j=c||H.createElement("tr");e.nTr=j;e.anCells=g;j._DT_RowIndex=b;Na(a,e);l=0;for(q=a.aoColumns.length;l<q;l++){h=a.aoColumns[l];i=c?d[l]:H.createElement(h.sCellType);i._DT_CellIndex={row:b,column:l};g.push(i);if(!c||h.mRender||h.mData!==l)i.innerHTML=B(a,b,l,"display");h.sClass&&(i.className+=" "+h.sClass);h.bVisible&&!c?j.appendChild(i):!h.bVisible&&c&&i.parentNode.removeChild(i);h.fnCreatedCell&&h.fnCreatedCell.call(a.oInstance,i,B(a,b,l),f,b,l)}v(a,"aoRowCreatedCallback",null,[j,f,b])}e.nTr.setAttribute("role",
|
25 |
+
"row")}function Na(a,b){var c=b.nTr,d=b._aData;if(c){var e=a.rowIdFn(d);e&&(c.id=e);d.DT_RowClass&&(e=d.DT_RowClass.split(" "),b.__rowc=b.__rowc?pa(b.__rowc.concat(e)):e,h(c).removeClass(b.__rowc.join(" ")).addClass(d.DT_RowClass));d.DT_RowAttr&&h(c).attr(d.DT_RowAttr);d.DT_RowData&&h(c).data(d.DT_RowData)}}function kb(a){var b,c,d,e,f,g=a.nTHead,j=a.nTFoot,i=0===h("th, td",g).length,o=a.oClasses,l=a.aoColumns;i&&(e=h("<tr/>").appendTo(g));b=0;for(c=l.length;b<c;b++)f=l[b],d=h(f.nTh).addClass(f.sClass),
|
26 |
+
i&&d.appendTo(e),a.oFeatures.bSort&&(d.addClass(f.sSortingClass),!1!==f.bSortable&&(d.attr("tabindex",a.iTabIndex).attr("aria-controls",a.sTableId),Oa(a,f.nTh,b))),f.sTitle!=d[0].innerHTML&&d.html(f.sTitle),Pa(a,"header")(a,d,f,o);i&&fa(a.aoHeader,g);h(g).find(">tr").attr("role","row");h(g).find(">tr>th, >tr>td").addClass(o.sHeaderTH);h(j).find(">tr>th, >tr>td").addClass(o.sFooterTH);if(null!==j){a=a.aoFooter[0];b=0;for(c=a.length;b<c;b++)f=l[b],f.nTf=a[b].cell,f.sClass&&h(f.nTf).addClass(f.sClass)}}
|
27 |
+
function ga(a,b,c){var d,e,f,g=[],j=[],i=a.aoColumns.length,o;if(b){c===k&&(c=!1);d=0;for(e=b.length;d<e;d++){g[d]=b[d].slice();g[d].nTr=b[d].nTr;for(f=i-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&g[d].splice(f,1);j.push([])}d=0;for(e=g.length;d<e;d++){if(a=g[d].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=g[d].length;f<b;f++)if(o=i=1,j[d][f]===k){a.appendChild(g[d][f].cell);for(j[d][f]=1;g[d+i]!==k&&g[d][f].cell==g[d+i][f].cell;)j[d+i][f]=1,i++;for(;g[d][f+o]!==k&&g[d][f].cell==g[d][f+o].cell;){for(c=
|
28 |
+
0;c<i;c++)j[d+c][f+o]=1;o++}h(g[d][f].cell).attr("rowspan",i).attr("colspan",o)}}}}function O(a){var b=v(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==h.inArray(!1,b))C(a,!1);else{var b=[],c=0,d=a.asStripeClasses,e=d.length,f=a.oLanguage,g=a.iInitDisplayStart,j="ssp"==y(a),i=a.aiDisplay;a.bDrawing=!0;g!==k&&-1!==g&&(a._iDisplayStart=j?g:g>=a.fnRecordsDisplay()?0:g,a.iInitDisplayStart=-1);var g=a._iDisplayStart,o=a.fnDisplayEnd();if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,C(a,!1);else if(j){if(!a.bDestroying&&
|
29 |
+
!lb(a))return}else a.iDraw++;if(0!==i.length){f=j?a.aoData.length:o;for(j=j?0:g;j<f;j++){var l=i[j],q=a.aoData[l];null===q.nTr&&Ja(a,l);l=q.nTr;if(0!==e){var u=d[c%e];q._sRowStripe!=u&&(h(l).removeClass(q._sRowStripe).addClass(u),q._sRowStripe=u)}v(a,"aoRowCallback",null,[l,q._aData,c,j]);b.push(l);c++}}else c=f.sZeroRecords,1==a.iDraw&&"ajax"==y(a)?c=f.sLoadingRecords:f.sEmptyTable&&0===a.fnRecordsTotal()&&(c=f.sEmptyTable),b[0]=h("<tr/>",{"class":e?d[0]:""}).append(h("<td />",{valign:"top",colSpan:ca(a),
|
30 |
+
"class":a.oClasses.sRowEmpty}).html(c))[0];v(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],Ma(a),g,o,i]);v(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0],Ma(a),g,o,i]);d=h(a.nTBody);d.children().detach();d.append(h(b));v(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1}}function T(a,b){var c=a.oFeatures,d=c.bFilter;c.bSort&&mb(a);d?ha(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;O(a);a._drawHold=
|
31 |
+
!1}function nb(a){var b=a.oClasses,c=h(a.nTable),c=h("<div/>").insertBefore(c),d=a.oFeatures,e=h("<div/>",{id:a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=e[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var f=a.sDom.split(""),g,j,i,o,l,q,u=0;u<f.length;u++){g=null;j=f[u];if("<"==j){i=h("<div/>")[0];o=f[u+1];if("'"==o||'"'==o){l="";for(q=2;f[u+q]!=o;)l+=f[u+q],q++;"H"==l?l=b.sJUIHeader:"F"==l&&(l=b.sJUIFooter);-1!=l.indexOf(".")?(o=l.split("."),
|
32 |
+
i.id=o[0].substr(1,o[0].length-1),i.className=o[1]):"#"==l.charAt(0)?i.id=l.substr(1,l.length-1):i.className=l;u+=q}e.append(i);e=h(i)}else if(">"==j)e=e.parent();else if("l"==j&&d.bPaginate&&d.bLengthChange)g=ob(a);else if("f"==j&&d.bFilter)g=pb(a);else if("r"==j&&d.bProcessing)g=qb(a);else if("t"==j)g=rb(a);else if("i"==j&&d.bInfo)g=sb(a);else if("p"==j&&d.bPaginate)g=tb(a);else if(0!==m.ext.feature.length){i=m.ext.feature;q=0;for(o=i.length;q<o;q++)if(j==i[q].cFeature){g=i[q].fnInit(a);break}}g&&
|
33 |
+
(i=a.aanFeatures,i[j]||(i[j]=[]),i[j].push(g),e.append(g))}c.replaceWith(e);a.nHolding=null}function fa(a,b){var c=h(b).children("tr"),d,e,f,g,j,i,o,l,q,u;a.splice(0,a.length);f=0;for(i=c.length;f<i;f++)a.push([]);f=0;for(i=c.length;f<i;f++){d=c[f];for(e=d.firstChild;e;){if("TD"==e.nodeName.toUpperCase()||"TH"==e.nodeName.toUpperCase()){l=1*e.getAttribute("colspan");q=1*e.getAttribute("rowspan");l=!l||0===l||1===l?1:l;q=!q||0===q||1===q?1:q;g=0;for(j=a[f];j[g];)g++;o=g;u=1===l?!0:!1;for(j=0;j<l;j++)for(g=
|
34 |
+
0;g<q;g++)a[f+g][o+j]={cell:e,unique:u},a[f+g].nTr=d}e=e.nextSibling}}}function qa(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],fa(c,b)));for(var b=0,e=c.length;b<e;b++)for(var f=0,g=c[b].length;f<g;f++)if(c[b][f].unique&&(!d[f]||!a.bSortCellsTop))d[f]=c[b][f].cell;return d}function ra(a,b,c){v(a,"aoServerParams","serverParams",[b]);if(b&&h.isArray(b)){var d={},e=/(.*?)\[\]$/;h.each(b,function(a,b){var c=b.name.match(e);c?(c=c[0],d[c]||(d[c]=[]),d[c].push(b.value)):d[b.name]=b.value});b=d}var f,g=a.ajax,
|
35 |
+
j=a.oInstance,i=function(b){v(a,null,"xhr",[a,b,a.jqXHR]);c(b)};if(h.isPlainObject(g)&&g.data){f=g.data;var o=h.isFunction(f)?f(b,a):f,b=h.isFunction(f)&&o?o:h.extend(!0,b,o);delete g.data}o={data:b,success:function(b){var c=b.error||b.sError;c&&K(a,0,c);a.json=b;i(b)},dataType:"json",cache:!1,type:a.sServerMethod,error:function(b,c){var d=v(a,null,"xhr",[a,null,a.jqXHR]);-1===h.inArray(!0,d)&&("parsererror"==c?K(a,0,"Invalid JSON response",1):4===b.readyState&&K(a,0,"Ajax error",7));C(a,!1)}};a.oAjaxData=
|
36 |
+
b;v(a,null,"preXhr",[a,b]);a.fnServerData?a.fnServerData.call(j,a.sAjaxSource,h.map(b,function(a,b){return{name:b,value:a}}),i,a):a.sAjaxSource||"string"===typeof g?a.jqXHR=h.ajax(h.extend(o,{url:g||a.sAjaxSource})):h.isFunction(g)?a.jqXHR=g.call(j,b,i,a):(a.jqXHR=h.ajax(h.extend(o,g)),g.data=f)}function lb(a){return a.bAjaxDataGet?(a.iDraw++,C(a,!0),ra(a,ub(a),function(b){vb(a,b)}),!1):!0}function ub(a){var b=a.aoColumns,c=b.length,d=a.oFeatures,e=a.oPreviousSearch,f=a.aoPreSearchCols,g,j=[],i,o,
|
37 |
+
l,q=W(a);g=a._iDisplayStart;i=!1!==d.bPaginate?a._iDisplayLength:-1;var k=function(a,b){j.push({name:a,value:b})};k("sEcho",a.iDraw);k("iColumns",c);k("sColumns",D(b,"sName").join(","));k("iDisplayStart",g);k("iDisplayLength",i);var S={draw:a.iDraw,columns:[],order:[],start:g,length:i,search:{value:e.sSearch,regex:e.bRegex}};for(g=0;g<c;g++)o=b[g],l=f[g],i="function"==typeof o.mData?"function":o.mData,S.columns.push({data:i,name:o.sName,searchable:o.bSearchable,orderable:o.bSortable,search:{value:l.sSearch,
|
38 |
+
regex:l.bRegex}}),k("mDataProp_"+g,i),d.bFilter&&(k("sSearch_"+g,l.sSearch),k("bRegex_"+g,l.bRegex),k("bSearchable_"+g,o.bSearchable)),d.bSort&&k("bSortable_"+g,o.bSortable);d.bFilter&&(k("sSearch",e.sSearch),k("bRegex",e.bRegex));d.bSort&&(h.each(q,function(a,b){S.order.push({column:b.col,dir:b.dir});k("iSortCol_"+a,b.col);k("sSortDir_"+a,b.dir)}),k("iSortingCols",q.length));b=m.ext.legacy.ajax;return null===b?a.sAjaxSource?j:S:b?j:S}function vb(a,b){var c=sa(a,b),d=b.sEcho!==k?b.sEcho:b.draw,e=
|
39 |
+
b.iTotalRecords!==k?b.iTotalRecords:b.recordsTotal,f=b.iTotalDisplayRecords!==k?b.iTotalDisplayRecords:b.recordsFiltered;if(d){if(1*d<a.iDraw)return;a.iDraw=1*d}na(a);a._iRecordsTotal=parseInt(e,10);a._iRecordsDisplay=parseInt(f,10);d=0;for(e=c.length;d<e;d++)N(a,c[d]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;O(a);a._bInitComplete||ta(a,b);a.bAjaxDataGet=!0;C(a,!1)}function sa(a,b){var c=h.isPlainObject(a.ajax)&&a.ajax.dataSrc!==k?a.ajax.dataSrc:a.sAjaxDataProp;return"data"===c?b.aaData||
|
40 |
+
b[c]:""!==c?Q(c)(b):b}function pb(a){var b=a.oClasses,c=a.sTableId,d=a.oLanguage,e=a.oPreviousSearch,f=a.aanFeatures,g='<input type="search" class="'+b.sFilterInput+'"/>',j=d.sSearch,j=j.match(/_INPUT_/)?j.replace("_INPUT_",g):j+g,b=h("<div/>",{id:!f.f?c+"_filter":null,"class":b.sFilter}).append(h("<label/>").append(j)),f=function(){var b=!this.value?"":this.value;b!=e.sSearch&&(ha(a,{sSearch:b,bRegex:e.bRegex,bSmart:e.bSmart,bCaseInsensitive:e.bCaseInsensitive}),a._iDisplayStart=0,O(a))},g=null!==
|
41 |
+
a.searchDelay?a.searchDelay:"ssp"===y(a)?400:0,i=h("input",b).val(e.sSearch).attr("placeholder",d.sSearchPlaceholder).bind("keyup.DT search.DT input.DT paste.DT cut.DT",g?ua(f,g):f).bind("keypress.DT",function(a){if(13==a.keyCode)return!1}).attr("aria-controls",c);h(a.nTable).on("search.dt.DT",function(b,c){if(a===c)try{i[0]!==H.activeElement&&i.val(e.sSearch)}catch(d){}});return b[0]}function ha(a,b,c){var d=a.oPreviousSearch,e=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;
|
42 |
+
d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};Ia(a);if("ssp"!=y(a)){wb(a,b.sSearch,c,b.bEscapeRegex!==k?!b.bEscapeRegex:b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<e.length;b++)xb(a,e[b].sSearch,b,e[b].bEscapeRegex!==k?!e[b].bEscapeRegex:e[b].bRegex,e[b].bSmart,e[b].bCaseInsensitive);yb(a)}else f(b);a.bFiltered=!0;v(a,null,"search",[a])}function yb(a){for(var b=m.ext.search,c=a.aiDisplay,d,e,f=0,g=b.length;f<g;f++){for(var j=[],i=0,o=c.length;i<o;i++)e=c[i],d=a.aoData[e],b[f](a,
|
43 |
+
d._aFilterData,e,d._aData,i)&&j.push(e);c.length=0;h.merge(c,j)}}function xb(a,b,c,d,e,f){if(""!==b)for(var g=a.aiDisplay,d=Qa(b,d,e,f),e=g.length-1;0<=e;e--)b=a.aoData[g[e]]._aFilterData[c],d.test(b)||g.splice(e,1)}function wb(a,b,c,d,e,f){var d=Qa(b,d,e,f),e=a.oPreviousSearch.sSearch,f=a.aiDisplayMaster,g;0!==m.ext.search.length&&(c=!0);g=zb(a);if(0>=b.length)a.aiDisplay=f.slice();else{if(g||c||e.length>b.length||0!==b.indexOf(e)||a.bSorted)a.aiDisplay=f.slice();b=a.aiDisplay;for(c=b.length-1;0<=
|
44 |
+
c;c--)d.test(a.aoData[b[c]]._sFilterRow)||b.splice(c,1)}}function Qa(a,b,c,d){a=b?a:va(a);c&&(a="^(?=.*?"+h.map(a.match(/"[^"]+"|[^ ]+/g)||[""],function(a){if('"'===a.charAt(0))var b=a.match(/^"(.*)"$/),a=b?b[1]:a;return a.replace('"',"")}).join(")(?=.*?")+").*$");return RegExp(a,d?"i":"")}function va(a){return a.replace(Yb,"\\$1")}function zb(a){var b=a.aoColumns,c,d,e,f,g,j,i,h,l=m.ext.type.search;c=!1;d=0;for(f=a.aoData.length;d<f;d++)if(h=a.aoData[d],!h._aFilterData){j=[];e=0;for(g=b.length;e<
|
45 |
+
g;e++)c=b[e],c.bSearchable?(i=B(a,d,e,"filter"),l[c.sType]&&(i=l[c.sType](i)),null===i&&(i=""),"string"!==typeof i&&i.toString&&(i=i.toString())):i="",i.indexOf&&-1!==i.indexOf("&")&&(wa.innerHTML=i,i=Zb?wa.textContent:wa.innerText),i.replace&&(i=i.replace(/[\r\n]/g,"")),j.push(i);h._aFilterData=j;h._sFilterRow=j.join(" ");c=!0}return c}function Ab(a){return{search:a.sSearch,smart:a.bSmart,regex:a.bRegex,caseInsensitive:a.bCaseInsensitive}}function Bb(a){return{sSearch:a.search,bSmart:a.smart,bRegex:a.regex,
|
46 |
+
bCaseInsensitive:a.caseInsensitive}}function sb(a){var b=a.sTableId,c=a.aanFeatures.i,d=h("<div/>",{"class":a.oClasses.sInfo,id:!c?b+"_info":null});c||(a.aoDrawCallback.push({fn:Cb,sName:"information"}),d.attr("role","status").attr("aria-live","polite"),h(a.nTable).attr("aria-describedby",b+"_info"));return d[0]}function Cb(a){var b=a.aanFeatures.i;if(0!==b.length){var c=a.oLanguage,d=a._iDisplayStart+1,e=a.fnDisplayEnd(),f=a.fnRecordsTotal(),g=a.fnRecordsDisplay(),j=g?c.sInfo:c.sInfoEmpty;g!==f&&
|
47 |
+
(j+=" "+c.sInfoFiltered);j+=c.sInfoPostFix;j=Db(a,j);c=c.fnInfoCallback;null!==c&&(j=c.call(a.oInstance,a,d,e,f,g,j));h(b).html(j)}}function Db(a,b){var c=a.fnFormatNumber,d=a._iDisplayStart+1,e=a._iDisplayLength,f=a.fnRecordsDisplay(),g=-1===e;return b.replace(/_START_/g,c.call(a,d)).replace(/_END_/g,c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,c.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g,c.call(a,f)).replace(/_PAGE_/g,c.call(a,g?1:Math.ceil(d/e))).replace(/_PAGES_/g,c.call(a,g?1:Math.ceil(f/
|
48 |
+
e)))}function ia(a){var b,c,d=a.iInitDisplayStart,e=a.aoColumns,f;c=a.oFeatures;var g=a.bDeferLoading;if(a.bInitialised){nb(a);kb(a);ga(a,a.aoHeader);ga(a,a.aoFooter);C(a,!0);c.bAutoWidth&&Ha(a);b=0;for(c=e.length;b<c;b++)f=e[b],f.sWidth&&(f.nTh.style.width=w(f.sWidth));v(a,null,"preInit",[a]);T(a);e=y(a);if("ssp"!=e||g)"ajax"==e?ra(a,[],function(c){var f=sa(a,c);for(b=0;b<f.length;b++)N(a,f[b]);a.iInitDisplayStart=d;T(a);C(a,!1);ta(a,c)},a):(C(a,!1),ta(a))}else setTimeout(function(){ia(a)},200)}
|
49 |
+
function ta(a,b){a._bInitComplete=!0;(b||a.oInit.aaData)&&U(a);v(a,null,"plugin-init",[a,b]);v(a,"aoInitComplete","init",[a,b])}function Ra(a,b){var c=parseInt(b,10);a._iDisplayLength=c;Sa(a);v(a,null,"length",[a,c])}function ob(a){for(var b=a.oClasses,c=a.sTableId,d=a.aLengthMenu,e=h.isArray(d[0]),f=e?d[0]:d,d=e?d[1]:d,e=h("<select/>",{name:c+"_length","aria-controls":c,"class":b.sLengthSelect}),g=0,j=f.length;g<j;g++)e[0][g]=new Option(d[g],f[g]);var i=h("<div><label/></div>").addClass(b.sLength);
|
50 |
+
a.aanFeatures.l||(i[0].id=c+"_length");i.children().append(a.oLanguage.sLengthMenu.replace("_MENU_",e[0].outerHTML));h("select",i).val(a._iDisplayLength).bind("change.DT",function(){Ra(a,h(this).val());O(a)});h(a.nTable).bind("length.dt.DT",function(b,c,d){a===c&&h("select",i).val(d)});return i[0]}function tb(a){var b=a.sPaginationType,c=m.ext.pager[b],d="function"===typeof c,e=function(a){O(a)},b=h("<div/>").addClass(a.oClasses.sPaging+b)[0],f=a.aanFeatures;d||c.fnInit(a,b,e);f.p||(b.id=a.sTableId+
|
51 |
+
"_paginate",a.aoDrawCallback.push({fn:function(a){if(d){var b=a._iDisplayStart,i=a._iDisplayLength,h=a.fnRecordsDisplay(),l=-1===i,b=l?0:Math.ceil(b/i),i=l?1:Math.ceil(h/i),h=c(b,i),k,l=0;for(k=f.p.length;l<k;l++)Pa(a,"pageButton")(a,f.p[l],l,h,b,i)}else c.fnUpdate(a,e)},sName:"pagination"}));return b}function Ta(a,b,c){var d=a._iDisplayStart,e=a._iDisplayLength,f=a.fnRecordsDisplay();0===f||-1===e?d=0:"number"===typeof b?(d=b*e,d>f&&(d=0)):"first"==b?d=0:"previous"==b?(d=0<=e?d-e:0,0>d&&(d=0)):"next"==
|
52 |
+
b?d+e<f&&(d+=e):"last"==b?d=Math.floor((f-1)/e)*e:K(a,0,"Unknown paging action: "+b,5);b=a._iDisplayStart!==d;a._iDisplayStart=d;b&&(v(a,null,"page",[a]),c&&O(a));return b}function qb(a){return h("<div/>",{id:!a.aanFeatures.r?a.sTableId+"_processing":null,"class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}function C(a,b){a.oFeatures.bProcessing&&h(a.aanFeatures.r).css("display",b?"block":"none");v(a,null,"processing",[a,b])}function rb(a){var b=h(a.nTable);b.attr("role",
|
53 |
+
"grid");var c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var d=c.sX,e=c.sY,f=a.oClasses,g=b.children("caption"),j=g.length?g[0]._captionSide:null,i=h(b[0].cloneNode(!1)),o=h(b[0].cloneNode(!1)),l=b.children("tfoot");l.length||(l=null);i=h("<div/>",{"class":f.sScrollWrapper}).append(h("<div/>",{"class":f.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:d?!d?null:w(d):"100%"}).append(h("<div/>",{"class":f.sScrollHeadInner}).css({"box-sizing":"content-box",width:c.sXInner||
|
54 |
+
"100%"}).append(i.removeAttr("id").css("margin-left",0).append("top"===j?g:null).append(b.children("thead"))))).append(h("<div/>",{"class":f.sScrollBody}).css({position:"relative",overflow:"auto",width:!d?null:w(d)}).append(b));l&&i.append(h("<div/>",{"class":f.sScrollFoot}).css({overflow:"hidden",border:0,width:d?!d?null:w(d):"100%"}).append(h("<div/>",{"class":f.sScrollFootInner}).append(o.removeAttr("id").css("margin-left",0).append("bottom"===j?g:null).append(b.children("tfoot")))));var b=i.children(),
|
55 |
+
k=b[0],f=b[1],u=l?b[2]:null;if(d)h(f).on("scroll.DT",function(){var a=this.scrollLeft;k.scrollLeft=a;l&&(u.scrollLeft=a)});h(f).css(e&&c.bCollapse?"max-height":"height",e);a.nScrollHead=k;a.nScrollBody=f;a.nScrollFoot=u;a.aoDrawCallback.push({fn:Z,sName:"scrolling"});return i[0]}function Z(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY,b=b.iBarWidth,f=h(a.nScrollHead),g=f[0].style,j=f.children("div"),i=j[0].style,o=j.children("table"),j=a.nScrollBody,l=h(j),q=j.style,u=h(a.nScrollFoot).children("div"),
|
56 |
+
m=u.children("table"),n=h(a.nTHead),p=h(a.nTable),t=p[0],v=t.style,r=a.nTFoot?h(a.nTFoot):null,Eb=a.oBrowser,Ua=Eb.bScrollOversize,s,L,P,x,y=[],z=[],A=[],B,C=function(a){a=a.style;a.paddingTop="0";a.paddingBottom="0";a.borderTopWidth="0";a.borderBottomWidth="0";a.height=0};L=j.scrollHeight>j.clientHeight;if(a.scrollBarVis!==L&&a.scrollBarVis!==k)a.scrollBarVis=L,U(a);else{a.scrollBarVis=L;p.children("thead, tfoot").remove();x=n.clone().prependTo(p);n=n.find("tr");L=x.find("tr");x.find("th, td").removeAttr("tabindex");
|
57 |
+
r&&(P=r.clone().prependTo(p),s=r.find("tr"),P=P.find("tr"));c||(q.width="100%",f[0].style.width="100%");h.each(qa(a,x),function(b,c){B=$(a,b);c.style.width=a.aoColumns[B].sWidth});r&&I(function(a){a.style.width=""},P);f=p.outerWidth();if(""===c){v.width="100%";if(Ua&&(p.find("tbody").height()>j.offsetHeight||"scroll"==l.css("overflow-y")))v.width=w(p.outerWidth()-b);f=p.outerWidth()}else""!==d&&(v.width=w(d),f=p.outerWidth());I(C,L);I(function(a){A.push(a.innerHTML);y.push(w(h(a).css("width")))},
|
58 |
+
L);I(function(a,b){a.style.width=y[b]},n);h(L).height(0);r&&(I(C,P),I(function(a){z.push(w(h(a).css("width")))},P),I(function(a,b){a.style.width=z[b]},s),h(P).height(0));I(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+A[b]+"</div>";a.style.width=y[b]},L);r&&I(function(a,b){a.innerHTML="";a.style.width=z[b]},P);if(p.outerWidth()<f){s=j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")?f+b:f;if(Ua&&(j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")))v.width=
|
59 |
+
w(s-b);(""===c||""!==d)&&K(a,1,"Possible column misalignment",6)}else s="100%";q.width=w(s);g.width=w(s);r&&(a.nScrollFoot.style.width=w(s));!e&&Ua&&(q.height=w(t.offsetHeight+b));c=p.outerWidth();o[0].style.width=w(c);i.width=w(c);d=p.height()>j.clientHeight||"scroll"==l.css("overflow-y");e="padding"+(Eb.bScrollbarLeft?"Left":"Right");i[e]=d?b+"px":"0px";r&&(m[0].style.width=w(c),u[0].style.width=w(c),u[0].style[e]=d?b+"px":"0px");l.scroll();if((a.bSorted||a.bFiltered)&&!a._drawHold)j.scrollTop=
|
60 |
+
0}}function I(a,b,c){for(var d=0,e=0,f=b.length,g,j;e<f;){g=b[e].firstChild;for(j=c?c[e].firstChild:null;g;)1===g.nodeType&&(c?a(g,j,d):a(g,d),d++),g=g.nextSibling,j=c?j.nextSibling:null;e++}}function Ha(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll,e=d.sY,f=d.sX,g=d.sXInner,j=c.length,i=aa(a,"bVisible"),o=h("th",a.nTHead),l=b.getAttribute("width"),k=b.parentNode,u=!1,m,n,p=a.oBrowser,d=p.bScrollOversize;(m=b.style.width)&&-1!==m.indexOf("%")&&(l=m);for(m=0;m<i.length;m++)n=c[i[m]],null!==n.sWidth&&
|
61 |
+
(n.sWidth=Fb(n.sWidthOrig,k),u=!0);if(d||!u&&!f&&!e&&j==ca(a)&&j==o.length)for(m=0;m<j;m++)i=$(a,m),null!==i&&(c[i].sWidth=w(o.eq(m).width()));else{j=h(b).clone().css("visibility","hidden").removeAttr("id");j.find("tbody tr").remove();var t=h("<tr/>").appendTo(j.find("tbody"));j.find("thead, tfoot").remove();j.append(h(a.nTHead).clone()).append(h(a.nTFoot).clone());j.find("tfoot th, tfoot td").css("width","");o=qa(a,j.find("thead")[0]);for(m=0;m<i.length;m++)n=c[i[m]],o[m].style.width=null!==n.sWidthOrig&&
|
62 |
+
""!==n.sWidthOrig?w(n.sWidthOrig):"",n.sWidthOrig&&f&&h(o[m]).append(h("<div/>").css({width:n.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(a.aoData.length)for(m=0;m<i.length;m++)u=i[m],n=c[u],h(Gb(a,u)).clone(!1).append(n.sContentPadding).appendTo(t);n=h("<div/>").css(f||e?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(j).appendTo(k);f&&g?j.width(g):f?(j.css("width","auto"),j.removeAttr("width"),j.width()<k.clientWidth&&l&&j.width(k.clientWidth)):e?j.width(k.clientWidth):
|
63 |
+
l&&j.width(l);for(m=e=0;m<i.length;m++)k=h(o[m]),g=k.outerWidth()-k.width(),k=p.bBounding?Math.ceil(o[m].getBoundingClientRect().width):k.outerWidth(),e+=k,c[i[m]].sWidth=w(k-g);b.style.width=w(e);n.remove()}l&&(b.style.width=w(l));if((l||f)&&!a._reszEvt)b=function(){h(E).bind("resize.DT-"+a.sInstance,ua(function(){U(a)}))},d?setTimeout(b,1E3):b(),a._reszEvt=!0}function ua(a,b){var c=b!==k?b:200,d,e;return function(){var b=this,g=+new Date,j=arguments;d&&g<d+c?(clearTimeout(e),e=setTimeout(function(){d=
|
64 |
+
k;a.apply(b,j)},c)):(d=g,a.apply(b,j))}}function Fb(a,b){if(!a)return 0;var c=h("<div/>").css("width",w(a)).appendTo(b||H.body),d=c[0].offsetWidth;c.remove();return d}function Gb(a,b){var c=Hb(a,b);if(0>c)return null;var d=a.aoData[c];return!d.nTr?h("<td/>").html(B(a,c,b,"display"))[0]:d.anCells[b]}function Hb(a,b){for(var c,d=-1,e=-1,f=0,g=a.aoData.length;f<g;f++)c=B(a,f,b,"display")+"",c=c.replace($b,""),c=c.replace(/ /g," "),c.length>d&&(d=c.length,e=f);return e}function w(a){return null===
|
65 |
+
a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function W(a){var b,c,d=[],e=a.aoColumns,f,g,j,i;b=a.aaSortingFixed;c=h.isPlainObject(b);var o=[];f=function(a){a.length&&!h.isArray(a[0])?o.push(a):h.merge(o,a)};h.isArray(b)&&f(b);c&&b.pre&&f(b.pre);f(a.aaSorting);c&&b.post&&f(b.post);for(a=0;a<o.length;a++){i=o[a][0];f=e[i].aDataSort;b=0;for(c=f.length;b<c;b++)g=f[b],j=e[g].sType||"string",o[a]._idx===k&&(o[a]._idx=h.inArray(o[a][1],e[g].asSorting)),d.push({src:i,col:g,dir:o[a][1],
|
66 |
+
index:o[a]._idx,type:j,formatter:m.ext.type.order[j+"-pre"]})}return d}function mb(a){var b,c,d=[],e=m.ext.type.order,f=a.aoData,g=0,j,i=a.aiDisplayMaster,h;Ia(a);h=W(a);b=0;for(c=h.length;b<c;b++)j=h[b],j.formatter&&g++,Ib(a,j.col);if("ssp"!=y(a)&&0!==h.length){b=0;for(c=i.length;b<c;b++)d[i[b]]=b;g===h.length?i.sort(function(a,b){var c,e,g,j,i=h.length,k=f[a]._aSortData,m=f[b]._aSortData;for(g=0;g<i;g++)if(j=h[g],c=k[j.col],e=m[j.col],c=c<e?-1:c>e?1:0,0!==c)return"asc"===j.dir?c:-c;c=d[a];e=d[b];
|
67 |
+
return c<e?-1:c>e?1:0}):i.sort(function(a,b){var c,g,j,i,k=h.length,m=f[a]._aSortData,p=f[b]._aSortData;for(j=0;j<k;j++)if(i=h[j],c=m[i.col],g=p[i.col],i=e[i.type+"-"+i.dir]||e["string-"+i.dir],c=i(c,g),0!==c)return c;c=d[a];g=d[b];return c<g?-1:c>g?1:0})}a.bSorted=!0}function Jb(a){for(var b,c,d=a.aoColumns,e=W(a),a=a.oLanguage.oAria,f=0,g=d.length;f<g;f++){c=d[f];var j=c.asSorting;b=c.sTitle.replace(/<.*?>/g,"");var i=c.nTh;i.removeAttribute("aria-sort");c.bSortable&&(0<e.length&&e[0].col==f?(i.setAttribute("aria-sort",
|
68 |
+
"asc"==e[0].dir?"ascending":"descending"),c=j[e[0].index+1]||j[0]):c=j[0],b+="asc"===c?a.sSortAscending:a.sSortDescending);i.setAttribute("aria-label",b)}}function Va(a,b,c,d){var e=a.aaSorting,f=a.aoColumns[b].asSorting,g=function(a,b){var c=a._idx;c===k&&(c=h.inArray(a[1],f));return c+1<f.length?c+1:b?null:0};"number"===typeof e[0]&&(e=a.aaSorting=[e]);c&&a.oFeatures.bSortMulti?(c=h.inArray(b,D(e,"0")),-1!==c?(b=g(e[c],!0),null===b&&1===e.length&&(b=0),null===b?e.splice(c,1):(e[c][1]=f[b],e[c]._idx=
|
69 |
+
b)):(e.push([b,f[0],0]),e[e.length-1]._idx=0)):e.length&&e[0][0]==b?(b=g(e[0]),e.length=1,e[0][1]=f[b],e[0]._idx=b):(e.length=0,e.push([b,f[0]]),e[0]._idx=0);T(a);"function"==typeof d&&d(a)}function Oa(a,b,c,d){var e=a.aoColumns[c];Wa(b,{},function(b){!1!==e.bSortable&&(a.oFeatures.bProcessing?(C(a,!0),setTimeout(function(){Va(a,c,b.shiftKey,d);"ssp"!==y(a)&&C(a,!1)},0)):Va(a,c,b.shiftKey,d))})}function xa(a){var b=a.aLastSort,c=a.oClasses.sSortColumn,d=W(a),e=a.oFeatures,f,g;if(e.bSort&&e.bSortClasses){e=
|
70 |
+
0;for(f=b.length;e<f;e++)g=b[e].src,h(D(a.aoData,"anCells",g)).removeClass(c+(2>e?e+1:3));e=0;for(f=d.length;e<f;e++)g=d[e].src,h(D(a.aoData,"anCells",g)).addClass(c+(2>e?e+1:3))}a.aLastSort=d}function Ib(a,b){var c=a.aoColumns[b],d=m.ext.order[c.sSortDataType],e;d&&(e=d.call(a.oInstance,a,b,ba(a,b)));for(var f,g=m.ext.type.order[c.sType+"-pre"],j=0,i=a.aoData.length;j<i;j++)if(c=a.aoData[j],c._aSortData||(c._aSortData=[]),!c._aSortData[b]||d)f=d?e[j]:B(a,j,b,"sort"),c._aSortData[b]=g?g(f):f}function ya(a){if(a.oFeatures.bStateSave&&
|
71 |
+
!a.bDestroying){var b={time:+new Date,start:a._iDisplayStart,length:a._iDisplayLength,order:h.extend(!0,[],a.aaSorting),search:Ab(a.oPreviousSearch),columns:h.map(a.aoColumns,function(b,d){return{visible:b.bVisible,search:Ab(a.aoPreSearchCols[d])}})};v(a,"aoStateSaveParams","stateSaveParams",[a,b]);a.oSavedState=b;a.fnStateSaveCallback.call(a.oInstance,a,b)}}function Kb(a){var b,c,d=a.aoColumns;if(a.oFeatures.bStateSave){var e=a.fnStateLoadCallback.call(a.oInstance,a);if(e&&e.time&&(b=v(a,"aoStateLoadParams",
|
72 |
+
"stateLoadParams",[a,e]),-1===h.inArray(!1,b)&&(b=a.iStateDuration,!(0<b&&e.time<+new Date-1E3*b)&&d.length===e.columns.length))){a.oLoadedState=h.extend(!0,{},e);e.start!==k&&(a._iDisplayStart=e.start,a.iInitDisplayStart=e.start);e.length!==k&&(a._iDisplayLength=e.length);e.order!==k&&(a.aaSorting=[],h.each(e.order,function(b,c){a.aaSorting.push(c[0]>=d.length?[0,c[1]]:c)}));e.search!==k&&h.extend(a.oPreviousSearch,Bb(e.search));b=0;for(c=e.columns.length;b<c;b++){var f=e.columns[b];f.visible!==
|
73 |
+
k&&(d[b].bVisible=f.visible);f.search!==k&&h.extend(a.aoPreSearchCols[b],Bb(f.search))}v(a,"aoStateLoaded","stateLoaded",[a,e])}}}function za(a){var b=m.settings,a=h.inArray(a,D(b,"nTable"));return-1!==a?b[a]:null}function K(a,b,c,d){c="DataTables warning: "+(a?"table id="+a.sTableId+" - ":"")+c;d&&(c+=". For more information about this error, please see http://datatables.net/tn/"+d);if(b)E.console&&console.log&&console.log(c);else if(b=m.ext,b=b.sErrMode||b.errMode,a&&v(a,null,"error",[a,d,c]),"alert"==
|
74 |
+
b)alert(c);else{if("throw"==b)throw Error(c);"function"==typeof b&&b(a,d,c)}}function F(a,b,c,d){h.isArray(c)?h.each(c,function(c,d){h.isArray(d)?F(a,b,d[0],d[1]):F(a,b,d)}):(d===k&&(d=c),b[c]!==k&&(a[d]=b[c]))}function Lb(a,b,c){var d,e;for(e in b)b.hasOwnProperty(e)&&(d=b[e],h.isPlainObject(d)?(h.isPlainObject(a[e])||(a[e]={}),h.extend(!0,a[e],d)):a[e]=c&&"data"!==e&&"aaData"!==e&&h.isArray(d)?d.slice():d);return a}function Wa(a,b,c){h(a).bind("click.DT",b,function(b){a.blur();c(b)}).bind("keypress.DT",
|
75 |
+
b,function(a){13===a.which&&(a.preventDefault(),c(a))}).bind("selectstart.DT",function(){return!1})}function z(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function v(a,b,c,d){var e=[];b&&(e=h.map(a[b].slice().reverse(),function(b){return b.fn.apply(a.oInstance,d)}));null!==c&&(b=h.Event(c+".dt"),h(a.nTable).trigger(b,d),e.push(b.result));return e}function Sa(a){var b=a._iDisplayStart,c=a.fnDisplayEnd(),d=a._iDisplayLength;b>=c&&(b=c-d);b-=b%d;if(-1===d||0>b)b=0;a._iDisplayStart=b}function Pa(a,b){var c=
|
76 |
+
a.renderer,d=m.ext.renderer[b];return h.isPlainObject(c)&&c[b]?d[c[b]]||d._:"string"===typeof c?d[c]||d._:d._}function y(a){return a.oFeatures.bServerSide?"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function Aa(a,b){var c=[],c=Mb.numbers_length,d=Math.floor(c/2);b<=c?c=X(0,b):a<=d?(c=X(0,c-2),c.push("ellipsis"),c.push(b-1)):(a>=b-1-d?c=X(b-(c-2),b):(c=X(a-d+2,a+d-1),c.push("ellipsis"),c.push(b-1)),c.splice(0,0,"ellipsis"),c.splice(0,0,0));c.DT_el="span";return c}function db(a){h.each({num:function(b){return Ba(b,
|
77 |
+
a)},"num-fmt":function(b){return Ba(b,a,Xa)},"html-num":function(b){return Ba(b,a,Ca)},"html-num-fmt":function(b){return Ba(b,a,Ca,Xa)}},function(b,c){s.type.order[b+a+"-pre"]=c;b.match(/^html\-/)&&(s.type.search[b+a]=s.type.search.html)})}function Nb(a){return function(){var b=[za(this[m.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return m.ext.internal[a].apply(this,b)}}var m,s,t,p,r,Ya={},Ob=/[\r\n]/g,Ca=/<.*?>/g,ac=/^[\w\+\-]/,bc=/[\w\+\-]$/,Yb=RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)",
|
78 |
+
"g"),Xa=/[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi,M=function(a){return!a||!0===a||"-"===a?!0:!1},Pb=function(a){var b=parseInt(a,10);return!isNaN(b)&&isFinite(a)?b:null},Qb=function(a,b){Ya[b]||(Ya[b]=RegExp(va(b),"g"));return"string"===typeof a&&"."!==b?a.replace(/\./g,"").replace(Ya[b],"."):a},Za=function(a,b,c){var d="string"===typeof a;if(M(a))return!0;b&&d&&(a=Qb(a,b));c&&d&&(a=a.replace(Xa,""));return!isNaN(parseFloat(a))&&isFinite(a)},Rb=function(a,b,c){return M(a)?!0:!(M(a)||"string"===
|
79 |
+
typeof a)?null:Za(a.replace(Ca,""),b,c)?!0:null},D=function(a,b,c){var d=[],e=0,f=a.length;if(c!==k)for(;e<f;e++)a[e]&&a[e][b]&&d.push(a[e][b][c]);else for(;e<f;e++)a[e]&&d.push(a[e][b]);return d},ja=function(a,b,c,d){var e=[],f=0,g=b.length;if(d!==k)for(;f<g;f++)a[b[f]][c]&&e.push(a[b[f]][c][d]);else for(;f<g;f++)e.push(a[b[f]][c]);return e},X=function(a,b){var c=[],d;b===k?(b=0,d=a):(d=b,b=a);for(var e=b;e<d;e++)c.push(e);return c},Sb=function(a){for(var b=[],c=0,d=a.length;c<d;c++)a[c]&&b.push(a[c]);
|
80 |
+
return b},pa=function(a){var b=[],c,d,e=a.length,f,g=0;d=0;a:for(;d<e;d++){c=a[d];for(f=0;f<g;f++)if(b[f]===c)continue a;b.push(c);g++}return b},A=function(a,b,c){a[b]!==k&&(a[c]=a[b])},da=/\[.*?\]$/,V=/\(\)$/,wa=h("<div>")[0],Zb=wa.textContent!==k,$b=/<.*?>/g;m=function(a){this.$=function(a,b){return this.api(!0).$(a,b)};this._=function(a,b){return this.api(!0).rows(a,b).data()};this.api=function(a){return a?new t(za(this[s.iApiIndex])):new t(this)};this.fnAddData=function(a,b){var c=this.api(!0),
|
81 |
+
d=h.isArray(a)&&(h.isArray(a[0])||h.isPlainObject(a[0]))?c.rows.add(a):c.row.add(a);(b===k||b)&&c.draw();return d.flatten().toArray()};this.fnAdjustColumnSizing=function(a){var b=this.api(!0).columns.adjust(),c=b.settings()[0],d=c.oScroll;a===k||a?b.draw(!1):(""!==d.sX||""!==d.sY)&&Z(c)};this.fnClearTable=function(a){var b=this.api(!0).clear();(a===k||a)&&b.draw()};this.fnClose=function(a){this.api(!0).row(a).child.hide()};this.fnDeleteRow=function(a,b,c){var d=this.api(!0),a=d.rows(a),e=a.settings()[0],
|
82 |
+
h=e.aoData[a[0][0]];a.remove();b&&b.call(this,e,h);(c===k||c)&&d.draw();return h};this.fnDestroy=function(a){this.api(!0).destroy(a)};this.fnDraw=function(a){this.api(!0).draw(a)};this.fnFilter=function(a,b,c,d,e,h){e=this.api(!0);null===b||b===k?e.search(a,c,d,h):e.column(b).search(a,c,d,h);e.draw()};this.fnGetData=function(a,b){var c=this.api(!0);if(a!==k){var d=a.nodeName?a.nodeName.toLowerCase():"";return b!==k||"td"==d||"th"==d?c.cell(a,b).data():c.row(a).data()||null}return c.data().toArray()};
|
83 |
+
this.fnGetNodes=function(a){var b=this.api(!0);return a!==k?b.row(a).node():b.rows().nodes().flatten().toArray()};this.fnGetPosition=function(a){var b=this.api(!0),c=a.nodeName.toUpperCase();return"TR"==c?b.row(a).index():"TD"==c||"TH"==c?(a=b.cell(a).index(),[a.row,a.columnVisible,a.column]):null};this.fnIsOpen=function(a){return this.api(!0).row(a).child.isShown()};this.fnOpen=function(a,b,c){return this.api(!0).row(a).child(b,c).show().child()[0]};this.fnPageChange=function(a,b){var c=this.api(!0).page(a);
|
84 |
+
(b===k||b)&&c.draw(!1)};this.fnSetColumnVis=function(a,b,c){a=this.api(!0).column(a).visible(b);(c===k||c)&&a.columns.adjust().draw()};this.fnSettings=function(){return za(this[s.iApiIndex])};this.fnSort=function(a){this.api(!0).order(a).draw()};this.fnSortListener=function(a,b,c){this.api(!0).order.listener(a,b,c)};this.fnUpdate=function(a,b,c,d,e){var h=this.api(!0);c===k||null===c?h.row(b).data(a):h.cell(b,c).data(a);(e===k||e)&&h.columns.adjust();(d===k||d)&&h.draw();return 0};this.fnVersionCheck=
|
85 |
+
s.fnVersionCheck;var b=this,c=a===k,d=this.length;c&&(a={});this.oApi=this.internal=s.internal;for(var e in m.ext.internal)e&&(this[e]=Nb(e));this.each(function(){var e={},e=1<d?Lb(e,a,!0):a,g=0,j,i=this.getAttribute("id"),o=!1,l=m.defaults,q=h(this);if("table"!=this.nodeName.toLowerCase())K(null,0,"Non-table node initialisation ("+this.nodeName+")",2);else{eb(l);fb(l.column);J(l,l,!0);J(l.column,l.column,!0);J(l,h.extend(e,q.data()));var u=m.settings,g=0;for(j=u.length;g<j;g++){var p=u[g];if(p.nTable==
|
86 |
+
this||p.nTHead.parentNode==this||p.nTFoot&&p.nTFoot.parentNode==this){g=e.bRetrieve!==k?e.bRetrieve:l.bRetrieve;if(c||g)return p.oInstance;if(e.bDestroy!==k?e.bDestroy:l.bDestroy){p.oInstance.fnDestroy();break}else{K(p,0,"Cannot reinitialise DataTable",3);return}}if(p.sTableId==this.id){u.splice(g,1);break}}if(null===i||""===i)this.id=i="DataTables_Table_"+m.ext._unique++;var n=h.extend(!0,{},m.models.oSettings,{sDestroyWidth:q[0].style.width,sInstance:i,sTableId:i});n.nTable=this;n.oApi=b.internal;
|
87 |
+
n.oInit=e;u.push(n);n.oInstance=1===b.length?b:q.dataTable();eb(e);e.oLanguage&&Fa(e.oLanguage);e.aLengthMenu&&!e.iDisplayLength&&(e.iDisplayLength=h.isArray(e.aLengthMenu[0])?e.aLengthMenu[0][0]:e.aLengthMenu[0]);e=Lb(h.extend(!0,{},l),e);F(n.oFeatures,e,"bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender".split(" "));F(n,e,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu",
|
88 |
+
"sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"],["bJQueryUI","bJUI"]]);F(n.oScroll,e,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);F(n.oLanguage,e,"fnInfoCallback");z(n,"aoDrawCallback",
|
89 |
+
e.fnDrawCallback,"user");z(n,"aoServerParams",e.fnServerParams,"user");z(n,"aoStateSaveParams",e.fnStateSaveParams,"user");z(n,"aoStateLoadParams",e.fnStateLoadParams,"user");z(n,"aoStateLoaded",e.fnStateLoaded,"user");z(n,"aoRowCallback",e.fnRowCallback,"user");z(n,"aoRowCreatedCallback",e.fnCreatedRow,"user");z(n,"aoHeaderCallback",e.fnHeaderCallback,"user");z(n,"aoFooterCallback",e.fnFooterCallback,"user");z(n,"aoInitComplete",e.fnInitComplete,"user");z(n,"aoPreDrawCallback",e.fnPreDrawCallback,
|
90 |
+
"user");n.rowIdFn=Q(e.rowId);gb(n);i=n.oClasses;e.bJQueryUI?(h.extend(i,m.ext.oJUIClasses,e.oClasses),e.sDom===l.sDom&&"lfrtip"===l.sDom&&(n.sDom='<"H"lfr>t<"F"ip>'),n.renderer)?h.isPlainObject(n.renderer)&&!n.renderer.header&&(n.renderer.header="jqueryui"):n.renderer="jqueryui":h.extend(i,m.ext.classes,e.oClasses);q.addClass(i.sTable);n.iInitDisplayStart===k&&(n.iInitDisplayStart=e.iDisplayStart,n._iDisplayStart=e.iDisplayStart);null!==e.iDeferLoading&&(n.bDeferLoading=!0,g=h.isArray(e.iDeferLoading),
|
91 |
+
n._iRecordsDisplay=g?e.iDeferLoading[0]:e.iDeferLoading,n._iRecordsTotal=g?e.iDeferLoading[1]:e.iDeferLoading);var t=n.oLanguage;h.extend(!0,t,e.oLanguage);""!==t.sUrl&&(h.ajax({dataType:"json",url:t.sUrl,success:function(a){Fa(a);J(l.oLanguage,a);h.extend(true,t,a);ia(n)},error:function(){ia(n)}}),o=!0);null===e.asStripeClasses&&(n.asStripeClasses=[i.sStripeOdd,i.sStripeEven]);var g=n.asStripeClasses,r=q.children("tbody").find("tr").eq(0);-1!==h.inArray(!0,h.map(g,function(a){return r.hasClass(a)}))&&
|
92 |
+
(h("tbody tr",this).removeClass(g.join(" ")),n.asDestroyStripes=g.slice());u=[];g=this.getElementsByTagName("thead");0!==g.length&&(fa(n.aoHeader,g[0]),u=qa(n));if(null===e.aoColumns){p=[];g=0;for(j=u.length;g<j;g++)p.push(null)}else p=e.aoColumns;g=0;for(j=p.length;g<j;g++)Ga(n,u?u[g]:null);ib(n,e.aoColumnDefs,p,function(a,b){la(n,a,b)});if(r.length){var s=function(a,b){return a.getAttribute("data-"+b)!==null?b:null};h(r[0]).children("th, td").each(function(a,b){var c=n.aoColumns[a];if(c.mData===
|
93 |
+
a){var d=s(b,"sort")||s(b,"order"),e=s(b,"filter")||s(b,"search");if(d!==null||e!==null){c.mData={_:a+".display",sort:d!==null?a+".@data-"+d:k,type:d!==null?a+".@data-"+d:k,filter:e!==null?a+".@data-"+e:k};la(n,a)}}})}var w=n.oFeatures;e.bStateSave&&(w.bStateSave=!0,Kb(n,e),z(n,"aoDrawCallback",ya,"state_save"));if(e.aaSorting===k){u=n.aaSorting;g=0;for(j=u.length;g<j;g++)u[g][1]=n.aoColumns[g].asSorting[0]}xa(n);w.bSort&&z(n,"aoDrawCallback",function(){if(n.bSorted){var a=W(n),b={};h.each(a,function(a,
|
94 |
+
c){b[c.src]=c.dir});v(n,null,"order",[n,a,b]);Jb(n)}});z(n,"aoDrawCallback",function(){(n.bSorted||y(n)==="ssp"||w.bDeferRender)&&xa(n)},"sc");g=q.children("caption").each(function(){this._captionSide=q.css("caption-side")});j=q.children("thead");0===j.length&&(j=h("<thead/>").appendTo(this));n.nTHead=j[0];j=q.children("tbody");0===j.length&&(j=h("<tbody/>").appendTo(this));n.nTBody=j[0];j=q.children("tfoot");if(0===j.length&&0<g.length&&(""!==n.oScroll.sX||""!==n.oScroll.sY))j=h("<tfoot/>").appendTo(this);
|
95 |
+
0===j.length||0===j.children().length?q.addClass(i.sNoFooter):0<j.length&&(n.nTFoot=j[0],fa(n.aoFooter,n.nTFoot));if(e.aaData)for(g=0;g<e.aaData.length;g++)N(n,e.aaData[g]);else(n.bDeferLoading||"dom"==y(n))&&ma(n,h(n.nTBody).children("tr"));n.aiDisplay=n.aiDisplayMaster.slice();n.bInitialised=!0;!1===o&&ia(n)}});b=null;return this};var Tb=[],x=Array.prototype,cc=function(a){var b,c,d=m.settings,e=h.map(d,function(a){return a.nTable});if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&"table"===a.nodeName.toLowerCase())return b=
|
96 |
+
h.inArray(a,e),-1!==b?[d[b]]:null;if(a&&"function"===typeof a.settings)return a.settings().toArray();"string"===typeof a?c=h(a):a instanceof h&&(c=a)}else return[];if(c)return c.map(function(){b=h.inArray(this,e);return-1!==b?d[b]:null}).toArray()};t=function(a,b){if(!(this instanceof t))return new t(a,b);var c=[],d=function(a){(a=cc(a))&&(c=c.concat(a))};if(h.isArray(a))for(var e=0,f=a.length;e<f;e++)d(a[e]);else d(a);this.context=pa(c);b&&h.merge(this,b);this.selector={rows:null,cols:null,opts:null};
|
97 |
+
t.extend(this,this,Tb)};m.Api=t;h.extend(t.prototype,{any:function(){return 0!==this.count()},concat:x.concat,context:[],count:function(){return this.flatten().length},each:function(a){for(var b=0,c=this.length;b<c;b++)a.call(this,this[b],b,this);return this},eq:function(a){var b=this.context;return b.length>a?new t(b[a],this[a]):null},filter:function(a){var b=[];if(x.filter)b=x.filter.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)a.call(this,this[c],c,this)&&b.push(this[c]);return new t(this.context,
|
98 |
+
b)},flatten:function(){var a=[];return new t(this.context,a.concat.apply(a,this.toArray()))},join:x.join,indexOf:x.indexOf||function(a,b){for(var c=b||0,d=this.length;c<d;c++)if(this[c]===a)return c;return-1},iterator:function(a,b,c,d){var e=[],f,g,h,i,o,l=this.context,m,p,r=this.selector;"string"===typeof a&&(d=c,c=b,b=a,a=!1);g=0;for(h=l.length;g<h;g++){var n=new t(l[g]);if("table"===b)f=c.call(n,l[g],g),f!==k&&e.push(f);else if("columns"===b||"rows"===b)f=c.call(n,l[g],this[g],g),f!==k&&e.push(f);
|
99 |
+
else if("column"===b||"column-rows"===b||"row"===b||"cell"===b){p=this[g];"column-rows"===b&&(m=Da(l[g],r.opts));i=0;for(o=p.length;i<o;i++)f=p[i],f="cell"===b?c.call(n,l[g],f.row,f.column,g,i):c.call(n,l[g],f,g,i,m),f!==k&&e.push(f)}}return e.length||d?(a=new t(l,a?e.concat.apply([],e):e),b=a.selector,b.rows=r.rows,b.cols=r.cols,b.opts=r.opts,a):this},lastIndexOf:x.lastIndexOf||function(a,b){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(a){var b=[];if(x.map)b=
|
100 |
+
x.map.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)b.push(a.call(this,this[c],c));return new t(this.context,b)},pluck:function(a){return this.map(function(b){return b[a]})},pop:x.pop,push:x.push,reduce:x.reduce||function(a,b){return hb(this,a,b,0,this.length,1)},reduceRight:x.reduceRight||function(a,b){return hb(this,a,b,this.length-1,-1,-1)},reverse:x.reverse,selector:null,shift:x.shift,sort:x.sort,splice:x.splice,toArray:function(){return x.slice.call(this)},to$:function(){return h(this)},
|
101 |
+
toJQuery:function(){return h(this)},unique:function(){return new t(this.context,pa(this))},unshift:x.unshift});t.extend=function(a,b,c){if(c.length&&b&&(b instanceof t||b.__dt_wrapper)){var d,e,f,g=function(a,b,c){return function(){var d=b.apply(a,arguments);t.extend(d,d,c.methodExt);return d}};d=0;for(e=c.length;d<e;d++)f=c[d],b[f.name]="function"===typeof f.val?g(a,f.val,f):h.isPlainObject(f.val)?{}:f.val,b[f.name].__dt_wrapper=!0,t.extend(a,b[f.name],f.propExt)}};t.register=p=function(a,b){if(h.isArray(a))for(var c=
|
102 |
+
0,d=a.length;c<d;c++)t.register(a[c],b);else for(var e=a.split("."),f=Tb,g,j,c=0,d=e.length;c<d;c++){g=(j=-1!==e[c].indexOf("()"))?e[c].replace("()",""):e[c];var i;a:{i=0;for(var k=f.length;i<k;i++)if(f[i].name===g){i=f[i];break a}i=null}i||(i={name:g,val:{},methodExt:[],propExt:[]},f.push(i));c===d-1?i.val=b:f=j?i.methodExt:i.propExt}};t.registerPlural=r=function(a,b,c){t.register(a,c);t.register(b,function(){var a=c.apply(this,arguments);return a===this?this:a instanceof t?a.length?h.isArray(a[0])?
|
103 |
+
new t(a.context,a[0]):a[0]:k:a})};p("tables()",function(a){var b;if(a){b=t;var c=this.context;if("number"===typeof a)a=[c[a]];else var d=h.map(c,function(a){return a.nTable}),a=h(d).filter(a).map(function(){var a=h.inArray(this,d);return c[a]}).toArray();b=new b(a)}else b=this;return b});p("table()",function(a){var a=this.tables(a),b=a.context;return b.length?new t(b[0]):a});r("tables().nodes()","table().node()",function(){return this.iterator("table",function(a){return a.nTable},1)});r("tables().body()",
|
104 |
+
"table().body()",function(){return this.iterator("table",function(a){return a.nTBody},1)});r("tables().header()","table().header()",function(){return this.iterator("table",function(a){return a.nTHead},1)});r("tables().footer()","table().footer()",function(){return this.iterator("table",function(a){return a.nTFoot},1)});r("tables().containers()","table().container()",function(){return this.iterator("table",function(a){return a.nTableWrapper},1)});p("draw()",function(a){return this.iterator("table",
|
105 |
+
function(b){"page"===a?O(b):("string"===typeof a&&(a="full-hold"===a?!1:!0),T(b,!1===a))})});p("page()",function(a){return a===k?this.page.info().page:this.iterator("table",function(b){Ta(b,a)})});p("page.info()",function(){if(0===this.context.length)return k;var a=this.context[0],b=a._iDisplayStart,c=a.oFeatures.bPaginate?a._iDisplayLength:-1,d=a.fnRecordsDisplay(),e=-1===c;return{page:e?0:Math.floor(b/c),pages:e?1:Math.ceil(d/c),start:b,end:a.fnDisplayEnd(),length:c,recordsTotal:a.fnRecordsTotal(),
|
106 |
+
recordsDisplay:d,serverSide:"ssp"===y(a)}});p("page.len()",function(a){return a===k?0!==this.context.length?this.context[0]._iDisplayLength:k:this.iterator("table",function(b){Ra(b,a)})});var Ub=function(a,b,c){if(c){var d=new t(a);d.one("draw",function(){c(d.ajax.json())})}if("ssp"==y(a))T(a,b);else{C(a,!0);var e=a.jqXHR;e&&4!==e.readyState&&e.abort();ra(a,[],function(c){na(a);for(var c=sa(a,c),d=0,e=c.length;d<e;d++)N(a,c[d]);T(a,b);C(a,!1)})}};p("ajax.json()",function(){var a=this.context;if(0<
|
107 |
+
a.length)return a[0].json});p("ajax.params()",function(){var a=this.context;if(0<a.length)return a[0].oAjaxData});p("ajax.reload()",function(a,b){return this.iterator("table",function(c){Ub(c,!1===b,a)})});p("ajax.url()",function(a){var b=this.context;if(a===k){if(0===b.length)return k;b=b[0];return b.ajax?h.isPlainObject(b.ajax)?b.ajax.url:b.ajax:b.sAjaxSource}return this.iterator("table",function(b){h.isPlainObject(b.ajax)?b.ajax.url=a:b.ajax=a})});p("ajax.url().load()",function(a,b){return this.iterator("table",
|
108 |
+
function(c){Ub(c,!1===b,a)})});var $a=function(a,b,c,d,e){var f=[],g,j,i,o,l,m;i=typeof b;if(!b||"string"===i||"function"===i||b.length===k)b=[b];i=0;for(o=b.length;i<o;i++){j=b[i]&&b[i].split?b[i].split(","):[b[i]];l=0;for(m=j.length;l<m;l++)(g=c("string"===typeof j[l]?h.trim(j[l]):j[l]))&&g.length&&(f=f.concat(g))}a=s.selector[a];if(a.length){i=0;for(o=a.length;i<o;i++)f=a[i](d,e,f)}return pa(f)},ab=function(a){a||(a={});a.filter&&a.search===k&&(a.search=a.filter);return h.extend({search:"none",
|
109 |
+
order:"current",page:"all"},a)},bb=function(a){for(var b=0,c=a.length;b<c;b++)if(0<a[b].length)return a[0]=a[b],a[0].length=1,a.length=1,a.context=[a.context[b]],a;a.length=0;return a},Da=function(a,b){var c,d,e,f=[],g=a.aiDisplay;c=a.aiDisplayMaster;var j=b.search;d=b.order;e=b.page;if("ssp"==y(a))return"removed"===j?[]:X(0,c.length);if("current"==e){c=a._iDisplayStart;for(d=a.fnDisplayEnd();c<d;c++)f.push(g[c])}else if("current"==d||"applied"==d)f="none"==j?c.slice():"applied"==j?g.slice():h.map(c,
|
110 |
+
function(a){return-1===h.inArray(a,g)?a:null});else if("index"==d||"original"==d){c=0;for(d=a.aoData.length;c<d;c++)"none"==j?f.push(c):(e=h.inArray(c,g),(-1===e&&"removed"==j||0<=e&&"applied"==j)&&f.push(c))}return f};p("rows()",function(a,b){a===k?a="":h.isPlainObject(a)&&(b=a,a="");var b=ab(b),c=this.iterator("table",function(c){var e=b;return $a("row",a,function(a){var b=Pb(a);if(b!==null&&!e)return[b];var j=Da(c,e);if(b!==null&&h.inArray(b,j)!==-1)return[b];if(!a)return j;if(typeof a==="function")return h.map(j,
|
111 |
+
function(b){var e=c.aoData[b];return a(b,e._aData,e.nTr)?b:null});b=Sb(ja(c.aoData,j,"nTr"));if(a.nodeName&&h.inArray(a,b)!==-1)return[a._DT_RowIndex];if(typeof a==="string"&&a.charAt(0)==="#"){j=c.aIds[a.replace(/^#/,"")];if(j!==k)return[j.idx]}return h(b).filter(a).map(function(){return this._DT_RowIndex}).toArray()},c,e)},1);c.selector.rows=a;c.selector.opts=b;return c});p("rows().nodes()",function(){return this.iterator("row",function(a,b){return a.aoData[b].nTr||k},1)});p("rows().data()",function(){return this.iterator(!0,
|
112 |
+
"rows",function(a,b){return ja(a.aoData,b,"_aData")},1)});r("rows().cache()","row().cache()",function(a){return this.iterator("row",function(b,c){var d=b.aoData[c];return"search"===a?d._aFilterData:d._aSortData},1)});r("rows().invalidate()","row().invalidate()",function(a){return this.iterator("row",function(b,c){ea(b,c,a)})});r("rows().indexes()","row().index()",function(){return this.iterator("row",function(a,b){return b},1)});r("rows().ids()","row().id()",function(a){for(var b=[],c=this.context,
|
113 |
+
d=0,e=c.length;d<e;d++)for(var f=0,g=this[d].length;f<g;f++){var h=c[d].rowIdFn(c[d].aoData[this[d][f]]._aData);b.push((!0===a?"#":"")+h)}return new t(c,b)});r("rows().remove()","row().remove()",function(){var a=this;this.iterator("row",function(b,c,d){var e=b.aoData,f=e[c],g,h,i,o,l;e.splice(c,1);g=0;for(h=e.length;g<h;g++)if(i=e[g],l=i.anCells,null!==i.nTr&&(i.nTr._DT_RowIndex=g),null!==l){i=0;for(o=l.length;i<o;i++)l[i]._DT_CellIndex.row=g}oa(b.aiDisplayMaster,c);oa(b.aiDisplay,c);oa(a[d],c,!1);
|
114 |
+
Sa(b);c=b.rowIdFn(f._aData);c!==k&&delete b.aIds[c]});this.iterator("table",function(a){for(var c=0,d=a.aoData.length;c<d;c++)a.aoData[c].idx=c});return this});p("rows.add()",function(a){var b=this.iterator("table",function(b){var c,f,g,h=[];f=0;for(g=a.length;f<g;f++)c=a[f],c.nodeName&&"TR"===c.nodeName.toUpperCase()?h.push(ma(b,c)[0]):h.push(N(b,c));return h},1),c=this.rows(-1);c.pop();h.merge(c,b);return c});p("row()",function(a,b){return bb(this.rows(a,b))});p("row().data()",function(a){var b=
|
115 |
+
this.context;if(a===k)return b.length&&this.length?b[0].aoData[this[0]]._aData:k;b[0].aoData[this[0]]._aData=a;ea(b[0],this[0],"data");return this});p("row().node()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]].nTr||null:null});p("row.add()",function(a){a instanceof h&&a.length&&(a=a[0]);var b=this.iterator("table",function(b){return a.nodeName&&"TR"===a.nodeName.toUpperCase()?ma(b,a)[0]:N(b,a)});return this.row(b[0])});var cb=function(a,b){var c=a.context;if(c.length&&
|
116 |
+
(c=c[0].aoData[b!==k?b:a[0]])&&c._details)c._details.remove(),c._detailsShow=k,c._details=k},Vb=function(a,b){var c=a.context;if(c.length&&a.length){var d=c[0].aoData[a[0]];if(d._details){(d._detailsShow=b)?d._details.insertAfter(d.nTr):d._details.detach();var e=c[0],f=new t(e),g=e.aoData;f.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details");0<D(g,"_details").length&&(f.on("draw.dt.DT_details",function(a,b){e===b&&f.rows({page:"current"}).eq(0).each(function(a){a=g[a];
|
117 |
+
a._detailsShow&&a._details.insertAfter(a.nTr)})}),f.on("column-visibility.dt.DT_details",function(a,b){if(e===b)for(var c,d=ca(b),f=0,h=g.length;f<h;f++)c=g[f],c._details&&c._details.children("td[colspan]").attr("colspan",d)}),f.on("destroy.dt.DT_details",function(a,b){if(e===b)for(var c=0,d=g.length;c<d;c++)g[c]._details&&cb(f,c)}))}}};p("row().child()",function(a,b){var c=this.context;if(a===k)return c.length&&this.length?c[0].aoData[this[0]]._details:k;if(!0===a)this.child.show();else if(!1===
|
118 |
+
a)cb(this);else if(c.length&&this.length){var d=c[0],c=c[0].aoData[this[0]],e=[],f=function(a,b){if(h.isArray(a)||a instanceof h)for(var c=0,k=a.length;c<k;c++)f(a[c],b);else a.nodeName&&"tr"===a.nodeName.toLowerCase()?e.push(a):(c=h("<tr><td/></tr>").addClass(b),h("td",c).addClass(b).html(a)[0].colSpan=ca(d),e.push(c[0]))};f(a,b);c._details&&c._details.remove();c._details=h(e);c._detailsShow&&c._details.insertAfter(c.nTr)}return this});p(["row().child.show()","row().child().show()"],function(){Vb(this,
|
119 |
+
!0);return this});p(["row().child.hide()","row().child().hide()"],function(){Vb(this,!1);return this});p(["row().child.remove()","row().child().remove()"],function(){cb(this);return this});p("row().child.isShown()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var dc=/^(.+):(name|visIdx|visible)$/,Wb=function(a,b,c,d,e){for(var c=[],d=0,f=e.length;d<f;d++)c.push(B(a,e[d],b));return c};p("columns()",function(a,b){a===k?a="":h.isPlainObject(a)&&
|
120 |
+
(b=a,a="");var b=ab(b),c=this.iterator("table",function(c){var e=a,f=b,g=c.aoColumns,j=D(g,"sName"),i=D(g,"nTh");return $a("column",e,function(a){var b=Pb(a);if(a==="")return X(g.length);if(b!==null)return[b>=0?b:g.length+b];if(typeof a==="function"){var e=Da(c,f);return h.map(g,function(b,f){return a(f,Wb(c,f,0,0,e),i[f])?f:null})}var k=typeof a==="string"?a.match(dc):"";if(k)switch(k[2]){case "visIdx":case "visible":b=parseInt(k[1],10);if(b<0){var m=h.map(g,function(a,b){return a.bVisible?b:null});
|
121 |
+
return[m[m.length+b]]}return[$(c,b)];case "name":return h.map(j,function(a,b){return a===k[1]?b:null})}else return h(i).filter(a).map(function(){return h.inArray(this,i)}).toArray()},c,f)},1);c.selector.cols=a;c.selector.opts=b;return c});r("columns().header()","column().header()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTh},1)});r("columns().footer()","column().footer()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTf},1)});r("columns().data()",
|
122 |
+
"column().data()",function(){return this.iterator("column-rows",Wb,1)});r("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},1)});r("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(b,c,d,e,f){return ja(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)},1)});r("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return ja(a.aoData,
|
123 |
+
e,"anCells",b)},1)});r("columns().visible()","column().visible()",function(a,b){return this.iterator("column",function(c,d){if(a===k)return c.aoColumns[d].bVisible;var e=c.aoColumns,f=e[d],g=c.aoData,j,i,m;if(a!==k&&f.bVisible!==a){if(a){var l=h.inArray(!0,D(e,"bVisible"),d+1);j=0;for(i=g.length;j<i;j++)m=g[j].nTr,e=g[j].anCells,m&&m.insertBefore(e[d],e[l]||null)}else h(D(c.aoData,"anCells",d)).detach();f.bVisible=a;ga(c,c.aoHeader);ga(c,c.aoFooter);if(b===k||b)U(c),(c.oScroll.sX||c.oScroll.sY)&&
|
124 |
+
Z(c);v(c,null,"column-visibility",[c,d,a,b]);ya(c)}})});r("columns().indexes()","column().index()",function(a){return this.iterator("column",function(b,c){return"visible"===a?ba(b,c):c},1)});p("columns.adjust()",function(){return this.iterator("table",function(a){U(a)},1)});p("column.index()",function(a,b){if(0!==this.context.length){var c=this.context[0];if("fromVisible"===a||"toData"===a)return $(c,b);if("fromData"===a||"toVisible"===a)return ba(c,b)}});p("column()",function(a,b){return bb(this.columns(a,
|
125 |
+
b))});p("cells()",function(a,b,c){h.isPlainObject(a)&&(a.row===k?(c=a,a=null):(c=b,b=null));h.isPlainObject(b)&&(c=b,b=null);if(null===b||b===k)return this.iterator("table",function(b){var d=a,e=ab(c),f=b.aoData,g=Da(b,e),j=Sb(ja(f,g,"anCells")),i=h([].concat.apply([],j)),l,m=b.aoColumns.length,o,p,t,r,s,v;return $a("cell",d,function(a){var c=typeof a==="function";if(a===null||a===k||c){o=[];p=0;for(t=g.length;p<t;p++){l=g[p];for(r=0;r<m;r++){s={row:l,column:r};if(c){v=f[l];a(s,B(b,l,r),v.anCells?
|
126 |
+
v.anCells[r]:null)&&o.push(s)}else o.push(s)}}return o}return h.isPlainObject(a)?[a]:i.filter(a).map(function(a,b){return{row:b._DT_CellIndex.row,column:b._DT_CellIndex.column}}).toArray()},b,e)});var d=this.columns(b,c),e=this.rows(a,c),f,g,j,i,m,l=this.iterator("table",function(a,b){f=[];g=0;for(j=e[b].length;g<j;g++){i=0;for(m=d[b].length;i<m;i++)f.push({row:e[b][g],column:d[b][i]})}return f},1);h.extend(l.selector,{cols:b,rows:a,opts:c});return l});r("cells().nodes()","cell().node()",function(){return this.iterator("cell",
|
127 |
+
function(a,b,c){return(a=a.aoData[b].anCells)?a[c]:k},1)});p("cells().data()",function(){return this.iterator("cell",function(a,b,c){return B(a,b,c)},1)});r("cells().cache()","cell().cache()",function(a){a="search"===a?"_aFilterData":"_aSortData";return this.iterator("cell",function(b,c,d){return b.aoData[c][a][d]},1)});r("cells().render()","cell().render()",function(a){return this.iterator("cell",function(b,c,d){return B(b,c,d,a)},1)});r("cells().indexes()","cell().index()",function(){return this.iterator("cell",
|
128 |
+
function(a,b,c){return{row:b,column:c,columnVisible:ba(a,c)}},1)});r("cells().invalidate()","cell().invalidate()",function(a){return this.iterator("cell",function(b,c,d){ea(b,c,a,d)})});p("cell()",function(a,b,c){return bb(this.cells(a,b,c))});p("cell().data()",function(a){var b=this.context,c=this[0];if(a===k)return b.length&&c.length?B(b[0],c[0].row,c[0].column):k;jb(b[0],c[0].row,c[0].column,a);ea(b[0],c[0].row,"data",c[0].column);return this});p("order()",function(a,b){var c=this.context;if(a===
|
129 |
+
k)return 0!==c.length?c[0].aaSorting:k;"number"===typeof a?a=[[a,b]]:h.isArray(a[0])||(a=Array.prototype.slice.call(arguments));return this.iterator("table",function(b){b.aaSorting=a.slice()})});p("order.listener()",function(a,b,c){return this.iterator("table",function(d){Oa(d,a,b,c)})});p("order.fixed()",function(a){if(!a){var b=this.context,b=b.length?b[0].aaSortingFixed:k;return h.isArray(b)?{pre:b}:b}return this.iterator("table",function(b){b.aaSortingFixed=h.extend(!0,{},a)})});p(["columns().order()",
|
130 |
+
"column().order()"],function(a){var b=this;return this.iterator("table",function(c,d){var e=[];h.each(b[d],function(b,c){e.push([c,a])});c.aaSorting=e})});p("search()",function(a,b,c,d){var e=this.context;return a===k?0!==e.length?e[0].oPreviousSearch.sSearch:k:this.iterator("table",function(e){e.oFeatures.bFilter&&ha(e,h.extend({},e.oPreviousSearch,{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),1)})});r("columns().search()","column().search()",function(a,
|
131 |
+
b,c,d){return this.iterator("column",function(e,f){var g=e.aoPreSearchCols;if(a===k)return g[f].sSearch;e.oFeatures.bFilter&&(h.extend(g[f],{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),ha(e,e.oPreviousSearch,1))})});p("state()",function(){return this.context.length?this.context[0].oSavedState:null});p("state.clear()",function(){return this.iterator("table",function(a){a.fnStateSaveCallback.call(a.oInstance,a,{})})});p("state.loaded()",function(){return this.context.length?
|
132 |
+
this.context[0].oLoadedState:null});p("state.save()",function(){return this.iterator("table",function(a){ya(a)})});m.versionCheck=m.fnVersionCheck=function(a){for(var b=m.version.split("."),a=a.split("."),c,d,e=0,f=a.length;e<f;e++)if(c=parseInt(b[e],10)||0,d=parseInt(a[e],10)||0,c!==d)return c>d;return!0};m.isDataTable=m.fnIsDataTable=function(a){var b=h(a).get(0),c=!1;h.each(m.settings,function(a,e){var f=e.nScrollHead?h("table",e.nScrollHead)[0]:null,g=e.nScrollFoot?h("table",e.nScrollFoot)[0]:
|
133 |
+
null;if(e.nTable===b||f===b||g===b)c=!0});return c};m.tables=m.fnTables=function(a){var b=!1;h.isPlainObject(a)&&(b=a.api,a=a.visible);var c=h.map(m.settings,function(b){if(!a||a&&h(b.nTable).is(":visible"))return b.nTable});return b?new t(c):c};m.util={throttle:ua,escapeRegex:va};m.camelToHungarian=J;p("$()",function(a,b){var c=this.rows(b).nodes(),c=h(c);return h([].concat(c.filter(a).toArray(),c.find(a).toArray()))});h.each(["on","one","off"],function(a,b){p(b+"()",function(){var a=Array.prototype.slice.call(arguments);
|
134 |
+
a[0].match(/\.dt\b/)||(a[0]+=".dt");var d=h(this.tables().nodes());d[b].apply(d,a);return this})});p("clear()",function(){return this.iterator("table",function(a){na(a)})});p("settings()",function(){return new t(this.context,this.context)});p("init()",function(){var a=this.context;return a.length?a[0].oInit:null});p("data()",function(){return this.iterator("table",function(a){return D(a.aoData,"_aData")}).flatten()});p("destroy()",function(a){a=a||!1;return this.iterator("table",function(b){var c=
|
135 |
+
b.nTableWrapper.parentNode,d=b.oClasses,e=b.nTable,f=b.nTBody,g=b.nTHead,j=b.nTFoot,i=h(e),f=h(f),k=h(b.nTableWrapper),l=h.map(b.aoData,function(a){return a.nTr}),p;b.bDestroying=!0;v(b,"aoDestroyCallback","destroy",[b]);a||(new t(b)).columns().visible(!0);k.unbind(".DT").find(":not(tbody *)").unbind(".DT");h(E).unbind(".DT-"+b.sInstance);e!=g.parentNode&&(i.children("thead").detach(),i.append(g));j&&e!=j.parentNode&&(i.children("tfoot").detach(),i.append(j));b.aaSorting=[];b.aaSortingFixed=[];xa(b);
|
136 |
+
h(l).removeClass(b.asStripeClasses.join(" "));h("th, td",g).removeClass(d.sSortable+" "+d.sSortableAsc+" "+d.sSortableDesc+" "+d.sSortableNone);b.bJUI&&(h("th span."+d.sSortIcon+", td span."+d.sSortIcon,g).detach(),h("th, td",g).each(function(){var a=h("div."+d.sSortJUIWrapper,this);h(this).append(a.contents());a.detach()}));f.children().detach();f.append(l);g=a?"remove":"detach";i[g]();k[g]();!a&&c&&(c.insertBefore(e,b.nTableReinsertBefore),i.css("width",b.sDestroyWidth).removeClass(d.sTable),(p=
|
137 |
+
b.asDestroyStripes.length)&&f.children().each(function(a){h(this).addClass(b.asDestroyStripes[a%p])}));c=h.inArray(b,m.settings);-1!==c&&m.settings.splice(c,1)})});h.each(["column","row","cell"],function(a,b){p(b+"s().every()",function(a){var d=this.selector.opts,e=this;return this.iterator(b,function(f,g,h,i,m){a.call(e[b](g,"cell"===b?h:d,"cell"===b?d:k),g,h,i,m)})})});p("i18n()",function(a,b,c){var d=this.context[0],a=Q(a)(d.oLanguage);a===k&&(a=b);c!==k&&h.isPlainObject(a)&&(a=a[c]!==k?a[c]:a._);
|
138 |
+
return a.replace("%d",c)});m.version="1.10.10";m.settings=[];m.models={};m.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};m.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1};m.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,
|
139 |
+
sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};m.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,
|
140 |
+
bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+
|
141 |
+
a.sInstance+"_"+location.pathname))}catch(b){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+a.sInstance+"_"+location.pathname,JSON.stringify(b))}catch(c){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},
|
142 |
+
oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:h.extend({},
|
143 |
+
m.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"};Y(m.defaults);m.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};
|
144 |
+
Y(m.defaults.column);m.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],
|
145 |
+
aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",
|
146 |
+
iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:k,oAjaxData:k,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==y(this)?
|
147 |
+
1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==y(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a=this._iDisplayLength,b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=this.oFeatures,f=e.bPaginate;return e.bServerSide?!1===f||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!f||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};
|
148 |
+
m.ext=s={buttons:{},classes:{},builder:"-source-",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:m.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:m.version};h.extend(s,{afnFiltering:s.search,aTypes:s.type.detect,ofnSearch:s.type.search,oSort:s.type.order,afnSortData:s.order,aoFeatures:s.feature,oApi:s.internal,oStdClasses:s.classes,
|
149 |
+
oPagination:s.pager});h.extend(m.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",
|
150 |
+
sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",
|
151 |
+
sJUIHeader:"",sJUIFooter:""});var Ea="",Ea="",G=Ea+"ui-state-default",ka=Ea+"css_right ui-icon ui-icon-",Xb=Ea+"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix";h.extend(m.ext.oJUIClasses,m.ext.classes,{sPageButton:"fg-button ui-button "+G,sPageButtonActive:"ui-state-disabled",sPageButtonDisabled:"ui-state-disabled",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:G+" sorting_asc",sSortDesc:G+" sorting_desc",sSortable:G+" sorting",
|
152 |
+
sSortableAsc:G+" sorting_asc_disabled",sSortableDesc:G+" sorting_desc_disabled",sSortableNone:G+" sorting_disabled",sSortJUIAsc:ka+"triangle-1-n",sSortJUIDesc:ka+"triangle-1-s",sSortJUI:ka+"carat-2-n-s",sSortJUIAscAllowed:ka+"carat-1-n",sSortJUIDescAllowed:ka+"carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead "+G,sScrollFoot:"dataTables_scrollFoot "+G,sHeaderTH:G,sFooterTH:G,sJUIHeader:Xb+" ui-corner-tl ui-corner-tr",sJUIFooter:Xb+
|
153 |
+
" ui-corner-bl ui-corner-br"});var Mb=m.ext.pager;h.extend(Mb,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},numbers:function(a,b){return[Aa(a,b)]},simple_numbers:function(a,b){return["previous",Aa(a,b),"next"]},full_numbers:function(a,b){return["first","previous",Aa(a,b),"next","last"]},_numbers:Aa,numbers_length:7});h.extend(!0,m.ext.renderer,{pageButton:{_:function(a,b,c,d,e,f){var g=a.oClasses,j=a.oLanguage.oPaginate,i=a.oLanguage.oAria.paginate||
|
154 |
+
{},k,l,m=0,p=function(b,d){var n,r,t,s,v=function(b){Ta(a,b.data.action,true)};n=0;for(r=d.length;n<r;n++){s=d[n];if(h.isArray(s)){t=h("<"+(s.DT_el||"div")+"/>").appendTo(b);p(t,s)}else{k=null;l="";switch(s){case "ellipsis":b.append('<span class="ellipsis">…</span>');break;case "first":k=j.sFirst;l=s+(e>0?"":" "+g.sPageButtonDisabled);break;case "previous":k=j.sPrevious;l=s+(e>0?"":" "+g.sPageButtonDisabled);break;case "next":k=j.sNext;l=s+(e<f-1?"":" "+g.sPageButtonDisabled);break;case "last":k=
|
155 |
+
j.sLast;l=s+(e<f-1?"":" "+g.sPageButtonDisabled);break;default:k=s+1;l=e===s?g.sPageButtonActive:""}if(k!==null){t=h("<a>",{"class":g.sPageButton+" "+l,"aria-controls":a.sTableId,"aria-label":i[s],"data-dt-idx":m,tabindex:a.iTabIndex,id:c===0&&typeof s==="string"?a.sTableId+"_"+s:null}).html(k).appendTo(b);Wa(t,{action:s},v);m++}}}},r;try{r=h(b).find(H.activeElement).data("dt-idx")}catch(n){}p(h(b).empty(),d);r&&h(b).find("[data-dt-idx="+r+"]").focus()}}});h.extend(m.ext.type.detect,[function(a,b){var c=
|
156 |
+
b.oLanguage.sDecimal;return Za(a,c)?"num"+c:null},function(a){if(a&&!(a instanceof Date)&&(!ac.test(a)||!bc.test(a)))return null;var b=Date.parse(a);return null!==b&&!isNaN(b)||M(a)?"date":null},function(a,b){var c=b.oLanguage.sDecimal;return Za(a,c,!0)?"num-fmt"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Rb(a,c)?"html-num"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Rb(a,c,!0)?"html-num-fmt"+c:null},function(a){return M(a)||"string"===typeof a&&-1!==a.indexOf("<")?"html":
|
157 |
+
null}]);h.extend(m.ext.type.search,{html:function(a){return M(a)?a:"string"===typeof a?a.replace(Ob," ").replace(Ca,""):""},string:function(a){return M(a)?a:"string"===typeof a?a.replace(Ob," "):a}});var Ba=function(a,b,c,d){if(0!==a&&(!a||"-"===a))return-Infinity;b&&(a=Qb(a,b));a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,"")));return 1*a};h.extend(s.type.order,{"date-pre":function(a){return Date.parse(a)||0},"html-pre":function(a){return M(a)?"":a.replace?a.replace(/<.*?>/g,"").toLowerCase():
|
158 |
+
a+""},"string-pre":function(a){return M(a)?"":"string"===typeof a?a.toLowerCase():!a.toString?"":a.toString()},"string-asc":function(a,b){return a<b?-1:a>b?1:0},"string-desc":function(a,b){return a<b?1:a>b?-1:0}});db("");h.extend(!0,m.ext.renderer,{header:{_:function(a,b,c,d){h(a.nTable).on("order.dt.DT",function(e,f,g,h){if(a===f){e=c.idx;b.removeClass(c.sSortingClass+" "+d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass)}})},jqueryui:function(a,
|
159 |
+
b,c,d){h("<div/>").addClass(d.sSortJUIWrapper).append(b.contents()).append(h("<span/>").addClass(d.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b);h(a.nTable).on("order.dt.DT",function(e,f,g,h){if(a===f){e=c.idx;b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass);b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass(h[e]=="asc"?d.sSortJUIAsc:
|
160 |
+
h[e]=="desc"?d.sSortJUIDesc:c.sSortingClassJUI)}})}}});m.render={number:function(a,b,c,d,e){return{display:function(f){if("number"!==typeof f&&"string"!==typeof f)return f;var g=0>f?"-":"",h=parseFloat(f);if(isNaN(h))return f;f=Math.abs(h);h=parseInt(f,10);f=c?b+(f-h).toFixed(c).substring(2):"";return g+(d||"")+h.toString().replace(/\B(?=(\d{3})+(?!\d))/g,a)+f+(e||"")}}},text:function(){return{display:function(a){return"string"===typeof a?a.replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):
|
161 |
+
a}}}};h.extend(m.ext.internal,{_fnExternApiFunc:Nb,_fnBuildAjax:ra,_fnAjaxUpdate:lb,_fnAjaxParameters:ub,_fnAjaxUpdateDraw:vb,_fnAjaxDataSrc:sa,_fnAddColumn:Ga,_fnColumnOptions:la,_fnAdjustColumnSizing:U,_fnVisibleToColumnIndex:$,_fnColumnIndexToVisible:ba,_fnVisbleColumns:ca,_fnGetColumns:aa,_fnColumnTypes:Ia,_fnApplyColumnDefs:ib,_fnHungarianMap:Y,_fnCamelToHungarian:J,_fnLanguageCompat:Fa,_fnBrowserDetect:gb,_fnAddData:N,_fnAddTr:ma,_fnNodeToDataIndex:function(a,b){return b._DT_RowIndex!==k?b._DT_RowIndex:
|
162 |
+
null},_fnNodeToColumnIndex:function(a,b,c){return h.inArray(c,a.aoData[b].anCells)},_fnGetCellData:B,_fnSetCellData:jb,_fnSplitObjNotation:La,_fnGetObjectDataFn:Q,_fnSetObjectDataFn:R,_fnGetDataMaster:Ma,_fnClearTable:na,_fnDeleteIndex:oa,_fnInvalidate:ea,_fnGetRowElements:Ka,_fnCreateTr:Ja,_fnBuildHead:kb,_fnDrawHead:ga,_fnDraw:O,_fnReDraw:T,_fnAddOptionsHtml:nb,_fnDetectHeader:fa,_fnGetUniqueThs:qa,_fnFeatureHtmlFilter:pb,_fnFilterComplete:ha,_fnFilterCustom:yb,_fnFilterColumn:xb,_fnFilter:wb,_fnFilterCreateSearch:Qa,
|
163 |
+
_fnEscapeRegex:va,_fnFilterData:zb,_fnFeatureHtmlInfo:sb,_fnUpdateInfo:Cb,_fnInfoMacros:Db,_fnInitialise:ia,_fnInitComplete:ta,_fnLengthChange:Ra,_fnFeatureHtmlLength:ob,_fnFeatureHtmlPaginate:tb,_fnPageChange:Ta,_fnFeatureHtmlProcessing:qb,_fnProcessingDisplay:C,_fnFeatureHtmlTable:rb,_fnScrollDraw:Z,_fnApplyToChildren:I,_fnCalculateColumnWidths:Ha,_fnThrottle:ua,_fnConvertToWidth:Fb,_fnGetWidestNode:Gb,_fnGetMaxLenString:Hb,_fnStringToCss:w,_fnSortFlatten:W,_fnSort:mb,_fnSortAria:Jb,_fnSortListener:Va,
|
164 |
+
_fnSortAttachListener:Oa,_fnSortingClasses:xa,_fnSortData:Ib,_fnSaveState:ya,_fnLoadState:Kb,_fnSettingsFromNode:za,_fnLog:K,_fnMap:F,_fnBindAction:Wa,_fnCallbackReg:z,_fnCallbackFire:v,_fnLengthOverflow:Sa,_fnRenderer:Pa,_fnDataSource:y,_fnRowAttributes:Na,_fnCalculateEnd:function(){}});h.fn.dataTable=m;m.$=h;h.fn.dataTableSettings=m.settings;h.fn.dataTableExt=m.ext;h.fn.DataTable=function(a){return h(this).dataTable(a).api()};h.each(m,function(a,b){h.fn.DataTable[a]=b});return h.fn.dataTable});
|
includes/js/menu.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<script>
|
2 |
+
+function($){"use strict";var n=function(n,e,t){if("[object Object]"===Object.prototype.toString.call(n))for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.call(t,n[o],o,n);else for(var i=0,a=n.length;a>i;i++)e.call(t,n[i],i,n)},e=document.querySelectorAll(".hamburger");e.length>0&&n(e,function(n){n.addEventListener("click",function(){this.classList.toggle("active")},!1)})}(jQuery),+function($){"use strict";function n(){var n=2*$(".navbar").height();$(window).scrollTop()>n?$(".navbar").addClass("scrolled"):$(".navbar").removeClass("scrolled")}$(".navbar").length>0&&$(window).on("scroll load resize",function(){n()})}(jQuery),window.megaNavbar={},+function(n,$){"use strict";var e=!1;$.extend(n,{unitedMenu:{defaults:{content:$("#navbar")},initialize:function(n,t){return e?this:(e=!0,this.$content=n||this.defaults.content,this.setOptions(t).build().events(),this)},setOptions:function(n){return this.options=$.extend(!0,{},this.defaults,n),this},build:function(){var n=this,e=$("#navbar");return e.find(".dropdown-toggle, .dropdown-submenu > a").append($("<i/>").addClass("fa fa-angle-down")),e.find(".dropdown").addClass("dropdown-reverse"),this},events:function(){var n=this,e=$("#navbar"),t=$(window);e.find('a[href="#"]').on("click",function(n){n.preventDefault()}),e.find('.dropdown-toggle[href="#"], .dropdown-submenu a[href="#"], .dropdown-toggle[href!="#"] .fa-angle-down, .dropdown-submenu a[href!="#"] .fa-angle-down').on("click",function(n){n.preventDefault(),t.width()<768&&$(this).closest("li").toggleClass("opened")})}}}),"undefined"!=typeof n.unitedMenu&&n.unitedMenu.initialize()}.apply(this,[window.megaNavbar,jQuery]);+function($){"use strict";function t(t){$(t).next().find('a[data-toggle="tab"]').click()}function e(t){$(t).prev().find('a[data-toggle="tab"]').click()}function a(){var t=0;$(".product").each(function(){t+=parseFloat($(this).children(".product-line-price").text())});var e=t*c,a=t>0?r:0,i=t+e+a;$(".totals-value").fadeOut(l,function(){$("#cart-subtotal").html(t.toFixed(2)),$("#cart-tax").html(e.toFixed(2)),$("#cart-shipping").html(a.toFixed(2)),$("#cart-total").html(i.toFixed(2)),0==i?$(".button").fadeOut(l):$(".button").fadeIn(l),$(".totals-value").fadeIn(l)})}function i(t){var e=$(t).parent().parent(),i=parseFloat(e.children(".product-price").text()),o=$(t).val(),n=i*o;e.children(".product-line-price").each(function(){$(this).fadeOut(l,function(){$(this).text(n.toFixed(2)),a(),$(this).fadeIn(l)})})}function o(t){var e=$(t).parent().parent();e.slideUp(l,function(){e.remove(),a()})}var n=$(window);n.load(function(){var t=$("#preloader"),e=$(".preloader");e.fadeOut(400,function(){t.delay(400).addClass("active")})}),$(".toggle").click(function(){$(this).children("i").toggleClass("fa-user-plus"),$(".form").animate({height:"toggle","padding-top":"toggle","padding-bottom":"toggle",opacity:"toggle"},"slow")}),$(".nav-tabs > li a[title]").tooltip(),$('a[data-toggle="tab"]').on("show.bs.tab",function(t){var e=$(t.target);if(e.parent().hasClass("disabled"))return!1}),$(".next-step").click(function(e){var a=$(".register .nav-tabs li.active");a.next().removeClass("disabled"),t(a)}),$(".prev-step").click(function(t){var a=$(".register .nav-tabs li.active");e(a)}),$(".hover").mouseleave(function(){$(this).removeClass("hover")});var c=.05,r=15,l=300;$(".product-quantity input").change(function(){i(this)}),$(".product-removal button").click(function(){o(this)}),null==$.cookie("MM-United")&&setTimeout(function(){$("#Cookie").modal("show"),$.cookie("MM-United"),document.cookie="MM-United=true; expires=Fri, 31 Dec 9999 23:59:59 UTC"},1e3)}(jQuery);function validateFirstStep(){return $(".wizard form").validate({rules:{firstname:"required",lastname:"required",email:{required:!0,email:!0}},messages:{firstname:"Please enter your First Name",lastname:"Please enter your Last Name",email:"Please enter a valid email address"}}),!!$(".wizard form").valid()}function validateSecondStep(){return $(".wizard form").validate({rules:{},messages:{}}),!!$(".wizard form").valid()||(console.log("invalid"),!1)}function readURL(e){if(e.files&&e.files[0]){var i=new FileReader;i.onload=function(e){$("#avatarPreview").attr("src",e.target.result).fadeIn("slow")},i.readAsDataURL(e.files[0])}}$(document).ready(function(){$(".wizard").bootstrapWizard({tabClass:"nav nav-pills",nextSelector:".btn-next",previousSelector:".btn-previous",onInit:function(e,i,t){var a=i.find("li").length;$width=100/a,$display_width=$(document).width(),$display_width<600&&a>3&&($width=50),i.find("li").css("width",$width+"%")},onNext:function(e,i,t){return 1==t?validateFirstStep():2==t?validateSecondStep():3==t?validateThirdStep():void 0},onTabClick:function(e,i,t){return!1},onTabShow:function(e,i,t){var a=i.find("li").length,d=t+1,r=i.closest(".wizard");d>=a?($(r).find(".btn-next").hide(),$(r).find(".btn-finish").show()):($(r).find(".btn-next").show(),$(r).find(".btn-finish").hide())}}),$("#avatar").change(function(){readURL(this)}),$('[data-toggle="wizard-radio"]').click(function(){wizard=$(this).closest(".wizard"),wizard.find('[data-toggle="wizard-radio"]').removeClass("active"),$(this).addClass("active"),$(wizard).find('[type="radio"]').removeAttr("checked"),$(this).find('[type="radio"]').attr("checked","true")}),$('[data-toggle="wizard-checkbox"]').click(function(){$(this).hasClass("active")?($(this).removeClass("active"),$(this).find('[type="checkbox"]').removeAttr("checked")):($(this).addClass("active"),$(this).find('[type="checkbox"]').attr("checked","true"))}),$height=$(document).height(),$(".set-full-height").css("height",$height)});
|
3 |
+
</script>
|
includes/js/rba/js/device_attributes.js
CHANGED
@@ -6,5 +6,5 @@ c="";a.isMobile()?(a.isMobileAndroid()?c="Android":a.isMobileOpera()?c="Opera":a
|
|
6 |
function hasFlash(){try{if(new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))return!0}catch(a){if(navigator.mimeTypes&&void 0!=navigator.mimeTypes["application/x-shockwave-flash"]&&navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)return!0}return!1}
|
7 |
var onSuccess=function(a){countryName=a.country.names.en;countryCode=a.country.iso_code;latitude=a.location.latitude;longitude=a.location.longitude;ip=a.traits.ip_address;timeZone=a.location.time_zone;region=a.subdivisions[0].names.en;regionCode=a.subdivisions[0].iso_code;postalCode=a.postal.code;city=a.city.names.en;continent=a.continent.names.en;continentCode=a.continent.code;isp=a.traits.isp;updateJSONObject("location.countryName",countryName);updateJSONObject("location.countryCode",countryCode);
|
8 |
updateJSONObject("location.latitude",latitude);updateJSONObject("location.longitude",longitude);updateJSONObject("location.ip",ip);updateJSONObject("location.timeZone",timeZone);updateJSONObject("location.region",region);updateJSONObject("location.regionCode",regionCode);updateJSONObject("location.postalCode",postalCode);updateJSONObject("location.city",city);updateJSONObject("location.continent",continent);updateJSONObject("location.continentCode",continentCode);updateJSONObject("location.isp",isp);},
|
9 |
-
onError=function(a){console.log("Couldn't get the location.");updateJSONObject('location.ip',$('#mo_client_ip').val());};function fetch_client_whorls(){$("#message").hide();hasFlash()&&checkFontsExist&&updateJSONObject("system.fonts",fontlist);get_browser_attributes()
|
10 |
function set_dom_storage(){try{localStorage.miniorange="yea",sessionStorage.miniorange="yea"}catch(a){}};
|
6 |
function hasFlash(){try{if(new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))return!0}catch(a){if(navigator.mimeTypes&&void 0!=navigator.mimeTypes["application/x-shockwave-flash"]&&navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)return!0}return!1}
|
7 |
var onSuccess=function(a){countryName=a.country.names.en;countryCode=a.country.iso_code;latitude=a.location.latitude;longitude=a.location.longitude;ip=a.traits.ip_address;timeZone=a.location.time_zone;region=a.subdivisions[0].names.en;regionCode=a.subdivisions[0].iso_code;postalCode=a.postal.code;city=a.city.names.en;continent=a.continent.names.en;continentCode=a.continent.code;isp=a.traits.isp;updateJSONObject("location.countryName",countryName);updateJSONObject("location.countryCode",countryCode);
|
8 |
updateJSONObject("location.latitude",latitude);updateJSONObject("location.longitude",longitude);updateJSONObject("location.ip",ip);updateJSONObject("location.timeZone",timeZone);updateJSONObject("location.region",region);updateJSONObject("location.regionCode",regionCode);updateJSONObject("location.postalCode",postalCode);updateJSONObject("location.city",city);updateJSONObject("location.continent",continent);updateJSONObject("location.continentCode",continentCode);updateJSONObject("location.isp",isp);},
|
9 |
+
onError=function(a){console.log("Couldn't get the location.");updateJSONObject('location.ip',$('#mo_client_ip').val());};function fetch_client_whorls(){$("#message").hide();hasFlash()&&checkFontsExist&&updateJSONObject("system.fonts",fontlist);get_browser_attributes();geoip2.insights(onSuccess,onError);set_dom_storage()}function updateJSONObject(a,b){rbaAttributes.attributes.push({attrName:a,attrValue:b})}
|
10 |
function set_dom_storage(){try{localStorage.miniorange="yea",sessionStorage.miniorange="yea"}catch(a){}};
|
miniorange_2_factor_common_login.php
CHANGED
@@ -651,9 +651,11 @@ function mo2f_get_qrcode_authentication_prompt( $login_status, $login_message, $
|
|
651 |
<?php
|
652 |
}
|
653 |
|
654 |
-
function mo2f_get_otp_authentication_prompt( $login_status, $login_message, $redirect_to,$session_id_encrypt ) {
|
655 |
$mo2f_enable_forgotphone = get_option( 'mo2f_enable_forgotphone' );
|
656 |
$mo2f_is_new_customer = get_option( 'mo2f_is_NC' );
|
|
|
|
|
657 |
?>
|
658 |
<html>
|
659 |
<head>
|
@@ -682,6 +684,8 @@ function mo2f_get_otp_authentication_prompt( $login_status, $login_message, $red
|
|
682 |
<p class="mo2fa_display_message_frontend"><?php echo $login_message; ?></p>
|
683 |
</div>
|
684 |
<?php } ?>
|
|
|
|
|
685 |
<br>
|
686 |
<div id="showOTP">
|
687 |
<div class="mo2f-login-container">
|
@@ -852,10 +856,10 @@ function mo2f_customize_logo() { ?>
|
|
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.
|
856 |
-
echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/front_end_login.css?version=5.1.
|
857 |
-
echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/style_settings.css?version=5.1.
|
858 |
-
echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/hide-login.css?version=5.1.
|
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__ ) . '" />';
|
651 |
<?php
|
652 |
}
|
653 |
|
654 |
+
function mo2f_get_otp_authentication_prompt( $login_status, $login_message, $redirect_to,$session_id_encrypt,$user_id ) {
|
655 |
$mo2f_enable_forgotphone = get_option( 'mo2f_enable_forgotphone' );
|
656 |
$mo2f_is_new_customer = get_option( 'mo2f_is_NC' );
|
657 |
+
//update_user_meta( $currentuser->ID, 'mo2f_user_login_attempts', get_option('mo2f_allwed_login_attempts') );
|
658 |
+
$attempts=get_user_meta( $user_id, 'mo2f_user_login_attempts', true );
|
659 |
?>
|
660 |
<html>
|
661 |
<head>
|
684 |
<p class="mo2fa_display_message_frontend"><?php echo $login_message; ?></p>
|
685 |
</div>
|
686 |
<?php } ?>
|
687 |
+
|
688 |
+
<br><span><b>Attempts left</b>:</span> <?php echo $attempts;?><br>
|
689 |
<br>
|
690 |
<div id="showOTP">
|
691 |
<div class="mo2f-login-container">
|
856 |
function echo_js_css_files() {
|
857 |
echo '<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>';
|
858 |
echo '<script src="' . plugins_url( 'includes/js/bootstrap.min.js', __FILE__ ) . '" ></script>';
|
859 |
+
echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/bootstrap.min.css?version=5.1.19', __FILE__ ) . '" />';
|
860 |
+
echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/front_end_login.css?version=5.1.19', __FILE__ ) . '" />';
|
861 |
+
echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/style_settings.css?version=5.1.19', __FILE__ ) . '" />';
|
862 |
+
echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/hide-login.css?version=5.1.19', __FILE__ ) . '" />';
|
863 |
|
864 |
if ( get_option( 'mo2f_personalization_ui' ) ) {
|
865 |
echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/mo2f_login_popup_ui.css', __FILE__ ) . '" />';
|
miniorange_2_factor_configuration.php
CHANGED
@@ -2,18 +2,16 @@
|
|
2 |
function mo_2_factor_register( $user ) {
|
3 |
global $Mo2fdbQueries;
|
4 |
if ( mo_2factor_is_curl_installed() == 0 ) { ?>
|
5 |
-
<p style="color:red;">(<?php echo mo2f_lt( 'Warning:' ); ?>
|
6 |
-
|
7 |
-
|
8 |
-
)</p>
|
9 |
<?php
|
10 |
}
|
11 |
|
12 |
if ( version_compare( PHP_VERSION, '5.3.0' ) < 0 ) {
|
13 |
?>
|
14 |
-
|
15 |
-
|
16 |
-
. <?php echo mo2f_lt( 'Some of the functionality of the plugin may not work in this version of PHP. Please upgrade your PHP version to 5.3.0 or above.' ); ?>
|
17 |
<br> <?php echo mo2f_lt( 'You can also write us by submitting a query on the right hand side in our ' ); ?>
|
18 |
<b><?php echo mo2f_lt( 'Support Section' ); ?></b>. )</p>
|
19 |
<?php
|
@@ -28,23 +26,24 @@ function mo_2_factor_register( $user ) {
|
|
28 |
|
29 |
$mo2f_active_tab = isset( $_GET['mo2f_tab'] ) ? $_GET['mo2f_tab'] : $default_tab ;
|
30 |
$mo_2factor_user_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $user->ID );
|
31 |
-
$account_tab_name = ( in_array( $mo_2factor_user_registration_status, array('MO_2_FACTOR_INITIALIZE_MOBILE_REGISTRATION','MO_2_FACTOR_PLUGIN_SETTINGS'
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
?>
|
35 |
-
<br>
|
36 |
<div class="wrap">
|
37 |
-
<div
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
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&mo2f_tab=mo2f_pricing"
|
48 |
><?php echo mo2f_lt( 'Upgrade to Standard/Premium Plans' ); ?></a>
|
49 |
|
50 |
<?php } ?>
|
@@ -52,134 +51,287 @@ function mo_2_factor_register( $user ) {
|
|
52 |
</div>
|
53 |
|
54 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
|
|
|
|
|
|
75 |
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
if ( get_option( 'mo_2factor_admin_registration_status' ) == 'MO_2_FACTOR_CUSTOMER_REGISTERED_SUCCESS' && get_option( 'mo2f_miniorange_admin' ) == $user->ID ) {
|
91 |
-
$Mo2fdbQueries->update_user_details( $user->ID, array( 'user_registration_with_miniorange' => 'SUCCESS' ) );
|
92 |
-
}
|
93 |
-
/* ----------------------------------------- */
|
94 |
-
$session_variables = array( 'mo2f_google_auth', 'mo2f_authy_keys', 'mo2f_mobile_support' );
|
95 |
-
|
96 |
-
if ( $mo2f_active_tab == 'mobile_configure' ) {
|
97 |
-
$mo2f_second_factor = mo2f_get_activated_second_factor( $user );
|
98 |
-
mo2f_select_2_factor_method( $user, $mo2f_second_factor );
|
99 |
-
?>
|
100 |
-
<?php
|
101 |
-
} else if ( $can_display_admin_features && $mo2f_active_tab == 'mo2f_support' ) {
|
102 |
-
MO2f_Utility::unset_session_variables( $session_variables );
|
103 |
-
mo2f_support();
|
104 |
-
} else if ( $can_display_admin_features && $mo2f_active_tab == 'proxy_setup' ) {
|
105 |
-
MO2f_Utility::unset_session_variables( $session_variables );
|
106 |
-
show_2_factor_proxy_setup( $user );
|
107 |
-
} else if ( $can_display_admin_features && $mo2f_active_tab == 'mo2f_login' ) {
|
108 |
-
MO2f_Utility::unset_session_variables( $session_variables );
|
109 |
-
show_2_factor_login_settings( $user );
|
110 |
-
} else if ( $can_display_admin_features && $mo2f_active_tab == 'mo2f_addon' ) {
|
111 |
-
MO2f_Utility::unset_session_variables( $session_variables );
|
112 |
-
show_2_factor_addons( $user );
|
113 |
-
do_action( 'mo2f_new_addon' );
|
114 |
-
} else if ( $can_display_admin_features && $mo2f_active_tab == 'mo2f_pricing' ) {
|
115 |
-
MO2f_Utility::unset_session_variables( $session_variables );
|
116 |
-
show_2_factor_pricing_page( $user );
|
117 |
-
}else {
|
118 |
-
|
119 |
-
MO2f_Utility::unset_session_variables( $session_variables );
|
120 |
-
if ( get_option( 'mo_2factor_admin_registration_status' ) == 'MO_2_FACTOR_CUSTOMER_REGISTERED_SUCCESS' && get_option( 'mo2f_miniorange_admin' ) != $user->ID ) {
|
121 |
-
if ( in_array( $mo_2factor_user_registration_status, array(
|
122 |
-
'MO_2_FACTOR_OTP_DELIVERED_SUCCESS',
|
123 |
-
'MO_2_FACTOR_OTP_DELIVERED_FAILURE'
|
124 |
-
) ) ) {
|
125 |
-
mo2f_show_user_otp_validation_page(); // OTP over email validation page
|
126 |
-
} else if ( $mo_2factor_user_registration_status == 'MO_2_FACTOR_INITIALIZE_MOBILE_REGISTRATION' ) { //displaying user profile
|
127 |
-
$mo2f_second_factor = mo2f_get_activated_second_factor( $user );
|
128 |
-
mo2f_show_instruction_to_allusers( $user, $mo2f_second_factor );
|
129 |
-
} else if ( $mo_2factor_user_registration_status == 'MO_2_FACTOR_PLUGIN_SETTINGS' ) {
|
130 |
-
$mo2f_second_factor = mo2f_get_activated_second_factor( $user );
|
131 |
-
mo2f_show_instruction_to_allusers( $user, $mo2f_second_factor ); //displaying user profile
|
132 |
-
} else {
|
133 |
-
show_user_welcome_page( $user ); //Landing page for additional admin for registration
|
134 |
-
}
|
135 |
-
} else {
|
136 |
|
137 |
-
|
138 |
-
|
139 |
-
'MO_2_FACTOR_OTP_DELIVERED_FAILURE'
|
140 |
-
) ) ) {
|
141 |
-
mo2f_show_otp_validation_page( $user ); // OTP over email validation page for admin
|
142 |
-
} else if ( $mo_2factor_user_registration_status == 'MO_2_FACTOR_INITIALIZE_MOBILE_REGISTRATION' ) { //displaying user profile
|
143 |
-
$mo2f_second_factor = mo2f_get_activated_second_factor( $user );
|
144 |
-
mo2f_show_instruction_to_allusers( $user, $mo2f_second_factor );
|
145 |
-
} else if ( $mo_2factor_user_registration_status == 'MO_2_FACTOR_PLUGIN_SETTINGS' ) {
|
146 |
-
$mo2f_second_factor = mo2f_get_activated_second_factor( $user );
|
147 |
-
mo2f_show_instruction_to_allusers( $user, $mo2f_second_factor ); //displaying user profile
|
148 |
-
|
149 |
-
} else if ( $mo_2factor_user_registration_status == 'MO_2_FACTOR_VERIFY_CUSTOMER' ) {
|
150 |
-
mo2f_show_verify_password_page(); //verify password page
|
151 |
-
} else if ( ! mo2f_is_customer_registered() ) {
|
152 |
-
delete_option( 'password_mismatch' );
|
153 |
-
mo2f_show_registration_page( $user ); //new registration page
|
154 |
-
}
|
155 |
-
}
|
156 |
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
</tr>
|
166 |
-
</table>
|
167 |
-
</div>
|
168 |
-
<?php
|
169 |
-
}
|
170 |
|
171 |
function mo2f_show_registration_page( $user ) {
|
172 |
global $Mo2fdbQueries;
|
173 |
$mo2f_active_tab = isset( $_GET['mo2f_tab'] ) ? $_GET['mo2f_tab'] : '';
|
174 |
$is_registration = ($mo2f_active_tab =='2factor_setup') ? true : false;
|
175 |
?>
|
176 |
-
|
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 } ?>
|
@@ -302,25 +454,22 @@ function mo2f_show_otp_validation_page( $user ) {
|
|
302 |
|
303 |
<?php
|
304 |
}
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
<div id="mo2f_rba_addon" style="min-height:850px; class=" mo2f_addon_spacing">
|
309 |
-
<?php if ( get_option( 'mo2f_rba_installed' ) ) { ?>
|
310 |
<a href="<?php echo admin_url(); ?>plugins.php" id="mo2f_activate_rba_addon"
|
311 |
class="button button-primary button-large"
|
312 |
style="float:right; margin-top:2%;"><?php echo __( 'Activate Plugin', 'miniorange-2-factor-authentication' ); ?></a>
|
313 |
-
|
314 |
-
|
315 |
<a onclick="mo2f_addonform('wp_2fa_addon_rba')" id="mo2f_purchase_rba_addon"
|
316 |
class="button button-primary button-large"
|
317 |
style="margin-right:2%;margin-top:2%;float:right;"><?php echo __( 'Purchase', 'miniorange-2-factor-authentication' ); ?></a><?php } ?>
|
318 |
-
<br><br>
|
319 |
<div id="mo2f_rba_addon_hide"><h3 id="toggle_rba_description"
|
320 |
class="mo2f_pointer"><?php echo __( 'Description', 'miniorange-2-factor-authentication' ); ?> </h3>
|
321 |
<p id="rba_description" style="margin:2% 2% 2% 4%">
|
322 |
-
|
323 |
-
|
324 |
</p>
|
325 |
<br>
|
326 |
<div id="mo2f_hide_rba_content">
|
@@ -345,84 +494,17 @@ function mo2f_rba_description() {
|
|
345 |
<h3><?php echo __( 'IP Restriction: Limit users to login from specific IPs', 'miniorange-2-factor-authentication' ); ?></h3>
|
346 |
<hr>
|
347 |
<p><?php echo __( 'The Admin can enable IP restrictions for the users. It will provide additional security to the accounts and perform different action to the accounts only from the listed IP Ranges. If user tries to access with a restricted IP, Admin can set three action: Allow, challenge or deny. Depending upon the action it will allow the user to login, challenge(prompt) for authentication or deny the access.', 'miniorange-2-factor-authentication' ); ?>
|
348 |
-
|
349 |
</div>
|
|
|
350 |
</div>
|
351 |
|
352 |
</div>
|
353 |
-
<div id="mo2f_rba_addon_show"
|
354 |
-
|
355 |
-
<?php
|
356 |
-
}
|
357 |
-
|
358 |
-
function show_2_factor_addons( $current_user ) {
|
359 |
-
global $Mo2fdbQueries;
|
360 |
-
$mo2f_user_email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $current_user->ID );
|
361 |
-
$mo2f_active_sub_tab = isset( $_GET['mo2f_sub_tab'] ) ? $_GET['mo2f_sub_tab'] : 'rba';
|
362 |
-
?>
|
363 |
-
|
364 |
-
|
365 |
-
<div class="mo2f_table_layout">
|
366 |
-
<div class="mo2f_vertical-submenu" style='text-align:justify'>
|
367 |
-
<a href="admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mo2f_addon&mo2f_sub_tab=mo2f_sub_tab_rba"
|
368 |
-
class="nav-tab show_rba <?php echo $mo2f_active_sub_tab == 'mo2f_sub_tab_rba' ? 'active' : ''; ?>"
|
369 |
-
style='margin-left:5px' " id="mo2f_rba_add_on"
|
370 |
-
><?php echo __( 'Risk Based Access', 'miniorange-2-factor-authentication' ); ?></a>
|
371 |
-
<a href="admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mo2f_addon&mo2f_sub_tab=mo2f_sub_tab_personalization"
|
372 |
-
class="nav-tab show_personalization <?php echo $mo2f_active_sub_tab == 'mo2f_sub_tab_personalization' ? 'active' : ''; ?>" id="mo2f_personalization_add_on"><?php echo __( 'Personalization', 'miniorange-2-factor-authentication' ); ?></a>
|
373 |
-
<a href="admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mo2f_addon&mo2f_sub_tab=mo2f_sub_tab_shortcode"
|
374 |
-
class="nav-tab show_shortcode <?php echo $mo2f_active_sub_tab == 'mo2f_sub_tab_shortcode' ? 'active' : ''; ?>"
|
375 |
-
style='margin-right:0px' " id="mo2f_shortcode_add_on"><?php echo __( 'Shortcode', 'miniorange-2-factor-authentication' ); ?></a>
|
376 |
-
</div>
|
377 |
-
<br><br><br><br>
|
378 |
-
<?php if ( $mo2f_active_sub_tab == "mo2f_sub_tab_rba" ) {
|
379 |
-
mo2f_rba_description(); ?>
|
380 |
-
|
381 |
-
<?php } else if ( $mo2f_active_sub_tab == "mo2f_sub_tab_personalization" ) { ?>
|
382 |
-
<div id="mo2f_custom_addon" style="min-height:850px;">
|
383 |
-
<?php if ( get_option( 'mo2f_personalization_installed' ) ) { ?>
|
384 |
-
|
385 |
-
<a href="<?php echo admin_url(); ?>plugins.php" id="mo2f_activate_custom_addon"
|
386 |
-
class="button button-primary button-large"
|
387 |
-
style="float:right; margin-top:2%;"><?php echo __( 'Activate Plugin', 'miniorange-2-factor-authentication' ); ?></a>
|
388 |
-
<?php } ?>
|
389 |
-
<?php if ( ! get_option( 'mo2f_personalization_purchased' ) ) { ?> <a
|
390 |
-
onclick="mo2f_addonform('wp_2fa_addon_personalization')" id="mo2f_purchase_custom_addon"
|
391 |
-
class="button button-primary button-large"
|
392 |
-
style="margin-right:2%;margin-top:2%;float:right;"><?php echo __( 'Purchase', 'miniorange-2-factor-authentication' ); ?></a>
|
393 |
-
<?php } ?>
|
394 |
-
<br>
|
395 |
-
<div id="mo2f_custom_addon_hide"><br>
|
396 |
-
<h3 id="toggle_personalization_description" class="mo2f_pointer">
|
397 |
-
<?php echo __( 'Description ', 'miniorange-2-factor-authentication' ); ?></h3>
|
398 |
-
<?php mo2f_personalization_description(); ?>
|
399 |
-
</div>
|
400 |
-
<div id="mo2f_custom_addon_show"><?php show_custom_content(); ?></div>
|
401 |
-
</div>
|
402 |
-
|
403 |
-
<?php } else if ( $mo2f_active_sub_tab == "mo2f_sub_tab_shortcode" ) { ?>
|
404 |
-
<div id="mo2f_shortcode_addon" style="min-height:420px;">
|
405 |
|
406 |
-
|
407 |
-
|
408 |
-
<a href="<?php echo admin_url(); ?>plugins.php" id="mo2f_activate_shortcode_addon"
|
409 |
-
class="button button-primary button-large" style="float:right; margin-top:2%;"><?php echo __( 'Activate
|
410 |
-
Plugin', 'miniorange-2-factor-authentication' ); ?></a>
|
411 |
-
<?php } ?>
|
412 |
-
<?php if ( ! get_option( 'mo2f_shortcode_purchased' ) ) { ?>
|
413 |
-
|
414 |
-
<a onclick="mo2f_addonform('wp_2fa_addon_shortcode')" id="mo2f_purchase_shortcode_addon"
|
415 |
-
class="button button-primary button-large"
|
416 |
-
style="margin-right:2%;margin-top:2%;float:right;"><?php echo __( 'Purchase', 'miniorange-2-factor-authentication' ); ?></a>
|
417 |
-
<?php } ?>
|
418 |
-
<br><br>
|
419 |
-
<h3 id="toggle_shortcode_description"
|
420 |
-
class="mo2f_pointer"><?php echo __( 'Description', 'miniorange-2-factor-authentication' ); ?> </h3>
|
421 |
-
<?php mo2f_shortcode_description(); ?>
|
422 |
-
</div>
|
423 |
-
<div id="mo2f_Shortcode_addon_show"><?php show_shortcode_content(); ?></div>
|
424 |
-
</div>
|
425 |
-
<?php } ?>
|
426 |
|
427 |
<form style="display:none;" id="mo2fa_loginform"
|
428 |
action="<?php echo get_option( 'mo2f_host_name' ) . '/moas/login'; ?>"
|
@@ -432,27 +514,93 @@ function show_2_factor_addons( $current_user ) {
|
|
432 |
value="<?php echo get_option( 'mo2f_host_name' ) . '/moas/initializepayment'; ?>"/>
|
433 |
<input type="text" name="requestOrigin" id="requestOrigin"/>
|
434 |
</form>
|
435 |
-
|
436 |
<script>
|
437 |
function mo2f_addonform(planType) {
|
438 |
jQuery('#requestOrigin').val(planType);
|
439 |
jQuery('#mo2fa_loginform').submit();
|
440 |
}
|
441 |
</script>
|
442 |
-
|
|
|
443 |
|
444 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
445 |
</div>
|
446 |
-
|
447 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
448 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
449 |
}
|
450 |
|
451 |
-
function mo2f_personalization_description() {
|
452 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
453 |
<p id="custom_description" style="margin:2% 2% 2% 4%">
|
454 |
-
|
455 |
-
|
456 |
</p>
|
457 |
<br>
|
458 |
<div id="mo2f_hide_custom_content">
|
@@ -460,13 +608,13 @@ function mo2f_personalization_description() {
|
|
460 |
<h3><?php echo __( 'Customize Plugin Icon', 'miniorange-2-factor-authentication' ); ?></h3>
|
461 |
<hr>
|
462 |
<p>
|
463 |
-
|
464 |
</p>
|
465 |
<br>
|
466 |
<h3><?php echo __( 'Customize Plugin Name', 'miniorange-2-factor-authentication' ); ?></h3>
|
467 |
<hr>
|
468 |
<p>
|
469 |
-
|
470 |
</p>
|
471 |
|
472 |
</div>
|
@@ -475,7 +623,7 @@ function mo2f_personalization_description() {
|
|
475 |
<h3><?php echo __( 'Customize UI of Login Pop up\'s', 'miniorange-2-factor-authentication' ); ?></h3>
|
476 |
<hr>
|
477 |
<p>
|
478 |
-
|
479 |
</p>
|
480 |
</div>
|
481 |
|
@@ -487,37 +635,76 @@ function mo2f_personalization_description() {
|
|
487 |
<p><?php echo __( 'You can change the templates for Email and SMS which user receives during authentication.', 'miniorange-2-factor-authentication' ); ?></p>
|
488 |
|
489 |
</div>
|
490 |
-
</div>
|
491 |
-
|
|
|
|
|
|
|
|
|
492 |
}
|
493 |
|
494 |
-
function mo2f_shortcode_description() {
|
495 |
-
|
496 |
-
|
497 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
498 |
ugly code in just one line. You can use these shortcodes on any custom page. Just include the shortcode on your page and boom!', 'miniorange-2-factor-authentication' ); ?>
|
499 |
</p>
|
500 |
<br>
|
501 |
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
519 |
</div>
|
520 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
521 |
}
|
522 |
|
523 |
function show_rba_content() {
|
@@ -527,10 +714,7 @@ function show_rba_content() {
|
|
527 |
if ( $paid_rba ) {
|
528 |
$x = apply_filters( 'mo2f_rba', $str );
|
529 |
}
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
<?php
|
534 |
}
|
535 |
|
536 |
function show_shortcode_content() {
|
@@ -539,9 +723,8 @@ function show_shortcode_content() {
|
|
539 |
$str = "shortcode";
|
540 |
if ( $paid_shortcode ) {
|
541 |
$x = apply_filters( 'mo2f_shortcode', $str );
|
|
|
542 |
}
|
543 |
-
?>
|
544 |
-
<?php
|
545 |
}
|
546 |
|
547 |
function show_custom_content() {
|
@@ -560,12 +743,8 @@ function show_custom_content() {
|
|
560 |
function show_2_factor_proxy_setup( $user ) {
|
561 |
global $Mo2fdbQueries;
|
562 |
?>
|
563 |
-
|
564 |
-
|
565 |
<div class="mo2f_proxy_setup">
|
566 |
<h3>Proxy Settings</h3>
|
567 |
-
|
568 |
-
|
569 |
<hr>
|
570 |
<br>
|
571 |
<div style="float:right;">
|
@@ -580,8 +759,7 @@ function show_2_factor_proxy_setup( $user ) {
|
|
580 |
|
581 |
<?php if ( $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $user->ID ) != 'MO_2_FACTOR_PLUGIN_SETTINGS' || ! get_option( 'mo2f_proxy_host' ) ) {
|
582 |
echo 'disabled';
|
583 |
-
|
584 |
-
/>
|
585 |
|
586 |
</form>
|
587 |
</div>
|
@@ -643,7 +821,7 @@ function show_2_factor_login_settings( $user ) {
|
|
643 |
|
644 |
|
645 |
<?php if ( get_option( 'mo2f_is_NC' ) ) { ?>
|
646 |
-
|
647 |
<?php echo get_standard_premium_options( $user ); ?>
|
648 |
</div>
|
649 |
<?php } else {
|
@@ -651,7 +829,7 @@ function show_2_factor_login_settings( $user ) {
|
|
651 |
$mo2f_active_tab = '2factor_setup';
|
652 |
?>
|
653 |
|
654 |
-
<div class="mo2f_advanced_options_EC"
|
655 |
|
656 |
<div id="mo2f_login_options">
|
657 |
<a href="#standard_premium_options" style="float:right">Show Standard/Premium
|
@@ -903,283 +1081,285 @@ function get_standard_premium_options( $user ) {
|
|
903 |
$is_NC = get_option( 'mo2f_is_NC' );
|
904 |
|
905 |
?>
|
|
|
|
|
|
|
906 |
|
907 |
-
|
908 |
-
<p style="font-size:22px;color:darkorange;padding:10px;"><?php echo mo2f_lt( 'Features in the Standard Plan' ); ?></p>
|
909 |
-
|
910 |
-
</div>
|
911 |
-
|
912 |
-
<hr>
|
913 |
-
<?php if ( $is_NC ) { ?>
|
914 |
-
<div>
|
915 |
-
<a class="mo2f_view_backup_options" onclick="show_backup_options()">
|
916 |
-
<img src="<?php echo plugins_url( 'includes/images/right-arrow.png"', __FILE__ ); ?>"
|
917 |
-
class="mo2f_advanced_options_images"/>
|
918 |
-
|
919 |
-
<p class="mo2f_heading_style"><?php echo mo2f_lt( 'Backup Options' ); ?></p>
|
920 |
-
</a>
|
921 |
-
|
922 |
-
</div>
|
923 |
-
<div id="backup_options" style="margin-left: 5%;">
|
924 |
-
|
925 |
-
<div class="mo2f_advanced_options_note"><p style="padding:5px;">
|
926 |
-
<i><?php echo mo2f_lt( 'Use these backup options to login to your site in case your
|
927 |
-
phone is lost / not accessible or if you are not able to login using your primary
|
928 |
-
authentication method.' ); ?></i></p></div>
|
929 |
-
|
930 |
-
<ol class="mo2f_ol">
|
931 |
-
<li><?php echo mo2f_lt( 'KBA (Security Questions)' ); ?></li>
|
932 |
-
</ol>
|
933 |
-
|
934 |
-
</div>
|
935 |
-
<?php } ?>
|
936 |
-
|
937 |
-
<div>
|
938 |
-
<a class="mo2f_view_customizations" onclick="show_customizations()">
|
939 |
-
<img src="<?php echo plugins_url( 'includes/images/right-arrow.png"', __FILE__ ); ?>"
|
940 |
-
class="mo2f_advanced_options_images"/>
|
941 |
-
|
942 |
-
<p class="mo2f_heading_style"><?php echo mo2f_lt( 'Customizations' ); ?></p>
|
943 |
-
</a>
|
944 |
-
</div>
|
945 |
-
|
946 |
-
|
947 |
-
<div id="customizations" style="margin-left: 5%;">
|
948 |
-
|
949 |
-
<p style="font-size:15px;font-weight:bold">1. <?php echo mo2f_lt( 'Login Screen Options' ); ?></p>
|
950 |
-
<div>
|
951 |
-
<ul style="margin-left:4%" class="mo2f_ol">
|
952 |
-
<li><?php echo mo2f_lt( 'Login with Wordpress username/password and 2nd Factor' ); ?> <a
|
953 |
-
class="btn btn-link" data-toggle="collapse" id="showpreview1" href="#preview7"
|
954 |
-
aria-expanded="false">[ <?php echo mo2f_lt( 'See Preview' ); ?>
|
955 |
-
]</a>
|
956 |
-
<div class="mo2f_collapse" id="preview7" style="height:300px;">
|
957 |
-
<center><br>
|
958 |
-
<img style="height:300px;"
|
959 |
-
src="https://auth.miniorange.com/moas/images/help/login-help-1.png">
|
960 |
-
</center>
|
961 |
-
|
962 |
-
</div>
|
963 |
-
</li>
|
964 |
-
<li><?php echo mo2f_lt( 'Login with Wordpress username and 2nd Factor only' ); ?> <a
|
965 |
-
class="btn btn-link" data-toggle="collapse" id="showpreview2" href="#preview6"
|
966 |
-
aria-expanded="false">[ <?php echo mo2f_lt( 'See Preview' ); ?>
|
967 |
-
]</a>
|
968 |
-
<br>
|
969 |
-
<div class="mo2f_collapse" id="preview6" style="height:300px;">
|
970 |
-
<center><br>
|
971 |
-
<img style="height:300px;"
|
972 |
-
src="https://auth.miniorange.com/moas/images/help/login-help-3.png">
|
973 |
-
</center>
|
974 |
-
</div>
|
975 |
-
<br>
|
976 |
-
</li>
|
977 |
-
</ul>
|
978 |
-
|
979 |
-
|
980 |
-
</div>
|
981 |
-
<br>
|
982 |
-
<p style="font-size:15px;font-weight:bold">2. <?php echo mo2f_lt( 'Custom Redirect URLs' ); ?></p>
|
983 |
-
<p style="margin-left:4%"><?php echo mo2f_lt( 'Enable Custom Relay state URL\'s (based on user roles in Wordpress) to which the users
|
984 |
-
will get redirected to, after the 2-factor authentication' ); ?>'.</p>
|
985 |
-
|
986 |
-
|
987 |
-
<br>
|
988 |
-
<p style="font-size:15px;font-weight:bold">3. <?php echo mo2f_lt( 'Custom Security Questions (KBA)' ); ?></p>
|
989 |
-
<div id="mo2f_customKBAQuestions1">
|
990 |
-
<p style="margin-left:4%"><?php echo mo2f_lt( 'Add up to 16 Custom Security Questions for Knowledge based authentication (KBA).
|
991 |
-
You also have the option to select how many standard and custom questions should be shown to the
|
992 |
-
users' ); ?>.</p>
|
993 |
-
|
994 |
-
</div>
|
995 |
-
<br>
|
996 |
-
<p style="font-size:15px;font-weight:bold">
|
997 |
-
4. <?php echo mo2f_lt( 'Custom account name in Google Authenticator App' ); ?></p>
|
998 |
-
<div id="mo2f_editGoogleAuthenticatorAccountName1">
|
999 |
-
|
1000 |
-
<p style="margin-left:4%"><?php echo mo2f_lt( 'Customize the Account name in the Google Authenticator App' ); ?>
|
1001 |
-
.</p>
|
1002 |
-
|
1003 |
-
</div>
|
1004 |
-
<br>
|
1005 |
-
</div>
|
1006 |
-
<div id="standard_premium_options" style="text-align: center;">
|
1007 |
-
<p style="font-size:22px;color:darkorange;padding:10px;"><?php echo mo2f_lt( 'Features in the Premium Plan' ); ?></p>
|
1008 |
-
|
1009 |
-
</div>
|
1010 |
-
<hr>
|
1011 |
-
<div>
|
1012 |
-
<a class="mo2f_view_customizations_prem" onclick="show_customizations_prem()">
|
1013 |
-
<img src="<?php echo plugins_url( 'includes/images/right-arrow.png"', __FILE__ ); ?>"
|
1014 |
-
class="mo2f_advanced_options_images"/>
|
1015 |
-
|
1016 |
-
<p class="mo2f_heading_style"><?php echo mo2f_lt( 'Customizations' ); ?></p>
|
1017 |
-
</a>
|
1018 |
-
</div>
|
1019 |
-
|
1020 |
-
|
1021 |
-
<div id="customizations_prem" style="margin-left: 5%;">
|
1022 |
-
|
1023 |
-
<p style="font-size:15px;font-weight:bold">1. <?php echo mo2f_lt( 'Login Screen Options' ); ?></p>
|
1024 |
-
<div>
|
1025 |
-
<ul style="margin-left:4%" class="mo2f_ol">
|
1026 |
-
<li><?php echo mo2f_lt( 'Login with Wordpress username/password and 2nd Factor' ); ?> <a
|
1027 |
-
class="btn btn-link" data-toggle="collapse" id="showpreview1" href="#preview3"
|
1028 |
-
aria-expanded="false">[ <?php echo mo2f_lt( 'See Preview' ); ?>
|
1029 |
-
]</a>
|
1030 |
-
<div class="mo2f_collapse" id="preview3" style="height:300px;">
|
1031 |
-
<center><br>
|
1032 |
-
<img style="height:300px;"
|
1033 |
-
src="https://auth.miniorange.com/moas/images/help/login-help-1.png">
|
1034 |
-
</center>
|
1035 |
-
|
1036 |
-
</div>
|
1037 |
-
<br></li>
|
1038 |
-
<li><?php echo mo2f_lt( 'Login with Wordpress username and 2nd Factor only' ); ?> <a
|
1039 |
-
class="btn btn-link" data-toggle="collapse" id="showpreview2" href="#preview4"
|
1040 |
-
aria-expanded="false">[ <?php echo mo2f_lt( 'See Preview' ); ?>
|
1041 |
-
]</a>
|
1042 |
-
<br>
|
1043 |
-
<div class="mo2f_collapse" id="preview4" style="height:300px;">
|
1044 |
-
<center><br>
|
1045 |
-
<img style="height:300px;"
|
1046 |
-
src="https://auth.miniorange.com/moas/images/help/login-help-3.png">
|
1047 |
-
</center>
|
1048 |
-
</div>
|
1049 |
-
<br>
|
1050 |
-
</li>
|
1051 |
-
</ul>
|
1052 |
-
|
1053 |
-
|
1054 |
-
</div>
|
1055 |
-
<br>
|
1056 |
-
<p style="font-size:15px;font-weight:bold">2. <?php echo mo2f_lt( 'Custom Redirect URLs' ); ?></p>
|
1057 |
-
<p style="margin-left:4%"><?php echo mo2f_lt( 'Enable Custom Relay state URL\'s (based on user roles in Wordpress) to which the users
|
1058 |
-
will get redirected to, after the 2-factor authentication' ); ?>'.</p>
|
1059 |
-
|
1060 |
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
|
1068 |
-
|
1069 |
-
|
1070 |
-
<p style="font-size:15px;font-weight:bold">
|
1071 |
-
4. <?php echo mo2f_lt( 'Custom account name in Google Authenticator App' ); ?></p>
|
1072 |
-
<div id="mo2f_editGoogleAuthenticatorAccountName1">
|
1073 |
|
1074 |
-
|
1075 |
-
|
1076 |
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
<a class="mo2f_view_backup_options_prem" onclick="show_backup_options_prem()">
|
1082 |
-
<img src="<?php echo plugins_url( 'includes/images/right-arrow.png"', __FILE__ ); ?>"
|
1083 |
-
class="mo2f_advanced_options_images"/>
|
1084 |
|
1085 |
-
|
1086 |
-
|
|
|
1087 |
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
<div class="mo2f_advanced_options_note"><p style="padding:5px;">
|
1092 |
-
<i><?php echo mo2f_lt( 'Use these backup options to login to your site in case your
|
1093 |
-
phone is lost / not accessible or if you are not able to login using your primary
|
1094 |
-
authentication method.' ); ?></i></p></div>
|
1095 |
-
|
1096 |
-
<ol class="mo2f_ol">
|
1097 |
-
<li><?php echo mo2f_lt( 'KBA (Security Questions)' ); ?></li>
|
1098 |
-
<li><?php echo mo2f_lt( 'OTP Over Email' ); ?></li>
|
1099 |
-
<li><?php echo mo2f_lt( 'Backup Codes' ); ?></li>
|
1100 |
-
</ol>
|
1101 |
-
|
1102 |
-
</div>
|
1103 |
-
|
1104 |
-
|
1105 |
-
<div>
|
1106 |
-
<a class="mo2f_view_inline_registration_options" onclick="show_inline_registration_options()">
|
1107 |
-
<img src="<?php echo plugins_url( 'includes/images/right-arrow.png"', __FILE__ ); ?>"
|
1108 |
-
class="mo2f_advanced_options_images"/>
|
1109 |
-
<p class="mo2f_heading_style"><?php echo mo2f_lt( 'Inline Registration Options' ); ?></p>
|
1110 |
-
</a>
|
1111 |
-
</div>
|
1112 |
-
|
1113 |
-
|
1114 |
-
<div id="inline_registration_options" style="margin-left: 5%;">
|
1115 |
-
|
1116 |
-
<div class="mo2f_advanced_options_note"><p style="padding:5px;">
|
1117 |
-
<i><?php echo mo2f_lt( 'Inline Registration is the registration process the users go through the first time they
|
1118 |
-
setup 2FA.' ); ?><br>
|
1119 |
-
<?php echo mo2f_lt( 'If Inline Registration is enabled by the admin for the users, the next time
|
1120 |
-
the users login to the website, they will be prompted to set up the 2FA of their choice by
|
1121 |
-
creating an account with miniOrange.' ); ?>
|
1122 |
-
|
1123 |
-
|
1124 |
-
</i></p></div>
|
1125 |
-
|
1126 |
-
|
1127 |
-
<p style="font-size:15px;font-weight:bold"><?php echo mo2f_lt( 'Features' ) ?>:</p>
|
1128 |
-
<ol style="margin-left: 5%" class="mo2f_ol">
|
1129 |
-
<li><?php echo mo2f_lt( 'Invoke 2FA Registration & Setup for Users during first-time login (Inline Registration)' ); ?>
|
1130 |
-
</li>
|
1131 |
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1145 |
|
1146 |
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
|
1155 |
-
|
1156 |
|
1157 |
-
|
1158 |
-
|
1159 |
|
1160 |
|
1161 |
-
|
1162 |
|
1163 |
-
|
1164 |
-
|
1165 |
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
|
1172 |
|
1173 |
-
|
1174 |
|
1175 |
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
|
1180 |
|
1181 |
-
|
1182 |
-
|
|
|
|
|
1183 |
<?php
|
1184 |
}
|
1185 |
|
@@ -1239,6 +1419,7 @@ function mo2f_show_verify_password_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();
|
@@ -1246,4 +1427,5 @@ function mo2f_show_verify_password_page() {
|
|
1246 |
|
1247 |
</script>
|
1248 |
|
1249 |
-
<?php }
|
|
2 |
function mo_2_factor_register( $user ) {
|
3 |
global $Mo2fdbQueries;
|
4 |
if ( mo_2factor_is_curl_installed() == 0 ) { ?>
|
5 |
+
<p style="color:red;">(<?php echo mo2f_lt( 'Warning:' ); ?>
|
6 |
+
<a href="http://php.net/manual/en/curl.installation.php" target="_blank"><?php echo mo2f_lt( 'PHP CURL extension' ); ?></a> <?php echo mo2f_lt( 'is not installed or disabled' ); ?>)
|
7 |
+
</p>
|
|
|
8 |
<?php
|
9 |
}
|
10 |
|
11 |
if ( version_compare( PHP_VERSION, '5.3.0' ) < 0 ) {
|
12 |
?>
|
13 |
+
<p style="color:red;"><b><span style="font-size:18px;">(<?php echo mo2f_lt( 'Warning:' ); ?></span></b> <?php echo mo2f_lt( 'Your current PHP version is ' ); ?><?php echo PHP_VERSION; ?> . <?php echo mo2f_lt( 'Some of the functionality of the plugin may not work in this version of PHP. Please upgrade your PHP version to 5.3.0 or above.' ); ?>
|
14 |
+
|
|
|
15 |
<br> <?php echo mo2f_lt( 'You can also write us by submitting a query on the right hand side in our ' ); ?>
|
16 |
<b><?php echo mo2f_lt( 'Support Section' ); ?></b>. )</p>
|
17 |
<?php
|
26 |
|
27 |
$mo2f_active_tab = isset( $_GET['mo2f_tab'] ) ? $_GET['mo2f_tab'] : $default_tab ;
|
28 |
$mo_2factor_user_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $user->ID );
|
29 |
+
$account_tab_name = ( in_array( $mo_2factor_user_registration_status, array('MO_2_FACTOR_INITIALIZE_MOBILE_REGISTRATION','MO_2_FACTOR_PLUGIN_SETTINGS') ) ) ? mo2f_lt( 'User Profile' ) : mo2f_lt( 'Account Setup' );
|
30 |
+
$mo2f_sub_active_tab = isset( $_GET['mo2f_sub_tab'] ) ? $_GET['mo2f_sub_tab'] : $default_tab ;
|
31 |
+
|
32 |
+
$mo2fa_tab='mo2f_ns';
|
33 |
+
|
34 |
+
if($mo2f_active_tab=="mobile_configure"||$mo2f_active_tab=="mo2f_support"||$mo2f_active_tab=="mo2f_addon"||$mo2f_active_tab=="2factor_setup"|| $mo2f_active_tab=="mo2f_login"||$mo2f_active_tab=="proxy_setup"){
|
35 |
+
$mo2fa_tab='2fa';
|
36 |
+
}
|
37 |
+
$session_variables = array( 'mo2f_google_auth', 'mo2f_authy_keys', 'mo2f_mobile_support' );
|
38 |
|
39 |
?>
|
|
|
40 |
<div class="wrap">
|
41 |
+
<div style="display:block;font-size:23px;line-height:29px;">
|
42 |
+
<a id="mo2f_home" class="add-new-h2" href="admin.php?page=miniOrange_2_factor_settings" ><?php echo mo2f_lt( 'Home' ); ?></a>
|
43 |
+
<a id="mo2f_account" href="admin.php?page=miniOrange_2_factor_settings&mo2f_tab=2factor_setup" class="add-new-h2" <?php echo $mo2f_active_tab == '2factor_setup' ? 'nav-tab-active' : ''; ?> id="mo2f_tab1" > <?php echo $account_tab_name; ?></a>
|
44 |
+
<a id="mo2f_faq" class="add-new-h2" href="https://wordpress.org/support/plugin/miniorange-2-factor-authentication" 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" href="admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mo2f_pricing"
|
|
|
|
|
|
|
|
|
|
|
47 |
><?php echo mo2f_lt( 'Upgrade to Standard/Premium Plans' ); ?></a>
|
48 |
|
49 |
<?php } ?>
|
51 |
</div>
|
52 |
|
53 |
</div>
|
54 |
+
<div id="messages"></div>
|
55 |
+
<?php echo mo2f_fixed_support();?>
|
56 |
+
<div >
|
57 |
+
<button id="mo2f_faq" class="add-new-h2 mo2f_fixed_support" data-show="false" style="float:right;background-color:#ffba00;color:black;width:13%;
|
58 |
+
font-size: 17px;" onclick="mo2f_opensupport()" ><?php echo mo2f_lt( 'NEED HELP?' ); ?></span>
|
59 |
+
</button>
|
60 |
+
</div>
|
61 |
+
<?php
|
62 |
+
if ( $can_display_admin_features && $mo2f_active_tab == 'mo2f_pricing' ) {
|
63 |
+
MO2f_Utility::unset_session_variables( $session_variables );
|
64 |
+
show_2_factor_pricing_page( $user );
|
65 |
+
exit;
|
66 |
+
}
|
67 |
+
?>
|
68 |
+
<div class="mo2f_container">
|
69 |
+
<div style="display: inline-flex; width: 100%;">
|
70 |
+
<div class="tab" style="height:54px;margin-top: 9px;border-bottom: 0px;text-align:center;border-radius: 15px 0px 0px 0px;width: 15%;">
|
71 |
+
<div><img style="float:left;margin-left:8px;width: 43px;height: 45px;padding-top: 5px;" src="<?php echo plugins_url( 'includes/images/logo.png"', __FILE__ ); ?>"></div>
|
72 |
+
<br>
|
73 |
+
<span style="font-size:20px;color:white;float:left;">miniOrange</span>
|
74 |
+
</div>
|
75 |
+
<div id="tab" class="nav-tab-wrapper" style="border: 0px;width: 85%;">
|
76 |
+
<div class="" style="display: inline-flex;width: 100%;">
|
77 |
+
<a href="admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mobile_configure" style="text-align: center;height:54px;width:50%;margin: 0;line-height: 3;" class="nav-tab <?php echo $mo2fa_tab=='2fa' ? 'nav-tab-active' : ''; ?>" id="mo2f_tab3"><?php echo mo2f_lt( 'Two Factor Authentication' ); ?></a>
|
78 |
+
<?php if ( $can_display_admin_features ) { ?>
|
79 |
+
|
80 |
+
<a href="admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mo2f_network&mo2f_sub_tab=mo2f_limit"
|
81 |
+
style="text-align: center;height:54px;width:50%;margin: 0;line-height: 3;" class="nav-tab <?php echo $mo2f_active_tab == 'mo2f_network' ? 'nav-tab-active' : ''; ?>"
|
82 |
+
id="mo2f_tab4"><?php echo mo2f_lt( 'Network Security' ); ?></a><?php } ?>
|
83 |
+
</div>
|
84 |
+
</div>
|
85 |
+
</div>
|
86 |
+
<div >
|
87 |
+
<div class="tab" style="min-height:350px;border-radius: 0px 0px 0px 15px; height: 350px">
|
88 |
+
<span class="tooltiptext"></span>
|
89 |
+
<?php if ( $mo2fa_tab=='2fa') {?>
|
90 |
+
<a href="admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mobile_configure" class="tablinks <?php echo $mo2f_active_tab == 'mobile_configure' ? 'active' : ''; ?>" id="mo2f_tab3"><?php echo mo2f_lt( 'Setup Two-Factor' ); ?></a>
|
91 |
+
<?php if ( $can_display_admin_features ) { ?>
|
92 |
+
<?php if ( get_option( 'mo2f_is_NC' ) ) { ?>
|
93 |
+
<a href="admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mo2f_addon&mo2f_sub_tab=mo2f_sub_tab_rba" class="tablinks <?php echo $mo2f_active_tab == 'mo2f_addon' ? 'active' : ''; ?>" id="mo2f_tab4"><?php echo mo2f_lt( 'Add-ons' ); ?></a><?php }
|
94 |
+
if( ! get_option('mo2f_is_NC') ) { ?><a href="admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mo2f_login"
|
95 |
+
class="tablinks <?php echo $mo2f_active_tab == 'mo2f_login' ? 'active' : ''; ?>"
|
96 |
+
id="mo2f_tab2"><?php echo mo2f_lt( 'Login Options' ); ?></a>
|
97 |
+
<?php } ?>
|
98 |
+
<a href="admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mo2f_support"
|
99 |
+
class="tablinks <?php echo $mo2f_active_tab == 'mo2f_support' ? ' active' : ''; ?>"
|
100 |
+
id="mo2f_tab7"><?php echo mo2f_lt( 'Support' ) ; ?></a>
|
101 |
+
|
102 |
+
<?php }//mo2f_network
|
103 |
+
} else{ ?>
|
104 |
+
<a href="admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mo2f_network&mo2f_sub_tab=mo2f_limit" class="tablinks <?php echo $mo2f_sub_active_tab == 'mo2f_limit' ? ' active' : ''; ?>" id="mo2f_tab7"><?php echo mo2f_lt( 'Brute Force' ) ; ?></a>
|
105 |
+
|
106 |
+
<a href="admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mo2f_network&mo2f_sub_tab=show_2_factor_ip_block" class="tablinks <?php echo $mo2f_sub_active_tab == 'show_2_factor_ip_block' ? 'active' : ''; ?>" id="mo2f_tab4"><?php echo mo2f_lt( 'Blocking' ); ?></a>
|
107 |
+
<a href="admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mo2f_network&mo2f_sub_tab=mo2f_monitor" class="tablinks <?php echo $mo2f_sub_active_tab == 'mo2f_monitor' ? 'active' : ''; ?>" id="mo2f_tab3"><?php echo mo2f_lt( 'Monitoring' ); ?></a>
|
108 |
+
|
109 |
+
<?php
|
110 |
+
} ?>
|
111 |
+
</div>
|
112 |
+
<div id="mo2f_left_navigation" class="tabcontent">
|
113 |
+
<table style="border-spacing:0px;">
|
114 |
+
<tr>
|
115 |
+
<td style="width:70%;vertical-align:top;">
|
116 |
+
<?php
|
117 |
+
/* to update the status of existing customers for adding their user registration status */
|
118 |
+
if ( get_option( 'mo_2factor_admin_registration_status' ) == 'MO_2_FACTOR_CUSTOMER_REGISTERED_SUCCESS' && get_option( 'mo2f_miniorange_admin' ) == $user->ID ) {
|
119 |
+
$Mo2fdbQueries->update_user_details( $user->ID, array( 'user_registration_with_miniorange' => 'SUCCESS' ) );
|
120 |
+
}
|
121 |
+
/* ----------------------------------------- */
|
122 |
+
$session_variables = array( 'mo2f_google_auth', 'mo2f_authy_keys', 'mo2f_mobile_support' );
|
123 |
+
if ( $mo2f_active_tab == 'mobile_configure' ) {
|
124 |
+
$mo2f_second_factor = mo2f_get_activated_second_factor( $user );
|
125 |
+
mo2f_select_2_factor_method( $user, $mo2f_second_factor );
|
126 |
+
} else if ( $can_display_admin_features && $mo2f_sub_active_tab == 'mo2f_limit' ) {
|
127 |
+
MO2f_Utility::unset_session_variables( $session_variables );
|
128 |
+
do_action('mo2f_network_view_brute_force',$user);
|
129 |
+
// show_2_factor_login_security($user);
|
130 |
+
} else if ( $can_display_admin_features && ($mo2f_sub_active_tab == 'show_2_factor_ip_block' ||$mo2f_sub_active_tab == 'mo2f_ip' )) {
|
131 |
+
MO2f_Utility::unset_session_variables( $session_variables );
|
132 |
+
// show_2_factor_ip_block($user);
|
133 |
+
do_action('mo2f_network_view_ip_blocking',$user);
|
134 |
+
} else if ( $can_display_admin_features && $mo2f_active_tab == 'mo2f_support' ) {
|
135 |
+
MO2f_Utility::unset_session_variables( $session_variables );
|
136 |
+
mo2f_support();
|
137 |
+
} else if ( $can_display_admin_features && $mo2f_active_tab == 'proxy_setup' ) {
|
138 |
+
MO2f_Utility::unset_session_variables( $session_variables );
|
139 |
+
show_2_factor_proxy_setup( $user );
|
140 |
+
}else if ( $can_display_admin_features && $mo2f_sub_active_tab == 'mo2f_monitor' ) {
|
141 |
+
MO2f_Utility::unset_session_variables( $session_variables );
|
142 |
+
//show_2_factor_user_login_reports( $user );
|
143 |
+
do_action('mo2f_network_view_monitoring',$user);
|
144 |
+
}else if ( $can_display_admin_features && $mo2f_active_tab == 'mo2f_login' ) {
|
145 |
+
MO2f_Utility::unset_session_variables( $session_variables );
|
146 |
+
show_2_factor_login_settings( $user );
|
147 |
+
} else if ( $can_display_admin_features && $mo2f_active_tab == 'mo2f_addon' ) {
|
148 |
+
MO2f_Utility::unset_session_variables( $session_variables );
|
149 |
+
show_2_factor_addons( $user );
|
150 |
+
do_action( 'mo2f_new_addon' );
|
151 |
+
} else if ( $can_display_admin_features && $mo2f_active_tab == 'mo2f_pricing' ) {
|
152 |
+
MO2f_Utility::unset_session_variables( $session_variables );
|
153 |
+
show_2_factor_pricing_page( $user );
|
154 |
+
}else {
|
155 |
+
MO2f_Utility::unset_session_variables( $session_variables );
|
156 |
+
|
157 |
+
if ( get_option( 'mo_2factor_admin_registration_status' ) == 'MO_2_FACTOR_CUSTOMER_REGISTERED_SUCCESS' && get_option( 'mo2f_miniorange_admin' ) != $user->ID ) {
|
158 |
+
if ( in_array( $mo_2factor_user_registration_status, array(
|
159 |
+
'MO_2_FACTOR_OTP_DELIVERED_SUCCESS',
|
160 |
+
'MO_2_FACTOR_OTP_DELIVERED_FAILURE'
|
161 |
+
) ) ) {
|
162 |
+
mo2f_show_user_otp_validation_page(); // OTP over email validation page
|
163 |
+
} else if ( $mo_2factor_user_registration_status == 'MO_2_FACTOR_INITIALIZE_MOBILE_REGISTRATION' ) { //displaying user profile
|
164 |
+
$mo2f_second_factor = mo2f_get_activated_second_factor( $user );
|
165 |
+
mo2f_show_instruction_to_allusers( $user, $mo2f_second_factor );
|
166 |
+
} else if ( $mo_2factor_user_registration_status == 'MO_2_FACTOR_PLUGIN_SETTINGS' ) {
|
167 |
+
$mo2f_second_factor = mo2f_get_activated_second_factor( $user );
|
168 |
+
mo2f_show_instruction_to_allusers( $user, $mo2f_second_factor ); //displaying user profile
|
169 |
+
} else {
|
170 |
+
show_user_welcome_page( $user ); //Landing page for additional admin for registration
|
171 |
+
}
|
172 |
+
} else {
|
173 |
+
if ( in_array( $mo_2factor_user_registration_status, array(
|
174 |
+
'MO_2_FACTOR_OTP_DELIVERED_SUCCESS',
|
175 |
+
'MO_2_FACTOR_OTP_DELIVERED_FAILURE'
|
176 |
+
) ) ) {
|
177 |
+
mo2f_show_otp_validation_page( $user ); // OTP over email validation page for admin
|
178 |
+
} else if ( $mo_2factor_user_registration_status == 'MO_2_FACTOR_INITIALIZE_MOBILE_REGISTRATION' ) { //displaying user profile
|
179 |
+
$mo2f_second_factor = mo2f_get_activated_second_factor( $user );
|
180 |
+
mo2f_show_instruction_to_allusers( $user, $mo2f_second_factor );
|
181 |
+
} else if ( $mo_2factor_user_registration_status == 'MO_2_FACTOR_PLUGIN_SETTINGS' ) {
|
182 |
+
$mo2f_second_factor = mo2f_get_activated_second_factor( $user );
|
183 |
+
mo2f_show_instruction_to_allusers( $user, $mo2f_second_factor ); //displaying user profile
|
184 |
+
|
185 |
+
} else if ( $mo_2factor_user_registration_status == 'MO_2_FACTOR_VERIFY_CUSTOMER' ) {
|
186 |
+
mo2f_show_verify_password_page(); //verify password page
|
187 |
+
} else if ( ! mo2f_is_customer_registered() ) {
|
188 |
+
delete_option( 'password_mismatch' );
|
189 |
+
mo2f_show_registration_page( $user ); //new registration page
|
190 |
+
}
|
191 |
+
}
|
192 |
+
}
|
193 |
+
?>
|
194 |
+
</td>
|
195 |
+
</tr>
|
196 |
+
</table>
|
197 |
+
</div>
|
198 |
+
</div>
|
199 |
+
</div>
|
200 |
+
<?php
|
201 |
+
}
|
202 |
|
203 |
+
function mo2f_fixed_support(){
|
204 |
+
global $user;
|
205 |
+
global $Mo2fdbQueries;
|
206 |
+
$user = wp_get_current_user();
|
207 |
+
$email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
|
208 |
+
$phone = $Mo2fdbQueries->get_user_detail( 'mo2f_user_phone', $user->ID );
|
209 |
+
$user_email = $email ? $email : $user->user_email;
|
210 |
+
$user_phone = $phone != 'false' ? $phone : '';?>
|
211 |
+
<style>
|
212 |
+
.mo2f_backdrop{
|
213 |
+
top: 0;
|
214 |
+
left: 0;
|
215 |
+
position: fixed;
|
216 |
+
width: 100% !important;
|
217 |
+
background-color: #000 !important;
|
218 |
+
opacity: 0.96 !important;
|
219 |
+
height: 100% !important;
|
220 |
+
z-index: 99999;
|
221 |
+
}
|
222 |
+
</style>
|
223 |
+
<div class="mo2f_backdrop" id="mo2f_backdrop" hidden>
|
224 |
+
<div class="mo2f_support_layout" id="mo2f_support_layout" hidden>
|
225 |
|
226 |
+
<h3><?php echo mo2f_lt( 'Support' ); ?>
|
227 |
+
<a id="mo2f_faq" class="add-new-h2" href="https://wordpress.org/support/plugin/miniorange-2-factor-authentication"
|
228 |
+
target="_blank" style="float:right"><?php echo mo2f_lt( 'Ask questions on the WP Forum' ); ?></a>
|
229 |
+
<a id="mo2f_faq" class="add-new-h2" href="https://faq.miniorange.com/kb/two-factor-authentication"
|
230 |
+
target="_blank" style="float:right"><?php echo mo2f_lt( 'FAQ' ); ?></a>
|
231 |
+
</h3>
|
232 |
+
<hr width="100%">
|
233 |
+
<br>
|
234 |
+
<form name="f" method="post" action="">
|
235 |
+
<div><?php echo mo2f_lt( 'Shoot us a query and we will get back to you.' ); ?> </div>
|
236 |
+
<br>
|
237 |
+
<div><?php echo mo2f_lt( 'Have a look at these FAQ\'s to see if your question has been answered already! ' ); ?>
|
238 |
+
<a href="https://faq.miniorange.com/kb/two-factor-authentication" target="_blank"><b>Frequently Asked
|
239 |
+
Questions.</b></a>
|
240 |
+
</div>
|
241 |
+
|
242 |
+
<br>
|
243 |
+
<div>
|
244 |
+
<table style="width:95%;">
|
245 |
+
<tr>
|
246 |
+
<td>
|
247 |
+
<input type="email" class="mo2f_table_textbox" id="EMAIL_MANDATORY" name="EMAIL_MANDATORY"
|
248 |
+
value="<?php echo $user_email ?>"
|
249 |
+
placeholder="Enter your email" required="true"/>
|
250 |
+
</td>
|
251 |
+
</tr>
|
252 |
+
<tr>
|
253 |
+
<td>
|
254 |
+
<input type="text" class="mo2f_table_textbox" style="width:100% !important;"
|
255 |
+
name="query_phone" id="query_phone"
|
256 |
+
value="<?php echo $user_phone; ?>"
|
257 |
+
placeholder="Enter your phone"/>
|
258 |
+
</td>
|
259 |
+
|
260 |
+
</tr>
|
261 |
+
<tr>
|
262 |
+
<td>
|
263 |
+
<textarea id="query" name="query" cols="52" rows="7"
|
264 |
+
style="resize: vertical;width:100%;height:143px;"
|
265 |
+
onkeyup="mo2f_valid(this)" onblur="mo2f_valid(this)" onkeypress="mo2f_valid(this)"
|
266 |
+
placeholder="<?php echo mo2f_lt( 'Your query here...' ); ?>"></textarea>
|
267 |
+
</td>
|
268 |
+
</tr>
|
269 |
+
</table>
|
270 |
+
</div>
|
271 |
+
<br>
|
272 |
+
<input type="hidden" name="option" value="mo_2factor_send_query"/>
|
273 |
+
<input type="hidden" name="mo_2factor_send_query_nonce"
|
274 |
+
value="<?php echo wp_create_nonce( "mo-2factor-send-query-nonce" ) ?>"/>
|
275 |
+
<input type="submit" name="send_query" id="send_query"
|
276 |
+
value="<?php echo mo2f_lt( 'Submit Query' ); ?>"
|
277 |
+
style="float:left;" class="button button-primary button-large"/>
|
278 |
+
<button type="button" class="button button-primary button-large" style="margin-left:2%;" onclick="mo2f_closesupport()">Close</button>
|
279 |
+
<br><br>
|
280 |
+
</form>
|
281 |
+
<br>
|
282 |
</div>
|
283 |
+
<br>
|
284 |
+
</div>
|
285 |
+
<script>
|
286 |
+
jQuery("#query_phone").intlTelInput();
|
287 |
+
var mo2f_backdrop = document.getElementById('mo2f_backdrop');
|
288 |
+
// hide if clicked in
|
289 |
+
window.onclick = function (event) {
|
290 |
+
if (event.target == mo2f_backdrop) {
|
291 |
+
mo2f_closesupport();
|
292 |
+
}
|
293 |
+
}
|
294 |
+
function mo2f_opensupport() {
|
295 |
|
296 |
+
document.getElementById("mo2f_backdrop").style.display = "block";
|
297 |
+
jQuery("#mo2f_support_layout").slideToggle(400, function() {
|
298 |
+
document.getElementById("mo2f_support_layout").style.display = "block";
|
299 |
+
});
|
300 |
+
}
|
301 |
|
302 |
+
function mo2f_closesupport() {
|
303 |
+
jQuery("#mo2f_support_layout").slideToggle(400, function() {
|
304 |
+
document.getElementById("mo2f_support_layout").style.display = "none";
|
305 |
+
document.getElementById("mo2f_backdrop").style.display = "none";
|
306 |
+
});
|
307 |
+
}
|
308 |
+
</script>
|
309 |
+
<?php
|
310 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
311 |
|
312 |
+
function show_2_factor_enforce_password() {
|
313 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
314 |
|
315 |
+
<div class="mo2f_image_container" style="background: white;border:0px;"><br>
|
316 |
+
<div style="text-align: center;"><b ><span class="impt">*</span><?php echo mo2f_lt( 'This Features are only enable for Premium/Standard Users to use this features upgrade to ' ); ?><a href="admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mo2f_pricing"" target="_blank"><b style="text-decoration: underline;color: red">Premium/Standard</b> </a>Plan.
|
317 |
+
</b></div><br>
|
318 |
+
<img style="float:left;width:100%; opacity: 0.7;" src="<?php echo plugins_url( 'includes/images/enforce_password.png"', __FILE__ ); ?>">
|
319 |
+
|
320 |
+
</div>
|
321 |
+
|
322 |
+
<?php }
|
|
|
|
|
|
|
|
|
|
|
323 |
|
324 |
function mo2f_show_registration_page( $user ) {
|
325 |
global $Mo2fdbQueries;
|
326 |
$mo2f_active_tab = isset( $_GET['mo2f_tab'] ) ? $_GET['mo2f_tab'] : '';
|
327 |
$is_registration = ($mo2f_active_tab =='2factor_setup') ? true : false;
|
328 |
?>
|
|
|
329 |
<!--Register with miniOrange-->
|
330 |
<form name="f" method="post" action="">
|
331 |
<input type="hidden" name="option" value="mo_auth_register_customer"/>
|
332 |
<input type="hidden" name="miniorange_register_customer_nonce"
|
333 |
value="<?php echo wp_create_nonce( "miniorange-register-customer-nonce" ) ?>"/>
|
334 |
+
<div <?php if($is_registration) { ?>class="mo2f_proxy_setup" style="width:100%;"<?php } ?>>
|
335 |
<?php if($is_registration) { ?>
|
336 |
<h3><span><?php echo mo2f_lt( 'Register with miniOrange' ); ?></span></h3><hr>
|
337 |
<?php } ?>
|
454 |
|
455 |
<?php
|
456 |
}
|
457 |
+
function mo2f_rba_description($mo2f_user_email) {?>
|
458 |
+
<div id="mo2f_rba_addon">
|
459 |
+
<?php if ( get_option( 'mo2f_rba_installed' ) ) { ?>
|
|
|
|
|
460 |
<a href="<?php echo admin_url(); ?>plugins.php" id="mo2f_activate_rba_addon"
|
461 |
class="button button-primary button-large"
|
462 |
style="float:right; margin-top:2%;"><?php echo __( 'Activate Plugin', 'miniorange-2-factor-authentication' ); ?></a>
|
463 |
+
<?php } ?>
|
464 |
+
<?php if ( ! get_option( 'mo2f_rba_purchased' ) ) { ?>
|
465 |
<a onclick="mo2f_addonform('wp_2fa_addon_rba')" id="mo2f_purchase_rba_addon"
|
466 |
class="button button-primary button-large"
|
467 |
style="margin-right:2%;margin-top:2%;float:right;"><?php echo __( 'Purchase', 'miniorange-2-factor-authentication' ); ?></a><?php } ?>
|
|
|
468 |
<div id="mo2f_rba_addon_hide"><h3 id="toggle_rba_description"
|
469 |
class="mo2f_pointer"><?php echo __( 'Description', 'miniorange-2-factor-authentication' ); ?> </h3>
|
470 |
<p id="rba_description" style="margin:2% 2% 2% 4%">
|
471 |
+
<?php echo __( 'This Add-On helps you in remembering the device, in which case you will not be prompted for the 2-factor authentication
|
472 |
+
if you login from the remembered device again. You can also decide the number of devices that can be remembered. Users can also be restricted access to the site based on the IP address they are logging in from.', 'miniorange-2-factor-authentication' ); ?>
|
473 |
</p>
|
474 |
<br>
|
475 |
<div id="mo2f_hide_rba_content">
|
494 |
<h3><?php echo __( 'IP Restriction: Limit users to login from specific IPs', 'miniorange-2-factor-authentication' ); ?></h3>
|
495 |
<hr>
|
496 |
<p><?php echo __( 'The Admin can enable IP restrictions for the users. It will provide additional security to the accounts and perform different action to the accounts only from the listed IP Ranges. If user tries to access with a restricted IP, Admin can set three action: Allow, challenge or deny. Depending upon the action it will allow the user to login, challenge(prompt) for authentication or deny the access.', 'miniorange-2-factor-authentication' ); ?>
|
497 |
+
|
498 |
</div>
|
499 |
+
<br>
|
500 |
</div>
|
501 |
|
502 |
</div>
|
503 |
+
<div id="mo2f_rba_addon_show">
|
504 |
+
<?php $x = apply_filters( 'mo2f_rba', "rba" );?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
|
506 |
+
</div>
|
507 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
508 |
|
509 |
<form style="display:none;" id="mo2fa_loginform"
|
510 |
action="<?php echo get_option( 'mo2f_host_name' ) . '/moas/login'; ?>"
|
514 |
value="<?php echo get_option( 'mo2f_host_name' ) . '/moas/initializepayment'; ?>"/>
|
515 |
<input type="text" name="requestOrigin" id="requestOrigin"/>
|
516 |
</form>
|
|
|
517 |
<script>
|
518 |
function mo2f_addonform(planType) {
|
519 |
jQuery('#requestOrigin').val(planType);
|
520 |
jQuery('#mo2fa_loginform').submit();
|
521 |
}
|
522 |
</script>
|
523 |
+
<?php
|
524 |
+
}
|
525 |
|
526 |
+
function show_2_factor_addons( $current_user ) {
|
527 |
+
global $Mo2fdbQueries;
|
528 |
+
$mo2f_user_email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $current_user->ID );
|
529 |
+
$mo2f_active_sub_sub_tab = isset( $_GET['mo2f_sub_sub_tab'] ) ? $_GET['mo2f_sub_sub_tab'] : 'rba'; ?>
|
530 |
+
<div class="mo2f_table_layout" style="border:0px;width: 80%;">
|
531 |
+
<?php //echo mo2f_check_if_registered_with_miniorange( $current_user ); ?>
|
532 |
+
<div class="mo2f_vertical-submenu" style="text-align:justify;padding-left: 10px;">
|
533 |
+
<a id="defaultOpen" class="nav-tab" onclick="openPage('rba', this, '#4CAF50')"
|
534 |
+
><?php echo __( 'Risk Based Access', 'miniorange-2-factor-authentication' ); ?></a>
|
535 |
+
<a id="onclickOpen" class="nav-tab" onclick="openPage('personal', this, '#4CAF50')" ><?php echo __( 'Personalization', 'miniorange-2-factor-authentication' ); ?></a>
|
536 |
+
<a id="onclick" class="nav-tab" onclick="openPage('shortcode', this, '#4CAF50')" ><?php echo __( 'Shortcode', 'miniorange-2-factor-authentication' ); ?></a>
|
537 |
+
</div>
|
538 |
+
<br><br><br><br>
|
539 |
+
<div class="mo2f_addon_spacing">
|
540 |
+
<div id="rba" class="mo2f_addon">
|
541 |
+
<?php mo2f_rba_description($mo2f_user_email); ?>
|
542 |
+
</div>
|
543 |
+
|
544 |
+
<div id="personal" class="mo2f_addon">
|
545 |
+
<?php mo2f_personalization_description($mo2f_user_email);?>
|
546 |
+
<br>
|
547 |
+
</div>
|
548 |
+
|
549 |
+
<div id="shortcode" class="mo2f_addon">
|
550 |
+
<?php mo2f_shortcode_description($mo2f_user_email);?>
|
551 |
+
<br>
|
552 |
+
</div>
|
553 |
+
</div>
|
554 |
</div>
|
555 |
+
<script>
|
556 |
+
jQuery(document).ready(function()
|
557 |
+
{
|
558 |
+
sessionStorage.setItem("code", "rba");
|
559 |
+
});
|
560 |
+
function openPage(pageName,elmnt,color) {
|
561 |
+
var i, tabcontent, tablinks;
|
562 |
+
tabcontent = document.getElementsByClassName("mo2f_addon");
|
563 |
+
for (i = 0; i < tabcontent.length; i++) {
|
564 |
+
tabcontent[i].style.display = "none";
|
565 |
+
}
|
566 |
+
tablinks = document.getElementsByClassName("nav-tab");
|
567 |
+
for (i = 0; i < tablinks.length; i++) {
|
568 |
+
tablinks[i].style.backgroundColor = "";
|
569 |
+
}
|
570 |
+
document.getElementById(pageName).style.display = "block";
|
571 |
+
elmnt.style.backgroundColor = color;
|
572 |
+
sessionStorage.setItem("code", pageName);
|
573 |
+
}
|
574 |
|
575 |
+
// Get the element with id="defaultOpen" and click on it
|
576 |
+
if(sessionStorage.getItem("code")=='personal')
|
577 |
+
document.getElementById("onclickOpen").click();
|
578 |
+
else if(sessionStorage.getItem("code")=='shortcode')
|
579 |
+
document.getElementById("onclick").click();
|
580 |
+
else
|
581 |
+
document.getElementById("defaultOpen").click();
|
582 |
+
</script>
|
583 |
+
<?php
|
584 |
}
|
585 |
|
586 |
+
function mo2f_personalization_description($mo2f_user_email) {?>
|
587 |
+
<div id="mo2f_custom_addon">
|
588 |
+
<?php if ( get_option( 'mo2f_personalization_installed' ) ) { ?>
|
589 |
+
<a href="<?php echo admin_url(); ?>plugins.php" id="mo2f_activate_custom_addon"
|
590 |
+
class="button button-primary button-large"
|
591 |
+
style="float:right; margin-top:2%;"><?php echo __( 'Activate Plugin', 'miniorange-2-factor-authentication' ); ?></a>
|
592 |
+
<?php } ?>
|
593 |
+
<?php if ( ! get_option( 'mo2f_personalization_purchased' ) ) { ?> <a
|
594 |
+
onclick="mo2f_addonform('wp_2fa_addon_shortcode')" id="mo2f_purchase_custom_addon"
|
595 |
+
class="button button-primary button-large"
|
596 |
+
style="margin-right:2%;margin-top:2%;float:right;"><?php echo __( 'Purchase', 'miniorange-2-factor-authentication' ); ?></a>
|
597 |
+
<?php } ?>
|
598 |
+
<div id="mo2f_custom_addon_hide">
|
599 |
+
<h3 id="toggle_personalization_description" class="mo2f_pointer">
|
600 |
+
<?php echo __( 'Description', 'miniorange-2-factor-authentication' ); ?> </h3>
|
601 |
<p id="custom_description" style="margin:2% 2% 2% 4%">
|
602 |
+
<?php echo __( 'This Add-On helps you modify and redesign the login screen\'s UI, and various customizations in the plugin dashboard.
|
603 |
+
Along with customizing the plugin Icon and name, you can also customize the email and sms templates you and your users receive during authentication.', 'miniorange-2-factor-authentication' ); ?>
|
604 |
</p>
|
605 |
<br>
|
606 |
<div id="mo2f_hide_custom_content">
|
608 |
<h3><?php echo __( 'Customize Plugin Icon', 'miniorange-2-factor-authentication' ); ?></h3>
|
609 |
<hr>
|
610 |
<p>
|
611 |
+
<?php echo __( 'With this feature, you can customize the plugin icon in the dashboard which is useful when you want your custom logo to be displayed to the users.', 'miniorange-2-factor-authentication' ); ?>
|
612 |
</p>
|
613 |
<br>
|
614 |
<h3><?php echo __( 'Customize Plugin Name', 'miniorange-2-factor-authentication' ); ?></h3>
|
615 |
<hr>
|
616 |
<p>
|
617 |
+
<?php echo __( 'With this feature, you can customize the name of the plugin in the dashboard.', 'miniorange-2-factor-authentication' ); ?>
|
618 |
</p>
|
619 |
|
620 |
</div>
|
623 |
<h3><?php echo __( 'Customize UI of Login Pop up\'s', 'miniorange-2-factor-authentication' ); ?></h3>
|
624 |
<hr>
|
625 |
<p>
|
626 |
+
<?php echo __( 'With this feature, you can customize the login pop-ups during two factor authentication according to the theme of your website.', 'miniorange-2-factor-authentication' ); ?>
|
627 |
</p>
|
628 |
</div>
|
629 |
|
635 |
<p><?php echo __( 'You can change the templates for Email and SMS which user receives during authentication.', 'miniorange-2-factor-authentication' ); ?></p>
|
636 |
|
637 |
</div>
|
638 |
+
</div></div>
|
639 |
+
|
640 |
+
<div id="mo2f_custom_addon_show"><?php $x = apply_filters( 'mo2f_custom', "custom"); ?></div>
|
641 |
+
</div>
|
642 |
+
|
643 |
+
<?php
|
644 |
}
|
645 |
|
646 |
+
function mo2f_shortcode_description($mo2f_user_email) {
|
647 |
+
?>
|
648 |
+
<div id="mo2f_Shortcode_addon_hide">
|
649 |
+
<?php if ( get_option( 'mo2f_shortcode_installed' ) ) { ?>
|
650 |
+
<a href="<?php echo admin_url(); ?>plugins.php" id="mo2f_activate_shortcode_addon"
|
651 |
+
class="button button-primary button-large" style="float:right; margin-top:2%;"><?php echo __( 'Activate
|
652 |
+
Plugin', 'miniorange-2-factor-authentication' ); ?></a>
|
653 |
+
<?php } if ( ! get_option( 'mo2f_shortcode_purchased' ) ) { ?>
|
654 |
+
<a onclick="mo2f_addonform('wp_2fa_addon_personalization')" id="mo2f_purchase_shortcode_addon"
|
655 |
+
class="button button-primary button-large"
|
656 |
+
style="margin-right:2%;margin-top:2%;float:right;"><?php echo __( 'Purchase', 'miniorange-2-factor-authentication' ); ?></a>
|
657 |
+
<?php } ?>
|
658 |
+
<h3 id="toggle_shortcode_description" class="mo2f_pointer">
|
659 |
+
<div id="shortcode" class="description">
|
660 |
+
|
661 |
+
<?php echo __( 'Description ', 'miniorange-2-factor-authentication' ); ?></h3>
|
662 |
+
<p id="shortcode_description" style="margin:2% 2% 2% 4%">
|
663 |
+
<?php echo __( 'A shortcode is a WordPress-specific code that lets you do things with very little effort. Shortcodes can embed
|
664 |
ugly code in just one line. You can use these shortcodes on any custom page. Just include the shortcode on your page and boom!', 'miniorange-2-factor-authentication' ); ?>
|
665 |
</p>
|
666 |
<br>
|
667 |
|
668 |
+
<div id="mo2f_hide_shortcode_content" class="mo2f_box">
|
669 |
+
|
670 |
+
<h3><?php echo __( 'List of Shortcodes', 'miniorange-2-factor-authentication' ); ?>:</h3>
|
671 |
+
<hr>
|
672 |
+
|
673 |
+
<ol style="margin-left:2%">
|
674 |
+
<li><b><?php echo __( 'Enable Two Factor: ', 'miniorange-2-factor-authentication' ); ?></b> <?php echo __( 'This shortcode provides
|
675 |
+
an option to turn on/off 2-factor by user.', 'miniorange-2-factor-authentication' ); ?></li>
|
676 |
+
<li>
|
677 |
+
<b><?php echo __( 'Enable Reconfiguration: ', 'miniorange-2-factor-authentication' ); ?></b> <?php echo __( 'This shortcode provides an option to configure the Google Authenticator and Security Questions by user.', 'miniorange-2-factor-authentication' ); ?>
|
678 |
+
</li>
|
679 |
+
<li>
|
680 |
+
<b><?php echo __( 'Enable Remember Device: ', 'miniorange-2-factor-authentication' ); ?></b> <?php echo __( ' This shortcode provides
|
681 |
+
\'Enable Remember Device\' from your custom login form.', 'miniorange-2-factor-authentication' ); ?>
|
682 |
+
</li>
|
683 |
+
</ol>
|
684 |
+
|
685 |
+
</div>
|
686 |
+
|
687 |
+
<div id="mo2f_Shortcode_addon_show"><?php $x = apply_filters( 'mo2f_shortcode', "shortcode" ); ?></div>
|
688 |
+
</div>
|
689 |
+
|
690 |
+
<br>
|
691 |
</div>
|
692 |
+
|
693 |
+
</div>
|
694 |
+
<form style="display:none;" id="mo2fa_loginform"
|
695 |
+
action="<?php echo get_option( 'mo2f_host_name' ) . '/moas/login'; ?>"
|
696 |
+
target="_blank" method="post">
|
697 |
+
<input type="email" name="username" value="<?php echo $mo2f_user_email; ?>"/>
|
698 |
+
<input type="text" name="redirectUrl"
|
699 |
+
value="<?php echo get_option( 'mo2f_host_name' ) . '/moas/initializepayment'; ?>"/>
|
700 |
+
<input type="text" name="requestOrigin" id="requestOrigin"/>
|
701 |
+
</form>
|
702 |
+
<script>
|
703 |
+
function mo2f_addonform(planType) {
|
704 |
+
jQuery('#requestOrigin').val(planType);
|
705 |
+
jQuery('#mo2fa_loginform').submit();
|
706 |
+
}</script>
|
707 |
+
<?php
|
708 |
}
|
709 |
|
710 |
function show_rba_content() {
|
714 |
if ( $paid_rba ) {
|
715 |
$x = apply_filters( 'mo2f_rba', $str );
|
716 |
}
|
717 |
+
|
|
|
|
|
|
|
718 |
}
|
719 |
|
720 |
function show_shortcode_content() {
|
723 |
$str = "shortcode";
|
724 |
if ( $paid_shortcode ) {
|
725 |
$x = apply_filters( 'mo2f_shortcode', $str );
|
726 |
+
|
727 |
}
|
|
|
|
|
728 |
}
|
729 |
|
730 |
function show_custom_content() {
|
743 |
function show_2_factor_proxy_setup( $user ) {
|
744 |
global $Mo2fdbQueries;
|
745 |
?>
|
|
|
|
|
746 |
<div class="mo2f_proxy_setup">
|
747 |
<h3>Proxy Settings</h3>
|
|
|
|
|
748 |
<hr>
|
749 |
<br>
|
750 |
<div style="float:right;">
|
759 |
|
760 |
<?php if ( $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $user->ID ) != 'MO_2_FACTOR_PLUGIN_SETTINGS' || ! get_option( 'mo2f_proxy_host' ) ) {
|
761 |
echo 'disabled';
|
762 |
+
} ?> />
|
|
|
763 |
|
764 |
</form>
|
765 |
</div>
|
821 |
|
822 |
|
823 |
<?php if ( get_option( 'mo2f_is_NC' ) ) { ?>
|
824 |
+
<div class="mo2f_advanced_options_EC" style="width: 85%;border: 0px;">
|
825 |
<?php echo get_standard_premium_options( $user ); ?>
|
826 |
</div>
|
827 |
<?php } else {
|
829 |
$mo2f_active_tab = '2factor_setup';
|
830 |
?>
|
831 |
|
832 |
+
<div class="mo2f_advanced_options_EC" style="width: 85%;border: 0px;>
|
833 |
|
834 |
<div id="mo2f_login_options">
|
835 |
<a href="#standard_premium_options" style="float:right">Show Standard/Premium
|
1081 |
$is_NC = get_option( 'mo2f_is_NC' );
|
1082 |
|
1083 |
?>
|
1084 |
+
<div style="width:85%;margin-left:3%;">
|
1085 |
+
<div id="standard_premium_options" style="text-align: center;">
|
1086 |
+
<p style="font-size:22px;color:darkorange;padding:10px;"><?php echo mo2f_lt( 'Features in the Standard Plan' ); ?></p>
|
1087 |
|
1088 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1089 |
|
1090 |
+
<hr>
|
1091 |
+
<?php if ( $is_NC ) { ?>
|
1092 |
+
<div>
|
1093 |
+
<a class="mo2f_view_backup_options" onclick="show_backup_options()">
|
1094 |
+
<img src="<?php echo plugins_url( 'includes/images/right-arrow.png"', __FILE__ ); ?>"
|
1095 |
+
class="mo2f_advanced_options_images"/>
|
1096 |
|
1097 |
+
<p class="mo2f_heading_style"><?php echo mo2f_lt( 'Backup Options' ); ?></p>
|
1098 |
+
</a>
|
|
|
|
|
|
|
1099 |
|
1100 |
+
</div>
|
1101 |
+
<div id="backup_options" style="margin-left: 5%;">
|
1102 |
|
1103 |
+
<div class="mo2f_advanced_options_note"><p style="padding:5px;">
|
1104 |
+
<i><?php echo mo2f_lt( 'Use these backup options to login to your site in case your
|
1105 |
+
phone is lost / not accessible or if you are not able to login using your primary
|
1106 |
+
authentication method.' ); ?></i></p></div>
|
|
|
|
|
|
|
1107 |
|
1108 |
+
<ol class="mo2f_ol">
|
1109 |
+
<li><?php echo mo2f_lt( 'KBA (Security Questions)' ); ?></li>
|
1110 |
+
</ol>
|
1111 |
|
1112 |
+
</div>
|
1113 |
+
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1114 |
|
1115 |
+
<div>
|
1116 |
+
<a class="mo2f_view_customizations" onclick="show_customizations()">
|
1117 |
+
<img src="<?php echo plugins_url( 'includes/images/right-arrow.png"', __FILE__ ); ?>"
|
1118 |
+
class="mo2f_advanced_options_images"/>
|
1119 |
+
|
1120 |
+
<p class="mo2f_heading_style"><?php echo mo2f_lt( 'Customizations' ); ?></p>
|
1121 |
+
</a>
|
1122 |
+
</div>
|
1123 |
+
|
1124 |
+
|
1125 |
+
<div id="customizations" style="margin-left: 5%;">
|
1126 |
+
|
1127 |
+
<p style="font-size:15px;font-weight:bold">1. <?php echo mo2f_lt( 'Login Screen Options' ); ?></p>
|
1128 |
+
<div>
|
1129 |
+
<ul style="margin-left:4%" class="mo2f_ol">
|
1130 |
+
<li><?php echo mo2f_lt( 'Login with Wordpress username/password and 2nd Factor' ); ?> <a
|
1131 |
+
class="btn btn-link" data-toggle="collapse" id="showpreview1" href="#preview7"
|
1132 |
+
aria-expanded="false">[ <?php echo mo2f_lt( 'See Preview' ); ?>
|
1133 |
+
]</a>
|
1134 |
+
<div class="mo2f_collapse" id="preview7" style="height:300px;">
|
1135 |
+
<center><br>
|
1136 |
+
<img style="height:300px;"
|
1137 |
+
src="https://auth.miniorange.com/moas/images/help/login-help-1.png">
|
1138 |
+
</center>
|
1139 |
+
|
1140 |
+
</div>
|
1141 |
+
</li>
|
1142 |
+
<li><?php echo mo2f_lt( 'Login with Wordpress username and 2nd Factor only' ); ?> <a
|
1143 |
+
class="btn btn-link" data-toggle="collapse" id="showpreview2" href="#preview6"
|
1144 |
+
aria-expanded="false">[ <?php echo mo2f_lt( 'See Preview' ); ?>
|
1145 |
+
]</a>
|
1146 |
+
<br>
|
1147 |
+
<div class="mo2f_collapse" id="preview6" style="height:300px;">
|
1148 |
+
<center><br>
|
1149 |
+
<img style="height:300px;"
|
1150 |
+
src="https://auth.miniorange.com/moas/images/help/login-help-3.png">
|
1151 |
+
</center>
|
1152 |
+
</div>
|
1153 |
+
<br>
|
1154 |
+
</li>
|
1155 |
+
</ul>
|
1156 |
+
|
1157 |
+
|
1158 |
+
</div>
|
1159 |
+
<br>
|
1160 |
+
<p style="font-size:15px;font-weight:bold">2. <?php echo mo2f_lt( 'Custom Redirect URLs' ); ?></p>
|
1161 |
+
<p style="margin-left:4%"><?php echo mo2f_lt( 'Enable Custom Relay state URL\'s (based on user roles in Wordpress) to which the users
|
1162 |
+
will get redirected to, after the 2-factor authentication' ); ?>'.</p>
|
1163 |
+
|
1164 |
+
|
1165 |
+
<br>
|
1166 |
+
<p style="font-size:15px;font-weight:bold">3. <?php echo mo2f_lt( 'Custom Security Questions (KBA)' ); ?></p>
|
1167 |
+
<div id="mo2f_customKBAQuestions1">
|
1168 |
+
<p style="margin-left:4%"><?php echo mo2f_lt( 'Add up to 16 Custom Security Questions for Knowledge based authentication (KBA).
|
1169 |
+
You also have the option to select how many standard and custom questions should be shown to the
|
1170 |
+
users' ); ?>.</p>
|
1171 |
+
|
1172 |
+
</div>
|
1173 |
+
<br>
|
1174 |
+
<p style="font-size:15px;font-weight:bold">
|
1175 |
+
4. <?php echo mo2f_lt( 'Custom account name in Google Authenticator App' ); ?></p>
|
1176 |
+
<div id="mo2f_editGoogleAuthenticatorAccountName1">
|
1177 |
+
|
1178 |
+
<p style="margin-left:4%"><?php echo mo2f_lt( 'Customize the Account name in the Google Authenticator App' ); ?>
|
1179 |
+
.</p>
|
1180 |
+
|
1181 |
+
</div>
|
1182 |
+
<br>
|
1183 |
+
</div>
|
1184 |
+
<div id="standard_premium_options" style="text-align: center;">
|
1185 |
+
<p style="font-size:22px;color:darkorange;padding:10px;"><?php echo mo2f_lt( 'Features in the Premium Plan' ); ?></p>
|
1186 |
+
|
1187 |
+
</div>
|
1188 |
+
<hr>
|
1189 |
+
<div>
|
1190 |
+
<a class="mo2f_view_customizations_prem" onclick="show_customizations_prem()">
|
1191 |
+
<img src="<?php echo plugins_url( 'includes/images/right-arrow.png"', __FILE__ ); ?>"
|
1192 |
+
class="mo2f_advanced_options_images"/>
|
1193 |
+
|
1194 |
+
<p class="mo2f_heading_style"><?php echo mo2f_lt( 'Customizations' ); ?></p>
|
1195 |
+
</a>
|
1196 |
+
</div>
|
1197 |
+
|
1198 |
+
|
1199 |
+
<div id="customizations_prem" style="margin-left: 5%;">
|
1200 |
+
|
1201 |
+
<p style="font-size:15px;font-weight:bold">1. <?php echo mo2f_lt( 'Login Screen Options' ); ?></p>
|
1202 |
+
<div>
|
1203 |
+
<ul style="margin-left:4%" class="mo2f_ol">
|
1204 |
+
<li><?php echo mo2f_lt( 'Login with Wordpress username/password and 2nd Factor' ); ?> <a
|
1205 |
+
class="btn btn-link" data-toggle="collapse" id="showpreview1" href="#preview3"
|
1206 |
+
aria-expanded="false">[ <?php echo mo2f_lt( 'See Preview' ); ?>
|
1207 |
+
]</a>
|
1208 |
+
<div class="mo2f_collapse" id="preview3" style="height:300px;">
|
1209 |
+
<center><br>
|
1210 |
+
<img style="height:300px;"
|
1211 |
+
src="https://auth.miniorange.com/moas/images/help/login-help-1.png">
|
1212 |
+
</center>
|
1213 |
+
|
1214 |
+
</div>
|
1215 |
+
<br></li>
|
1216 |
+
<li><?php echo mo2f_lt( 'Login with Wordpress username and 2nd Factor only' ); ?> <a
|
1217 |
+
class="btn btn-link" data-toggle="collapse" id="showpreview2" href="#preview4"
|
1218 |
+
aria-expanded="false">[ <?php echo mo2f_lt( 'See Preview' ); ?>
|
1219 |
+
]</a>
|
1220 |
+
<br>
|
1221 |
+
<div class="mo2f_collapse" id="preview4" style="height:300px;">
|
1222 |
+
<center><br>
|
1223 |
+
<img style="height:300px;"
|
1224 |
+
src="https://auth.miniorange.com/moas/images/help/login-help-3.png">
|
1225 |
+
</center>
|
1226 |
+
</div>
|
1227 |
+
<br>
|
1228 |
+
</li>
|
1229 |
+
</ul>
|
1230 |
+
|
1231 |
+
|
1232 |
+
</div>
|
1233 |
+
<br>
|
1234 |
+
<p style="font-size:15px;font-weight:bold">2. <?php echo mo2f_lt( 'Custom Redirect URLs' ); ?></p>
|
1235 |
+
<p style="margin-left:4%"><?php echo mo2f_lt( 'Enable Custom Relay state URL\'s (based on user roles in Wordpress) to which the users
|
1236 |
+
will get redirected to, after the 2-factor authentication' ); ?>'.</p>
|
1237 |
+
|
1238 |
+
|
1239 |
+
<br>
|
1240 |
+
<p style="font-size:15px;font-weight:bold">3. <?php echo mo2f_lt( 'Custom Security Questions (KBA)' ); ?></p>
|
1241 |
+
<div id="mo2f_customKBAQuestions1">
|
1242 |
+
<p style="margin-left:4%"><?php echo mo2f_lt( 'Add up to 16 Custom Security Questions for Knowledge based authentication (KBA).
|
1243 |
+
You also have the option to select how many standard and custom questions should be shown to the
|
1244 |
+
users' ); ?>.</p>
|
1245 |
+
|
1246 |
+
</div>
|
1247 |
+
<br>
|
1248 |
+
<p style="font-size:15px;font-weight:bold">
|
1249 |
+
4. <?php echo mo2f_lt( 'Custom account name in Google Authenticator App' ); ?></p>
|
1250 |
+
<div id="mo2f_editGoogleAuthenticatorAccountName1">
|
1251 |
+
|
1252 |
+
<p style="margin-left:4%"><?php echo mo2f_lt( 'Customize the Account name in the Google Authenticator App' ); ?>
|
1253 |
+
.</p>
|
1254 |
+
|
1255 |
+
</div>
|
1256 |
+
<br>
|
1257 |
+
</div>
|
1258 |
+
<div>
|
1259 |
+
<a class="mo2f_view_backup_options_prem" onclick="show_backup_options_prem()">
|
1260 |
+
<img src="<?php echo plugins_url( 'includes/images/right-arrow.png"', __FILE__ ); ?>"
|
1261 |
+
class="mo2f_advanced_options_images"/>
|
1262 |
+
|
1263 |
+
<p class="mo2f_heading_style"><?php echo mo2f_lt( 'Backup Options' ); ?></p>
|
1264 |
+
</a>
|
1265 |
+
|
1266 |
+
</div>
|
1267 |
+
<div id="backup_options_prem" style="margin-left: 5%;">
|
1268 |
+
|
1269 |
+
<div class="mo2f_advanced_options_note"><p style="padding:5px;">
|
1270 |
+
<i><?php echo mo2f_lt( 'Use these backup options to login to your site in case your
|
1271 |
+
phone is lost / not accessible or if you are not able to login using your primary
|
1272 |
+
authentication method.' ); ?></i></p></div>
|
1273 |
+
|
1274 |
+
<ol class="mo2f_ol">
|
1275 |
+
<li><?php echo mo2f_lt( 'KBA (Security Questions)' ); ?></li>
|
1276 |
+
<li><?php echo mo2f_lt( 'OTP Over Email' ); ?></li>
|
1277 |
+
<li><?php echo mo2f_lt( 'Backup Codes' ); ?></li>
|
1278 |
+
</ol>
|
1279 |
+
|
1280 |
+
</div>
|
1281 |
+
|
1282 |
+
|
1283 |
+
<div>
|
1284 |
+
<a class="mo2f_view_inline_registration_options" onclick="show_inline_registration_options()">
|
1285 |
+
<img src="<?php echo plugins_url( 'includes/images/right-arrow.png"', __FILE__ ); ?>"
|
1286 |
+
class="mo2f_advanced_options_images"/>
|
1287 |
+
<p class="mo2f_heading_style"><?php echo mo2f_lt( 'Inline Registration Options' ); ?></p>
|
1288 |
+
</a>
|
1289 |
+
</div>
|
1290 |
+
|
1291 |
+
|
1292 |
+
<div id="inline_registration_options" style="margin-left: 5%;">
|
1293 |
+
|
1294 |
+
<div class="mo2f_advanced_options_note"><p style="padding:5px;">
|
1295 |
+
<i><?php echo mo2f_lt( 'Inline Registration is the registration process the users go through the first time they
|
1296 |
+
setup 2FA.' ); ?><br>
|
1297 |
+
<?php echo mo2f_lt( 'If Inline Registration is enabled by the admin for the users, the next time
|
1298 |
+
the users login to the website, they will be prompted to set up the 2FA of their choice by
|
1299 |
+
creating an account with miniOrange.' ); ?>
|
1300 |
+
|
1301 |
+
|
1302 |
+
</i></p></div>
|
1303 |
+
|
1304 |
+
|
1305 |
+
<p style="font-size:15px;font-weight:bold"><?php echo mo2f_lt( 'Features' ) ?>:</p>
|
1306 |
+
<ol style="margin-left: 5%" class="mo2f_ol">
|
1307 |
+
<li><?php echo mo2f_lt( 'Invoke 2FA Registration & Setup for Users during first-time login (Inline Registration)' ); ?>
|
1308 |
+
</li>
|
1309 |
+
|
1310 |
+
<li><?php echo mo2f_lt( 'Verify Email address of User during Inline Registration' ); ?></li>
|
1311 |
+
<li><?php echo mo2f_lt( 'Remove Knowledge Based Authentication(KBA) setup during inline registration' ); ?></li>
|
1312 |
+
<li><?php echo mo2f_lt( 'Enable 2FA for specific Roles' ); ?></li>
|
1313 |
+
<li><?php echo mo2f_lt( 'Enable specific 2FA methods to Users during Inline Registration' ); ?>:
|
1314 |
+
<ul style="padding-top:10px;">
|
1315 |
+
<li style="margin-left: 5%;">
|
1316 |
+
1. <?php echo mo2f_lt( 'Show specific 2FA methods to All Users' ); ?></li>
|
1317 |
+
<li style="margin-left: 5%;">
|
1318 |
+
2. <?php echo mo2f_lt( 'Show specific 2FA methods to Users based on their roles' ); ?></li>
|
1319 |
+
</ul>
|
1320 |
+
</li>
|
1321 |
+
</ol>
|
1322 |
+
</div>
|
1323 |
|
1324 |
|
1325 |
+
<div>
|
1326 |
+
<a class="mo2f_view_login_options" onclick="show_login_options()">
|
1327 |
+
<img src="<?php echo plugins_url( 'includes/images/right-arrow.png"', __FILE__ ); ?>"
|
1328 |
+
class="mo2f_advanced_options_images"/>
|
1329 |
+
<p class="mo2f_heading_style"><?php echo mo2f_lt( 'User Login Options' ); ?></p>
|
1330 |
+
</a>
|
1331 |
+
</div>
|
1332 |
|
1333 |
+
<div id="login_options" style="margin-left: 5%;">
|
1334 |
|
1335 |
+
<div class="mo2f_advanced_options_note"><p style="padding:5px;">
|
1336 |
+
<i><?php echo mo2f_lt( 'These are the options customizable for your users.' ); ?>
|
1337 |
|
1338 |
|
1339 |
+
</i></p></div>
|
1340 |
|
1341 |
+
<ol style="margin-left: 5%" class="mo2f_ol">
|
1342 |
+
<li><?php echo mo2f_lt( 'Enable 2FA during login for specific users on your site' ); ?>.</li>
|
1343 |
|
1344 |
+
<li><?php echo mo2f_lt( 'Enable login from external apps that support XML-RPC. (eg. Wordpress App)' ); ?>
|
1345 |
+
<br>
|
1346 |
+
<div class="mo2f_advanced_options_note"><p style="padding:5px;">
|
1347 |
+
<i><?php echo mo2f_lt( 'Use the Password generated in the 2FA plugin to login to your Wordpress Site from
|
1348 |
+
any application that supports XML-RPC.' ); ?>
|
1349 |
|
1350 |
|
1351 |
+
</i></p></div>
|
1352 |
|
1353 |
|
1354 |
+
<li><?php echo mo2f_lt( 'Enable KBA (Security Questions) as 2FA for Users logging in to the site from mobile
|
1355 |
+
phones.' ); ?>
|
1356 |
+
</li>
|
1357 |
|
1358 |
|
1359 |
+
</ol>
|
1360 |
+
<br>
|
1361 |
+
</div>
|
1362 |
+
</div>
|
1363 |
<?php
|
1364 |
}
|
1365 |
|
1419 |
<input type="hidden" name="mo_2factor_gobackto_registration_page_nonce"
|
1420 |
value="<?php echo wp_create_nonce( "mo-2factor-gobackto-registration-page-nonce" ) ?>"/>
|
1421 |
</form>
|
1422 |
+
|
1423 |
<script>
|
1424 |
jQuery('#mo2f_go_back').click(function () {
|
1425 |
jQuery('#gobackform').submit();
|
1427 |
|
1428 |
</script>
|
1429 |
|
1430 |
+
<?php }
|
1431 |
+
?>
|
miniorange_2_factor_mobile_configuration.php
CHANGED
@@ -252,7 +252,7 @@ function mo2f_show_instruction_to_allusers( $user, $mo2f_second_factor ) {
|
|
252 |
<?php if ( current_user_can( 'manage_options' ) == false ) { ?>
|
253 |
<div><?php } ?>
|
254 |
|
255 |
-
<div class="mo2f_table_layout">
|
256 |
|
257 |
<h3><?php echo mo2f_lt( 'Your Profile' ); ?></h3>
|
258 |
<table border="1"
|
@@ -448,33 +448,25 @@ function mo2f_select_2_factor_method( $user, $mo2f_second_factor ) {
|
|
448 |
|
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&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 |
-
|
469 |
-
<div
|
470 |
-
|
471 |
-
|
|
|
|
|
|
|
|
|
472 |
onclick="testAuthenticationMethod('<?php echo $selectedMethod; ?>');"
|
473 |
<?php echo $is_customer_registered && ( $selectedMethod != 'NONE' ) ? "" : " disabled "; ?>>Test
|
474 |
Authentication Method
|
475 |
</button>
|
476 |
</div>
|
477 |
-
<br>
|
478 |
<?php
|
479 |
if ( in_array( $selectedMethod, array(
|
480 |
"Google Authenticator",
|
@@ -551,7 +543,7 @@ function mo2f_select_2_factor_method( $user, $mo2f_second_factor ) {
|
|
551 |
$premium_plan_methods_existing_user = array_chunk( array_merge( $standard_plan_existing_user, $premium_plan ), 3 );
|
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>
|
@@ -815,13 +807,13 @@ function mo2f_create_2fa_form( $user, $category, $auth_methods, $can_display_adm
|
|
815 |
<div style="width: 80px; float:left;">';
|
816 |
|
817 |
if($is_image){
|
818 |
-
$form .= '<img src="' . plugins_url( "includes/images/authmethods/" . $auth_method_abr . ".png", __FILE__ ) . '" style="width:
|
819 |
}
|
820 |
|
821 |
$form .= '</div>
|
822 |
-
<div style="width:
|
823 |
'</b><br>
|
824 |
-
<p style="padding:
|
825 |
|
826 |
</div>
|
827 |
</div>
|
@@ -896,6 +888,9 @@ function show_2_factor_pricing_page( $user ) {
|
|
896 |
"User role based redirection after Login",
|
897 |
"Add custom Security Questions (KBA)",
|
898 |
"Customize account name in Google Authenticator app",
|
|
|
|
|
|
|
899 |
"Enable 2FA for specific User Roles",
|
900 |
"Enable 2FA for specific Users",
|
901 |
"Choose specific authentication methods for Users",
|
@@ -927,35 +922,43 @@ function show_2_factor_pricing_page( $user ) {
|
|
927 |
"Authentication Methods" => array(
|
928 |
array_slice( $two_factor_methods, 0, 5 ),
|
929 |
array_slice( $two_factor_methods, 0, 10 ),
|
|
|
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 |
),
|
937 |
-
"Language Translation Support" => array( true, true, true ),
|
938 |
-
"Login with Username + password + 2FA" => array( true, true, true ),
|
939 |
-
"Login with Username + 2FA (skip password)" => array( false, true, true ),
|
940 |
"Backup Methods" => array(
|
941 |
false,
|
942 |
"KBA",
|
|
|
943 |
array( "KBA", "OTP Over Email", "Backup Codes" )
|
944 |
),
|
945 |
-
"Multi-Site Support" => array( false, true, true ),
|
946 |
-
"User role based redirection after Login" => array( false, true, true ),
|
947 |
-
"Add custom Security Questions (KBA)" => array( false, true, true ),
|
948 |
-
"
|
949 |
-
"
|
950 |
-
"
|
951 |
-
"
|
952 |
-
"
|
953 |
-
"
|
954 |
-
"Enable
|
955 |
-
"
|
|
|
|
|
|
|
|
|
956 |
"Support" => array(
|
957 |
"Basic Support by Email",
|
958 |
"Priority Support by Email",
|
|
|
959 |
array( "Priority Support by Email", "Priority Support with GoTo meetings" )
|
960 |
),
|
961 |
|
@@ -965,35 +968,42 @@ function show_2_factor_pricing_page( $user ) {
|
|
965 |
"Authentication Methods" => array(
|
966 |
array_slice( $two_factor_methods, 0, 8 ),
|
967 |
array_slice( $two_factor_methods, 0, 10 ),
|
|
|
968 |
array_slice( $two_factor_methods, 0, 11 )
|
969 |
),
|
970 |
"No. of Users" => array(
|
971 |
"1",
|
972 |
"User Based Pricing",
|
|
|
973 |
"User Based Pricing"
|
974 |
),
|
975 |
-
"Language Translation Support" => array( true, true, true ),
|
976 |
-
"Login with Username + password + 2FA" => array( true, true, true ),
|
977 |
-
"Login with Username + 2FA (skip password)" => array( true, true, true ),
|
978 |
"Backup Methods" => array(
|
979 |
"KBA",
|
980 |
"KBA",
|
|
|
981 |
array( "KBA", "OTP Over Email", "Backup Codes" )
|
982 |
),
|
983 |
-
"Multi-Site Support" => array( false, true, true ),
|
984 |
-
"
|
985 |
-
"
|
986 |
-
"
|
987 |
-
"
|
988 |
-
"
|
989 |
-
"
|
990 |
-
"
|
991 |
-
"
|
992 |
-
"
|
993 |
-
"
|
|
|
|
|
|
|
994 |
"Support" => array(
|
995 |
"Basic Support by Email",
|
996 |
"Priority Support by Email",
|
|
|
997 |
array( "Priority Support by Email", "Priority Support with GoTo meetings" )
|
998 |
),
|
999 |
|
@@ -1018,12 +1028,12 @@ function show_2_factor_pricing_page( $user ) {
|
|
1018 |
"Customize 'powered by' Logo",
|
1019 |
"Customize Plugin Icon",
|
1020 |
"Customize Plugin Name",
|
1021 |
-
|
1022 |
),
|
1023 |
"RBA & Trusted Devices Management Add-on" => array(
|
1024 |
"Remember Device",
|
1025 |
"Set Device Limit for the users to login",
|
1026 |
-
|
1027 |
),
|
1028 |
"Short Codes Add-on" => array(
|
1029 |
"Option to turn on/off 2-factor by user",
|
@@ -1033,20 +1043,21 @@ function show_2_factor_pricing_page( $user ) {
|
|
1033 |
)
|
1034 |
);
|
1035 |
?>
|
1036 |
-
|
1037 |
-
|
|
|
1038 |
<table class="table mo_table-bordered mo_table-striped">
|
1039 |
<thead>
|
1040 |
<tr class="mo2f_licensing_plans_tr">
|
1041 |
-
<th width="
|
1042 |
<h3>Features \ Plans</h3></th>
|
1043 |
-
<th class="text-center" width="
|
1044 |
|
1045 |
<p class="mo2f_licensing_plans_plan_desc">Basic 2FA for Small Scale Web Businesses</p><br></th>
|
1046 |
-
<th class="text-center" width="
|
1047 |
|
1048 |
<p class="mo2f_licensing_plans_plan_desc">Intermediate 2FA for Medium Scale Web Businesses with
|
1049 |
-
basic support</p><span
|
1050 |
<?php echo mo2f_yearly_standard_pricing(); ?>
|
1051 |
|
1052 |
<?php echo mo2f_sms_cost();
|
@@ -1065,9 +1076,9 @@ function show_2_factor_pricing_page( $user ) {
|
|
1065 |
</span></h3>
|
1066 |
</th>
|
1067 |
|
1068 |
-
<th class="text-center" width="
|
1069 |
|
1070 |
-
<p class="mo2f_licensing_plans_plan_desc" style="margin:16px 0
|
1071 |
2FA for Large Scale Web businesses with enterprise-grade support</p><span>
|
1072 |
<?php echo mo2f_yearly_premium_pricing(); ?>
|
1073 |
<?php echo mo2f_sms_cost();
|
@@ -1083,7 +1094,15 @@ function show_2_factor_pricing_page( $user ) {
|
|
1083 |
onclick="mo2f_register_and_upgradeform('wp_2fa_premium_plan')" >Upgrade</button></h4>
|
1084 |
<?php } ?>
|
1085 |
<br>
|
1086 |
-
</span
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1087 |
</th>
|
1088 |
|
1089 |
</tr>
|
@@ -1095,9 +1114,8 @@ function show_2_factor_pricing_page( $user ) {
|
|
1095 |
$feature_set = $mo2f_feature_set[ $i ];
|
1096 |
|
1097 |
echo $feature_set;
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
<?php if ( $is_NC ) {
|
1102 |
$f_feature_set_with_plan = $mo2f_feature_set_with_plans_NC[ $feature_set ];
|
1103 |
} else {
|
@@ -1136,6 +1154,17 @@ function show_2_factor_pricing_page( $user ) {
|
|
1136 |
echo $f_feature_set_with_plan[2];
|
1137 |
}
|
1138 |
} ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1139 |
</td>
|
1140 |
</tr>
|
1141 |
<?php } ?>
|
@@ -1149,6 +1178,7 @@ function show_2_factor_pricing_page( $user ) {
|
|
1149 |
<?php } ?>
|
1150 |
<td><b>Purchase Separately</b></td>
|
1151 |
<td><b>Included</b></td>
|
|
|
1152 |
</tr>
|
1153 |
<?php for ( $i = 0; $i < count( $mo2f_addons ); $i ++ ) { ?>
|
1154 |
<tr>
|
@@ -1159,8 +1189,8 @@ function show_2_factor_pricing_page( $user ) {
|
|
1159 |
<button class="button button-primary button-small" style="cursor:pointer"
|
1160 |
onclick="mo2f_upgradeform('<?php echo $mo2f_addons_plan_name[ $mo2f_addons[ $i ] ]; ?>')" <?php echo $is_customer_registered ? "" : " disabled " ?> >
|
1161 |
Purchase
|
1162 |
-
</
|
1163 |
-
|
1164 |
</td>
|
1165 |
<?php } else { ?>
|
1166 |
<td><b>NA</b></td>
|
@@ -1172,6 +1202,7 @@ function show_2_factor_pricing_page( $user ) {
|
|
1172 |
</button>
|
1173 |
</td>
|
1174 |
<td><i class='fa fa-check'></i></td>
|
|
|
1175 |
</tr>
|
1176 |
<?php } ?>
|
1177 |
|
252 |
<?php if ( current_user_can( 'manage_options' ) == false ) { ?>
|
253 |
<div><?php } ?>
|
254 |
|
255 |
+
<div class="mo2f_table_layout" style="width: 107%;border:0px;">
|
256 |
|
257 |
<h3><?php echo mo2f_lt( 'Your Profile' ); ?></h3>
|
258 |
<table border="1"
|
448 |
|
449 |
?>
|
450 |
<div class="mo2f_setup_2_factor_tab">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
451 |
<?php if( $selectedMethod == 'NONE' ) { ?>
|
452 |
<p style="float:left;" ><span style="color:limegreen;font-weight:bold"><?php echo mo2f_lt( 'HOW DO I CONFIGURE 2FA?' ); ?></span>
|
453 |
+
<br>Just click on <b>Configure</b> of your preferred authentication method below.</p><br><br><br>
|
454 |
+
<br>
|
455 |
<?php } ?>
|
456 |
+
|
457 |
+
<div >
|
458 |
+
<span id="mo2f_selected_method" style="float:left;font-size:20px;color:darkorange;"><?php echo mo2f_lt( 'Selected Method - ' ); ?><?php echo $selectedMethod; ?></span>
|
459 |
+
<div >
|
460 |
+
<a id="mo2f_restart_tour" class="add-new-h2" onclick="restart_tour();"
|
461 |
+
style="float:right;background-color:#006799;color:white;"><?php echo mo2f_lt( 'RESTART TOUR' ); ?></a>
|
462 |
+
</div><br><br>
|
463 |
+
<button class="button button-primary button-large" id="test" style="float:left;"
|
464 |
onclick="testAuthenticationMethod('<?php echo $selectedMethod; ?>');"
|
465 |
<?php echo $is_customer_registered && ( $selectedMethod != 'NONE' ) ? "" : " disabled "; ?>>Test
|
466 |
Authentication Method
|
467 |
</button>
|
468 |
</div>
|
469 |
+
<br><br>
|
470 |
<?php
|
471 |
if ( in_array( $selectedMethod, array(
|
472 |
"Google Authenticator",
|
543 |
$premium_plan_methods_existing_user = array_chunk( array_merge( $standard_plan_existing_user, $premium_plan ), 3 );
|
544 |
$premium_plan_methods_new_user = array_chunk( array_merge( $standard_plan_new_user, $premium_plan ), 3 );
|
545 |
?>
|
546 |
+
<hr style="width:106%;">
|
547 |
<div class="mo2f_setup_2factor_tab">
|
548 |
|
549 |
<div>
|
807 |
<div style="width: 80px; float:left;">';
|
808 |
|
809 |
if($is_image){
|
810 |
+
$form .= '<img src="' . plugins_url( "includes/images/authmethods/" . $auth_method_abr . ".png", __FILE__ ) . '" style="width: 85px;height: 85px !important; padding: 20px; line-height: 80px;" />';
|
811 |
}
|
812 |
|
813 |
$form .= '</div>
|
814 |
+
<div style="width:200px; padding:20px;font-size:14px;overflow: hidden;"><b>' . $auth_method .
|
815 |
'</b><br>
|
816 |
+
<p style="padding:0px; padding-left:0px;"> ' . $two_factor_methods_descriptions[ $auth_method ] . '</p>
|
817 |
|
818 |
</div>
|
819 |
</div>
|
888 |
"User role based redirection after Login",
|
889 |
"Add custom Security Questions (KBA)",
|
890 |
"Customize account name in Google Authenticator app",
|
891 |
+
"Brute Force Protection",
|
892 |
+
"Blocking IP",
|
893 |
+
"Monitoring",
|
894 |
"Enable 2FA for specific User Roles",
|
895 |
"Enable 2FA for specific Users",
|
896 |
"Choose specific authentication methods for Users",
|
922 |
"Authentication Methods" => array(
|
923 |
array_slice( $two_factor_methods, 0, 5 ),
|
924 |
array_slice( $two_factor_methods, 0, 10 ),
|
925 |
+
array_slice( $two_factor_methods, 0, 11 ),
|
926 |
array_slice( $two_factor_methods, 0, 11 )
|
927 |
),
|
928 |
"No. of Users" => array(
|
929 |
"1",
|
930 |
"User Based Pricing",
|
931 |
+
"User Based Pricing",
|
932 |
"User Based Pricing"
|
933 |
),
|
934 |
+
"Language Translation Support" => array( true, true, true, true ),
|
935 |
+
"Login with Username + password + 2FA" => array( true, true, true, true ),
|
936 |
+
"Login with Username + 2FA (skip password)" => array( false, true, true, true ),
|
937 |
"Backup Methods" => array(
|
938 |
false,
|
939 |
"KBA",
|
940 |
+
array( "KBA", "OTP Over Email", "Backup Codes" ),
|
941 |
array( "KBA", "OTP Over Email", "Backup Codes" )
|
942 |
),
|
943 |
+
"Multi-Site Support" => array( false, true, true, true ),
|
944 |
+
"User role based redirection after Login" => array( false, true, true, true ),
|
945 |
+
"Add custom Security Questions (KBA)" => array( false, true, true, true ),
|
946 |
+
"Add custom Security Questions (KBA)" => array( false, true, true, true ),
|
947 |
+
"Customize account name in Google Authenticator app" => array( false, true, true, true ),
|
948 |
+
"Brute Force Protection" => array( true, false, false, true ),
|
949 |
+
"Blocking IP" => array( true, false, false, true ),
|
950 |
+
"Monitoring" => array( true, false, false, true ),
|
951 |
+
"Enable 2FA for specific User Roles" => array( false, false, true, true ),
|
952 |
+
"Enable 2FA for specific Users" => array( false, false, true, true ),
|
953 |
+
"Choose specific authentication methods for Users" => array( false, false, true, true ),
|
954 |
+
"Prompt for 2FA Registration for Users at login" => array( false, false, true, true ),
|
955 |
+
"One Time Email Verification for Users during 2FA Registration" => array( false, false, true, true ),
|
956 |
+
"Enable Security Questions as backup for Users during 2FA registration" => array( false, false, true, true ),
|
957 |
+
"App Specific Password to login from mobile Apps" => array( false, false, true, true ),
|
958 |
"Support" => array(
|
959 |
"Basic Support by Email",
|
960 |
"Priority Support by Email",
|
961 |
+
array( "Priority Support by Email", "Priority Support with GoTo meetings" ),
|
962 |
array( "Priority Support by Email", "Priority Support with GoTo meetings" )
|
963 |
),
|
964 |
|
968 |
"Authentication Methods" => array(
|
969 |
array_slice( $two_factor_methods, 0, 8 ),
|
970 |
array_slice( $two_factor_methods, 0, 10 ),
|
971 |
+
array_slice( $two_factor_methods, 0, 11 ),
|
972 |
array_slice( $two_factor_methods, 0, 11 )
|
973 |
),
|
974 |
"No. of Users" => array(
|
975 |
"1",
|
976 |
"User Based Pricing",
|
977 |
+
"User Based Pricing",
|
978 |
"User Based Pricing"
|
979 |
),
|
980 |
+
"Language Translation Support" => array( true, true, true, true ),
|
981 |
+
"Login with Username + password + 2FA" => array( true, true, true, true ),
|
982 |
+
"Login with Username + 2FA (skip password)" => array( true, true, true, true ),
|
983 |
"Backup Methods" => array(
|
984 |
"KBA",
|
985 |
"KBA",
|
986 |
+
array( "KBA", "OTP Over Email", "Backup Codes" ),
|
987 |
array( "KBA", "OTP Over Email", "Backup Codes" )
|
988 |
),
|
989 |
+
"Multi-Site Support" => array( false, true, true, true ),
|
990 |
+
"Brute Force Protection" => array( true, false, false, true ),
|
991 |
+
"Blocking IP" => array( true, false, false, true ),
|
992 |
+
"Monitoring" => array( true, false, false, true ),
|
993 |
+
"User role based redirection after Login" => array( false, true, true, true ),
|
994 |
+
"Add custom Security Questions (KBA)" => array( false, true, true, true ),
|
995 |
+
"Customize account name in Google Authenticator app" => array( false, true, true, true ),
|
996 |
+
"Enable 2FA for specific User Roles" => array( false, false, true, true ),
|
997 |
+
"Enable 2FA for specific Users" => array( false, false, true, true ),
|
998 |
+
"Choose specific authentication methods for Users" => array( false, false, true, true ),
|
999 |
+
"Prompt for 2FA Registration for Users at login" => array( false, false, true, true ),
|
1000 |
+
"One Time Email Verification for Users during 2FA Registration" => array( false, false, true, true ),
|
1001 |
+
"Enable Security Questions as backup for Users during 2FA registration" => array( false, false, true, true ),
|
1002 |
+
"App Specific Password to login from mobile Apps" => array( false, false, true, true ),
|
1003 |
"Support" => array(
|
1004 |
"Basic Support by Email",
|
1005 |
"Priority Support by Email",
|
1006 |
+
array( "Priority Support by Email", "Priority Support with GoTo meetings" ),
|
1007 |
array( "Priority Support by Email", "Priority Support with GoTo meetings" )
|
1008 |
),
|
1009 |
|
1028 |
"Customize 'powered by' Logo",
|
1029 |
"Customize Plugin Icon",
|
1030 |
"Customize Plugin Name",
|
1031 |
+
|
1032 |
),
|
1033 |
"RBA & Trusted Devices Management Add-on" => array(
|
1034 |
"Remember Device",
|
1035 |
"Set Device Limit for the users to login",
|
1036 |
+
"IP Restriction: Limit users to login from specific IPs"
|
1037 |
),
|
1038 |
"Short Codes Add-on" => array(
|
1039 |
"Option to turn on/off 2-factor by user",
|
1043 |
)
|
1044 |
);
|
1045 |
?>
|
1046 |
+
<br>
|
1047 |
+
<div class="mo2f_licensing_plans" style="border:0px;">
|
1048 |
+
|
1049 |
<table class="table mo_table-bordered mo_table-striped">
|
1050 |
<thead>
|
1051 |
<tr class="mo2f_licensing_plans_tr">
|
1052 |
+
<th width="20%">
|
1053 |
<h3>Features \ Plans</h3></th>
|
1054 |
+
<th class="text-center" width="20%"><h3>Free</h3>
|
1055 |
|
1056 |
<p class="mo2f_licensing_plans_plan_desc">Basic 2FA for Small Scale Web Businesses</p><br></th>
|
1057 |
+
<th class="text-center" width="20%"><h3>Standard</h3>
|
1058 |
|
1059 |
<p class="mo2f_licensing_plans_plan_desc">Intermediate 2FA for Medium Scale Web Businesses with
|
1060 |
+
basic support</p><span>
|
1061 |
<?php echo mo2f_yearly_standard_pricing(); ?>
|
1062 |
|
1063 |
<?php echo mo2f_sms_cost();
|
1076 |
</span></h3>
|
1077 |
</th>
|
1078 |
|
1079 |
+
<th class="text-center" width="20%"><h3>Premium</h3>
|
1080 |
|
1081 |
+
<p class="mo2f_licensing_plans_plan_desc" style="margin:16px 0 16px 0 ">Advanced and Intuitive
|
1082 |
2FA for Large Scale Web businesses with enterprise-grade support</p><span>
|
1083 |
<?php echo mo2f_yearly_premium_pricing(); ?>
|
1084 |
<?php echo mo2f_sms_cost();
|
1094 |
onclick="mo2f_register_and_upgradeform('wp_2fa_premium_plan')" >Upgrade</button></h4>
|
1095 |
<?php } ?>
|
1096 |
<br>
|
1097 |
+
</span>
|
1098 |
+
</th>
|
1099 |
+
<th class="text-center" width="25%"><h3>Enterprise</h3>
|
1100 |
+
|
1101 |
+
<p class="mo2f_licensing_plans_plan_desc" style="margin:16px 0 16px 0;">One stop security solution with 2fa and Network security for Large Web businesses.</p><span>
|
1102 |
+
<a class="button button-primary button-large" href="admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mo2f_support">Contact Us</a>
|
1103 |
+
|
1104 |
+
<br>
|
1105 |
+
</span>
|
1106 |
</th>
|
1107 |
|
1108 |
</tr>
|
1114 |
$feature_set = $mo2f_feature_set[ $i ];
|
1115 |
|
1116 |
echo $feature_set;
|
1117 |
+
?>
|
1118 |
+
</td>
|
|
|
1119 |
<?php if ( $is_NC ) {
|
1120 |
$f_feature_set_with_plan = $mo2f_feature_set_with_plans_NC[ $feature_set ];
|
1121 |
} else {
|
1154 |
echo $f_feature_set_with_plan[2];
|
1155 |
}
|
1156 |
} ?>
|
1157 |
+
</td>
|
1158 |
+
<td><?php
|
1159 |
+
if ( is_array( $f_feature_set_with_plan[3] ) ) {
|
1160 |
+
echo mo2f_create_li( $f_feature_set_with_plan[3] );
|
1161 |
+
} else {
|
1162 |
+
if ( gettype( $f_feature_set_with_plan[3] ) == "boolean" ) {
|
1163 |
+
echo mo2f_get_binary_equivalent( $f_feature_set_with_plan[3] );
|
1164 |
+
} else {
|
1165 |
+
echo $f_feature_set_with_plan[3];
|
1166 |
+
}
|
1167 |
+
} ?>
|
1168 |
</td>
|
1169 |
</tr>
|
1170 |
<?php } ?>
|
1178 |
<?php } ?>
|
1179 |
<td><b>Purchase Separately</b></td>
|
1180 |
<td><b>Included</b></td>
|
1181 |
+
<td><b>Included</b></td>
|
1182 |
</tr>
|
1183 |
<?php for ( $i = 0; $i < count( $mo2f_addons ); $i ++ ) { ?>
|
1184 |
<tr>
|
1189 |
<button class="button button-primary button-small" style="cursor:pointer"
|
1190 |
onclick="mo2f_upgradeform('<?php echo $mo2f_addons_plan_name[ $mo2f_addons[ $i ] ]; ?>')" <?php echo $is_customer_registered ? "" : " disabled " ?> >
|
1191 |
Purchase
|
1192 |
+
</button>
|
1193 |
+
|
1194 |
</td>
|
1195 |
<?php } else { ?>
|
1196 |
<td><b>NA</b></td>
|
1202 |
</button>
|
1203 |
</td>
|
1204 |
<td><i class='fa fa-check'></i></td>
|
1205 |
+
<td><i class='fa fa-check'></i></td>
|
1206 |
</tr>
|
1207 |
<?php } ?>
|
1208 |
|
miniorange_2_factor_settings.php
CHANGED
@@ -3,7 +3,7 @@
|
|
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.
|
7 |
* Author: miniOrange
|
8 |
* Author URI: https://miniorange.com
|
9 |
* License: GPL2
|
@@ -17,11 +17,16 @@ include_once dirname( __FILE__ ) . '/database/database_functions.php';
|
|
17 |
include dirname( __FILE__ ) . '/views/feedback_form.php';
|
18 |
include dirname( __FILE__ ) . '/views/test_2fa_notification.php';
|
19 |
include dirname( __FILE__ ) . '/views/customer_registration.php';
|
|
|
20 |
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-pass2fa-login.php' );
|
|
|
|
|
|
|
|
|
25 |
define( 'MOAUTH_PATH', plugins_url( __FILE__ ) );
|
26 |
|
27 |
|
@@ -40,6 +45,9 @@ class Miniorange_Authentication {
|
|
40 |
add_option( 'mo2f_enable_2fa_for_users', 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' ) );
|
@@ -53,11 +61,13 @@ class Miniorange_Authentication {
|
|
53 |
|
54 |
remove_action( 'admin_notices', array( $this, 'mo_auth_success_message' ) );
|
55 |
remove_action( 'admin_notices', array( $this, 'mo_auth_error_message' ) );
|
|
|
|
|
|
|
56 |
|
57 |
register_activation_hook( __FILE__, array( $this, 'mo_auth_activate' ) );
|
58 |
register_deactivation_hook( __FILE__, array( $this, 'mo_auth_deactivate' ) );
|
59 |
$this->define_global();
|
60 |
-
|
61 |
global $wp_roles;
|
62 |
|
63 |
if ( ! isset( $wp_roles ) ) {
|
@@ -77,7 +87,7 @@ class Miniorange_Authentication {
|
|
77 |
add_action( 'mo2f_shortcode_form_fields', array(
|
78 |
$pass2fa_login,
|
79 |
'miniorange_pass2login_form_fields'
|
80 |
-
), 10,
|
81 |
add_filter( 'mo2f_gauth_service', array( $mo2f_rba_attributes, 'mo2f_google_auth_service' ), 10, 1 );
|
82 |
|
83 |
|
@@ -144,6 +154,7 @@ class Miniorange_Authentication {
|
|
144 |
|
145 |
|
146 |
}
|
|
|
147 |
}
|
148 |
}
|
149 |
|
@@ -153,9 +164,12 @@ class Miniorange_Authentication {
|
|
153 |
}
|
154 |
|
155 |
function mo2f_update_db_check() {
|
156 |
-
|
|
|
|
|
|
|
157 |
if(get_option('mo2f_encryption_key',"not_exits")=="not_exits"){
|
158 |
-
$get_encryption_key = MO2f_Utility::random_str(
|
159 |
update_option('mo2f_encryption_key',$get_encryption_key);
|
160 |
|
161 |
}
|
@@ -331,11 +345,12 @@ class Miniorange_Authentication {
|
|
331 |
|
332 |
|
333 |
function mo_auth_success_message() {
|
|
|
334 |
$message = get_option( 'mo2f_message' ); ?>
|
335 |
<script>
|
336 |
jQuery(document).ready(function () {
|
337 |
var message = "<?php echo $message; ?>";
|
338 |
-
jQuery('#messages').append("<div style='padding:5px;'><div class='error notice is-dismissible mo2f_error_container'> <p class='mo2f_msgs'>" + message + "</p></div></div>");
|
339 |
});
|
340 |
</script>
|
341 |
<?php
|
@@ -343,19 +358,21 @@ class Miniorange_Authentication {
|
|
343 |
|
344 |
function mo_auth_error_message() {
|
345 |
$message = get_option( 'mo2f_message' ); ?>
|
|
|
346 |
<script>
|
347 |
jQuery(document).ready(function () {
|
348 |
var message = "<?php echo $message; ?>";
|
349 |
-
jQuery('#messages').append("<div style='padding:5px;'><div class='updated notice is-dismissible mo2f_success_container'> <p class='mo2f_msgs'>" + message + "</p></div></div>");
|
350 |
});
|
351 |
</script>
|
352 |
<?php
|
|
|
353 |
}
|
354 |
|
355 |
function miniorange_auth_menu() {
|
356 |
global $user;
|
357 |
$user = wp_get_current_user();
|
358 |
-
|
359 |
|
360 |
$roles = $user->roles;
|
361 |
$miniorange_role = array_shift( $roles );
|
@@ -371,21 +388,26 @@ class Miniorange_Authentication {
|
|
371 |
|
372 |
if ( $admin_registration_status ) {
|
373 |
if ( $can_current_user_manage_options && $is_customer_admin ) {
|
374 |
-
$mo2fa_hook_page =
|
375 |
-
$this,
|
376 |
-
'mo_auth_login_options'
|
377 |
-
), $iconurl );
|
378 |
}
|
379 |
} else if ( $can_current_user_manage_options ) {
|
380 |
-
$mo2fa_hook_page =
|
381 |
-
$this,
|
382 |
-
'mo_auth_login_options'
|
383 |
-
), $iconurl );
|
384 |
}
|
385 |
|
386 |
|
387 |
}
|
388 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
function mo_auth_login_options() {
|
390 |
global $user;
|
391 |
$user = wp_get_current_user();
|
@@ -394,22 +416,23 @@ class Miniorange_Authentication {
|
|
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.
|
398 |
-
wp_enqueue_style( 'bootstrap_style', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.
|
399 |
-
wp_enqueue_style( 'mo_2_factor_admin_settings_phone_style', plugins_url( 'includes/css/phone.css?version=5.1.
|
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.
|
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.
|
409 |
-
wp_enqueue_style( 'mo_2_factor_admin_settings_phone_style', plugins_url( 'includes/css/phone.css?version=5.1.
|
410 |
-
wp_enqueue_style( 'bootstrap_style', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.
|
411 |
-
wp_enqueue_style( 'bootstrap_style_ass', plugins_url( 'includes/css/bootstrap-tour-standalone.css?version=5.1.
|
412 |
wp_enqueue_style( 'mo_2_factor_wpb-fa', plugins_url( 'includes/css/font-awesome.min.css', __FILE__ ) );
|
|
|
413 |
}
|
414 |
|
415 |
function plugin_settings_script( $mo2fa_hook_page ) {
|
@@ -420,6 +443,7 @@ class Miniorange_Authentication {
|
|
420 |
wp_enqueue_script( 'mo_2_factor_admin_settings_phone_script', plugins_url( 'includes/js/phone.js', __FILE__ ) );
|
421 |
wp_enqueue_script( 'bootstrap_script', plugins_url( 'includes/js/bootstrap.min.js', __FILE__ ) );
|
422 |
wp_enqueue_script( 'bootstrap_script_hehe', plugins_url( 'includes/js/bootstrap-tour-standalone.min.js', __FILE__ ) );
|
|
|
423 |
|
424 |
}
|
425 |
|
@@ -440,7 +464,12 @@ class Miniorange_Authentication {
|
|
440 |
$user_id = $user->ID;
|
441 |
|
442 |
if ( current_user_can( 'manage_options' ) ) {
|
443 |
-
|
|
|
|
|
|
|
|
|
|
|
444 |
if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_deactivate_account" ) {
|
445 |
$nonce = $_POST['mo_auth_deactivate_account_nonce'];
|
446 |
if ( ! wp_verify_nonce( $nonce, 'mo-auth-deactivate-account-nonce' ) ) {
|
@@ -452,9 +481,7 @@ class Miniorange_Authentication {
|
|
452 |
$url = admin_url( 'plugins.php' );
|
453 |
wp_redirect( $url );
|
454 |
}
|
455 |
-
}
|
456 |
-
|
457 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_remove_account" ) {
|
458 |
$nonce = $_POST['mo_auth_remove_account_nonce'];
|
459 |
if ( ! wp_verify_nonce( $nonce, 'mo-auth-remove-account-nonce' ) ) {
|
460 |
$error = new WP_Error();
|
@@ -464,10 +491,7 @@ class Miniorange_Authentication {
|
|
464 |
update_option( 'mo2f_register_with_another_email', 1 );
|
465 |
$this->mo_auth_deactivate();
|
466 |
}
|
467 |
-
}
|
468 |
-
|
469 |
-
|
470 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == "mo2f_save_proxy_settings" ) {
|
471 |
$nonce = $_POST['mo2f_save_proxy_settings_nonce'];
|
472 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-save-proxy-settings-nonce' ) ) {
|
473 |
$error = new WP_Error();
|
@@ -487,8 +511,7 @@ class Miniorange_Authentication {
|
|
487 |
$this->mo_auth_show_success_message();
|
488 |
}
|
489 |
|
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' ) ) {
|
@@ -556,8 +579,7 @@ class Miniorange_Authentication {
|
|
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' ) ) {
|
563 |
$error = new WP_Error();
|
@@ -568,10 +590,7 @@ class Miniorange_Authentication {
|
|
568 |
update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "ENTER_YOUR_EMAIL_PASSWORD" ) );
|
569 |
$Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_VERIFY_CUSTOMER' ) );
|
570 |
}
|
571 |
-
}
|
572 |
-
|
573 |
-
|
574 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo_2factor_gobackto_registration_page' ) { //back to registration page for admin
|
575 |
$nonce = $_POST['mo_2factor_gobackto_registration_page_nonce'];
|
576 |
if ( ! wp_verify_nonce( $nonce, 'mo-2factor-gobackto-registration-page-nonce' ) ) {
|
577 |
$error = new WP_Error();
|
@@ -590,9 +609,7 @@ class Miniorange_Authentication {
|
|
590 |
$Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => 'REGISTRATION_STARTED' ) );
|
591 |
}
|
592 |
|
593 |
-
}
|
594 |
-
|
595 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo2f_registration_closed' ) {
|
596 |
$nonce = $_POST['mo2f_registration_closed_nonce'];
|
597 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-registration-closed-nonce' ) ) {
|
598 |
$error = new WP_Error();
|
@@ -602,8 +619,7 @@ class Miniorange_Authentication {
|
|
602 |
$Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => '' ) );
|
603 |
delete_user_meta( $user->ID, 'register_account' );
|
604 |
}
|
605 |
-
}
|
606 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_verify_customer" ) { //register the admin to miniOrange if already exist
|
607 |
|
608 |
$nonce = $_POST['miniorange_verify_customer_nonce'];
|
609 |
|
@@ -705,7 +721,7 @@ class Miniorange_Authentication {
|
|
705 |
$mo2f_message .= ' ' . '<a href=\"admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mobile_configure\" >' . Mo2fConstants:: langTranslate( "CLICK_HERE" ) . '</a> ' . Mo2fConstants:: langTranslate( "CONFIGURE_2FA" );
|
706 |
|
707 |
delete_user_meta( $user->ID, 'register_account' );
|
708 |
-
|
709 |
$mo2f_customer_selected_plan = get_option( 'mo2f_customer_selected_plan' );
|
710 |
if ( ! empty( $mo2f_customer_selected_plan ) ) {
|
711 |
delete_option( 'mo2f_customer_selected_plan' );
|
@@ -714,8 +730,8 @@ class Miniorange_Authentication {
|
|
714 |
update_user_meta( $user->ID, 'configure_2FA', 1 );
|
715 |
}
|
716 |
|
717 |
-
|
718 |
update_option( 'mo2f_message', $mo2f_message );
|
|
|
719 |
} else {
|
720 |
update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "INVALID_EMAIL_OR_PASSWORD" ) );
|
721 |
$mo_2factor_user_registration_status = 'MO_2_FACTOR_VERIFY_CUSTOMER';
|
@@ -733,9 +749,7 @@ class Miniorange_Authentication {
|
|
733 |
|
734 |
delete_option( 'mo2f_password' );
|
735 |
}
|
736 |
-
}
|
737 |
-
|
738 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo_2factor_phone_verification' ) { //at registration time
|
739 |
$phone = sanitize_text_field( $_POST['phone_number'] );
|
740 |
$Mo2fdbQueries->update_user_details( $user->ID, array( 'mo2f_user_phone' => $phone ) );
|
741 |
|
@@ -766,9 +780,7 @@ class Miniorange_Authentication {
|
|
766 |
$this->mo_auth_show_error_message();
|
767 |
}
|
768 |
|
769 |
-
}
|
770 |
-
|
771 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_2factor_resend_otp" ) { //resend OTP over email for admin
|
772 |
|
773 |
$nonce = $_POST['mo_2factor_resend_otp_nonce'];
|
774 |
|
@@ -801,15 +813,9 @@ class Miniorange_Authentication {
|
|
801 |
}
|
802 |
|
803 |
|
804 |
-
}
|
805 |
-
|
806 |
-
|
807 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == "mo2f_dismiss_notice_option" ) {
|
808 |
update_option( 'mo2f_bug_fix_done', 1 );
|
809 |
-
}
|
810 |
-
|
811 |
-
|
812 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_2factor_validate_otp" ) { //validate OTP over email for admin
|
813 |
|
814 |
$nonce = $_POST['mo_2factor_validate_otp_nonce'];
|
815 |
|
@@ -853,9 +859,7 @@ class Miniorange_Authentication {
|
|
853 |
}
|
854 |
}
|
855 |
}
|
856 |
-
}
|
857 |
-
|
858 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_2factor_validate_user_otp" ) { //validate OTP over email for additional admin
|
859 |
|
860 |
//validation and sanitization
|
861 |
$nonce = $_POST['mo_2factor_validate_user_otp_nonce'];
|
@@ -902,9 +906,7 @@ class Miniorange_Authentication {
|
|
902 |
$this->mo_auth_show_error_message();
|
903 |
}*/
|
904 |
}
|
905 |
-
}
|
906 |
-
|
907 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_2factor_send_query" ) { //Help me or support
|
908 |
$nonce = $_POST['mo_2factor_send_query_nonce'];
|
909 |
|
910 |
if ( ! wp_verify_nonce( $nonce, 'mo-2factor-send-query-nonce' ) ) {
|
@@ -943,14 +945,10 @@ class Miniorange_Authentication {
|
|
943 |
|
944 |
}
|
945 |
}
|
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 |
-
}
|
952 |
-
|
953 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo_auth_login_settings_save' ) {
|
954 |
$nonce = $_POST['mo_auth_login_settings_save_nonce'];
|
955 |
if ( ! wp_verify_nonce( $nonce, 'mo-auth-login-settings-save-nonce' ) ) {
|
956 |
$error = new WP_Error();
|
@@ -992,9 +990,7 @@ class Miniorange_Authentication {
|
|
992 |
$this->mo_auth_show_error_message();
|
993 |
}
|
994 |
}
|
995 |
-
}
|
996 |
-
|
997 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_sync_sms_transactions" ) {
|
998 |
$customer = new Customer_Setup();
|
999 |
$content = json_decode( $customer->get_customer_transactions( get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
|
1000 |
if ( ! array_key_exists( 'smsRemaining', $content ) ) {
|
@@ -1025,11 +1021,8 @@ class Miniorange_Authentication {
|
|
1025 |
$Mo2fdbQueries->database_table_issue();
|
1026 |
|
1027 |
}
|
1028 |
-
}
|
1029 |
|
1030 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo2f_skip_feedback' ) {
|
1031 |
-
|
1032 |
-
//update_option( 'mo2f_feedback_form', 1 );
|
1033 |
$nonce = $_POST['mo2f_skip_feedback_nonce'];
|
1034 |
|
1035 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-skip-feedback-nonce' ) ) {
|
@@ -1041,8 +1034,7 @@ class Miniorange_Authentication {
|
|
1041 |
deactivate_plugins( '/miniorange-2-factor-authentication/miniorange_2_factor_settings.php' );
|
1042 |
}
|
1043 |
|
1044 |
-
}
|
1045 |
-
if ( isset( $_POST['mo2f_feedback'] ) and $_POST['mo2f_feedback'] == 'mo2f_feedback' ) {
|
1046 |
|
1047 |
$nonce = $_POST['mo2f_feedback_nonce'];
|
1048 |
|
@@ -1099,13 +1091,11 @@ class Miniorange_Authentication {
|
|
1099 |
} else {
|
1100 |
update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "QUERY_SUBMITTED_SUCCESSFULLY" ) );
|
1101 |
$this->mo_auth_show_success_message();
|
1102 |
-
//update_option( 'mo2f_feedback_form', 1 );
|
1103 |
}
|
1104 |
}
|
1105 |
}
|
1106 |
}
|
1107 |
|
1108 |
-
//update_option( 'mo2f_feedback_form', 1 );
|
1109 |
deactivate_plugins( '/miniorange-2-factor-authentication/miniorange_2_factor_settings.php' );
|
1110 |
|
1111 |
}
|
@@ -1116,9 +1106,7 @@ class Miniorange_Authentication {
|
|
1116 |
}
|
1117 |
}
|
1118 |
|
1119 |
-
}
|
1120 |
-
|
1121 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_2factor_resend_user_otp" ) { //resend OTP over email for additional admin and non-admin user
|
1122 |
|
1123 |
$nonce = $_POST['mo_2factor_resend_user_otp_nonce'];
|
1124 |
|
@@ -1145,9 +1133,7 @@ class Miniorange_Authentication {
|
|
1145 |
}
|
1146 |
}
|
1147 |
|
1148 |
-
}
|
1149 |
-
|
1150 |
-
if ( isset( $_POST['option'] ) and ( $_POST['option'] == "mo2f_configure_miniorange_authenticator_validate" || $_POST['option'] == 'mo_auth_mobile_reconfiguration_complete' ) ) { //mobile registration successfully complete for all users
|
1151 |
|
1152 |
$nonce = $_POST['mo2f_configure_miniorange_authenticator_validate_nonce'];
|
1153 |
|
@@ -1205,9 +1191,7 @@ class Miniorange_Authentication {
|
|
1205 |
$this->mo_auth_show_error_message();
|
1206 |
}
|
1207 |
}
|
1208 |
-
}
|
1209 |
-
|
1210 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo2f_mobile_authenticate_success' ) { // mobile registration for all users(common)
|
1211 |
|
1212 |
$nonce = $_POST['mo2f_mobile_authenticate_success_nonce'];
|
1213 |
|
@@ -1230,9 +1214,7 @@ class Miniorange_Authentication {
|
|
1230 |
delete_user_meta( $user->ID, 'test_2FA' );
|
1231 |
$this->mo_auth_show_success_message();
|
1232 |
}
|
1233 |
-
}
|
1234 |
-
|
1235 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo2f_mobile_authenticate_error' ) { //mobile registration failed for all users(common)
|
1236 |
$nonce = $_POST['mo2f_mobile_authenticate_error_nonce'];
|
1237 |
|
1238 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-mobile-authenticate-error-nonce' ) ) {
|
@@ -1246,16 +1228,12 @@ class Miniorange_Authentication {
|
|
1246 |
$this->mo_auth_show_error_message();
|
1247 |
}
|
1248 |
|
1249 |
-
}
|
1250 |
-
|
1251 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_setting_configuration" ) // redirect to setings page
|
1252 |
{
|
1253 |
|
1254 |
$Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_PLUGIN_SETTINGS' ) );
|
1255 |
|
1256 |
-
}
|
1257 |
-
|
1258 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_refresh_mobile_qrcode" ) { // refrsh Qrcode for all users
|
1259 |
|
1260 |
$nonce = $_POST['mo_auth_refresh_mobile_qrcode_nonce'];
|
1261 |
|
@@ -1279,9 +1257,7 @@ class Miniorange_Authentication {
|
|
1279 |
|
1280 |
}
|
1281 |
}
|
1282 |
-
}
|
1283 |
-
|
1284 |
-
if ( isset( $_POST['mo2fa_register_to_upgrade_nonce'] ) ) { //registration with miniOrange for upgrading
|
1285 |
$nonce = $_POST['mo2fa_register_to_upgrade_nonce'];
|
1286 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-user-reg-to-upgrade-nonce' ) ) {
|
1287 |
update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "INVALID_REQ" ) );
|
@@ -1291,9 +1267,7 @@ class Miniorange_Authentication {
|
|
1291 |
header( 'Location: admin.php?page=miniOrange_2_factor_settings&mo2f_tab=2factor_setup' );
|
1292 |
|
1293 |
}
|
1294 |
-
}
|
1295 |
-
|
1296 |
-
if ( isset( $_POST['miniorange_get_started'] ) && isset( $_POST['miniorange_user_reg_nonce'] ) ) { //registration with miniOrange for additional admin and non-admin
|
1297 |
$nonce = $_POST['miniorange_user_reg_nonce'];
|
1298 |
$Mo2fdbQueries->insert_user( $user_id, array( 'user_id' => $user_id ) );
|
1299 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-user-reg-nonce' ) ) {
|
@@ -1353,10 +1327,7 @@ class Miniorange_Authentication {
|
|
1353 |
$this->mo_auth_show_error_message();
|
1354 |
}
|
1355 |
}
|
1356 |
-
}
|
1357 |
-
|
1358 |
-
|
1359 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo_2factor_backto_user_registration' ) { //back to registration page for additional admin and non-admin
|
1360 |
$nonce = $_POST['mo_2factor_backto_user_registration_nonce'];
|
1361 |
|
1362 |
if ( ! wp_verify_nonce( $nonce, 'mo-2factor-backto-user-registration-nonce' ) ) {
|
@@ -1371,9 +1342,7 @@ class Miniorange_Authentication {
|
|
1371 |
delete_option( 'mo2f_transactionId' );
|
1372 |
}
|
1373 |
|
1374 |
-
}
|
1375 |
-
|
1376 |
-
if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_validate_soft_token' ) { // validate Soft Token during test for all users
|
1377 |
|
1378 |
$nonce = $_POST['mo2f_validate_soft_token_nonce'];
|
1379 |
|
@@ -1414,9 +1383,7 @@ class Miniorange_Authentication {
|
|
1414 |
}
|
1415 |
}
|
1416 |
}
|
1417 |
-
}
|
1418 |
-
|
1419 |
-
if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_validate_otp_over_sms' ) { //validate otp over sms and phone call during test for all users
|
1420 |
|
1421 |
$nonce = $_POST['mo2f_validate_otp_over_sms_nonce'];
|
1422 |
|
@@ -1464,9 +1431,7 @@ class Miniorange_Authentication {
|
|
1464 |
|
1465 |
}
|
1466 |
}
|
1467 |
-
}
|
1468 |
-
|
1469 |
-
if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_out_of_band_success' ) {
|
1470 |
$nonce = $_POST['mo2f_out_of_band_success_nonce'];
|
1471 |
|
1472 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-out-of-band-success-nonce' ) ) {
|
@@ -1499,9 +1464,7 @@ class Miniorange_Authentication {
|
|
1499 |
}
|
1500 |
|
1501 |
|
1502 |
-
}
|
1503 |
-
|
1504 |
-
if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo2f_out_of_band_error' ) { //push and out of band email denied
|
1505 |
$nonce = $_POST['mo2f_out_of_band_error_nonce'];
|
1506 |
|
1507 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-out-of-band-error-nonce' ) ) {
|
@@ -1519,9 +1482,7 @@ class Miniorange_Authentication {
|
|
1519 |
$this->mo_auth_show_error_message();
|
1520 |
}
|
1521 |
|
1522 |
-
}
|
1523 |
-
|
1524 |
-
if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_validate_google_authy_test' ) {
|
1525 |
|
1526 |
$nonce = $_POST['mo2f_validate_google_authy_test_nonce'];
|
1527 |
|
@@ -1568,9 +1529,7 @@ class Miniorange_Authentication {
|
|
1568 |
|
1569 |
}
|
1570 |
}
|
1571 |
-
}
|
1572 |
-
|
1573 |
-
if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_google_appname' ) {
|
1574 |
$nonce = $_POST['mo2f_google_appname_nonce'];
|
1575 |
|
1576 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-google-appname-nonce' ) ) {
|
@@ -1583,8 +1542,7 @@ class Miniorange_Authentication {
|
|
1583 |
update_option('mo2f_google_appname',((isset($_POST['mo2f_google_auth_appname']) && $_POST['mo2f_google_auth_appname']!='') ? $_POST['mo2f_google_auth_appname'] : 'miniOrangeAuth'));
|
1584 |
}
|
1585 |
|
1586 |
-
}
|
1587 |
-
if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_configure_google_authenticator_validate' ) {
|
1588 |
$nonce = $_POST['mo2f_configure_google_authenticator_validate_nonce'];
|
1589 |
|
1590 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-configure-google-authenticator-validate-nonce' ) ) {
|
@@ -1650,10 +1608,7 @@ class Miniorange_Authentication {
|
|
1650 |
|
1651 |
}
|
1652 |
}
|
1653 |
-
}
|
1654 |
-
|
1655 |
-
|
1656 |
-
if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_configure_authy_authenticator' ) {
|
1657 |
$nonce = $_POST['mo2f_configure_authy_authenticator_nonce'];
|
1658 |
|
1659 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-configure-authy-authenticator-nonce' ) ) {
|
@@ -1680,9 +1635,7 @@ class Miniorange_Authentication {
|
|
1680 |
$this->mo_auth_show_error_message();
|
1681 |
}
|
1682 |
}
|
1683 |
-
}
|
1684 |
-
|
1685 |
-
if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_configure_authy_authenticator_validate' ) {
|
1686 |
$nonce = $_POST['mo2f_configure_authy_authenticator_validate_nonce'];
|
1687 |
|
1688 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-configure-authy-authenticator-validate-nonce' ) ) {
|
@@ -1738,9 +1691,7 @@ class Miniorange_Authentication {
|
|
1738 |
$this->mo_auth_show_error_message();
|
1739 |
}
|
1740 |
}
|
1741 |
-
}
|
1742 |
-
|
1743 |
-
if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_save_kba' ) {
|
1744 |
|
1745 |
$nonce = $_POST['mo2f_save_kba_nonce'];
|
1746 |
|
@@ -1812,7 +1763,7 @@ class Miniorange_Authentication {
|
|
1812 |
'mo2f_configured_2FA_method' => "Security Questions",
|
1813 |
'mo_2factor_user_registration_status' => "MO_2_FACTOR_PLUGIN_SETTINGS"
|
1814 |
) );
|
1815 |
-
|
1816 |
mo2f_display_test_2fa_notification($user);
|
1817 |
|
1818 |
} else {
|
@@ -1842,10 +1793,7 @@ class Miniorange_Authentication {
|
|
1842 |
}
|
1843 |
}
|
1844 |
|
1845 |
-
}
|
1846 |
-
|
1847 |
-
|
1848 |
-
if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_validate_kba_details' ) {
|
1849 |
|
1850 |
$nonce = $_POST['mo2f_validate_kba_details_nonce'];
|
1851 |
|
@@ -1896,10 +1844,7 @@ class Miniorange_Authentication {
|
|
1896 |
}
|
1897 |
}
|
1898 |
}
|
1899 |
-
}
|
1900 |
-
|
1901 |
-
|
1902 |
-
if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_configure_otp_over_sms_send_otp' ) { // sendin otp for configuring OTP over SMS
|
1903 |
|
1904 |
$nonce = $_POST['mo2f_configure_otp_over_sms_send_otp_nonce'];
|
1905 |
|
@@ -1946,9 +1891,7 @@ class Miniorange_Authentication {
|
|
1946 |
$this->mo_auth_show_error_message();
|
1947 |
}
|
1948 |
}
|
1949 |
-
}
|
1950 |
-
|
1951 |
-
if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_configure_otp_over_sms_validate' ) {
|
1952 |
$nonce = $_POST['mo2f_configure_otp_over_sms_validate_nonce'];
|
1953 |
|
1954 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-configure-otp-over-sms-validate-nonce' ) ) {
|
@@ -2037,10 +1980,7 @@ class Miniorange_Authentication {
|
|
2037 |
}
|
2038 |
}
|
2039 |
|
2040 |
-
}
|
2041 |
-
|
2042 |
-
// user clicks on Set 2-Factor method
|
2043 |
-
if ( ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_save_free_plan_auth_methods' ) ) {
|
2044 |
|
2045 |
$nonce = $_POST['miniorange_save_form_auth_methods_nonce'];
|
2046 |
|
@@ -2106,9 +2046,7 @@ class Miniorange_Authentication {
|
|
2106 |
display_customer_registration_forms( $user );
|
2107 |
}
|
2108 |
}
|
2109 |
-
}
|
2110 |
-
|
2111 |
-
if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_enable_2FA_for_users_option' ) {
|
2112 |
$nonce = $_POST['mo2f_enable_2FA_for_users_option_nonce'];
|
2113 |
|
2114 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-enable-2FA-for-users-option-nonce' ) ) {
|
@@ -2119,9 +2057,7 @@ class Miniorange_Authentication {
|
|
2119 |
} else {
|
2120 |
update_option( 'mo2f_enable_2fa_for_users', isset( $_POST['mo2f_enable_2fa_for_users'] ) ? $_POST['mo2f_enable_2fa_for_users'] : 0 );
|
2121 |
}
|
2122 |
-
}
|
2123 |
-
|
2124 |
-
if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_disable_proxy_setup_option' ) {
|
2125 |
$nonce = $_POST['mo2f_disable_proxy_setup_option_nonce'];
|
2126 |
|
2127 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-disable-proxy-setup-option-nonce' ) ) {
|
@@ -2137,9 +2073,7 @@ class Miniorange_Authentication {
|
|
2137 |
update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "Proxy Configurations Reset." ) );
|
2138 |
$this->mo_auth_show_success_message();
|
2139 |
}
|
2140 |
-
}
|
2141 |
-
|
2142 |
-
if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_enable_2FA_option' ) {
|
2143 |
$nonce = $_POST['mo2f_enable_2FA_option_nonce'];
|
2144 |
|
2145 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-enable-2FA-option-nonce' ) ) {
|
@@ -2150,9 +2084,7 @@ class Miniorange_Authentication {
|
|
2150 |
} else {
|
2151 |
update_option( 'mo2f_enable_2fa', isset( $_POST['mo2f_enable_2fa'] ) ? $_POST['mo2f_enable_2fa'] : 0 );
|
2152 |
}
|
2153 |
-
}
|
2154 |
-
|
2155 |
-
if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_enable_2FA_on_login_page_option' ) {
|
2156 |
$nonce = $_POST['mo2f_enable_2FA_on_login_page_option_nonce'];
|
2157 |
|
2158 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-enable-2FA-on-login-page-option-nonce' ) ) {
|
@@ -2163,10 +2095,9 @@ class Miniorange_Authentication {
|
|
2163 |
} else {
|
2164 |
update_option( 'mo2f_enable_2fa_prompt_on_login_page', isset( $_POST['mo2f_enable_2fa_prompt_on_login_page'] ) ? $_POST['mo2f_enable_2fa_prompt_on_login_page'] : 0 );
|
2165 |
}
|
2166 |
-
}
|
2167 |
-
|
2168 |
-
|
2169 |
-
if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo_2factor_test_authentication_method' ) {
|
2170 |
|
2171 |
$nonce = $_POST['mo_2factor_test_authentication_method_nonce'];
|
2172 |
|
@@ -2299,9 +2230,7 @@ class Miniorange_Authentication {
|
|
2299 |
update_user_meta( $user->ID, 'mo2f_2FA_method_to_test', $selected_2FA_method );
|
2300 |
}
|
2301 |
|
2302 |
-
}
|
2303 |
-
|
2304 |
-
if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_go_back' ) {
|
2305 |
$nonce = $_POST['mo2f_go_back_nonce'];
|
2306 |
|
2307 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-go-back-nonce' ) ) {
|
@@ -2704,8 +2633,8 @@ class Miniorange_Authentication {
|
|
2704 |
}
|
2705 |
|
2706 |
function mo_auth_activate() {
|
2707 |
-
|
2708 |
-
$get_encryption_key = MO2f_Utility::random_str(
|
2709 |
update_option('mo2f_encryption_key',$get_encryption_key);
|
2710 |
|
2711 |
if ( get_option( 'mo2f_customerKey' ) && ! get_option( 'mo2f_is_NC' ) ) {
|
@@ -2715,6 +2644,8 @@ class Miniorange_Authentication {
|
|
2715 |
update_option( 'mo2f_is_NNC', 1 );
|
2716 |
}
|
2717 |
|
|
|
|
|
2718 |
update_option( 'mo2f_host_name', 'https://auth.miniorange.com' );
|
2719 |
update_option('mo2f_data_storage',null);
|
2720 |
global $Mo2fdbQueries;
|
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.19
|
7 |
* Author: miniOrange
|
8 |
* Author URI: https://miniorange.com
|
9 |
* License: GPL2
|
17 |
include dirname( __FILE__ ) . '/views/feedback_form.php';
|
18 |
include dirname( __FILE__ ) . '/views/test_2fa_notification.php';
|
19 |
include dirname( __FILE__ ) . '/views/customer_registration.php';
|
20 |
+
include_once dirname( __FILE__ ) . '/network_security/class_miniorange_2fa_network_security.php';
|
21 |
require( 'class-utility.php' );
|
22 |
require( 'class-mo2f-constants.php' );
|
23 |
require( 'class-miniorange-2-factor-login.php' );
|
24 |
require( 'miniorange_2_factor_support.php' );
|
25 |
require( 'class-miniorange-2-factor-pass2fa-login.php' );
|
26 |
+
//require('miniorange_handler.php');
|
27 |
+
require('resources/constants.php');
|
28 |
+
require('resources/messages.php');
|
29 |
+
//require('integrations/class_buddypress.php');
|
30 |
define( 'MOAUTH_PATH', plugins_url( __FILE__ ) );
|
31 |
|
32 |
|
45 |
add_option( 'mo2f_enable_2fa_for_users', 1 );
|
46 |
add_option( 'mo2f_enable_2fa_prompt_on_login_page', 0 );
|
47 |
add_option( 'mo2f_enable_xmlrpc', 0 );
|
48 |
+
add_option('mo2fa_administrator',1);
|
49 |
+
add_option('mo2f_custom_plugin_name','miniOrange 2-Factor');
|
50 |
+
|
51 |
add_option( 'mo2f_show_sms_transaction_message', 0 );
|
52 |
add_action( 'admin_menu', array( $this, 'miniorange_auth_menu' ) );
|
53 |
add_action( 'admin_init', array( $this, 'miniorange_auth_save_settings' ) );
|
61 |
|
62 |
remove_action( 'admin_notices', array( $this, 'mo_auth_success_message' ) );
|
63 |
remove_action( 'admin_notices', array( $this, 'mo_auth_error_message' ) );
|
64 |
+
//network security
|
65 |
+
add_action( 'mo_auth_show_success_message', array($this, 'mo_auth_show_success_message'), 10, 1 );
|
66 |
+
add_action( 'mo_auth_show_error_message', array($this, 'mo_auth_show_error_message'), 10, 1 );
|
67 |
|
68 |
register_activation_hook( __FILE__, array( $this, 'mo_auth_activate' ) );
|
69 |
register_deactivation_hook( __FILE__, array( $this, 'mo_auth_deactivate' ) );
|
70 |
$this->define_global();
|
|
|
71 |
global $wp_roles;
|
72 |
|
73 |
if ( ! isset( $wp_roles ) ) {
|
87 |
add_action( 'mo2f_shortcode_form_fields', array(
|
88 |
$pass2fa_login,
|
89 |
'miniorange_pass2login_form_fields'
|
90 |
+
), 10, 5 );
|
91 |
add_filter( 'mo2f_gauth_service', array( $mo2f_rba_attributes, 'mo2f_google_auth_service' ), 10, 1 );
|
92 |
|
93 |
|
154 |
|
155 |
|
156 |
}
|
157 |
+
|
158 |
}
|
159 |
}
|
160 |
|
164 |
}
|
165 |
|
166 |
function mo2f_update_db_check() {
|
167 |
+
if(get_option('mo2f_network_features',"not_exits")=="not_exits"){
|
168 |
+
do_action('mo2f_network_create_db');
|
169 |
+
update_option('mo2f_network_features',1);
|
170 |
+
}
|
171 |
if(get_option('mo2f_encryption_key',"not_exits")=="not_exits"){
|
172 |
+
$get_encryption_key = MO2f_Utility::random_str(16);
|
173 |
update_option('mo2f_encryption_key',$get_encryption_key);
|
174 |
|
175 |
}
|
345 |
|
346 |
|
347 |
function mo_auth_success_message() {
|
348 |
+
|
349 |
$message = get_option( 'mo2f_message' ); ?>
|
350 |
<script>
|
351 |
jQuery(document).ready(function () {
|
352 |
var message = "<?php echo $message; ?>";
|
353 |
+
jQuery('#messages').append("<div style='padding:5px;'><div class='error notice is-dismissible mo2f_error_container' style='position: fixed;left: 70.3%;top: 11%;width: 27%;z-index: 500;background-color: bisque;font-weight: bold;'> <p class='mo2f_msgs'>" + message + "</p></div></div>");
|
354 |
});
|
355 |
</script>
|
356 |
<?php
|
358 |
|
359 |
function mo_auth_error_message() {
|
360 |
$message = get_option( 'mo2f_message' ); ?>
|
361 |
+
|
362 |
<script>
|
363 |
jQuery(document).ready(function () {
|
364 |
var message = "<?php echo $message; ?>";
|
365 |
+
jQuery('#messages').append("<div style='padding:5px;'><div class='updated notice is-dismissible mo2f_success_container' style='position: fixed;left: 70.3%;top: 11%;width: 27%;z-index: 500;background-color: #bcffb4;font-weight: bold;'> <p class='mo2f_msgs'>" + message + "</p></div></div>");
|
366 |
});
|
367 |
</script>
|
368 |
<?php
|
369 |
+
|
370 |
}
|
371 |
|
372 |
function miniorange_auth_menu() {
|
373 |
global $user;
|
374 |
$user = wp_get_current_user();
|
375 |
+
|
376 |
|
377 |
$roles = $user->roles;
|
378 |
$miniorange_role = array_shift( $roles );
|
388 |
|
389 |
if ( $admin_registration_status ) {
|
390 |
if ( $can_current_user_manage_options && $is_customer_admin ) {
|
391 |
+
$mo2fa_hook_page = $this->hookpages();
|
|
|
|
|
|
|
392 |
}
|
393 |
} else if ( $can_current_user_manage_options ) {
|
394 |
+
$mo2fa_hook_page = $this->hookpages();
|
|
|
|
|
|
|
395 |
}
|
396 |
|
397 |
|
398 |
}
|
399 |
|
400 |
+
function hookpages() {
|
401 |
+
if(get_site_option('mo2f_enable_custom_icon')!=1)
|
402 |
+
$iconurl = plugin_dir_url(__FILE__) . 'includes/images/miniorange_icon.png';
|
403 |
+
else
|
404 |
+
$iconurl = site_url(). '/wp-content/uploads/miniorange/plugin_icon.png';
|
405 |
+
$menu_slug = 'miniOrange_2_factor_settings';
|
406 |
+
|
407 |
+
add_menu_page( 'miniOrange 2 Factor Auth', get_option('mo2f_custom_plugin_name'), 'manage_options', $menu_slug, array($this,'mo_auth_login_options'), $iconurl );
|
408 |
+
|
409 |
+
}
|
410 |
+
|
411 |
function mo_auth_login_options() {
|
412 |
global $user;
|
413 |
$user = wp_get_current_user();
|
416 |
}
|
417 |
|
418 |
function mo_2_factor_enable_frontend_style() {
|
419 |
+
wp_enqueue_style( 'mo2f_frontend_login_style', plugins_url( 'includes/css/front_end_login.css?version=5.1.19', __FILE__ ) );
|
420 |
+
wp_enqueue_style( 'bootstrap_style', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.18', __FILE__ ) );
|
421 |
+
wp_enqueue_style( 'mo_2_factor_admin_settings_phone_style', plugins_url( 'includes/css/phone.css?version=5.1.18', __FILE__ ) );
|
422 |
wp_enqueue_style( 'mo_2_factor_wpb-fa', plugins_url( 'includes/css/font-awesome.min.css', __FILE__ ) );
|
423 |
+
wp_enqueue_style( 'mo2f_login_popup_style', plugins_url( 'includes/css/mo2f_login_popup_ui.css?version=5.1.19', __FILE__ ) );
|
424 |
}
|
425 |
|
426 |
function plugin_settings_style( $mo2fa_hook_page ) {
|
427 |
if ( 'toplevel_page_miniOrange_2_factor_settings' != $mo2fa_hook_page ) {
|
428 |
return;
|
429 |
}
|
430 |
+
wp_enqueue_style( 'mo_2_factor_admin_settings_style', plugins_url( 'includes/css/style_settings.css?version=5.1.19', __FILE__ ) );
|
431 |
+
wp_enqueue_style( 'mo_2_factor_admin_settings_phone_style', plugins_url( 'includes/css/phone.css?version=5.1.19', __FILE__ ) );
|
432 |
+
wp_enqueue_style( 'bootstrap_style', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.19', __FILE__ ) );
|
433 |
+
wp_enqueue_style( 'bootstrap_style_ass', plugins_url( 'includes/css/bootstrap-tour-standalone.css?version=5.1.19', __FILE__ ) );
|
434 |
wp_enqueue_style( 'mo_2_factor_wpb-fa', plugins_url( 'includes/css/font-awesome.min.css', __FILE__ ) );
|
435 |
+
wp_enqueue_style( 'mo2f_ns_admin_settings_datatable_style', plugins_url('includes/css/jquery.dataTables.min.css', __FILE__));
|
436 |
}
|
437 |
|
438 |
function plugin_settings_script( $mo2fa_hook_page ) {
|
443 |
wp_enqueue_script( 'mo_2_factor_admin_settings_phone_script', plugins_url( 'includes/js/phone.js', __FILE__ ) );
|
444 |
wp_enqueue_script( 'bootstrap_script', plugins_url( 'includes/js/bootstrap.min.js', __FILE__ ) );
|
445 |
wp_enqueue_script( 'bootstrap_script_hehe', plugins_url( 'includes/js/bootstrap-tour-standalone.min.js', __FILE__ ) );
|
446 |
+
wp_enqueue_script( 'mo2f_ns_admin_datatable_script', plugins_url('includes/js/jquery.dataTables.min.js', __FILE__ ), array('jquery'));
|
447 |
|
448 |
}
|
449 |
|
464 |
$user_id = $user->ID;
|
465 |
|
466 |
if ( current_user_can( 'manage_options' ) ) {
|
467 |
+
|
468 |
+
if(strlen(get_option('mo2f_encryption_key'))>17){
|
469 |
+
$get_encryption_key = MO2f_Utility::random_str(16);
|
470 |
+
update_option('mo2f_encryption_key',$get_encryption_key);
|
471 |
+
}
|
472 |
+
|
473 |
if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_deactivate_account" ) {
|
474 |
$nonce = $_POST['mo_auth_deactivate_account_nonce'];
|
475 |
if ( ! wp_verify_nonce( $nonce, 'mo-auth-deactivate-account-nonce' ) ) {
|
481 |
$url = admin_url( 'plugins.php' );
|
482 |
wp_redirect( $url );
|
483 |
}
|
484 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_remove_account" ) {
|
|
|
|
|
485 |
$nonce = $_POST['mo_auth_remove_account_nonce'];
|
486 |
if ( ! wp_verify_nonce( $nonce, 'mo-auth-remove-account-nonce' ) ) {
|
487 |
$error = new WP_Error();
|
491 |
update_option( 'mo2f_register_with_another_email', 1 );
|
492 |
$this->mo_auth_deactivate();
|
493 |
}
|
494 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo2f_save_proxy_settings" ) {
|
|
|
|
|
|
|
495 |
$nonce = $_POST['mo2f_save_proxy_settings_nonce'];
|
496 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-save-proxy-settings-nonce' ) ) {
|
497 |
$error = new WP_Error();
|
511 |
$this->mo_auth_show_success_message();
|
512 |
}
|
513 |
|
514 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_register_customer" ) { //register the admin to miniOrange
|
|
|
515 |
//miniorange_register_customer_nonce
|
516 |
$nonce = $_POST['miniorange_register_customer_nonce'];
|
517 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-register-customer-nonce' ) ) {
|
579 |
}
|
580 |
}
|
581 |
}
|
582 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo2f_goto_verifycustomer" ) {
|
|
|
583 |
$nonce = $_POST['mo2f_goto_verifycustomer_nonce'];
|
584 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-goto-verifycustomer-nonce' ) ) {
|
585 |
$error = new WP_Error();
|
590 |
update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "ENTER_YOUR_EMAIL_PASSWORD" ) );
|
591 |
$Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_VERIFY_CUSTOMER' ) );
|
592 |
}
|
593 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo_2factor_gobackto_registration_page' ) { //back to registration page for admin
|
|
|
|
|
|
|
594 |
$nonce = $_POST['mo_2factor_gobackto_registration_page_nonce'];
|
595 |
if ( ! wp_verify_nonce( $nonce, 'mo-2factor-gobackto-registration-page-nonce' ) ) {
|
596 |
$error = new WP_Error();
|
609 |
$Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => 'REGISTRATION_STARTED' ) );
|
610 |
}
|
611 |
|
612 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo2f_registration_closed' ) {
|
|
|
|
|
613 |
$nonce = $_POST['mo2f_registration_closed_nonce'];
|
614 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-registration-closed-nonce' ) ) {
|
615 |
$error = new WP_Error();
|
619 |
$Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => '' ) );
|
620 |
delete_user_meta( $user->ID, 'register_account' );
|
621 |
}
|
622 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_verify_customer" ) { //register the admin to miniOrange if already exist
|
|
|
623 |
|
624 |
$nonce = $_POST['miniorange_verify_customer_nonce'];
|
625 |
|
721 |
$mo2f_message .= ' ' . '<a href=\"admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mobile_configure\" >' . Mo2fConstants:: langTranslate( "CLICK_HERE" ) . '</a> ' . Mo2fConstants:: langTranslate( "CONFIGURE_2FA" );
|
722 |
|
723 |
delete_user_meta( $user->ID, 'register_account' );
|
724 |
+
|
725 |
$mo2f_customer_selected_plan = get_option( 'mo2f_customer_selected_plan' );
|
726 |
if ( ! empty( $mo2f_customer_selected_plan ) ) {
|
727 |
delete_option( 'mo2f_customer_selected_plan' );
|
730 |
update_user_meta( $user->ID, 'configure_2FA', 1 );
|
731 |
}
|
732 |
|
|
|
733 |
update_option( 'mo2f_message', $mo2f_message );
|
734 |
+
$this->mo_auth_show_success_message();
|
735 |
} else {
|
736 |
update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "INVALID_EMAIL_OR_PASSWORD" ) );
|
737 |
$mo_2factor_user_registration_status = 'MO_2_FACTOR_VERIFY_CUSTOMER';
|
749 |
|
750 |
delete_option( 'mo2f_password' );
|
751 |
}
|
752 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo_2factor_phone_verification' ) { //at registration time
|
|
|
|
|
753 |
$phone = sanitize_text_field( $_POST['phone_number'] );
|
754 |
$Mo2fdbQueries->update_user_details( $user->ID, array( 'mo2f_user_phone' => $phone ) );
|
755 |
|
780 |
$this->mo_auth_show_error_message();
|
781 |
}
|
782 |
|
783 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_2factor_resend_otp" ) { //resend OTP over email for admin
|
|
|
|
|
784 |
|
785 |
$nonce = $_POST['mo_2factor_resend_otp_nonce'];
|
786 |
|
813 |
}
|
814 |
|
815 |
|
816 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo2f_dismiss_notice_option" ) {
|
|
|
|
|
|
|
817 |
update_option( 'mo2f_bug_fix_done', 1 );
|
818 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_2factor_validate_otp" ) { //validate OTP over email for admin
|
|
|
|
|
|
|
819 |
|
820 |
$nonce = $_POST['mo_2factor_validate_otp_nonce'];
|
821 |
|
859 |
}
|
860 |
}
|
861 |
}
|
862 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_2factor_validate_user_otp" ) { //validate OTP over email for additional admin
|
|
|
|
|
863 |
|
864 |
//validation and sanitization
|
865 |
$nonce = $_POST['mo_2factor_validate_user_otp_nonce'];
|
906 |
$this->mo_auth_show_error_message();
|
907 |
}*/
|
908 |
}
|
909 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_2factor_send_query" ) { //Help me or support
|
|
|
|
|
910 |
$nonce = $_POST['mo_2factor_send_query_nonce'];
|
911 |
|
912 |
if ( ! wp_verify_nonce( $nonce, 'mo-2factor-send-query-nonce' ) ) {
|
945 |
|
946 |
}
|
947 |
}
|
948 |
+
}else 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 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo_auth_login_settings_save' ) {
|
|
|
|
|
952 |
$nonce = $_POST['mo_auth_login_settings_save_nonce'];
|
953 |
if ( ! wp_verify_nonce( $nonce, 'mo-auth-login-settings-save-nonce' ) ) {
|
954 |
$error = new WP_Error();
|
990 |
$this->mo_auth_show_error_message();
|
991 |
}
|
992 |
}
|
993 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_sync_sms_transactions" ) {
|
|
|
|
|
994 |
$customer = new Customer_Setup();
|
995 |
$content = json_decode( $customer->get_customer_transactions( get_option( 'mo2f_customerKey' ), get_option( 'mo2f_api_key' ) ), true );
|
996 |
if ( ! array_key_exists( 'smsRemaining', $content ) ) {
|
1021 |
$Mo2fdbQueries->database_table_issue();
|
1022 |
|
1023 |
}
|
1024 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo2f_skip_feedback' ) {
|
1025 |
|
|
|
|
|
|
|
1026 |
$nonce = $_POST['mo2f_skip_feedback_nonce'];
|
1027 |
|
1028 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-skip-feedback-nonce' ) ) {
|
1034 |
deactivate_plugins( '/miniorange-2-factor-authentication/miniorange_2_factor_settings.php' );
|
1035 |
}
|
1036 |
|
1037 |
+
}else if ( isset( $_POST['mo2f_feedback'] ) and $_POST['mo2f_feedback'] == 'mo2f_feedback' ) {
|
|
|
1038 |
|
1039 |
$nonce = $_POST['mo2f_feedback_nonce'];
|
1040 |
|
1091 |
} else {
|
1092 |
update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "QUERY_SUBMITTED_SUCCESSFULLY" ) );
|
1093 |
$this->mo_auth_show_success_message();
|
|
|
1094 |
}
|
1095 |
}
|
1096 |
}
|
1097 |
}
|
1098 |
|
|
|
1099 |
deactivate_plugins( '/miniorange-2-factor-authentication/miniorange_2_factor_settings.php' );
|
1100 |
|
1101 |
}
|
1106 |
}
|
1107 |
}
|
1108 |
|
1109 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_2factor_resend_user_otp" ) { //resend OTP over email for additional admin and non-admin user
|
|
|
|
|
1110 |
|
1111 |
$nonce = $_POST['mo_2factor_resend_user_otp_nonce'];
|
1112 |
|
1133 |
}
|
1134 |
}
|
1135 |
|
1136 |
+
}else if ( isset( $_POST['option'] ) and ( $_POST['option'] == "mo2f_configure_miniorange_authenticator_validate" || $_POST['option'] == 'mo_auth_mobile_reconfiguration_complete' ) ) { //mobile registration successfully complete for all users
|
|
|
|
|
1137 |
|
1138 |
$nonce = $_POST['mo2f_configure_miniorange_authenticator_validate_nonce'];
|
1139 |
|
1191 |
$this->mo_auth_show_error_message();
|
1192 |
}
|
1193 |
}
|
1194 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo2f_mobile_authenticate_success' ) { // mobile registration for all users(common)
|
|
|
|
|
1195 |
|
1196 |
$nonce = $_POST['mo2f_mobile_authenticate_success_nonce'];
|
1197 |
|
1214 |
delete_user_meta( $user->ID, 'test_2FA' );
|
1215 |
$this->mo_auth_show_success_message();
|
1216 |
}
|
1217 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo2f_mobile_authenticate_error' ) { //mobile registration failed for all users(common)
|
|
|
|
|
1218 |
$nonce = $_POST['mo2f_mobile_authenticate_error_nonce'];
|
1219 |
|
1220 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-mobile-authenticate-error-nonce' ) ) {
|
1228 |
$this->mo_auth_show_error_message();
|
1229 |
}
|
1230 |
|
1231 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_setting_configuration" ) // redirect to setings page
|
|
|
|
|
1232 |
{
|
1233 |
|
1234 |
$Mo2fdbQueries->update_user_details( $user->ID, array( 'mo_2factor_user_registration_status' => 'MO_2_FACTOR_PLUGIN_SETTINGS' ) );
|
1235 |
|
1236 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_refresh_mobile_qrcode" ) { // refrsh Qrcode for all users
|
|
|
|
|
1237 |
|
1238 |
$nonce = $_POST['mo_auth_refresh_mobile_qrcode_nonce'];
|
1239 |
|
1257 |
|
1258 |
}
|
1259 |
}
|
1260 |
+
}else if ( isset( $_POST['mo2fa_register_to_upgrade_nonce'] ) ) { //registration with miniOrange for upgrading
|
|
|
|
|
1261 |
$nonce = $_POST['mo2fa_register_to_upgrade_nonce'];
|
1262 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-user-reg-to-upgrade-nonce' ) ) {
|
1263 |
update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "INVALID_REQ" ) );
|
1267 |
header( 'Location: admin.php?page=miniOrange_2_factor_settings&mo2f_tab=2factor_setup' );
|
1268 |
|
1269 |
}
|
1270 |
+
}else if ( isset( $_POST['miniorange_get_started'] ) && isset( $_POST['miniorange_user_reg_nonce'] ) ) { //registration with miniOrange for additional admin and non-admin
|
|
|
|
|
1271 |
$nonce = $_POST['miniorange_user_reg_nonce'];
|
1272 |
$Mo2fdbQueries->insert_user( $user_id, array( 'user_id' => $user_id ) );
|
1273 |
if ( ! wp_verify_nonce( $nonce, 'miniorange-2-factor-user-reg-nonce' ) ) {
|
1327 |
$this->mo_auth_show_error_message();
|
1328 |
}
|
1329 |
}
|
1330 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo_2factor_backto_user_registration' ) { //back to registration page for additional admin and non-admin
|
|
|
|
|
|
|
1331 |
$nonce = $_POST['mo_2factor_backto_user_registration_nonce'];
|
1332 |
|
1333 |
if ( ! wp_verify_nonce( $nonce, 'mo-2factor-backto-user-registration-nonce' ) ) {
|
1342 |
delete_option( 'mo2f_transactionId' );
|
1343 |
}
|
1344 |
|
1345 |
+
}else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_validate_soft_token' ) { // validate Soft Token during test for all users
|
|
|
|
|
1346 |
|
1347 |
$nonce = $_POST['mo2f_validate_soft_token_nonce'];
|
1348 |
|
1383 |
}
|
1384 |
}
|
1385 |
}
|
1386 |
+
}else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_validate_otp_over_sms' ) { //validate otp over sms and phone call during test for all users
|
|
|
|
|
1387 |
|
1388 |
$nonce = $_POST['mo2f_validate_otp_over_sms_nonce'];
|
1389 |
|
1431 |
|
1432 |
}
|
1433 |
}
|
1434 |
+
}else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_out_of_band_success' ) {
|
|
|
|
|
1435 |
$nonce = $_POST['mo2f_out_of_band_success_nonce'];
|
1436 |
|
1437 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-out-of-band-success-nonce' ) ) {
|
1464 |
}
|
1465 |
|
1466 |
|
1467 |
+
}else if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo2f_out_of_band_error' ) { //push and out of band email denied
|
|
|
|
|
1468 |
$nonce = $_POST['mo2f_out_of_band_error_nonce'];
|
1469 |
|
1470 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-out-of-band-error-nonce' ) ) {
|
1482 |
$this->mo_auth_show_error_message();
|
1483 |
}
|
1484 |
|
1485 |
+
}else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_validate_google_authy_test' ) {
|
|
|
|
|
1486 |
|
1487 |
$nonce = $_POST['mo2f_validate_google_authy_test_nonce'];
|
1488 |
|
1529 |
|
1530 |
}
|
1531 |
}
|
1532 |
+
}else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_google_appname' ) {
|
|
|
|
|
1533 |
$nonce = $_POST['mo2f_google_appname_nonce'];
|
1534 |
|
1535 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-google-appname-nonce' ) ) {
|
1542 |
update_option('mo2f_google_appname',((isset($_POST['mo2f_google_auth_appname']) && $_POST['mo2f_google_auth_appname']!='') ? $_POST['mo2f_google_auth_appname'] : 'miniOrangeAuth'));
|
1543 |
}
|
1544 |
|
1545 |
+
}else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_configure_google_authenticator_validate' ) {
|
|
|
1546 |
$nonce = $_POST['mo2f_configure_google_authenticator_validate_nonce'];
|
1547 |
|
1548 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-configure-google-authenticator-validate-nonce' ) ) {
|
1608 |
|
1609 |
}
|
1610 |
}
|
1611 |
+
}else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_configure_authy_authenticator' ) {
|
|
|
|
|
|
|
1612 |
$nonce = $_POST['mo2f_configure_authy_authenticator_nonce'];
|
1613 |
|
1614 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-configure-authy-authenticator-nonce' ) ) {
|
1635 |
$this->mo_auth_show_error_message();
|
1636 |
}
|
1637 |
}
|
1638 |
+
}else if( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_configure_authy_authenticator_validate' ) {
|
|
|
|
|
1639 |
$nonce = $_POST['mo2f_configure_authy_authenticator_validate_nonce'];
|
1640 |
|
1641 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-configure-authy-authenticator-validate-nonce' ) ) {
|
1691 |
$this->mo_auth_show_error_message();
|
1692 |
}
|
1693 |
}
|
1694 |
+
}else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_save_kba' ) {
|
|
|
|
|
1695 |
|
1696 |
$nonce = $_POST['mo2f_save_kba_nonce'];
|
1697 |
|
1763 |
'mo2f_configured_2FA_method' => "Security Questions",
|
1764 |
'mo_2factor_user_registration_status' => "MO_2_FACTOR_PLUGIN_SETTINGS"
|
1765 |
) );
|
1766 |
+
// $this->mo_auth_show_success_message();
|
1767 |
mo2f_display_test_2fa_notification($user);
|
1768 |
|
1769 |
} else {
|
1793 |
}
|
1794 |
}
|
1795 |
|
1796 |
+
}else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_validate_kba_details' ) {
|
|
|
|
|
|
|
1797 |
|
1798 |
$nonce = $_POST['mo2f_validate_kba_details_nonce'];
|
1799 |
|
1844 |
}
|
1845 |
}
|
1846 |
}
|
1847 |
+
}else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_configure_otp_over_sms_send_otp' ) { // sendin otp for configuring OTP over SMS
|
|
|
|
|
|
|
1848 |
|
1849 |
$nonce = $_POST['mo2f_configure_otp_over_sms_send_otp_nonce'];
|
1850 |
|
1891 |
$this->mo_auth_show_error_message();
|
1892 |
}
|
1893 |
}
|
1894 |
+
}else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_configure_otp_over_sms_validate' ) {
|
|
|
|
|
1895 |
$nonce = $_POST['mo2f_configure_otp_over_sms_validate_nonce'];
|
1896 |
|
1897 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-configure-otp-over-sms-validate-nonce' ) ) {
|
1980 |
}
|
1981 |
}
|
1982 |
|
1983 |
+
}else if ( ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_save_free_plan_auth_methods' ) ) {// user clicks on Set 2-Factor method
|
|
|
|
|
|
|
1984 |
|
1985 |
$nonce = $_POST['miniorange_save_form_auth_methods_nonce'];
|
1986 |
|
2046 |
display_customer_registration_forms( $user );
|
2047 |
}
|
2048 |
}
|
2049 |
+
}else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_enable_2FA_for_users_option' ) {
|
|
|
|
|
2050 |
$nonce = $_POST['mo2f_enable_2FA_for_users_option_nonce'];
|
2051 |
|
2052 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-enable-2FA-for-users-option-nonce' ) ) {
|
2057 |
} else {
|
2058 |
update_option( 'mo2f_enable_2fa_for_users', isset( $_POST['mo2f_enable_2fa_for_users'] ) ? $_POST['mo2f_enable_2fa_for_users'] : 0 );
|
2059 |
}
|
2060 |
+
}else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_disable_proxy_setup_option' ) {
|
|
|
|
|
2061 |
$nonce = $_POST['mo2f_disable_proxy_setup_option_nonce'];
|
2062 |
|
2063 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-disable-proxy-setup-option-nonce' ) ) {
|
2073 |
update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "Proxy Configurations Reset." ) );
|
2074 |
$this->mo_auth_show_success_message();
|
2075 |
}
|
2076 |
+
}else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_enable_2FA_option' ) {
|
|
|
|
|
2077 |
$nonce = $_POST['mo2f_enable_2FA_option_nonce'];
|
2078 |
|
2079 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-enable-2FA-option-nonce' ) ) {
|
2084 |
} else {
|
2085 |
update_option( 'mo2f_enable_2fa', isset( $_POST['mo2f_enable_2fa'] ) ? $_POST['mo2f_enable_2fa'] : 0 );
|
2086 |
}
|
2087 |
+
}else if( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_enable_2FA_on_login_page_option' ) {
|
|
|
|
|
2088 |
$nonce = $_POST['mo2f_enable_2FA_on_login_page_option_nonce'];
|
2089 |
|
2090 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-enable-2FA-on-login-page-option-nonce' ) ) {
|
2095 |
} else {
|
2096 |
update_option( 'mo2f_enable_2fa_prompt_on_login_page', isset( $_POST['mo2f_enable_2fa_prompt_on_login_page'] ) ? $_POST['mo2f_enable_2fa_prompt_on_login_page'] : 0 );
|
2097 |
}
|
2098 |
+
}else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo_2factor_test_authentication_method' ) {
|
2099 |
+
//network security feature
|
2100 |
+
|
|
|
2101 |
|
2102 |
$nonce = $_POST['mo_2factor_test_authentication_method_nonce'];
|
2103 |
|
2230 |
update_user_meta( $user->ID, 'mo2f_2FA_method_to_test', $selected_2FA_method );
|
2231 |
}
|
2232 |
|
2233 |
+
}else if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_go_back' ) {
|
|
|
|
|
2234 |
$nonce = $_POST['mo2f_go_back_nonce'];
|
2235 |
|
2236 |
if ( ! wp_verify_nonce( $nonce, 'mo2f-go-back-nonce' ) ) {
|
2633 |
}
|
2634 |
|
2635 |
function mo_auth_activate() {
|
2636 |
+
error_log(' miniOrange Two Factor Plugin Activated');
|
2637 |
+
$get_encryption_key = MO2f_Utility::random_str(16);
|
2638 |
update_option('mo2f_encryption_key',$get_encryption_key);
|
2639 |
|
2640 |
if ( get_option( 'mo2f_customerKey' ) && ! get_option( 'mo2f_is_NC' ) ) {
|
2644 |
update_option( 'mo2f_is_NNC', 1 );
|
2645 |
}
|
2646 |
|
2647 |
+
do_action('mo2f_network_create_db');
|
2648 |
+
|
2649 |
update_option( 'mo2f_host_name', 'https://auth.miniorange.com' );
|
2650 |
update_option('mo2f_data_storage',null);
|
2651 |
global $Mo2fdbQueries;
|
miniorange_2_factor_support.php
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
function mo2f_support() {
|
|
|
4 |
global $user;
|
5 |
global $Mo2fdbQueries;
|
6 |
$user = wp_get_current_user();
|
@@ -9,8 +10,8 @@ function mo2f_support() {
|
|
9 |
$user_email = $email ? $email : $user->user_email;
|
10 |
$user_phone = $phone != 'false' ? $phone : '';
|
11 |
?>
|
12 |
-
<div
|
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>
|
@@ -72,9 +73,9 @@ function mo2f_support() {
|
|
72 |
<script>
|
73 |
jQuery("#query_phone").intlTelInput();
|
74 |
|
75 |
-
function mo2f_valid(f) {
|
76 |
!(/^[a-zA-Z?,.\(\)\/@ 0-9]*$/).test(f.value) ? f.value = f.value.replace(/[^a-zA-Z?,.\(\)\/@ 0-9]/, '') : null;
|
77 |
-
}
|
78 |
</script>
|
79 |
<?php
|
80 |
}
|
1 |
<?php
|
2 |
|
3 |
function mo2f_support() {
|
4 |
+
|
5 |
global $user;
|
6 |
global $Mo2fdbQueries;
|
7 |
$user = wp_get_current_user();
|
10 |
$user_email = $email ? $email : $user->user_email;
|
11 |
$user_phone = $phone != 'false' ? $phone : '';
|
12 |
?>
|
13 |
+
<div style="margin-left:5%;width: 80%;">
|
14 |
+
|
15 |
<h3><?php echo mo2f_lt( 'Support' ); ?>
|
16 |
<a id="mo2f_faq" class="add-new-h2" href="https://wordpress.org/support/plugin/miniorange-2-factor-authentication"
|
17 |
target="_blank" style="float:right"><?php echo mo2f_lt( 'Ask questions on the WP Forum' ); ?></a>
|
73 |
<script>
|
74 |
jQuery("#query_phone").intlTelInput();
|
75 |
|
76 |
+
/*function mo2f_valid(f) {
|
77 |
!(/^[a-zA-Z?,.\(\)\/@ 0-9]*$/).test(f.value) ? f.value = f.value.replace(/[^a-zA-Z?,.\(\)\/@ 0-9]/, '') : null;
|
78 |
+
}*/
|
79 |
</script>
|
80 |
<?php
|
81 |
}
|
network_security/class_miniorange_2fa_network_security.php
ADDED
@@ -0,0 +1,257 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require('miniorange_handler.php');
|
4 |
+
require('integrations/class_buddypress.php');
|
5 |
+
include ('miniorange_2_factor_network_security_view.php');
|
6 |
+
|
7 |
+
|
8 |
+
class class_miniorange_2fa_network_security {
|
9 |
+
|
10 |
+
function __construct(){
|
11 |
+
add_option('mo2f_enable_brute_force',0);
|
12 |
+
add_option('mo2f_ns_blocked_ip',0);
|
13 |
+
add_option('mo2f_ns_whitelist_ip',0);
|
14 |
+
$mo2f_buddypress = new Mo2f_BuddyPress();
|
15 |
+
add_action('bp_signup_validate', array($mo2f_buddypress, 'signup_errors'));
|
16 |
+
|
17 |
+
add_action( 'mo2f_network_init', array( $this, 'mo2f_network_init' ),5 );
|
18 |
+
add_action( 'admin_init', array( $this, 'mo2f_network_save_settings' ),5 );
|
19 |
+
/*
|
20 |
+
* Hooks added when user logs in. Both hooks one after successful login and one with unsuccessful login
|
21 |
+
* */
|
22 |
+
if( get_site_option('mo2f_activate_plugin') == 1) {
|
23 |
+
if ( get_option( 'mo2f_enable_brute_force' ) ) {
|
24 |
+
add_action( 'wp_login', array( $this, 'mo2f_ns_login_success' ) );
|
25 |
+
add_action( 'wp_login_failed', array( $this, 'mo2f_ns_login_failed' ) );
|
26 |
+
}
|
27 |
+
}
|
28 |
+
$mo2f_ns_config = new MO2f_Handler();
|
29 |
+
add_action('mo2f_network_create_db',array($mo2f_ns_config,'create_db'),5);
|
30 |
+
add_action('mo2f_network_view_monitoring','mo2f_show_2_factor_user_login_reports',5,1);
|
31 |
+
add_action('mo2f_network_view_ip_blocking','mo2f_show_2_factor_ip_block',5,1);
|
32 |
+
add_action('mo2f_network_view_brute_force','mo2f_show_2_factor_login_security',5,1);
|
33 |
+
}
|
34 |
+
|
35 |
+
public function mo2f_network_init(){
|
36 |
+
$userIp = MO2f_Utility::get_client_ipaddress();
|
37 |
+
$userIp='127.0.0.1';
|
38 |
+
$mo2f_ns_config = new MO2f_Handler();
|
39 |
+
$isIpBlocked = false;
|
40 |
+
if ($mo2f_ns_config->is_whitelisted($userIp)) {
|
41 |
+
|
42 |
+
} else if ($mo2f_ns_config->is_ip_blocked($userIp)) {
|
43 |
+
$isIpBlocked = true;
|
44 |
+
}
|
45 |
+
if ($isIpBlocked) {
|
46 |
+
require_once 'templates/403.php';
|
47 |
+
exit();
|
48 |
+
}
|
49 |
+
|
50 |
+
}
|
51 |
+
|
52 |
+
/*
|
53 |
+
* Log information of user login
|
54 |
+
*/
|
55 |
+
function mo2f_ns_login_success($username){
|
56 |
+
$user = get_user_by( 'login', $username );
|
57 |
+
update_user_meta($user->ID,'last_active_time',date('H:i:s'));
|
58 |
+
if(!get_option('mo2f_enable_brute_force'))
|
59 |
+
return;
|
60 |
+
$mo2f_ns_config = new MO2f_Handler();
|
61 |
+
$userIp = MO2f_Utility::get_client_ipaddress();
|
62 |
+
|
63 |
+
$mo2f_ns_config->move_failed_transactions_to_past_failed($userIp);
|
64 |
+
$mo2f_ns_config->add_transactions($userIp, $username, MO2f_Constants::LOGIN_TRANSACTION, MO2f_Constants::SUCCESS);
|
65 |
+
}
|
66 |
+
|
67 |
+
function mo2f_ns_login_failed($username){
|
68 |
+
if(!get_option('mo2f_enable_brute_force'))
|
69 |
+
return;
|
70 |
+
|
71 |
+
$userIp = MO2f_Utility::get_client_ipaddress();
|
72 |
+
if(empty($userIp))
|
73 |
+
return;
|
74 |
+
else if(empty($username))
|
75 |
+
return;
|
76 |
+
|
77 |
+
$mo2f_ns_config = new MO2f_Handler();
|
78 |
+
$mo2f_ns_config->add_transactions($userIp, $username, MO2f_Constants::LOGIN_TRANSACTION, MO2f_Constants::FAILED);
|
79 |
+
|
80 |
+
$isWhitelisted = $mo2f_ns_config->is_whitelisted($userIp);
|
81 |
+
|
82 |
+
if(!$isWhitelisted){
|
83 |
+
$failedAttempts = $mo2f_ns_config->get_failed_attempts_count($userIp);
|
84 |
+
|
85 |
+
$allowedLoginAttepts = 5;
|
86 |
+
if(get_option('mo2f_allwed_login_attempts'))
|
87 |
+
$allowedLoginAttepts = get_option('mo2f_allwed_login_attempts');
|
88 |
+
|
89 |
+
if($allowedLoginAttepts - $failedAttempts<=0){
|
90 |
+
$mo2f_ns_config->block_ip($userIp, Mo2f_Messages::LOGIN_ATTEMPTS_EXCEEDED, false);
|
91 |
+
require_once 'templates/403.php';
|
92 |
+
exit();
|
93 |
+
}else {
|
94 |
+
if(get_option('mo2f_show_remaining_attempts')){
|
95 |
+
global $error;
|
96 |
+
$diff = $allowedLoginAttepts - $failedAttempts;
|
97 |
+
$error = "<br>You have <b>".$diff."</b> attempts remaining.";
|
98 |
+
}
|
99 |
+
}
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
function mo2f_network_save_settings(){
|
104 |
+
global $user;
|
105 |
+
global $Mo2fdbQueries;
|
106 |
+
// $mo2f_settings=new Miniorange_Authentication();
|
107 |
+
$user = wp_get_current_user();
|
108 |
+
$user_id = $user->ID;
|
109 |
+
|
110 |
+
if ( current_user_can( 'manage_options' ) ) {
|
111 |
+
if(isset($_POST['option']) and $_POST['option'] == "mo2f_enable_brute_force")
|
112 |
+
{
|
113 |
+
$enable_brute_force_protection = false;
|
114 |
+
if(isset($_POST['mo2f_enable_brute_force_protection']) && $_POST['mo2f_enable_brute_force_protection']=='1'){
|
115 |
+
$enable_brute_force_protection = sanitize_text_field($_POST['mo2f_enable_brute_force_protection']);
|
116 |
+
update_option( 'mo2f_message', 'Brute force protection is enabled.');
|
117 |
+
do_action('mo_auth_show_success_message');
|
118 |
+
}else {
|
119 |
+
update_option( 'mo2f_message', 'Brute force protection is disabled.');
|
120 |
+
do_action('mo_auth_show_error_message');
|
121 |
+
}
|
122 |
+
update_option( 'mo2f_enable_brute_force', $enable_brute_force_protection);
|
123 |
+
} else if(isset($_POST['option']) and $_POST['option'] == "mo2f_brute_force_configuration"){
|
124 |
+
if($_POST['allwed_login_attempts']>0)
|
125 |
+
{
|
126 |
+
if($_POST['time_of_blocking_type']=='permanent'){
|
127 |
+
update_option( 'mo2f_allwed_login_attempts', sanitize_text_field($_POST['allwed_login_attempts']));
|
128 |
+
|
129 |
+
update_option( 'mo2f_time_of_blocking_type', sanitize_text_field($_POST['time_of_blocking_type']));
|
130 |
+
if(isset($_POST['time_of_blocking_val']))
|
131 |
+
update_option( 'mo2f_time_of_blocking_val', sanitize_text_field($_POST['time_of_blocking_val']));
|
132 |
+
$show_remaining_attempts = false;
|
133 |
+
if(isset($_POST['show_remaining_attempts']) && $_POST['show_remaining_attempts'])
|
134 |
+
$show_remaining_attempts = true;
|
135 |
+
update_option( 'mo2f_show_remaining_attempts', $show_remaining_attempts);
|
136 |
+
update_option( 'mo2f_message', 'Your configuration has been saved.');
|
137 |
+
do_action('mo_auth_show_success_message');
|
138 |
+
}else{
|
139 |
+
update_option( 'mo2f_message', 'You will have to upgrade to our Standard/Premium plan to use this feature.');
|
140 |
+
do_action('mo_auth_show_error_message');
|
141 |
+
}
|
142 |
+
|
143 |
+
}else{
|
144 |
+
update_option( 'mo2f_message', 'Login Limit Should be more than or equal to 1.');
|
145 |
+
do_action('mo_auth_show_error_message');
|
146 |
+
}
|
147 |
+
}else if(isset($_POST['option']) and $_POST['option']=='mo2f_manual_clear'){
|
148 |
+
|
149 |
+
$mo2f_ns_config = new MO2f_Handler();
|
150 |
+
$mo2f_ns_config->mo2f_clear_login_report();
|
151 |
+
update_option( 'mo2f_message', "Login Reports have been successfully erased.");
|
152 |
+
do_action('mo_auth_show_success_message');
|
153 |
+
|
154 |
+
}else if(isset($_POST['option']) and $_POST['option'] == "mo2f_ns_manual_block_ip"){
|
155 |
+
$reg = '/\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/';
|
156 |
+
if( MO2f_Utility::mo2f_check_empty_or_null( $_POST['ip'] )|| !preg_match($reg, $_POST['ip'])) {
|
157 |
+
update_option( 'mo2f_message', 'Please enter valid IP address (e.g., 0.0.0.0 to 255.255.255.255).');
|
158 |
+
do_action('mo_auth_show_error_message');
|
159 |
+
return;
|
160 |
+
} else{
|
161 |
+
$ipAddress = sanitize_text_field( $_POST['ip'] );
|
162 |
+
$mo2f_ns_config = new MO2f_Handler();
|
163 |
+
$isWhitelisted = $mo2f_ns_config->is_whitelisted($ipAddress);
|
164 |
+
if(!$isWhitelisted){
|
165 |
+
if($mo2f_ns_config->is_ip_blocked($ipAddress)){
|
166 |
+
update_option( 'mo2f_message', "IP Address is already in blocked IP's list.");
|
167 |
+
do_action('mo_auth_show_error_message');
|
168 |
+
} else{
|
169 |
+
//add limit to number of blocks
|
170 |
+
$no_of_blocks=get_option('mo2f_ns_blocked_ip');
|
171 |
+
if($no_of_blocks<5){
|
172 |
+
$mo2f_ns_config->block_ip($ipAddress, Mo2f_Messages::BLOCKED_BY_ADMIN, true);
|
173 |
+
$no_of_blocks=$no_of_blocks+1;
|
174 |
+
update_option('mo2f_ns_blocked_ip',$no_of_blocks);
|
175 |
+
update_option( 'mo2f_message', 'IP Address is blocked permanently.');
|
176 |
+
do_action('mo_auth_show_success_message');
|
177 |
+
}else{
|
178 |
+
update_option( 'mo2f_message', "You cannot Manually block more than 5 IP Addresses in Free plugin.");
|
179 |
+
do_action('mo_auth_show_error_message');
|
180 |
+
}
|
181 |
+
|
182 |
+
}
|
183 |
+
}else{
|
184 |
+
update_option( 'mo2f_message', "IP Address is in Whitelisted IP's list. Please remove it from whitelisted list first.");
|
185 |
+
do_action('mo_auth_show_error_message');
|
186 |
+
}
|
187 |
+
}
|
188 |
+
} else if(isset($_POST['option']) and $_POST['option'] == "mo2f_ns_unblock_ip"){
|
189 |
+
|
190 |
+
if( MO2f_Utility::mo2f_check_empty_or_null( $_POST['entryid'] )) {
|
191 |
+
update_option( 'mo2f_message', 'Error processing your request. Please try again.');
|
192 |
+
do_action('mo_auth_show_error_message');
|
193 |
+
return;
|
194 |
+
}else{
|
195 |
+
$entryid = sanitize_text_field( $_POST['entryid'] );
|
196 |
+
$mo2f_ns_config = new MO2f_Handler();
|
197 |
+
$reason=$mo2f_ns_config->unblock_ip_entry($entryid);
|
198 |
+
update_option( 'mo2f_message', 'IP has been unblocked.');
|
199 |
+
do_action('mo_auth_show_success_message');
|
200 |
+
if(strpos($reason, 'Blocked') !== false){
|
201 |
+
$no_of_blocks=get_option('mo2f_ns_blocked_ip');
|
202 |
+
update_option('mo2f_ns_blocked_ip',$no_of_blocks-1);
|
203 |
+
}
|
204 |
+
}
|
205 |
+
} else if(isset($_POST['option']) and $_POST['option'] == "mo2f_ns_whitelist_ip"){
|
206 |
+
$reg = '/\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/';
|
207 |
+
if( MO2f_Utility::mo2f_check_empty_or_null( $_POST['ip'] ) || !preg_match($reg, $_POST['ip'])) {
|
208 |
+
update_option( 'mo2f_message', 'Please enter valid IP address (e.g., 0.0.0.0 to 255.255.255.255).');
|
209 |
+
do_action('mo_auth_show_error_message');
|
210 |
+
return;
|
211 |
+
}else{
|
212 |
+
$ipAddress = sanitize_text_field( $_POST['ip'] );
|
213 |
+
$mo2f_ns_config = new MO2f_Handler();
|
214 |
+
if($mo2f_ns_config->is_whitelisted($ipAddress)){
|
215 |
+
update_option( 'mo2f_message', "IP Address is already in whitelisted IP's list.");
|
216 |
+
do_action('mo_auth_show_error_message');
|
217 |
+
} else{
|
218 |
+
$no_of_whitelist=get_option('mo2f_ns_whitelist_ip');
|
219 |
+
if($no_of_whitelist<5) {
|
220 |
+
$mo2f_ns_config = new MO2f_Handler();
|
221 |
+
if($mo2f_ns_config ->is_ip_blocked($ipAddress)){
|
222 |
+
update_option( 'mo2f_message', "IP Address is in Blocked IP's list. Please remove it from blocked list first." );
|
223 |
+
do_action('mo_auth_show_error_message');
|
224 |
+
}
|
225 |
+
else {
|
226 |
+
$mo2f_ns_config->whitelist_ip( $ipAddress );
|
227 |
+
update_option( 'mo2f_message', 'IP Address is whitelisted.' );
|
228 |
+
do_action('mo_auth_show_success_message');
|
229 |
+
$no_of_whitelist = $no_of_whitelist + 1;
|
230 |
+
update_option( 'mo2f_ns_whitelist_ip', $no_of_whitelist );
|
231 |
+
}
|
232 |
+
}else{
|
233 |
+
update_option( 'mo2f_message', "You cannot Whitelist more than 5 IP Addresses in Free plugin.");
|
234 |
+
do_action('mo_auth_show_error_message');
|
235 |
+
}
|
236 |
+
}
|
237 |
+
}
|
238 |
+
} else if(isset($_POST['option']) and $_POST['option'] == "mo2f_ns_remove_whitelist"){
|
239 |
+
|
240 |
+
if( MO2f_Utility::mo2f_check_empty_or_null( $_POST['entryid'] )) {
|
241 |
+
update_option( 'mo2f_message', 'Error processing your request. Please try again.');
|
242 |
+
do_action('mo_auth_show_error_message');
|
243 |
+
return;
|
244 |
+
}else{
|
245 |
+
$entryid = sanitize_text_field( $_POST['entryid'] );
|
246 |
+
$mo2f_ns_config = new MO2f_Handler();
|
247 |
+
$mo2f_ns_config->remove_whitelist_entry($entryid);
|
248 |
+
$no_of_whitelist=get_option('mo2f_ns_whitelist_ip');
|
249 |
+
update_option('mo2f_ns_whitelist_ip',$no_of_whitelist-1);
|
250 |
+
update_option( 'mo2f_message', "IP Address is removed from the whitelisted IP's list.");
|
251 |
+
do_action('mo_auth_show_success_message');
|
252 |
+
}
|
253 |
+
}
|
254 |
+
}
|
255 |
+
}
|
256 |
+
}
|
257 |
+
new class_miniorange_2fa_network_security;
|
network_security/integrations/class_buddypress.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php class Mo2f_BuddyPress{
|
2 |
+
|
3 |
+
public static function signup_errors() {
|
4 |
+
if (!isset($_POST['signup_username']))
|
5 |
+
return;
|
6 |
+
|
7 |
+
$user_name = $_POST['signup_username'];
|
8 |
+
$error = "";
|
9 |
+
global $bp;
|
10 |
+
// making sure we are in the registration page
|
11 |
+
if ( !function_exists('bp_is_current_component') || !bp_is_current_component('register') ) {
|
12 |
+
return;
|
13 |
+
}
|
14 |
+
|
15 |
+
if (get_option('mo2f_enable_brute_force')) {
|
16 |
+
$userIp = MO2f_Utility::get_client_ipaddress();
|
17 |
+
$mo2f_ns_config = new MO2f_Handler();
|
18 |
+
$mo2f_ns_config->add_transactions($userIp, $user_name, MO2f_Constants::REGISTRATION_TRANSACTION, MO2f_Constants::FAILED);
|
19 |
+
|
20 |
+
$isWhitelisted = $mo2f_ns_config->is_whitelisted($userIp);
|
21 |
+
if(!$isWhitelisted){
|
22 |
+
$failedAttempts = $mo2f_ns_config->get_failed_attempts_count($userIp);
|
23 |
+
|
24 |
+
|
25 |
+
$allowedLoginAttepts = 5;
|
26 |
+
if(get_option('mo2f_allwed_login_attempts'))
|
27 |
+
$allowedLoginAttepts = get_option('mo2f_allwed_login_attempts');
|
28 |
+
|
29 |
+
|
30 |
+
if($allowedLoginAttepts - $failedAttempts<=0){
|
31 |
+
$mo2f_ns_config->block_ip($userIp, Mo2f_Messages::LOGIN_ATTEMPTS_EXCEEDED, false);
|
32 |
+
require_once '../templates/403.php';
|
33 |
+
exit();
|
34 |
+
}else {
|
35 |
+
if(get_option('mo2f_show_remaining_attempts')){
|
36 |
+
$diff = $allowedLoginAttepts - $failedAttempts;
|
37 |
+
$error = "<br>You have <b>".$diff."</b> attempts remaining.";
|
38 |
+
}
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
bp_core_add_message($error, 'error');
|
43 |
+
}
|
44 |
+
}?>
|
network_security/miniorange_2_factor_network_security_view.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
include_once dirname( __FILE__ ) . '/views/miniorange_network_security_monitoring.php';
|
4 |
+
include_once dirname( __FILE__ ) . '/views/miniorange_network_security_ip_blocking.php';
|
5 |
+
include_once dirname( __FILE__ ) . '/views/miniorange_network_security_brute_force.php';
|
6 |
+
|
7 |
+
?>
|
network_security/miniorange_handler.php
ADDED
@@ -0,0 +1,271 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/** Copyright (C) 2015 miniOrange
|
3 |
+
|
4 |
+
This program is free software: you can redistribute it and/or modify
|
5 |
+
it under the terms of the GNU General Public License as published by
|
6 |
+
the Free Software Foundation, either version 3 of the License, or
|
7 |
+
(at your option) any later version.
|
8 |
+
|
9 |
+
This program is distributed in the hope that it will be useful,
|
10 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
+
GNU General Public License for more details.
|
13 |
+
|
14 |
+
You should have received a copy of the GNU General Public License
|
15 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>
|
16 |
+
* @package miniOrange OAuth
|
17 |
+
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
|
21 |
+
class MO2f_Handler{
|
22 |
+
|
23 |
+
|
24 |
+
function create_db(){
|
25 |
+
global $wpdb;
|
26 |
+
$tableName = $wpdb->prefix.MO2f_Constants::USER_TRANSCATIONS_TABLE;
|
27 |
+
if($wpdb->get_var("show tables like '$tableName'") != $tableName)
|
28 |
+
{
|
29 |
+
$sql = "CREATE TABLE " . $tableName . " (
|
30 |
+
`id` bigint NOT NULL AUTO_INCREMENT, `ip_address` mediumtext NOT NULL , `username` mediumtext NOT NULL ,
|
31 |
+
`type` mediumtext NOT NULL , `url` mediumtext NOT NULL , `status` mediumtext NOT NULL , `created_timestamp` int, UNIQUE KEY id (id) );";
|
32 |
+
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
33 |
+
dbDelta($sql);
|
34 |
+
}
|
35 |
+
$tableName = $wpdb->prefix.MO2f_Constants::BLOCKED_IPS_TABLE;
|
36 |
+
if($wpdb->get_var("show tables like '$tableName'") != $tableName)
|
37 |
+
{
|
38 |
+
$sql = "CREATE TABLE " . $tableName . " (
|
39 |
+
`id` int NOT NULL AUTO_INCREMENT, `ip_address` mediumtext NOT NULL , `reason` mediumtext, `blocked_for_time` int,
|
40 |
+
`created_timestamp` int, UNIQUE KEY id (id) );";
|
41 |
+
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
42 |
+
dbDelta($sql);
|
43 |
+
}
|
44 |
+
$tableName = $wpdb->prefix.MO2f_Constants::WHITELISTED_IPS_TABLE;
|
45 |
+
if($wpdb->get_var("show tables like '$tableName'") != $tableName)
|
46 |
+
{
|
47 |
+
$sql = "CREATE TABLE " . $tableName . " (
|
48 |
+
`id` int NOT NULL AUTO_INCREMENT, `ip_address` mediumtext NOT NULL , `created_timestamp` int, UNIQUE KEY id (id) );";
|
49 |
+
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
50 |
+
dbDelta($sql);
|
51 |
+
}
|
52 |
+
$tableName = $wpdb->prefix.MO2f_Constants::EMAIL_SENT_AUDIT;
|
53 |
+
if($wpdb->get_var("show tables like '$tableName'") != $tableName)
|
54 |
+
{
|
55 |
+
$sql = "CREATE TABLE " . $tableName . " (
|
56 |
+
`id` int NOT NULL AUTO_INCREMENT, `ip_address` mediumtext NOT NULL , `username` mediumtext NOT NULL, `reason` mediumtext, `created_timestamp` int, UNIQUE KEY id (id) );";
|
57 |
+
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
58 |
+
dbDelta($sql);
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
function is_ip_blocked($ipAddress){
|
63 |
+
if(empty($ipAddress))
|
64 |
+
return false;
|
65 |
+
global $wpdb;
|
66 |
+
|
67 |
+
$myrows = $wpdb->get_results( "SELECT * FROM ".$wpdb->prefix.MO2f_Constants::BLOCKED_IPS_TABLE." where ip_address = '".$ipAddress."'" );
|
68 |
+
if($myrows){
|
69 |
+
if(count($myrows)>0){
|
70 |
+
$time_of_blocking = $myrows[0]->blocked_for_time;
|
71 |
+
$currenttime = current_time( 'timestamp' );
|
72 |
+
if($currenttime < $time_of_blocking){
|
73 |
+
return true;
|
74 |
+
} else{ //premium
|
75 |
+
$wpdb->query( "DELETE FROM ".$wpdb->prefix.MO2f_Constants::BLOCKED_IPS_TABLE." WHERE ip_address = '".$ipAddress."'");
|
76 |
+
$wpdb->query( "UPDATE ".$wpdb->prefix.MO2f_Constants::USER_TRANSCATIONS_TABLE." SET status='".MO2f_Constants::PAST_FAILED."' WHERE ip_address = '".$ipAddress."' AND status='".MO2f_Constants::FAILED."'");
|
77 |
+
}
|
78 |
+
}
|
79 |
+
}
|
80 |
+
return false;
|
81 |
+
}
|
82 |
+
|
83 |
+
function block_ip($ipAddress, $reason, $permenently){
|
84 |
+
if(empty($ipAddress))
|
85 |
+
return;
|
86 |
+
if($this->is_ip_blocked($ipAddress))
|
87 |
+
return;
|
88 |
+
$blocked_for_time = null;
|
89 |
+
$blocking_type = get_option('mo2f_time_of_blocking_type');
|
90 |
+
|
91 |
+
$time_of_blocking_val = 3;
|
92 |
+
if(!$permenently)
|
93 |
+
{
|
94 |
+
if(get_option('mo2f_time_of_blocking_val'))
|
95 |
+
$time_of_blocking_val = get_option('mo2f_time_of_blocking_val');
|
96 |
+
if($blocking_type=="months")
|
97 |
+
$blocked_for_time = current_time( 'timestamp' )+$time_of_blocking_val * 30 * 24 * 60 * 60;
|
98 |
+
else if($blocking_type=="days")
|
99 |
+
$blocked_for_time = current_time( 'timestamp' )+$time_of_blocking_val * 24 * 60 * 60;
|
100 |
+
else if($blocking_type=="hours")
|
101 |
+
$blocked_for_time = current_time( 'timestamp' )+$time_of_blocking_val * 60 * 60;
|
102 |
+
else if($blocking_type=="minutes")
|
103 |
+
$blocked_for_time = current_time( 'timestamp' )+$time_of_blocking_val * 60;
|
104 |
+
else
|
105 |
+
$blocked_for_time = current_time( 'timestamp' )+3* 365 * 24 * 60 * 60;
|
106 |
+
}else
|
107 |
+
{
|
108 |
+
$blocked_for_time = current_time( 'timestamp' )+$time_of_blocking_val * 365 * 24 * 60 * 60;
|
109 |
+
}
|
110 |
+
|
111 |
+
global $wpdb;
|
112 |
+
$wpdb->insert(
|
113 |
+
$wpdb->prefix.MO2f_Constants::BLOCKED_IPS_TABLE,
|
114 |
+
array(
|
115 |
+
'ip_address' => $ipAddress,
|
116 |
+
'reason' => $reason,
|
117 |
+
'blocked_for_time' => $blocked_for_time,
|
118 |
+
'created_timestamp' => current_time( 'timestamp' )
|
119 |
+
)
|
120 |
+
);
|
121 |
+
}
|
122 |
+
|
123 |
+
function unblock_ip_entry($entryid){
|
124 |
+
global $wpdb;
|
125 |
+
$myrows = $wpdb->get_results( "SELECT ip_address FROM ".$wpdb->prefix.MO2f_Constants::BLOCKED_IPS_TABLE." where id=".$entryid );
|
126 |
+
if(count($myrows)>0){
|
127 |
+
$ip=$wpdb->get_var( "SELECT ip_address FROM ".$wpdb->prefix.MO2f_Constants::BLOCKED_IPS_TABLE." where id=".$entryid );
|
128 |
+
$reason=$wpdb->get_var( "SELECT reason FROM ".$wpdb->prefix.MO2f_Constants::BLOCKED_IPS_TABLE." where id=".$entryid );
|
129 |
+
}
|
130 |
+
|
131 |
+
$wpdb->query(
|
132 |
+
"UPDATE ".$wpdb->prefix.MO2f_Constants::USER_TRANSCATIONS_TABLE." SET status='".MO2f_Constants::PAST_FAILED."'
|
133 |
+
WHERE ip_address = '".$ip."' AND status='".MO2f_Constants::FAILED."'"
|
134 |
+
);
|
135 |
+
$wpdb->query(
|
136 |
+
"DELETE FROM ".$wpdb->prefix.MO2f_Constants::BLOCKED_IPS_TABLE."
|
137 |
+
WHERE id = ".$entryid
|
138 |
+
);
|
139 |
+
return $reason;
|
140 |
+
|
141 |
+
}
|
142 |
+
public static function get_current_url()
|
143 |
+
{
|
144 |
+
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
|
145 |
+
$url = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
146 |
+
return $url;
|
147 |
+
}
|
148 |
+
|
149 |
+
function get_blocked_ips(){
|
150 |
+
global $wpdb;
|
151 |
+
$myrows = $wpdb->get_results( "SELECT id, ip_address, reason, blocked_for_time, created_timestamp FROM ".$wpdb->prefix.MO2f_Constants::BLOCKED_IPS_TABLE );
|
152 |
+
return $myrows;
|
153 |
+
}
|
154 |
+
|
155 |
+
function is_whitelisted($ipAddress){
|
156 |
+
if(empty($ipAddress))
|
157 |
+
return false;
|
158 |
+
global $wpdb;
|
159 |
+
$user_count = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix.MO2f_Constants::WHITELISTED_IPS_TABLE." where ip_address = '".$ipAddress."'" );
|
160 |
+
if($user_count)
|
161 |
+
$user_count = intval($user_count);
|
162 |
+
if($user_count>0)
|
163 |
+
return true;
|
164 |
+
return false;
|
165 |
+
}
|
166 |
+
|
167 |
+
function whitelist_ip($ipAddress){
|
168 |
+
|
169 |
+
if(empty($ipAddress))
|
170 |
+
return;
|
171 |
+
if($this->is_whitelisted($ipAddress))
|
172 |
+
return;
|
173 |
+
global $wpdb;
|
174 |
+
$wpdb->insert(
|
175 |
+
$wpdb->prefix.MO2f_Constants::WHITELISTED_IPS_TABLE,
|
176 |
+
array(
|
177 |
+
'ip_address' => $ipAddress,
|
178 |
+
'created_timestamp' => current_time( 'timestamp' )
|
179 |
+
)
|
180 |
+
);
|
181 |
+
}
|
182 |
+
|
183 |
+
function remove_whitelist_entry($entryid){
|
184 |
+
global $wpdb;
|
185 |
+
$wpdb->query(
|
186 |
+
"DELETE FROM ".$wpdb->prefix.MO2f_Constants::WHITELISTED_IPS_TABLE."
|
187 |
+
WHERE id = ".$entryid
|
188 |
+
);
|
189 |
+
}
|
190 |
+
|
191 |
+
function get_whitelisted_ips(){
|
192 |
+
global $wpdb;
|
193 |
+
$myrows = $wpdb->get_results( "SELECT id, ip_address, created_timestamp FROM ".$wpdb->prefix.MO2f_Constants::WHITELISTED_IPS_TABLE );
|
194 |
+
return $myrows;
|
195 |
+
}
|
196 |
+
|
197 |
+
|
198 |
+
function add_transactions($ipAddress, $username, $type, $status,$url=null){
|
199 |
+
global $wpdb;
|
200 |
+
if ($username == '') {
|
201 |
+
$username = "-";
|
202 |
+
}
|
203 |
+
$url=is_null($url) ? '' : $url;
|
204 |
+
$wpdb->insert(
|
205 |
+
$wpdb->prefix.MO2f_Constants::USER_TRANSCATIONS_TABLE,
|
206 |
+
array(
|
207 |
+
'ip_address' => $ipAddress,
|
208 |
+
'username' => $username,
|
209 |
+
'type' => $type,
|
210 |
+
'status' => $status,
|
211 |
+
'url' =>$url,
|
212 |
+
'created_timestamp' => current_time( 'timestamp' )
|
213 |
+
)
|
214 |
+
);
|
215 |
+
}
|
216 |
+
|
217 |
+
function mo2f_clear_login_report() {
|
218 |
+
global $wpdb;
|
219 |
+
$wpdb->query("DELETE FROM " . $wpdb->prefix . MO2f_Constants::USER_TRANSCATIONS_TABLE . " WHERE Status='".MO2f_Constants::SUCCESS."' or Status= '".MO2f_Constants::PAST_FAILED."' OR Status='".MO2f_Constants::FAILED."'");
|
220 |
+
|
221 |
+
}
|
222 |
+
function mo2f_clear_error_report() {
|
223 |
+
global $wpdb;
|
224 |
+
$wpdb->query( "DELETE FROM " . $wpdb->prefix . MO2f_Constants::USER_TRANSCATIONS_TABLE . " WHERE Status='".MO2f_Constants::ACCESS_DENIED."' " );
|
225 |
+
}
|
226 |
+
|
227 |
+
function get_all_transactions() {
|
228 |
+
global $wpdb;
|
229 |
+
$myrows = $wpdb->get_results("SELECT ip_address, username, type, status, created_timestamp,url FROM " . $wpdb->prefix . MO2f_Constants::USER_TRANSCATIONS_TABLE . " order by id desc limit 5000");
|
230 |
+
return $myrows;
|
231 |
+
}
|
232 |
+
|
233 |
+
function move_failed_transactions_to_past_failed($ipAddress){
|
234 |
+
global $wpdb;
|
235 |
+
$wpdb->query(
|
236 |
+
"UPDATE ".$wpdb->prefix.MO2f_Constants::USER_TRANSCATIONS_TABLE." SET status='".MO2f_Constants::PAST_FAILED."'
|
237 |
+
WHERE ip_address = '".$ipAddress."' AND status='".MO2f_Constants::FAILED."'"
|
238 |
+
);
|
239 |
+
}
|
240 |
+
|
241 |
+
function delete_last_transaction($ipAddress, $username, $type, $status) {
|
242 |
+
global $wpdb;
|
243 |
+
$wpdb->query(
|
244 |
+
"DELETE FROM ".$wpdb->prefix.MO2f_Constants::USER_TRANSCATIONS_TABLE."
|
245 |
+
WHERE ip_address = '".$ipAddress."' AND status='".$status."' AND username='".$username."' AND type='".$type."' order by created_timestamp desc limit 1"
|
246 |
+
);
|
247 |
+
}
|
248 |
+
|
249 |
+
|
250 |
+
function delete_all_transactions(){
|
251 |
+
|
252 |
+
|
253 |
+
global $wpdb;
|
254 |
+
$wpdb->query("DELETE FROM ".$wpdb->prefix.MO2f_Constants::USER_TRANSCATIONS_TABLE." WHERE Status='success' or Status= 'pastfailed' OR Status='failed'");
|
255 |
+
|
256 |
+
}
|
257 |
+
|
258 |
+
function get_failed_attempts_count($ipAddress){
|
259 |
+
global $wpdb;
|
260 |
+
|
261 |
+
$user_count = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix.MO2f_Constants::USER_TRANSCATIONS_TABLE." where ip_address = '".$ipAddress."'
|
262 |
+
AND status = '".MO2f_Constants::FAILED."'" );
|
263 |
+
if($user_count){
|
264 |
+
$user_count = intval($user_count);
|
265 |
+
return $user_count;
|
266 |
+
}
|
267 |
+
return 0;
|
268 |
+
}
|
269 |
+
|
270 |
+
|
271 |
+
} ?>
|
network_security/templates/403.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php header('HTTP/1.0 403 Forbidden');?>
|
2 |
+
<h1>403 Forbidden</h1>
|
3 |
+
You don't have permission to access this website.<br><br>
|
4 |
+
<hr>
|
5 |
+
<?php
|
6 |
+
do_action('mo2f_log_403');
|
7 |
+
?>
|
network_security/views/miniorange_network_security_brute_force.php
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function mo2f_show_2_factor_login_security($current_user){
|
4 |
+
?>
|
5 |
+
<div class="mo2f_table_layout" style="border:0px;">
|
6 |
+
<!-- Brute Force Configuration -->
|
7 |
+
<h3>Login Protection </h3>
|
8 |
+
<div class="mo2f_advanced_options_note" style="font-style:Italic;padding:2%;width: 80%;"><?php echo __('A Brute Force Attack is repeated attempts at guessing your username and password to gain access to your WordPress admin. In a brute force attack, automated software is used to generate a large number of consecutive guesses which can be random or leaked passwords data. Limiting the the attempts and blocking the IP can protect your accounts and website from these attacks. ');?></div>
|
9 |
+
<form id="mo2f_enable_brute_force_form" method="post" action="">
|
10 |
+
<input type="hidden" name="option" value="mo2f_enable_brute_force">
|
11 |
+
<br><input type="checkbox" name="mo2f_enable_brute_force_protection" value="1" <?php if(get_option('mo2f_enable_brute_force')) echo "checked"; if(mo2f_is_customer_registered()){}else{ echo 'disabled';}?> <?php if(get_option('mo2f_enable_brute_force')) echo "checked";?> onchange="document.getElementById('mo2f_enable_brute_force_form').submit();"> Enable the Brute Force Protection
|
12 |
+
</form>
|
13 |
+
<br>
|
14 |
+
<?php if(get_option('mo2f_enable_brute_force')){
|
15 |
+
$allwed_login_attempts = 10;
|
16 |
+
$time_of_blocking_type = "permanent";
|
17 |
+
$time_of_blocking_val = 3;
|
18 |
+
if(get_option('mo2f_allwed_login_attempts'))
|
19 |
+
$allwed_login_attempts = get_option('mo2f_allwed_login_attempts');
|
20 |
+
else
|
21 |
+
update_option('mo2f_allwed_login_attempts', $allwed_login_attempts);
|
22 |
+
if(get_option('mo2f_time_of_blocking_type'))
|
23 |
+
$time_of_blocking_type = get_option('mo2f_time_of_blocking_type');
|
24 |
+
if(get_option('mo2f_time_of_blocking_val'))
|
25 |
+
$time_of_blocking_val = get_option('mo2f_time_of_blocking_val');
|
26 |
+
?>
|
27 |
+
<form id="mo2f_enable_brute_force_form" method="post" action="">
|
28 |
+
<input type="hidden" name="option" value="mo2f_brute_force_configuration">
|
29 |
+
<table class="mo2f_ns_settings_table" style="width:80%;">
|
30 |
+
<tr>
|
31 |
+
<td>Allowed login attempts before blocking an IP : </td>
|
32 |
+
<td><input class="mo2f_ns_table_textbox" style="width: 65%;" type="number" id="allwed_login_attempts" name="allwed_login_attempts" required placeholder="10" value="<?php echo $allwed_login_attempts;?>" min="1"<?php if(mo2f_is_customer_registered()){}else{ echo 'disabled';}?>/></td>
|
33 |
+
</tr>
|
34 |
+
<tr>
|
35 |
+
<td>Time period for which IP should be blocked : </td>
|
36 |
+
<td>
|
37 |
+
<select id="time_of_blocking_type" name="time_of_blocking_type" style="width:65%;"<?php if(mo2f_is_customer_registered() ){}else{ echo 'disabled';}?>onchange="if((this.value)!='permanent')document.getElementById('time_of_blocking_val').style.display='block';else document.getElementById('time_of_blocking_val').style.display='none';" >
|
38 |
+
<option value="permanent" <?php if($time_of_blocking_type=="permanent") echo "selected";?>>Permanently</option>
|
39 |
+
<option value="months" disabled >Months (Standard/Premium Feature)</option>
|
40 |
+
<option value="days" disabled >Days (Standard/Premium Feature)</option>
|
41 |
+
<option value="minutes" disabled >Minutes (Standard/Premium Feature)</option>
|
42 |
+
</select>
|
43 |
+
</td>
|
44 |
+
</tr>
|
45 |
+
<tr style="height: 28px;">
|
46 |
+
<td>Show remaining login attempts to user : </td>
|
47 |
+
<td><input type="checkbox" name="show_remaining_attempts" <?php if(get_option('mo2f_show_remaining_attempts')) echo "checked";?> <?php if(mo2f_is_customer_registered()){}else{ echo 'disabled';}?>/></td>
|
48 |
+
</tr>
|
49 |
+
<tr>
|
50 |
+
<td></td>
|
51 |
+
<td><input type="submit" name="submit" style="width:100px;" value="Save" class="button button-primary button-large"<?php if(mo2f_is_customer_registered()){}else{ echo 'disabled';}?>></td>
|
52 |
+
</tr>
|
53 |
+
</table>
|
54 |
+
<br>
|
55 |
+
</form>
|
56 |
+
<?php } ?>
|
57 |
+
</div>
|
58 |
+
|
59 |
+
<br>
|
60 |
+
<script>
|
61 |
+
<?php if (!MO2f_Utility::is_customer_registered()) { ?>
|
62 |
+
jQuery( document ).ready(function() {
|
63 |
+
//jQuery(".mo2f_table_layout :input").prop("disabled", true);
|
64 |
+
jQuery(".mo2f_table_layout :input[type=text]").val("");
|
65 |
+
jQuery(".mo2f_table_layout :input[type=url]").val("");
|
66 |
+
});
|
67 |
+
<?php } ?>
|
68 |
+
|
69 |
+
jQuery("#time_of_blocking_type").change(function() {
|
70 |
+
if(jQuery(this).val()=="permanent")
|
71 |
+
jQuery("#time_of_blocking_val").addClass("hidden");
|
72 |
+
else
|
73 |
+
jQuery("#time_of_blocking_val").removeClass("hidden");
|
74 |
+
});
|
75 |
+
</script>
|
76 |
+
<?php
|
77 |
+
}
|
78 |
+
|
79 |
+
?>
|
network_security/views/miniorange_network_security_ip_blocking.php
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function mo2f_show_2_factor_ip_block($user) {
|
4 |
+
$mo2f_ns_handler = new MO2f_Handler();
|
5 |
+
$blockedips = $mo2f_ns_handler->get_blocked_ips();?>
|
6 |
+
<div class="mo2f_table_layout" style="border:0px;">
|
7 |
+
|
8 |
+
<h2>Manual Block IP's <p style="display: inline-block;color: #0085ba;font-size: 15px;">(Permanently)</p></h2>
|
9 |
+
<form name="f" method="post" action="" id="manualblockipform" >
|
10 |
+
<input type="hidden" name="option" value="mo2f_ns_manual_block_ip" />
|
11 |
+
<table><tr><td>You can manually block an IP address here: </td>
|
12 |
+
<td style="padding:0px 10px"><input class="mo2f_ns_table_textbox" type="text" name="ip"
|
13 |
+
required placeholder="xxx.xxx.xxx.xxx" value=""<?php if(mo2f_is_customer_registered()){}else{ echo 'disabled';}?> /></td>
|
14 |
+
<td><input type="submit" class="button button-primary button-large" value="Manual Block IP"<?php if(mo2f_is_customer_registered()){}else{ echo 'disabled';}?> /></td></tr></table>
|
15 |
+
</form>
|
16 |
+
<h2>Blocked IP's</h2>
|
17 |
+
<table id="blockedips_table" class="display">
|
18 |
+
<thead><tr><th width="15%">IP Address</th><th width="25%">Reason</th><th width="24%">Blocked Until</th><th width="24%">Blocked Date</th><th width="20%">Action</th></tr></thead>
|
19 |
+
<tbody style="text-align: center;">
|
20 |
+
<?php foreach($blockedips as $blockedip){
|
21 |
+
echo "<tr><td>".$blockedip->ip_address."</td><td>".$blockedip->reason."</td><td>";
|
22 |
+
if(date("Y",$blockedip->blocked_for_time)-date("Y",$blockedip->created_timestamp)==3) echo "<span class=redtext style='color:red;'>Permanently</span>"; else echo date("M j, Y, g:i:s a",$blockedip->blocked_for_time);
|
23 |
+
echo "</td><td>".date("M j, Y, g:i:s a",$blockedip->created_timestamp)."</td><td><a onclick=unblockip('".$blockedip->id."') style=cursor:pointer;>Unblock IP</a></td></tr>";
|
24 |
+
} ?>
|
25 |
+
</tbody>
|
26 |
+
</table>
|
27 |
+
<br>
|
28 |
+
</div>
|
29 |
+
<form class="hidden" id="unblockipform" method="POST">
|
30 |
+
<input type="hidden" name="option" value="mo2f_ns_unblock_ip" />
|
31 |
+
<input type="hidden" name="entryid" value="" id="unblockipvalue" />
|
32 |
+
</form>
|
33 |
+
|
34 |
+
<hr >
|
35 |
+
<?php $whitelisted_ips = $mo2f_ns_handler->get_whitelisted_ips(); ?>
|
36 |
+
<div class="mo2f_table_layout" style="border:0px;">
|
37 |
+
<h2>Whitelist IP's</h2>
|
38 |
+
<form name="f" method="post" action="" id="whitelistipform">
|
39 |
+
<input type="hidden" name="option" value="mo2f_ns_whitelist_ip" />
|
40 |
+
<table><tr><td>Add new IP address to whitelist : </td>
|
41 |
+
<td style="padding:0px 10px"><input class="mo2f_ns_table_textbox" type="text" name="ip"
|
42 |
+
required placeholder="xxx.xxx.xxx.xxx" value="" <?php if(mo2f_is_customer_registered()){}else{ echo 'disabled';}?> /></td>
|
43 |
+
<td><input type="submit" class="button button-primary button-large" value="Whitelist IP"<?php if(mo2f_is_customer_registered()){}else{ echo 'disabled';}?> /></td></tr></table>
|
44 |
+
</form>
|
45 |
+
<h2>Whitelisted IP's</h2>
|
46 |
+
<table id="whitelistedips_table" class="display">
|
47 |
+
<thead><tr><th width="30%">IP Address</th><th width="40%">Whitelisted Date</th><th width="30%">Remove from Whitelist</th></tr></thead>
|
48 |
+
<tbody><?php foreach($whitelisted_ips as $whitelisted_ip){
|
49 |
+
echo "<tr><td>".$whitelisted_ip->ip_address."</td><td>".date("M j, Y, g:i:s a",$whitelisted_ip->created_timestamp)."</td><td><a onclick=removefromwhitelist('".$whitelisted_ip->id."') style=cursor:pointer;>Remove</a></td></tr>";
|
50 |
+
} ?></tbody>
|
51 |
+
</table>
|
52 |
+
<br>
|
53 |
+
</div>
|
54 |
+
|
55 |
+
<form class="hidden" id="removefromwhitelistform" method="POST">
|
56 |
+
<input type="hidden" name="option" value="mo2f_ns_remove_whitelist" />
|
57 |
+
<input type="hidden" name="entryid" value="" id="removefromwhitelistentry" />
|
58 |
+
</form>
|
59 |
+
|
60 |
+
<script>
|
61 |
+
|
62 |
+
function unblockip(entryid){
|
63 |
+
jQuery("#unblockipvalue").val(entryid);
|
64 |
+
jQuery("#unblockipform").submit();
|
65 |
+
}
|
66 |
+
jQuery(document).ready(function() {
|
67 |
+
jQuery('#blockedips_table').DataTable({
|
68 |
+
"order": [[ 3, "desc" ]]
|
69 |
+
});
|
70 |
+
} );
|
71 |
+
function removefromwhitelist(entryid){
|
72 |
+
jQuery("#removefromwhitelistentry").val(entryid);
|
73 |
+
jQuery("#removefromwhitelistform").submit();
|
74 |
+
}
|
75 |
+
jQuery(document).ready(function() {
|
76 |
+
jQuery('#whitelistedips_table').DataTable({
|
77 |
+
"order": [[ 1, "desc" ]]
|
78 |
+
});
|
79 |
+
} );
|
80 |
+
</script>
|
81 |
+
<?php }
|
82 |
+
?>
|
network_security/views/miniorange_network_security_monitoring.php
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by PhpStorm.
|
4 |
+
* User: mittal
|
5 |
+
* Date: 04-04-2019
|
6 |
+
* Time: 13:45
|
7 |
+
*/
|
8 |
+
function mo2f_show_2_factor_user_login_reports($user){
|
9 |
+
$mo2f_handler = new MO2f_Handler();
|
10 |
+
$style = "none";
|
11 |
+
$message = "Show Advanced Search";
|
12 |
+
$usertranscations = $mo2f_handler->get_all_transactions();
|
13 |
+
?>
|
14 |
+
<div class="mo2f_table_layout" style="border:0px;">
|
15 |
+
|
16 |
+
<form name="f" method="post" action="" id="manualblockipform" >
|
17 |
+
<input type="hidden" name="option" value="mo2f_manual_clear" id="clear_all" />
|
18 |
+
<div style="display: inline-flex;width: 100%;">
|
19 |
+
<div style="float: left;width: 50%;">
|
20 |
+
<h2>
|
21 |
+
User login Transactions Report
|
22 |
+
</h2>
|
23 |
+
</div>
|
24 |
+
<div style="width: 50%;">
|
25 |
+
<input type="submit" style="margin: 1em 0;float: right;" class="button button-primary button-large" value="Clear Login Reports" />
|
26 |
+
</div>
|
27 |
+
</div>
|
28 |
+
</form>
|
29 |
+
|
30 |
+
<table id="reports_table" class="display" cellspacing="0" width="100%">
|
31 |
+
<thead>
|
32 |
+
<tr>
|
33 |
+
<th>IP Address</th>
|
34 |
+
<th>Username</th>
|
35 |
+
<th>User Action</th>
|
36 |
+
<th>Status</th>
|
37 |
+
<th>Created Date</th>
|
38 |
+
</tr>
|
39 |
+
</thead>
|
40 |
+
<tbody style="text-align: center;">
|
41 |
+
<?php foreach($usertranscations as $usertranscation){
|
42 |
+
echo "<tr><td>" . $usertranscation->ip_address . "</td><td>" . $usertranscation->username . "</td><td>" . $usertranscation->type . "</td><td>";
|
43 |
+
if ( $usertranscation->status == MO2f_Constants::FAILED || $usertranscation->status == MO2f_Constants::PAST_FAILED ) {
|
44 |
+
echo "<span style=color:red>" . MO2f_Constants::FAILED . "</span>";
|
45 |
+
} else if ( $usertranscation->status == MO2f_Constants::SUCCESS ) {
|
46 |
+
echo "<span style=color:green>" . MO2f_Constants::SUCCESS . "</span>";
|
47 |
+
} else {
|
48 |
+
echo "N/A";
|
49 |
+
}
|
50 |
+
echo "</td><td>" . date( "M j, Y, g:i:s a", $usertranscation->created_timestamp ) . "</td></tr>";
|
51 |
+
} ?>
|
52 |
+
</tbody>
|
53 |
+
<br>
|
54 |
+
</table>
|
55 |
+
<br>
|
56 |
+
</div>
|
57 |
+
<br>
|
58 |
+
<script>
|
59 |
+
jQuery(document).ready(function() {
|
60 |
+
jQuery('#reports_table').DataTable({
|
61 |
+
"order": [[ 4, "desc" ]]
|
62 |
+
});
|
63 |
+
} );
|
64 |
+
function showAdvancedSearch(){
|
65 |
+
var x = document.getElementById('mo2f_advanced_search_div');
|
66 |
+
if (x.style.display === 'none') {
|
67 |
+
x.style.display = 'block';
|
68 |
+
document.getElementById('advanced_search_settings').innerHTML = "Hide Advanced Search";
|
69 |
+
} else {
|
70 |
+
x.style.display = 'none';
|
71 |
+
document.getElementById('advanced_search_settings').innerHTML = "Show Advanced Search";
|
72 |
+
//document.getElementById('mo2f_hide_advanced_search').submit();
|
73 |
+
}
|
74 |
+
}
|
75 |
+
</script>
|
76 |
+
<?php
|
77 |
+
}
|
78 |
+
|
79 |
+
?>
|
readme.txt
CHANGED
@@ -3,13 +3,13 @@ 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.
|
7 |
Requires PHP: 5.3.0
|
8 |
-
Stable tag: 5.1.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
12 |
-
Easy 2FA setup with Google
|
13 |
|
14 |
== Description ==
|
15 |
|
@@ -67,7 +67,7 @@ Adding to this, you can also use the same account on multiple applications and y
|
|
67 |
* Customize 'powered by' Logo
|
68 |
* Customize Plugin Icon
|
69 |
* Customize Plugin Name
|
70 |
-
|
71 |
* Short Codes Add-on Features
|
72 |
* Option to turn on/off 2-factor by user
|
73 |
* Option to configure the Google Authenticator and Security Questions by user
|
@@ -232,6 +232,12 @@ miniOrange authentication service has 15+ authentication methods.One time passco
|
|
232 |
|
233 |
== Changelog ==
|
234 |
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
= 5.1.17 =
|
236 |
* Google Authenticator-Two Factor Authentication (2FA) : Minor Bug fix and Documentation changes.
|
237 |
|
@@ -584,6 +590,12 @@ More descriptive setup messages and UI changes.
|
|
584 |
|
585 |
== Upgrade Notice ==
|
586 |
|
|
|
|
|
|
|
|
|
|
|
|
|
587 |
= 5.1.17 =
|
588 |
* Google Authenticator-Two Factor Authentication (2FA) : Minor Bug fix and Documentation changes.
|
589 |
|
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.19
|
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 |
|
67 |
* Customize 'powered by' Logo
|
68 |
* Customize Plugin Icon
|
69 |
* Customize Plugin Name
|
70 |
+
|
71 |
* Short Codes Add-on Features
|
72 |
* Option to turn on/off 2-factor by user
|
73 |
* Option to configure the Google Authenticator and Security Questions by user
|
232 |
|
233 |
== Changelog ==
|
234 |
|
235 |
+
= 5.1.18 =
|
236 |
+
* Google Authenticator-Two Factor Authentication (2FA) : Adding basic Security Features Monitorning, IP blocking and login transaction report.
|
237 |
+
|
238 |
+
= 5.1.18 =
|
239 |
+
* Google Authenticator-Two Factor Authentication (2FA) : Object access error for lower PHP versions.
|
240 |
+
|
241 |
= 5.1.17 =
|
242 |
* Google Authenticator-Two Factor Authentication (2FA) : Minor Bug fix and Documentation changes.
|
243 |
|
590 |
|
591 |
== Upgrade Notice ==
|
592 |
|
593 |
+
= 5.1.19 =
|
594 |
+
* Google Authenticator-Two Factor Authentication (2FA) : Adding basic Security Features Monitorning, IP blocking and login transaction report.
|
595 |
+
|
596 |
+
= 5.1.18 =
|
597 |
+
* Google Authenticator-Two Factor Authentication (2FA) : Object access error for lower PHP versions.
|
598 |
+
|
599 |
= 5.1.17 =
|
600 |
* Google Authenticator-Two Factor Authentication (2FA) : Minor Bug fix and Documentation changes.
|
601 |
|
resources/constants.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php class MO2f_Constants{
|
2 |
+
|
3 |
+
const SUCCESS = "success";
|
4 |
+
const FAILED = "failed";
|
5 |
+
const PAST_FAILED = "pastfailed";
|
6 |
+
|
7 |
+
const LOGIN_TRANSACTION = "User Login";
|
8 |
+
const REGISTRATION_TRANSACTION = "User Registration";
|
9 |
+
|
10 |
+
const USER_TRANSCATIONS_TABLE = "mo2f_network_transactions";
|
11 |
+
const BLOCKED_IPS_TABLE = "mo2f_network_blocked_ips";
|
12 |
+
const WHITELISTED_IPS_TABLE = "mo2f_network_whitelisted_ips";
|
13 |
+
const EMAIL_SENT_AUDIT = "mo2f_network_email_sent_audit";
|
14 |
+
const LOGGED_IN_FROM_NEW_IP = "Logged in from new IP.";
|
15 |
+
|
16 |
+
|
17 |
+
}?>
|
resources/messages.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php class Mo2f_Messages{
|
2 |
+
|
3 |
+
const LOGIN_ATTEMPTS_EXCEEDED = "User exceeded allowed login attempts.";
|
4 |
+
const BLOCKED_BY_ADMIN = "Blocked by Admin";
|
5 |
+
const IP_RANGE_BLOCKING = "IP Range Blocking";
|
6 |
+
const FAILED_LOGIN_ATTEMPTS_FROM_NEW_IP = "Failed login attempts from new IP.";
|
7 |
+
const LOGGED_IN_FROM_NEW_IP = "Logged in from new IP.";
|
8 |
+
//content protection
|
9 |
+
const CONTENT_PROTECTION_ENABLED = "Your configuration for Content Protection has been saved.";
|
10 |
+
|
11 |
+
|
12 |
+
public static function showMessage($message , $data=array())
|
13 |
+
{
|
14 |
+
$message = constant( "self::".$message );
|
15 |
+
foreach($data as $key => $value)
|
16 |
+
{
|
17 |
+
$message = str_replace("{{" . $key . "}}", $value , $message);
|
18 |
+
}
|
19 |
+
return $message;
|
20 |
+
}
|
21 |
+
|
22 |
+
}?>
|
templates/403.php
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?php header('HTTP/1.0 403 Forbidden');?>
|
2 |
+
<h1>403 Forbidden</h1>
|
3 |
+
You don't have permission to access this website.<br><br>
|
4 |
+
<hr>
|
uninstall.php
CHANGED
@@ -13,6 +13,14 @@ $table_name = $wpdb->prefix . 'mo2f_user_details';
|
|
13 |
$Mo2fdbQueries->drop_table( $table_name );
|
14 |
$table_name = $wpdb->prefix . 'mo2f_user_login_info';
|
15 |
$Mo2fdbQueries->drop_table( $table_name );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
if ( ! is_multisite() ) {
|
18 |
|
@@ -71,6 +79,15 @@ if ( ! is_multisite() ) {
|
|
71 |
delete_option( 'mo2f_login_option_updated' );
|
72 |
delete_option( 'mo2f_encryption_key' );
|
73 |
delete_option( 'mo2f_google_appname' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
//delete all stored key-value pairs for the roles
|
76 |
global $wp_roles;
|
@@ -143,6 +160,14 @@ if ( ! is_multisite() ) {
|
|
143 |
delete_option( 'mo2f_bug_fix_done' );
|
144 |
delete_option( 'mo2f_encryption_key' );
|
145 |
delete_option( 'mo2f_google_appname' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
//delete all stored key-value pairs for the roles
|
147 |
global $wp_roles;
|
148 |
if ( ! isset( $wp_roles ) ) {
|
@@ -178,5 +203,13 @@ delete_option( 'mo_2factor_login_status' );
|
|
178 |
delete_option( 'mo2f_configured_2_factor_method' );
|
179 |
delete_option( 'mo2f_enable_2fa' );
|
180 |
delete_option( 'kba_questions' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
|
182 |
?>
|
13 |
$Mo2fdbQueries->drop_table( $table_name );
|
14 |
$table_name = $wpdb->prefix . 'mo2f_user_login_info';
|
15 |
$Mo2fdbQueries->drop_table( $table_name );
|
16 |
+
$table_name = $wpdb->prefix . 'mo2f_network_blocked_ips';
|
17 |
+
$Mo2fdbQueries->drop_table( $table_name );
|
18 |
+
$table_name = $wpdb->prefix . 'mo2f_network_transactions';
|
19 |
+
$Mo2fdbQueries->drop_table( $table_name );
|
20 |
+
$table_name = $wpdb->prefix . 'mo2f_network_whitelisted_ips';
|
21 |
+
$Mo2fdbQueries->drop_table( $table_name );
|
22 |
+
$table_name = $wpdb->prefix . 'mo2f_network_email_sent_audit';
|
23 |
+
$Mo2fdbQueries->drop_table( $table_name );
|
24 |
|
25 |
if ( ! is_multisite() ) {
|
26 |
|
79 |
delete_option( 'mo2f_login_option_updated' );
|
80 |
delete_option( 'mo2f_encryption_key' );
|
81 |
delete_option( 'mo2f_google_appname' );
|
82 |
+
//Network Security
|
83 |
+
delete_option( 'mo2f_ns_whitelist_ip' );
|
84 |
+
delete_option( 'mo2f_enable_brute_force' );
|
85 |
+
delete_option( 'mo2f_show_remaining_attempts' );
|
86 |
+
delete_option( 'mo2f_ns_blocked_ip' );
|
87 |
+
delete_option( 'mo2f_allwed_login_attempts' );
|
88 |
+
delete_option( 'mo2f_time_of_blocking_type' );
|
89 |
+
delete_option( 'mo2f_network_features' );
|
90 |
+
|
91 |
|
92 |
//delete all stored key-value pairs for the roles
|
93 |
global $wp_roles;
|
160 |
delete_option( 'mo2f_bug_fix_done' );
|
161 |
delete_option( 'mo2f_encryption_key' );
|
162 |
delete_option( 'mo2f_google_appname' );
|
163 |
+
//Network Security
|
164 |
+
delete_option( 'mo2f_enable_brute_force' );
|
165 |
+
delete_option( 'mo2f_ns_whitelist_ip' );
|
166 |
+
delete_option( 'mo2f_show_remaining_attempts' );
|
167 |
+
delete_option( 'mo2f_ns_blocked_ip' );
|
168 |
+
delete_option( 'mo2f_allwed_login_attempts' );
|
169 |
+
delete_option( 'mo2f_time_of_blocking_type' );
|
170 |
+
delete_option( 'mo2f_network_features' );
|
171 |
//delete all stored key-value pairs for the roles
|
172 |
global $wp_roles;
|
173 |
if ( ! isset( $wp_roles ) ) {
|
203 |
delete_option( 'mo2f_configured_2_factor_method' );
|
204 |
delete_option( 'mo2f_enable_2fa' );
|
205 |
delete_option( 'kba_questions' );
|
206 |
+
//Network Security
|
207 |
+
delete_option( 'mo2f_enable_brute_force' );
|
208 |
+
delete_option( 'mo2f_ns_whitelist_ip' );
|
209 |
+
delete_option( 'mo2f_show_remaining_attempts' );
|
210 |
+
delete_option( 'mo2f_ns_blocked_ip' );
|
211 |
+
delete_option( 'mo2f_allwed_login_attempts' );
|
212 |
+
delete_option( 'mo2f_time_of_blocking_type' );
|
213 |
+
delete_option( 'mo2f_network_features' );
|
214 |
|
215 |
?>
|
views/configure_google_authenticator
CHANGED
@@ -35,7 +35,7 @@ function mo2f_configure_google_authenticator( $user ) {
|
|
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:
|
39 |
|
40 |
<input type="submit" name="submit" value="Save App Name" class="button button-primary button-medium" />
|
41 |
|
@@ -51,7 +51,7 @@ function mo2f_configure_google_authenticator( $user ) {
|
|
51 |
<div id="displayQrCode"style="padding:10px;"><?php echo '<img src="data:image/jpg;base64,' . $data . '" />'; ?></div>
|
52 |
|
53 |
</ol>
|
54 |
-
|
55 |
<div><a data-toggle="collapse" href="#mo2f_scanbarcode_a"
|
56 |
aria-expanded="false"><b><?php echo mo2f_lt( 'Can\'t scan the barcode? ' ); ?></b></a>
|
57 |
</div>
|
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:22% !important;" name="mo2f_google_auth_appname" placeholder="Enter the app name" value="<?php echo $gauth_name;?>" />
|
39 |
|
40 |
<input type="submit" name="submit" value="Save App Name" class="button button-primary button-medium" />
|
41 |
|
51 |
<div id="displayQrCode"style="padding:10px;"><?php echo '<img src="data:image/jpg;base64,' . $data . '" />'; ?></div>
|
52 |
|
53 |
</ol>
|
54 |
+
|
55 |
<div><a data-toggle="collapse" href="#mo2f_scanbarcode_a"
|
56 |
aria-expanded="false"><b><?php echo mo2f_lt( 'Can\'t scan the barcode? ' ); ?></b></a>
|
57 |
</div>
|
views/configure_miniorange_authenticator
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
<?php function mo2f_configure_miniorange_authenticator($user){
|
2 |
-
|
3 |
-
$mobile_reg_status = get_user_meta($user->ID,'mobile_registration_status',true);
|
4 |
if(!$mobile_reg_status) {
|
5 |
download_instruction_for_mobile_app($mobile_reg_status);
|
6 |
} ?>
|
@@ -53,6 +53,7 @@
|
|
53 |
<input type="hidden" name="mo2f_go_back_nonce"
|
54 |
value="<?php echo wp_create_nonce( "mo2f-go-back-nonce" ) ?>"/>
|
55 |
</form>
|
|
|
56 |
<script>
|
57 |
jQuery('#go_back').click(function() {
|
58 |
jQuery('#mo2f_go_back_form').submit();
|
1 |
+
<?php function mo2f_configure_miniorange_authenticator($user){?>
|
2 |
+
<div id="mo2f_width">
|
3 |
+
<?php $mobile_reg_status = get_user_meta($user->ID,'mobile_registration_status',true);
|
4 |
if(!$mobile_reg_status) {
|
5 |
download_instruction_for_mobile_app($mobile_reg_status);
|
6 |
} ?>
|
53 |
<input type="hidden" name="mo2f_go_back_nonce"
|
54 |
value="<?php echo wp_create_nonce( "mo2f-go-back-nonce" ) ?>"/>
|
55 |
</form>
|
56 |
+
</div>
|
57 |
<script>
|
58 |
jQuery('#go_back').click(function() {
|
59 |
jQuery('#mo2f_go_back_form').submit();
|
views/feedback_form.php
CHANGED
@@ -10,7 +10,7 @@
|
|
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 |
|
15 |
$action = 'install-plugin';
|
16 |
$slug = 'miniorange-google-authenticator';
|
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.19', __FILE__ ) );
|
14 |
|
15 |
$action = 'install-plugin';
|
16 |
$slug = 'miniorange-google-authenticator';
|
views/test_miniorange_push_notification
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
<?php function mo2f_test_miniorange_push_notification( $user ) {
|
2 |
-
|
3 |
<h3><?php echo mo2f_lt( 'Test Push Notification' ); ?></h3>
|
4 |
<hr>
|
5 |
<div>
|
@@ -30,7 +30,7 @@
|
|
30 |
<input type="hidden" name="mo2f_out_of_band_error_nonce"
|
31 |
value="<?php echo wp_create_nonce( "mo2f-out-of-band-error-nonce" ) ?>"/>
|
32 |
</form>
|
33 |
-
|
34 |
<script>
|
35 |
jQuery('#go_back').click(function () {
|
36 |
jQuery('#mo2f_go_back_form').submit();
|
1 |
+
<?php function mo2f_test_miniorange_push_notification( $user ) { ?>
|
2 |
+
<div style="width:200%;">
|
3 |
<h3><?php echo mo2f_lt( 'Test Push Notification' ); ?></h3>
|
4 |
<hr>
|
5 |
<div>
|
30 |
<input type="hidden" name="mo2f_out_of_band_error_nonce"
|
31 |
value="<?php echo wp_create_nonce( "mo2f-out-of-band-error-nonce" ) ?>"/>
|
32 |
</form>
|
33 |
+
</div>
|
34 |
<script>
|
35 |
jQuery('#go_back').click(function () {
|
36 |
jQuery('#mo2f_go_back_form').submit();
|
views/test_miniorange_qr_code_authentication
CHANGED
@@ -22,7 +22,7 @@ function mo2f_test_miniorange_qr_code_authentication( $user ) {
|
|
22 |
<li><?php echo mo2f_lt( 'If you get cross mark on QR Code then click on \'Back\' button and again click on \'Test\' link.' ); ?></li>
|
23 |
</ol>
|
24 |
</div>
|
25 |
-
<br
|
26 |
<table class="mo2f_settings_table">
|
27 |
<div id="qr-success"></div>
|
28 |
<div id="displayQrCode" >
|
22 |
<li><?php echo mo2f_lt( 'If you get cross mark on QR Code then click on \'Back\' button and again click on \'Test\' link.' ); ?></li>
|
23 |
</ol>
|
24 |
</div>
|
25 |
+
<br>
|
26 |
<table class="mo2f_settings_table">
|
27 |
<div id="qr-success"></div>
|
28 |
<div id="displayQrCode" >
|
views/test_miniorange_soft_token
CHANGED
@@ -1,32 +1,33 @@
|
|
1 |
-
<?php function mo2f_test_miniorange_soft_token( $user ) {
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
|
23 |
-
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
30 |
<script>
|
31 |
jQuery('#go_back').click(function () {
|
32 |
jQuery('#mo2f_go_back_form').submit();
|
1 |
+
<?php function mo2f_test_miniorange_soft_token( $user ) {?>
|
2 |
+
<div style="width:100%;">
|
3 |
+
<h3><?php echo mo2f_lt( 'Test Soft Token' ); ?></h3>
|
4 |
+
<hr>
|
5 |
+
<p><?php echo mo2f_lt( 'Open your' ); ?>
|
6 |
+
<b><?php echo mo2f_lt( 'miniOrange Authenticator App ' ); ?></b> <?php echo mo2f_lt( 'and ' ); ?>
|
7 |
+
<?php echo mo2f_lt( 'enter the' ); ?>
|
8 |
+
<b><?php echo mo2f_lt( 'one time passcode' ); ?></b> <?php echo mo2f_lt( 'shown in the App under your account.' ); ?>
|
9 |
+
</p>
|
10 |
+
<form name="f" method="post" action="" id="mo2f_test_token_form">
|
11 |
+
<input type="hidden" name="option" value="mo2f_validate_soft_token"/>
|
12 |
+
<input type="hidden" name="mo2f_validate_soft_token_nonce"
|
13 |
+
value="<?php echo wp_create_nonce( "mo2f-validate-soft-token-nonce" ) ?>"/>
|
14 |
+
<input class="mo2f_table_textbox" style="width:200px;" autofocus="true" type="text" name="otp_token" required
|
15 |
+
placeholder="<?php echo mo2f_lt( 'Enter OTP' ); ?>" style="width:95%;"/>
|
16 |
|
17 |
+
<br><br>
|
18 |
+
<input type="button" name="back" id="go_back" class="button button-primary button-large"
|
19 |
+
value="<?php echo mo2f_lt( 'Back' ); ?>"/>
|
20 |
+
<input type="submit" name="validate" id="validate" class="button button-primary button-large"
|
21 |
+
value="<?php echo mo2f_lt( 'Validate OTP' ); ?>"/>
|
22 |
|
23 |
+
</form>
|
24 |
|
25 |
+
<form name="f" method="post" action="" id="mo2f_go_back_form">
|
26 |
+
<input type="hidden" name="option" value="mo2f_go_back"/>
|
27 |
+
<input type="hidden" name="mo2f_go_back_nonce"
|
28 |
+
value="<?php echo wp_create_nonce( "mo2f-go-back-nonce" ) ?>"/>
|
29 |
+
</form>
|
30 |
+
</div>
|
31 |
<script>
|
32 |
jQuery('#go_back').click(function () {
|
33 |
jQuery('#mo2f_go_back_form').submit();
|