Plugin Directory

Changeset 911291


Ignore:
Timestamp:
05/09/2014 07:41:40 PM (12 years ago)
Author:
eig
Message:

Fix timing issue, bump version to 1.0.2

Location:
eig-sso/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • eig-sso/trunk/eig-sso.php

    r907551 r911291  
    22/*
    33Plugin Name: EIG-SSO
    4 Version: 1.0.1
     4Version: 1.0.2
    55Description: Securely log in to WordPress from Control Panel without needing a username and password.
    66Author: Endurance International Group
     
    6262
    6363    $hash = base64_encode( hash( 'sha256', $nonce . $salt, true ) );
    64     $now  = time();
    65     $expiration = $now + 20;
    6664
    6765    $table = $wpdb->prefix . 'eig_sso';
     
    7169        $wpdb->prepare(
    7270            "SELECT 1=1 FROM $table
    73                 WHERE offer = %s AND expires >= %s AND expires < %s",
    74             $hash, $now, $expiration
     71                WHERE offer = %s AND expires >= UNIX_TIMESTAMP()",
     72            $hash
    7573        )
    7674    );
     
    118116
    119117    $table = $wpdb->prefix . 'eig_sso';
    120     $res = $wpdb->query( "TRUNCATE TABLE $table" );
     118    $res = $wpdb->query( "DELETE FROM $table WHERE expires < UNIX_TIMESTAMP()" );
    121119
    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;
     120    return false !== $res;
    128121}
    129122
  • eig-sso/trunk/readme.txt

    r907551 r911291  
    44Requires at least: 3.3
    55Tested up to: 3.9
    6 Stable tag: 1.0.1
     6Stable tag: 1.0.2
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4949== Changelog ==
    5050
     511.0.2 - Fix timing issues.
     52
    51531.0.1 - Fix uninstall bug.
    5254
Note: See TracChangeset for help on using the changeset viewer.