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

Version Description

  • Google Authenticator (2FA) : Added Proxy Setup feature.
Download this release

Release Info

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

Code changes from version 5.0.9 to 5.0.10

class-customer-setup.php CHANGED
@@ -62,6 +62,16 @@ class Customer_Setup {
62
  curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string );
63
  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5 );
64
  curl_setopt( $ch, CURLOPT_TIMEOUT, 20 );
 
 
 
 
 
 
 
 
 
 
65
  $content = curl_exec( $ch );
66
  if ( curl_errno( $ch ) ) {
67
  return null;
@@ -120,6 +130,16 @@ class Customer_Setup {
120
  curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string );
121
  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5 );
122
  curl_setopt( $ch, CURLOPT_TIMEOUT, 20 );
 
 
 
 
 
 
 
 
 
 
123
  $content = curl_exec( $ch );
124
 
125
  if ( curl_errno( $ch ) ) {
@@ -169,6 +189,16 @@ class Customer_Setup {
169
  curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string );
170
  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5 );
171
  curl_setopt( $ch, CURLOPT_TIMEOUT, 20 );
 
 
 
 
 
 
 
 
 
 
172
  $content = curl_exec( $ch );
173
  if ( curl_errno( $ch ) ) {
174
  return null;
@@ -251,6 +281,16 @@ class Customer_Setup {
251
  curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string );
252
  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5 );
253
  curl_setopt( $ch, CURLOPT_TIMEOUT, 20 );
 
 
 
 
 
 
 
 
 
 
254
  $content = curl_exec( $ch );
255
  if ( curl_errno( $ch ) ) {
256
  return null;
@@ -344,12 +384,20 @@ class Customer_Setup {
344
 
345
 
346
  /** Proxy Details **/
347
- if ( defined( 'WP_PROXY_HOST' ) && defined( 'WP_PROXY_PORT' ) ) {
 
 
 
 
 
 
 
348
  curl_setopt( $ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP );
349
  curl_setopt( $ch, CURLOPT_PROXY, WP_PROXY_HOST );
350
  curl_setopt( $ch, CURLOPT_PROXYPORT, WP_PROXY_PORT );
351
  }
352
 
 
353
  $content = curl_exec( $ch );
354
  if ( curl_errno( $ch ) ) {
355
  return null;
@@ -438,6 +486,16 @@ class Customer_Setup {
438
  curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string );
439
  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5 );
440
  curl_setopt( $ch, CURLOPT_TIMEOUT, 20 );
 
 
 
 
 
 
 
 
 
 
441
  $content = curl_exec( $ch );
442
 
443
  if ( curl_errno( $ch ) ) {
@@ -476,7 +534,7 @@ class Customer_Setup {
476
  $customer_feature="V3";
477
  }
478
 
479
- $query = '[WordPress 2 Factor Authentication Plugin: '.$customer_feature.' - V 5.0.9]: ' . $query;
480
  $fields = array(
481
  'firstName' => $user->user_firstname,
482
  'lastName' => $user->user_lastname,
@@ -505,6 +563,16 @@ class Customer_Setup {
505
  curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string );
506
  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5 );
507
  curl_setopt( $ch, CURLOPT_TIMEOUT, 20 );
 
 
 
 
 
 
 
 
 
 
508
  $content = curl_exec( $ch );
509
 
510
  if ( curl_errno( $ch ) ) {
62
  curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string );
63
  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5 );
64
  curl_setopt( $ch, CURLOPT_TIMEOUT, 20 );
65
+
66
+ $proxy_host = get_option( 'mo2f_proxy_host' );
67
+ if (! empty( $proxy_host ) ){
68
+ curl_setopt( $ch, CURLOPT_PROXY, get_option( 'mo2f_proxy_host' ) );
69
+ curl_setopt( $ch, CURLOPT_PROXYPORT, get_option( 'mo2f_port_number' ) );
70
+ curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
71
+ curl_setopt( $ch, CURLOPT_PROXYUSERPWD, get_option( "mo2f_proxy_username" ) . ':' . get_option( "mo2f_proxy_password" ) );
72
+
73
+ }
74
+
75
  $content = curl_exec( $ch );
76
  if ( curl_errno( $ch ) ) {
77
  return null;
130
  curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string );
131
  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5 );
132
  curl_setopt( $ch, CURLOPT_TIMEOUT, 20 );
133
+
134
+ $proxy_host = get_option( 'mo2f_proxy_host' );
135
+ if (! empty( $proxy_host ) ){
136
+ curl_setopt( $ch, CURLOPT_PROXY, get_option( 'mo2f_proxy_host' ) );
137
+ curl_setopt( $ch, CURLOPT_PROXYPORT, get_option( 'mo2f_port_number' ) );
138
+ curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
139
+ curl_setopt( $ch, CURLOPT_PROXYUSERPWD, get_option( "mo2f_proxy_username" ) . ':' . get_option( "mo2f_proxy_password" ) );
140
+
141
+ }
142
+
143
  $content = curl_exec( $ch );
144
 
145
  if ( curl_errno( $ch ) ) {
189
  curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string );
190
  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5 );
191
  curl_setopt( $ch, CURLOPT_TIMEOUT, 20 );
192
+
193
+ $proxy_host = get_option( 'mo2f_proxy_host' );
194
+ if (! empty( $proxy_host ) ){
195
+ curl_setopt( $ch, CURLOPT_PROXY, get_option( 'mo2f_proxy_host' ) );
196
+ curl_setopt( $ch, CURLOPT_PROXYPORT, get_option( 'mo2f_port_number' ) );
197
+ curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
198
+ curl_setopt( $ch, CURLOPT_PROXYUSERPWD, get_option( "mo2f_proxy_username" ) . ':' . get_option( "mo2f_proxy_password" ) );
199
+
200
+ }
201
+
202
  $content = curl_exec( $ch );
203
  if ( curl_errno( $ch ) ) {
204
  return null;
281
  curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string );
282
  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5 );
283
  curl_setopt( $ch, CURLOPT_TIMEOUT, 20 );
284
+
285
+ $proxy_host = get_option( 'mo2f_proxy_host' );
286
+ if (! empty( $proxy_host ) ){
287
+ curl_setopt( $ch, CURLOPT_PROXY, get_option( 'mo2f_proxy_host' ) );
288
+ curl_setopt( $ch, CURLOPT_PROXYPORT, get_option( 'mo2f_port_number' ) );
289
+ curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
290
+ curl_setopt( $ch, CURLOPT_PROXYUSERPWD, get_option( "mo2f_proxy_username" ) . ':' . get_option( "mo2f_proxy_password" ) );
291
+
292
+ }
293
+
294
  $content = curl_exec( $ch );
295
  if ( curl_errno( $ch ) ) {
296
  return null;
384
 
385
 
386
  /** Proxy Details **/
387
+ $proxy_host = get_option( 'mo2f_proxy_host' );
388
+ if (! empty( $proxy_host ) ){
389
+ curl_setopt( $ch, CURLOPT_PROXY, get_option( 'mo2f_proxy_host' ) );
390
+ curl_setopt( $ch, CURLOPT_PROXYPORT, get_option( 'mo2f_port_number' ) );
391
+ curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
392
+ curl_setopt( $ch, CURLOPT_PROXYUSERPWD, get_option( "mo2f_proxy_username" ) . ':' . get_option( "mo2f_proxy_password" ) );
393
+
394
+ }else if ( defined( 'WP_PROXY_HOST' ) && defined( 'WP_PROXY_PORT' ) ) {
395
  curl_setopt( $ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP );
396
  curl_setopt( $ch, CURLOPT_PROXY, WP_PROXY_HOST );
397
  curl_setopt( $ch, CURLOPT_PROXYPORT, WP_PROXY_PORT );
398
  }
399
 
400
+
401
  $content = curl_exec( $ch );
402
  if ( curl_errno( $ch ) ) {
403
  return null;
486
  curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string );
487
  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5 );
488
  curl_setopt( $ch, CURLOPT_TIMEOUT, 20 );
489
+
490
+ $proxy_host = get_option( 'mo2f_proxy_host' );
491
+ if (! empty( $proxy_host ) ){
492
+ curl_setopt( $ch, CURLOPT_PROXY, get_option( 'mo2f_proxy_host' ) );
493
+ curl_setopt( $ch, CURLOPT_PROXYPORT, get_option( 'mo2f_port_number' ) );
494
+ curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
495
+ curl_setopt( $ch, CURLOPT_PROXYUSERPWD, get_option( "mo2f_proxy_username" ) . ':' . get_option( "mo2f_proxy_password" ) );
496
+
497
+ }
498
+
499
  $content = curl_exec( $ch );
500
 
501
  if ( curl_errno( $ch ) ) {
534
  $customer_feature="V3";
535
  }
536
 
537
+ $query = '[WordPress 2 Factor Authentication Plugin: '.$customer_feature.' - V 5.0.10]: ' . $query;
538
  $fields = array(
539
  'firstName' => $user->user_firstname,
540
  'lastName' => $user->user_lastname,
563
  curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string );
564
  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5 );
565
  curl_setopt( $ch, CURLOPT_TIMEOUT, 20 );
566
+
567
+ $proxy_host = get_option( 'mo2f_proxy_host' );
568
+ if (! empty( $proxy_host ) ){
569
+ curl_setopt( $ch, CURLOPT_PROXY, get_option( 'mo2f_proxy_host' ) );
570
+ curl_setopt( $ch, CURLOPT_PROXYPORT, get_option( 'mo2f_port_number' ) );
571
+ curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
572
+ curl_setopt( $ch, CURLOPT_PROXYUSERPWD, get_option( "mo2f_proxy_username" ) . ':' . get_option( "mo2f_proxy_password" ) );
573
+
574
+ }
575
+
576
  $content = curl_exec( $ch );
577
 
578
  if ( curl_errno( $ch ) ) {
class-rba-attributes.php CHANGED
@@ -83,7 +83,14 @@ class Miniorange_Rba_Attributes {
83
 
84
  curl_setopt( $ch, CURLOPT_POST, true );
85
 
86
- if ( defined( 'WP_PROXY_HOST' ) && defined( 'WP_PROXY_PORT' ) && defined( 'WP_PROXY_USERNAME' ) && defined( 'WP_PROXY_PASSWORD' ) ) {
 
 
 
 
 
 
 
87
  curl_setopt( $ch, CURLOPT_PROXY, WP_PROXY_HOST );
88
  curl_setopt( $ch, CURLOPT_PROXYPORT, WP_PROXY_PORT );
89
  curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
@@ -124,6 +131,16 @@ class Miniorange_Rba_Attributes {
124
  curl_setopt( $ch, CURLOPT_POSTFIELDS, $fields );
125
  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5 );
126
  curl_setopt( $ch, CURLOPT_TIMEOUT, 20 );
 
 
 
 
 
 
 
 
 
 
127
  $content = curl_exec( $ch );
128
 
129
  if ( curl_errno( $ch ) ) {
83
 
84
  curl_setopt( $ch, CURLOPT_POST, true );
85
 
86
+ $proxy_host = get_option( 'mo2f_proxy_host' );
87
+ if (! empty( $proxy_host ) ){
88
+ curl_setopt( $ch, CURLOPT_PROXY, get_option( 'mo2f_proxy_host' ) );
89
+ curl_setopt( $ch, CURLOPT_PROXYPORT, get_option( 'mo2f_port_number' ) );
90
+ curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
91
+ curl_setopt( $ch, CURLOPT_PROXYUSERPWD, get_option( "mo2f_proxy_username" ) . ':' . get_option( "mo2f_proxy_password" ) );
92
+
93
+ }else if ( defined( 'WP_PROXY_HOST' ) && defined( 'WP_PROXY_PORT' ) && defined( 'WP_PROXY_USERNAME' ) && defined( 'WP_PROXY_PASSWORD' ) ) {
94
  curl_setopt( $ch, CURLOPT_PROXY, WP_PROXY_HOST );
95
  curl_setopt( $ch, CURLOPT_PROXYPORT, WP_PROXY_PORT );
96
  curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
131
  curl_setopt( $ch, CURLOPT_POSTFIELDS, $fields );
132
  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5 );
133
  curl_setopt( $ch, CURLOPT_TIMEOUT, 20 );
134
+
135
+ $proxy_host = get_option( 'mo2f_proxy_host' );
136
+ if (! empty( $proxy_host ) ){
137
+ curl_setopt( $ch, CURLOPT_PROXY, get_option( 'mo2f_proxy_host' ) );
138
+ curl_setopt( $ch, CURLOPT_PROXYPORT, get_option( 'mo2f_port_number' ) );
139
+ curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
140
+ curl_setopt( $ch, CURLOPT_PROXYUSERPWD, get_option( "mo2f_proxy_username" ) . ':' . get_option( "mo2f_proxy_password" ) );
141
+
142
+ }
143
+
144
  $content = curl_exec( $ch );
145
 
146
  if ( curl_errno( $ch ) ) {
class-two-factor-setup.php CHANGED
@@ -85,8 +85,14 @@ class Two_Factor_Setup {
85
  curl_setopt( $ch, CURLOPT_MAXREDIRS, 10 );
86
 
87
  curl_setopt( $ch, CURLOPT_POST, true );
 
 
 
 
 
 
88
 
89
- if ( defined( 'WP_PROXY_HOST' ) && defined( 'WP_PROXY_PORT' ) && defined( 'WP_PROXY_USERNAME' ) && defined( 'WP_PROXY_PASSWORD' ) ) {
90
  curl_setopt( $ch, CURLOPT_PROXY, WP_PROXY_HOST );
91
  curl_setopt( $ch, CURLOPT_PROXYPORT, WP_PROXY_PORT );
92
  curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
@@ -128,6 +134,14 @@ class Two_Factor_Setup {
128
  curl_setopt( $ch, CURLOPT_POSTFIELDS, $fields );
129
  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5 );
130
  curl_setopt( $ch, CURLOPT_TIMEOUT, 20 );
 
 
 
 
 
 
 
 
131
  $content = curl_exec( $ch );
132
 
133
  if ( curl_errno( $ch ) ) {
85
  curl_setopt( $ch, CURLOPT_MAXREDIRS, 10 );
86
 
87
  curl_setopt( $ch, CURLOPT_POST, true );
88
+ $proxy_host = get_option( 'mo2f_proxy_host' );
89
+ if (! empty( $proxy_host ) ){
90
+ curl_setopt( $ch, CURLOPT_PROXY, get_option( 'mo2f_proxy_host' ) );
91
+ curl_setopt( $ch, CURLOPT_PROXYPORT, get_option( 'mo2f_port_number' ) );
92
+ curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
93
+ curl_setopt( $ch, CURLOPT_PROXYUSERPWD, get_option( "mo2f_proxy_username" ) . ':' . get_option( "mo2f_proxy_password" ) );
94
 
95
+ }else if ( defined( 'WP_PROXY_HOST' ) && defined( 'WP_PROXY_PORT' ) && defined( 'WP_PROXY_USERNAME' ) && defined( 'WP_PROXY_PASSWORD' ) ) {
96
  curl_setopt( $ch, CURLOPT_PROXY, WP_PROXY_HOST );
97
  curl_setopt( $ch, CURLOPT_PROXYPORT, WP_PROXY_PORT );
98
  curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
134
  curl_setopt( $ch, CURLOPT_POSTFIELDS, $fields );
135
  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5 );
136
  curl_setopt( $ch, CURLOPT_TIMEOUT, 20 );
137
+ $proxy_host = get_option( 'mo2f_proxy_host' );
138
+ if (! empty( $proxy_host ) ){
139
+ curl_setopt( $ch, CURLOPT_PROXY, get_option( 'mo2f_proxy_host' ) );
140
+ curl_setopt( $ch, CURLOPT_PROXYPORT, get_option( 'mo2f_port_number' ) );
141
+ curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
142
+ curl_setopt( $ch, CURLOPT_PROXYUSERPWD, get_option( "mo2f_proxy_username" ) . ':' . get_option( "mo2f_proxy_password" ) );
143
+
144
+ }
145
  $content = curl_exec( $ch );
146
 
147
  if ( curl_errno( $ch ) ) {
includes/css/style_settings.css CHANGED
@@ -630,6 +630,18 @@ a {
630
 
631
  }
632
 
 
 
 
 
 
 
 
 
 
 
 
 
633
  .mo2f_setup_2_factor_tab {
634
  background-color: white;
635
  border-style: solid;
630
 
631
  }
632
 
633
+ .mo2f_proxy_setup {
634
+ background-color: white;
635
+ border-style: solid;
636
+ border-color: lightgrey;
637
+ border-radius: 4px;
638
+ border-width: 1px;
639
+ padding: 30px;
640
+ width: 600px;
641
+ align-content: center
642
+
643
+ }
644
+
645
  .mo2f_setup_2_factor_tab {
646
  background-color: white;
647
  border-style: solid;
miniorange_2_factor_configuration.php CHANGED
@@ -62,6 +62,9 @@ function mo_2_factor_register( $user ) {
62
  href="admin.php?page=miniOrange_2_factor_settings&mo2f_tab=mo2f_addon&mo2f_sub_tab=mo2f_sub_tab_rba"
63
  class="nav-tab <?php echo $mo2f_active_tab == 'mo2f_addon' ? 'nav-tab-active' : ''; ?>"
64
  id="mo2f_tab4"><?php echo mo2f_lt( 'Add-ons' ); ?></a><?php } ?>
 
 
 
65
  <a href="admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=mo2f_login"
66
  class="nav-tab <?php echo $mo2f_active_tab == 'mo2f_login' ? 'nav-tab-active' : ''; ?>"
67
  id="mo2f_tab2"><?php echo get_option( 'mo2f_is_NC' ) ? mo2f_lt( 'Standard/Premium Features' ) : mo2f_lt( 'Login Options' ); ?></a>
@@ -93,6 +96,9 @@ function mo_2_factor_register( $user ) {
93
 
94
 
95
  <?php
 
 
 
96
  } else if ( $can_display_admin_features && $mo2f_active_tab == 'mo2f_login' ) {
97
  MO2f_Utility::unset_session_variables( $session_variables );
98
  show_2_factor_login_settings( $user );
@@ -595,6 +601,76 @@ function show_custom_content() {
595
  <?php
596
  }
597
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
598
  function show_2_factor_login_settings( $user ) {
599
  global $Mo2fdbQueries;
600
  $roles = get_editable_roles();
62
  href="admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=mo2f_addon&amp;mo2f_sub_tab=mo2f_sub_tab_rba"
63
  class="nav-tab <?php echo $mo2f_active_tab == 'mo2f_addon' ? 'nav-tab-active' : ''; ?>"
64
  id="mo2f_tab4"><?php echo mo2f_lt( 'Add-ons' ); ?></a><?php } ?>
65
+ <a href="admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=proxy_setup"
66
+ class="nav-tab <?php echo $mo2f_active_tab == 'proxy_setup' ? 'nav-tab-active' : ''; ?>"
67
+ id="mo2f_tab5"><?php echo mo2f_lt( 'Proxy Setup' ); ?></a>
68
  <a href="admin.php?page=miniOrange_2_factor_settings&amp;mo2f_tab=mo2f_login"
69
  class="nav-tab <?php echo $mo2f_active_tab == 'mo2f_login' ? 'nav-tab-active' : ''; ?>"
70
  id="mo2f_tab2"><?php echo get_option( 'mo2f_is_NC' ) ? mo2f_lt( 'Standard/Premium Features' ) : mo2f_lt( 'Login Options' ); ?></a>
96
 
97
 
98
  <?php
99
+ } else if ( $can_display_admin_features && $mo2f_active_tab == 'proxy_setup' ) {
100
+ MO2f_Utility::unset_session_variables( $session_variables );
101
+ show_2_factor_proxy_setup( $user );
102
  } else if ( $can_display_admin_features && $mo2f_active_tab == 'mo2f_login' ) {
103
  MO2f_Utility::unset_session_variables( $session_variables );
104
  show_2_factor_login_settings( $user );
601
  <?php
602
  }
603
 
604
+ function show_2_factor_proxy_setup($user){
605
+ global $Mo2fdbQueries;
606
+ ?>
607
+
608
+
609
+ <div class="mo2f_proxy_setup">
610
+ <h3>Proxy Settings</h3>
611
+
612
+
613
+ <hr><br>
614
+ <div style="float:right;">
615
+ <form name="f" method="post" action="" id="mo2f_disable_proxy_setup_form">
616
+ <input type="hidden" name="option" value="mo2f_disable_proxy_setup_option"/>
617
+
618
+ <input type="submit" name="submit" style="float:right"
619
+ value="<?php echo mo2f_lt( 'Reset Proxy Settings' ); ?>"
620
+ class="button button-primary button-large"
621
+
622
+ <?php if ( $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $user->ID ) != 'MO_2_FACTOR_PLUGIN_SETTINGS' || ! get_option('mo2f_proxy_host')) {
623
+ echo 'disabled';
624
+ } ?>
625
+ />
626
+
627
+ </form>
628
+ </div>
629
+ <br><br>
630
+ <form name="f" method="post" action="">
631
+ <input type="hidden" name="option" value="mo2f_save_proxy_settings"/>
632
+ <table class="mo2f_settings_table">
633
+ <tr>
634
+
635
+ <td style="width:30%"><b><span class="impt">*</span><?php echo mo2f_lt( 'Proxy Host Name: ' ); ?></b></td>
636
+ <td style="width:70%"><input class="mo2f_table_textbox" type="text" name="proxyHost" required
637
+ value="<?php echo get_option( 'mo2f_proxy_host' ); ?>"/></td>
638
+ </tr>
639
+ <tr>
640
+
641
+ <td style="width:30%"><b><span class="impt">*</span><?php echo mo2f_lt( 'Port Number: ' ); ?></b></td>
642
+ <td style="width:70%"><input class="mo2f_table_textbox" type="number" name="portNumber" required
643
+ value="<?php echo get_option( 'mo2f_port_number' ); ?>"/></td>
644
+ </tr>
645
+ <tr>
646
+
647
+ <td style="width:30%"><b><span class="impt">*</span><?php echo mo2f_lt( 'Username: ' ); ?></b></td>
648
+ <td style="width:70%"><input class="mo2f_table_textbox" type="text" name="proxyUsername" required
649
+ value="<?php echo get_option( 'mo2f_proxy_username' ); ?>"/></td>
650
+ </tr>
651
+ <tr>
652
+
653
+ <td style="width:30%"><b><span class="impt">*</span><?php echo mo2f_lt( 'Password: ' ); ?></b></td>
654
+ <td style="width:70%"><input class="mo2f_table_textbox" type="password" name="proxyPass" required
655
+ value="<?php echo get_option( 'mo2f_proxy_password' ); ?>"/></td>
656
+ </tr>
657
+
658
+ <tr>
659
+
660
+ <td>&nbsp;</td>
661
+ <td><input type="submit" name="submit" style="float:right"
662
+ value="<?php echo mo2f_lt( 'Save Settings' ); ?>"
663
+ class="button button-primary button-large"
664
+ <?php if ( $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $user->ID ) != 'MO_2_FACTOR_PLUGIN_SETTINGS' ) {
665
+ echo 'disabled';
666
+ } ?> /></td>
667
+ </tr>
668
+
669
+ </table>
670
+ </div>
671
+ </form>
672
+ <?php }
673
+
674
  function show_2_factor_login_settings( $user ) {
675
  global $Mo2fdbQueries;
676
  $roles = get_editable_roles();
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 Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA) for 1 User in the free version of the plugin.
6
- * Version: 5.0.9
7
  * Author: miniOrange
8
  * Author URI: https://miniorange.com
9
  * License: GPL2
@@ -486,7 +486,25 @@ class Miniorange_Authentication {
486
  $this->mo_auth_deactivate();
487
  }
488
 
489
- if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_register_customer" ) { //register the admin to miniOrange
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
490
  //validate and sanitize
491
  $email = '';
492
  $phone = '';
@@ -2001,6 +2019,16 @@ class Miniorange_Authentication {
2001
  update_option( 'mo2f_enable_2fa_for_users', isset( $_POST['mo2f_enable_2fa_for_users'] ) ? $_POST['mo2f_enable_2fa_for_users'] : 0 );
2002
  }
2003
 
 
 
 
 
 
 
 
 
 
 
2004
  if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_enable_2FA_option' ) {
2005
  update_option( 'mo2f_enable_2fa', isset( $_POST['mo2f_enable_2fa'] ) ? $_POST['mo2f_enable_2fa'] : 0 );
2006
  }
@@ -2224,6 +2252,11 @@ class Miniorange_Authentication {
2224
  delete_option( 'mo2f_enable_login_with_2nd_factor' );
2225
  delete_option( 'mo2f_enable_xmlrpc' );
2226
  delete_option( 'mo2f_register_with_another_email' );
 
 
 
 
 
2227
  }
2228
 
2229
  function mo_auth_show_error_message() {
3
  * Plugin Name: miniOrange 2 Factor Authentication
4
  * Plugin URI: https://miniorange.com
5
  * Description: This plugin provides various two-factor authentication methods as an additional layer of security after the default wordpress login. We Support Google Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA) for 1 User in the free version of the plugin.
6
+ * Version: 5.0.10
7
  * Author: miniOrange
8
  * Author URI: https://miniorange.com
9
  * License: GPL2
486
  $this->mo_auth_deactivate();
487
  }
488
 
489
+
490
+
491
+ if ( isset( $_POST['option'] ) and $_POST['option'] == "mo2f_save_proxy_settings" ) {
492
+ $proxyHost = $_POST['proxyHost'] ;
493
+ $portNumber = $_POST['portNumber'] ;
494
+ $proxyUsername = $_POST['proxyUsername'];
495
+ $proxyPassword = $_POST['proxyPass'];
496
+
497
+ update_option( 'mo2f_proxy_host', $proxyHost );
498
+ update_option( 'mo2f_port_number', $portNumber );
499
+ update_option( 'mo2f_proxy_username', $proxyUsername );
500
+ update_option( 'mo2f_proxy_password', $proxyPassword );
501
+ update_option('mo2f_message','Proxy settings saved successfully.');
502
+ $this->mo_auth_show_success_message();
503
+
504
+ }
505
+
506
+
507
+ if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_register_customer" ) { //register the admin to miniOrange
508
  //validate and sanitize
509
  $email = '';
510
  $phone = '';
2019
  update_option( 'mo2f_enable_2fa_for_users', isset( $_POST['mo2f_enable_2fa_for_users'] ) ? $_POST['mo2f_enable_2fa_for_users'] : 0 );
2020
  }
2021
 
2022
+ if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_disable_proxy_setup_option' ) {
2023
+
2024
+ delete_option( 'mo2f_proxy_host' );
2025
+ delete_option( 'mo2f_port_number' );
2026
+ delete_option( 'mo2f_proxy_username' );
2027
+ delete_option( 'mo2f_proxy_password' );
2028
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "Proxy Configurations Reset." ) );
2029
+ $this->mo_auth_show_success_message();
2030
+ }
2031
+
2032
  if ( isset( $_POST['option'] ) && $_POST['option'] == 'mo2f_enable_2FA_option' ) {
2033
  update_option( 'mo2f_enable_2fa', isset( $_POST['mo2f_enable_2fa'] ) ? $_POST['mo2f_enable_2fa'] : 0 );
2034
  }
2252
  delete_option( 'mo2f_enable_login_with_2nd_factor' );
2253
  delete_option( 'mo2f_enable_xmlrpc' );
2254
  delete_option( 'mo2f_register_with_another_email' );
2255
+ delete_option( 'mo2f_proxy_host' );
2256
+ delete_option( 'mo2f_port_number' );
2257
+ delete_option( 'mo2f_proxy_username' );
2258
+ delete_option( 'mo2f_proxy_password' );
2259
+
2260
  }
2261
 
2262
  function mo_auth_show_error_message() {
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: google authenticator, two factor authentication, two factor, 2FA, 2 factor
5
  Requires at least: 3.0.1
6
  Tested up to: 4.9.4
7
  Requires PHP: 5.3.0
8
- Stable tag: 5.0.9
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -219,6 +219,9 @@ miniOrange authentication service has 15+ authentication methods.One time passco
219
 
220
  == Changelog ==
221
 
 
 
 
222
  = 5.0.9 =
223
  * Google Authenticator (2FA) : Bug Fix for "The loopback request to your site failed." error.
224
 
@@ -496,6 +499,9 @@ More descriptive setup messages and UI changes.
496
 
497
  == Upgrade Notice ==
498
 
 
 
 
499
  = 5.0.9 =
500
  * Google Authenticator (2FA) : Bug Fix for "The loopback request to your site failed." error.
501
 
5
  Requires at least: 3.0.1
6
  Tested up to: 4.9.4
7
  Requires PHP: 5.3.0
8
+ Stable tag: 5.0.10
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
219
 
220
  == Changelog ==
221
 
222
+ = 5.0.10 =
223
+ * Google Authenticator (2FA) : Added Proxy Setup feature.
224
+
225
  = 5.0.9 =
226
  * Google Authenticator (2FA) : Bug Fix for "The loopback request to your site failed." error.
227
 
499
 
500
  == Upgrade Notice ==
501
 
502
+ = 5.0.10 =
503
+ * Google Authenticator (2FA) : Added Proxy Setup feature.
504
+
505
  = 5.0.9 =
506
  * Google Authenticator (2FA) : Bug Fix for "The loopback request to your site failed." error.
507
 
uninstall.php CHANGED
@@ -43,7 +43,10 @@ if ( ! is_multisite() ) {
43
  delete_option( 'mo2f_admin_first_name' );
44
  delete_option( 'mo2_admin_last_name' );
45
  delete_option( 'mo2f_admin_company' );
46
-
 
 
 
47
  delete_option( 'mo2f_auth_methods_for_users' );
48
  delete_option( 'mo2f_enable_mobile_support' );
49
  delete_option( 'mo2f_login_policy' );
@@ -106,7 +109,10 @@ if ( ! is_multisite() ) {
106
  delete_option( 'mo2f_show_sms_transaction_message' );
107
  update_option( 'mo2f_is_NC', 1 );
108
  update_option( 'mo2f_is_NNC', 1 );
109
-
 
 
 
110
  delete_option( 'mo2f_auth_methods_for_users' );
111
  delete_option( 'mo2f_enable_mobile_support' );
112
  delete_option( 'mo2f_login_policy' );
43
  delete_option( 'mo2f_admin_first_name' );
44
  delete_option( 'mo2_admin_last_name' );
45
  delete_option( 'mo2f_admin_company' );
46
+ delete_option( 'mo2f_proxy_host' );
47
+ delete_option( 'mo2f_port_number' );
48
+ delete_option( 'mo2f_proxy_username' );
49
+ delete_option( 'mo2f_proxy_password' );
50
  delete_option( 'mo2f_auth_methods_for_users' );
51
  delete_option( 'mo2f_enable_mobile_support' );
52
  delete_option( 'mo2f_login_policy' );
109
  delete_option( 'mo2f_show_sms_transaction_message' );
110
  update_option( 'mo2f_is_NC', 1 );
111
  update_option( 'mo2f_is_NNC', 1 );
112
+ delete_option( 'mo2f_proxy_host' );
113
+ delete_option( 'mo2f_port_number' );
114
+ delete_option( 'mo2f_proxy_username' );
115
+ delete_option( 'mo2f_proxy_password' );
116
  delete_option( 'mo2f_auth_methods_for_users' );
117
  delete_option( 'mo2f_enable_mobile_support' );
118
  delete_option( 'mo2f_login_policy' );