Plugin Directory

Changeset 2123362


Ignore:
Timestamp:
07/15/2019 04:58:54 PM (7 years ago)
Author:
sovstack
Message:

Version 2.1.1

Location:
security-safe/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • security-safe/trunk/README.txt

    r2123215 r2123362  
    6060== Changelog ==
    6161
     62= 2.1.1 (Medium Priority) =
     63*Release Date - 15 July 2019*
     64* Bug Fix: Session handling conflicted with some admin features in oddball scenarios
     65* Improvement: Fixed a PHP Warning
     66
    6267= 2.1.0 (Medium Priority) =
    6368*Release Date - 15 July 2019*
  • security-safe/trunk/core/Plugin.php

    r2123215 r2123362  
    8686
    8787            // Get user once
    88             $session['user'] = wp_get_current_user();
    89 
    90             // Set values as keys
    91             $session['user']->roles = array_combine( $session['user']->roles, $session['user']->roles );
    92 
    93             if ( is_super_admin() ) {
    94 
    95                 // Get super admin once
    96                 $session['user']->roles['super_admin'] = true;
    97 
    98             }
    99 
     88            $user = wp_get_current_user();
     89
     90            $new_roles = array_combine( $user->roles, $user->roles );
     91
     92            // Cache roles
     93            $session['user']['roles'] = $new_roles;
     94           
    10095        }
    10196
     
    576571
    577572                // Only Super Admin has the power
    578                 $admin_user = ( isset( $session->user->roles['super_admin'] ) ) ? true : false;
     573                $admin_user = ( isset( $session['user']['roles']['super_admin'] ) ) ? true : false;
    579574
    580575            } else {
    581576
    582                 $admin_user = ( isset( $session->user->roles['administror'] ) || current_user_can( 'manage_options' ) ) ? true : false;
     577                $admin_user = ( isset( $session['user']['roles']['administror'] ) || current_user_can( 'manage_options' ) ) ? true : false;
    583578
    584579            }
  • security-safe/trunk/core/includes/Janitor.php

    r2123215 r2123362  
    129129    public static function log_activity( $args = [] ) {
    130130
    131         global $SecuritySafe;
    132 
    133         // Get Current Session
    134         $SecuritySafe->logged_in = is_user_logged_in();
    135         $SecuritySafe->user = wp_get_current_user();
     131        $user = wp_get_current_user();
    136132
    137133        // Log Actual Activity
     
    139135        $args['threats'] = '0';
    140136        $args['user_agent'] = Yoda::get_user_agent();
    141         $args['username'] = ( isset( $SecuritySafe->user->user_login ) ) ? $SecuritySafe->user->user_login : 'unknown';
     137        $args['username'] = ( isset( $user->user_login ) ) ? $user->user_login : 'unknown';
    142138        $args['ip'] = Yoda::get_ip();
    143139        $args['status'] = ( defined( 'DOING_CRON' ) ) ? 'automatic' : 'unknown';
    144         $args['status'] = ( $args['status'] == 'unknown' && isset( $SecuritySafe->user->user_login ) ) ? 'manual' : $args['status'];
     140        $args['status'] = ( $args['status'] == 'unknown' && isset( $user->user_login ) ) ? 'manual' : $args['status'];
    145141       
    146142        Self::add_entry( $args );
  • security-safe/trunk/core/security/Security.php

    r2123215 r2123362  
    197197       
    198198        if ( $settings['on'] == "1" ) {
    199             if ( isset( $this->user->roles['author'] ) || isset( $this->user->roles['editor'] ) || isset( $this->user->roles['administror'] ) || isset( $this->user->roles['super_admin'] ) ) {
     199            if ( isset( $this->user['roles']['author'] ) || isset( $this->user['roles']['editor'] ) || isset( $this->user['roles']['administror'] ) || isset( $this->user['roles']['super_admin'] ) ) {
    200200                // Skip Conditional Policies
    201201                $skip = true;
  • security-safe/trunk/security-safe.php

    r2123215 r2123362  
    77    die;
    88}
    9 define( 'SECSAFE_VERSION', '2.1.0' );
     9define( 'SECSAFE_VERSION', '2.1.1' );
    1010define( 'SECSAFE_DEBUG', false );
    1111define( 'SECSAFE_TIME_START', microtime( true ) );
     
    2323 * @wordpress-plugin
    2424 * Plugin Name: WP Security Safe
    25  * Version:     2.1.0
     25 * Version:     2.1.1
    2626 * Plugin URI: https://sovstack.com/security-safe
    2727 * Description: WP Security Safe - Firewall, Security Hardening, Auditing & Privacy
Note: See TracChangeset for help on using the changeset viewer.