Plugin Directory

Changeset 2738335


Ignore:
Timestamp:
06/07/2022 03:07:44 AM (4 years ago)
Author:
wtsec
Message:

2.4.8

  • Session data storage has been changed
Location:
wt-security/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wt-security/trunk/includes/templates/monitoring.html.twig

    r2717857 r2738335  
    6666                            <div class="wtotem-tooltip__content">
    6767                                <p class="wtotem-tooltip__header">{{ 'Availability module'|trans }}</p>
    68                                 <p class="wtotem-tooltip__text">{{ 'Check the performance of your site every minute. Stay informed about the problems of accessibility of the site instantly using any available types of notifications: SMS, Email, Telegram, Slack and many others.'|trans }}</p>
     68                                <p class="wtotem-tooltip__text">{{ 'Check the performance of your site every minute. Stay informed about the problems.'|trans }}</p>
    6969                            </div>
    7070                        </div>
  • wt-security/trunk/lib/Option.php

    r2723090 r2738335  
    3838            'all_hosts',
    3939            'plugin_version',
     40            'sessions',
    4041
    4142            'host_id',
     
    108109  public static function setSessionOptions(array $options) {
    109110
    110     foreach ($options as $option => $value) {
    111         $_SESSION['wtotem.' . $option] = $value;
    112     }
     111      $sessions = self::getOption('sessions') ?: [];
     112      $user_id = get_current_user_id();
     113
     114        foreach ($options as $option => $value){
     115            $sessions[$user_id][$option] = $value;
     116        }
     117
     118        self::setOptions(['sessions' => $sessions]);
     119
    113120    return TRUE;
    114121  }
     
    124131   */
    125132  public static function getSessionOption($option) {
    126     if(!isset($_SESSION)) {
    127         return [];
    128       }
    129       if(isset($_SESSION['wtotem.' . $option])){
    130           return $_SESSION['wtotem.' . $option];
    131       }
    132       else {
    133         return FALSE;
    134       }
     133
     134      $sessions = self::getOption('sessions') ?: [];
     135      $user_id = get_current_user_id();
     136        if(array_key_exists($user_id, $sessions) and array_key_exists($option, $sessions[$user_id])){
     137            return $sessions[$user_id][$option];
     138        } else {
     139            return [];
     140        }
     141
    135142  }
    136143
  • wt-security/trunk/readme.txt

    r2726827 r2738335  
    7171
    7272== Changelog ==
     73= 2.4.8 =
     74* Session data storage has been changed
     75
    7376= 2.4.7 =
    7477* Fixed a bug related to using the function str_contains
  • wt-security/trunk/src/Common.php

    r2724281 r2738335  
    1010if (defined('WEBTOTEM')) {
    1111
    12     /**
    13      * Plugin's session start.
    14      */
    15     if(!session_id()) {
    16         session_start();
    17     }
    18 
    19     /**
    20      * Plugin's session close.
    21      */
    22     function wtotem_curl_before_request($curlhandle){
    23         session_write_close();
    24     }
    25     add_action( 'requests-curl.before_request','wtotem_curl_before_request', 9999 );
    2612
    2713  /**
  • wt-security/trunk/wt-security.php

    r2726827 r2738335  
    88 * Text Domain: wtotem
    99 * Domain Path: /lang
    10  * Version: 2.4.7
     10 * Version: 2.4.8
    1111 *
    1212 * PHP version 7
     
    5555 * Current version of the plugin's code.
    5656 */
    57 define('WEBTOTEM_VERSION', '2.4.7');
     57define('WEBTOTEM_VERSION', '2.4.8');
    5858
    5959/**
Note: See TracChangeset for help on using the changeset viewer.