Plugin Directory

Changeset 2907223


Ignore:
Timestamp:
05/03/2023 01:10:57 AM (3 years ago)
Author:
code9fair
Message:

Fixed force to logout when use Wordpress with Cloudflare

Location:
code9/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code9/trunk/code9.php

    r2904138 r2907223  
    44Plugin URI: https://wordpress.org/plugins/code9/
    55Description: Utility tool for wordpress. 2-step verificatoin code user login.
    6 Version:     1.0.11
     6Version:     1.0.12
    77Author:      Code9Fair
    88Author URI: https://paypal.me/code9fair/
  • code9/trunk/function/code9_security.php

    r2643054 r2907223  
    3838    setcookie('code9_security_public', code9_security_encrypt(json_encode([
    3939        "host_name" => $_SERVER["SERVER_NAME"],
    40         "remote_ip" => $_SERVER["REMOTE_ADDR"],
     40        // "remote_ip" => $_SERVER["REMOTE_ADDR"],
    4141        "request_time" => $_SERVER["REQUEST_TIME"],
    4242    ]), false, false), 0, "/", "", false, false);
     
    245245
    246246                            throw new Exception('Wrong server name');
    247                         } else if (isset($data_decrypt->remote_ip) !== true || $data_decrypt->remote_ip !== $_SERVER['REMOTE_ADDR']) {
     247                        } else if (isset($data_decrypt->remote_ip) !== true /*|| $data_decrypt->remote_ip !== $_SERVER['REMOTE_ADDR']*/) {
    248248                            code9_security_public_unset();
    249249
     
    294294                                } else if ($data_post->admin_id != $admin_id) {
    295295                                    throw new Exception('Wrong login');
    296                                 } else if ($data_post->host_name !== $_SERVER["SERVER_NAME"] || $data_post->remote_ip !== $_SERVER["REMOTE_ADDR"] || $data_post->request_uri !== $_SERVER["REQUEST_URI"]) {
     296                                } else if ($data_post->host_name !== $_SERVER["SERVER_NAME"] /*|| $data_post->remote_ip !== $_SERVER["REMOTE_ADDR"]*/ || $data_post->request_uri !== $_SERVER["REQUEST_URI"]) {
    297297                                    throw new Exception('Wrong host name');
    298298                                } else if (time() - $data_post->request_time > 300) {
     
    370370                    $salts_array = [
    371371                        "host_name" => $_SERVER["SERVER_NAME"],
    372                         "remote_ip" => $_SERVER["REMOTE_ADDR"],
     372                        // "remote_ip" => $_SERVER["REMOTE_ADDR"],
    373373                        "request_time" => $_SERVER["REQUEST_TIME"],
    374374                        "request_uri" => $_SERVER["REQUEST_URI"],
  • code9/trunk/readme.txt

    r2904138 r2907223  
    55Requires at least: 4.1
    66Tested up to: 6.2
    7 Stable tag: 1.0.11
     7Stable tag: 1.0.12
    88Requires PHP: 5.6.4
    99License: GPLv2
     
    7575= 1.0.11 =
    7676* Fixed table log to full width when no log data.
     77= 1.0.12 =
     78* Fixed force to logout when use Wordpress with Cloudflare.
Note: See TracChangeset for help on using the changeset viewer.