EIG-SSO - Version 1.0.2

Version Description

Download this release

Release Info

Developer eig
Plugin Icon wp plugin EIG-SSO
Version 1.0.2
Comparing to
See all releases

Code changes from version 1.0.1 to 1.0.2

Files changed (2) hide show
  1. eig-sso.php +5 -12
  2. readme.txt +4 -2
eig-sso.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: EIG-SSO
4
- Version: 1.0.1
5
  Description: Securely log in to WordPress from Control Panel without needing a username and password.
6
  Author: Endurance International Group
7
  Author URI: http://endurance.com/
@@ -61,8 +61,6 @@ function eigsso_check_offer($nonce, $salt) {
61
  global $wpdb;
62
 
63
  $hash = base64_encode( hash( 'sha256', $nonce . $salt, true ) );
64
- $now = time();
65
- $expiration = $now + 20;
66
 
67
  $table = $wpdb->prefix . 'eig_sso';
68
 
@@ -70,8 +68,8 @@ function eigsso_check_offer($nonce, $salt) {
70
  $res = $wpdb->get_var(
71
  $wpdb->prepare(
72
  "SELECT 1=1 FROM $table
73
- WHERE offer = %s AND expires >= %s AND expires < %s",
74
- $hash, $now, $expiration
75
  )
76
  );
77
 
@@ -117,14 +115,9 @@ function eigsso_clear_offers() {
117
  global $wpdb;
118
 
119
  $table = $wpdb->prefix . 'eig_sso';
120
- $res = $wpdb->query( "TRUNCATE TABLE $table" );
121
 
122
- /* if the user doesn't have truncate privileges */
123
- if ( true !== $res ) {
124
- $res = $wpdb->query( "DELETE FROM $table WHERE 1" );
125
- }
126
-
127
- return $res;
128
  }
129
 
130
  function eigsso_uninstall() {
1
  <?php
2
  /*
3
  Plugin Name: EIG-SSO
4
+ Version: 1.0.2
5
  Description: Securely log in to WordPress from Control Panel without needing a username and password.
6
  Author: Endurance International Group
7
  Author URI: http://endurance.com/
61
  global $wpdb;
62
 
63
  $hash = base64_encode( hash( 'sha256', $nonce . $salt, true ) );
 
 
64
 
65
  $table = $wpdb->prefix . 'eig_sso';
66
 
68
  $res = $wpdb->get_var(
69
  $wpdb->prepare(
70
  "SELECT 1=1 FROM $table
71
+ WHERE offer = %s AND expires >= UNIX_TIMESTAMP()",
72
+ $hash
73
  )
74
  );
75
 
115
  global $wpdb;
116
 
117
  $table = $wpdb->prefix . 'eig_sso';
118
+ $res = $wpdb->query( "DELETE FROM $table WHERE expires < UNIX_TIMESTAMP()" );
119
 
120
+ return false !== $res;
 
 
 
 
 
121
  }
122
 
123
  function eigsso_uninstall() {
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: bcorey, eig
3
  Tags: sso, single sign-on
4
  Requires at least: 3.3
5
- Tested up to: 3.9
6
- Stable tag: 1.0.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -48,6 +48,8 @@ As an additional security measure, the plugin will refuse to authenticate users
48
 
49
  == Changelog ==
50
 
 
 
51
  1.0.1 - Fix uninstall bug.
52
 
53
  1.0 - Initial release.
2
  Contributors: bcorey, eig
3
  Tags: sso, single sign-on
4
  Requires at least: 3.3
5
+ Tested up to: 4.0
6
+ Stable tag: 1.0.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
48
 
49
  == Changelog ==
50
 
51
+ 1.0.2 - Fix timing issues.
52
+
53
  1.0.1 - Fix uninstall bug.
54
 
55
  1.0 - Initial release.