Plugin Directory

Changeset 1820882


Ignore:
Timestamp:
02/12/2018 10:18:53 PM (8 years ago)
Author:
fs1995
Message:

resource monitor password bug fix

Location:
lw-mwp-tools
Files:
1 deleted
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • lw-mwp-tools/tags/0.3.1/lw-mwp-tools.php

    r1819502 r1820882  
    55Description: Easy access to system logs and resource usage on the Liquid Web Managed WordPress Hosting Platform.
    66Author: Francis Smith
    7 Version: 0.3
     7Version: 0.3.1
    88Author URI: https://github.com/fs1995
    99License: GPL2
  • lw-mwp-tools/tags/0.3.1/monitor.php

    r1819502 r1820882  
    11<?php defined('ABSPATH') or die('No!');
    2 $jsonpath = plugins_url( 'monitor_json.php', __FILE__ );?>
     2$jsonpath = plugins_url( 'monitor_json.php', __FILE__ ) . "?lw-mwp-tools=" . gethostname() . get_current_user();?>
    33
    44<h2>Server Resource Monitor</h2>
     
    5858function updateChart(){
    5959  var xhr = new XMLHttpRequest(); //ie7+
    60   xhr.open("GET", <?php echo "\"" . $jsonpath . "\""; ?>, true, "", <?php echo "\"" . gethostname() . get_current_user() . "\""; ?>); //little bit of mixing php here to get the path of monitor_json.php to get the json with all the system resource info
     60  xhr.open("GET", <?php echo "\"" . $jsonpath . "\""; ?>, true,  ); //little bit of mixing php here to get the path of monitor_json.php to get the json with all the system resource info
    6161  xhr.onload = function (e) {
    6262    if (xhr.readyState === 4){
  • lw-mwp-tools/tags/0.3.1/monitor_json.php

    r1819503 r1820882  
    11<?php
    2 $json_password = gethostname() . get_current_user(); //not super secure, but this isint terribly sensitive info we are protecting...
    32
    4 if (!isset($_SERVER['PHP_AUTH_PW'])) { //no password provided, need to authenticate
    5     header('WWW-Authenticate: Basic realm="lw-mwp-tools"'); //the http authentication form. page will reload on submit.
    6     header('HTTP/1.0 401 Unauthorized'); //user clicked cancel or somehow didnt get password
    7     echo 'didnt authenticate';
     3if (!isset( $_GET['lw-mwp-tools'] )) { //to protect access to this file
     4    header('HTTP/1.0 401 Unauthorized');
    85    exit;
    9 } else {
    10     if($_SERVER['PHP_AUTH_PW'] !== $json_password){ //got password but its not right
    11       echo "invalid";
    12       exit;
    13     }
     6}else if( $_GET['lw-mwp-tools'] !== gethostname() . get_current_user() ){ //so the GET parameter is set, now to check what it's set to... not super secure, but this isint terribly sensitive info we are protecting...
     7  header('HTTP/1.0 401 Unauthorized');
     8  exit;
    149}
    1510
  • lw-mwp-tools/tags/0.3.1/readme.txt

    r1819502 r1820882  
    4141== Changelog ==
    4242
     43= 0.3.1 =
     44* Bug fix on Resource Monitor page.
     45
    4346= 0.3 =
    4447* Rewrite of the system monitor page, resource usage is now updated automatically.
     
    5457== Upgrade Notice ==
    5558
    56 = 0.3 =
    57 * Resource Monitor now updates automatically!
     59= 0.3.1 =
     60* Bug causing a password popup on Resource Monitor page is fixed.
  • lw-mwp-tools/trunk/lw-mwp-tools.php

    r1819502 r1820882  
    55Description: Easy access to system logs and resource usage on the Liquid Web Managed WordPress Hosting Platform.
    66Author: Francis Smith
    7 Version: 0.3
     7Version: 0.3.1
    88Author URI: https://github.com/fs1995
    99License: GPL2
  • lw-mwp-tools/trunk/monitor.php

    r1819502 r1820882  
    11<?php defined('ABSPATH') or die('No!');
    2 $jsonpath = plugins_url( 'monitor_json.php', __FILE__ );?>
     2$jsonpath = plugins_url( 'monitor_json.php', __FILE__ ) . "?lw-mwp-tools=" . gethostname() . get_current_user();?>
    33
    44<h2>Server Resource Monitor</h2>
     
    5858function updateChart(){
    5959  var xhr = new XMLHttpRequest(); //ie7+
    60   xhr.open("GET", <?php echo "\"" . $jsonpath . "\""; ?>, true, "", <?php echo "\"" . gethostname() . get_current_user() . "\""; ?>); //little bit of mixing php here to get the path of monitor_json.php to get the json with all the system resource info
     60  xhr.open("GET", <?php echo "\"" . $jsonpath . "\""; ?>, true,  ); //little bit of mixing php here to get the path of monitor_json.php to get the json with all the system resource info
    6161  xhr.onload = function (e) {
    6262    if (xhr.readyState === 4){
  • lw-mwp-tools/trunk/monitor_json.php

    r1819503 r1820882  
    11<?php
    2 $json_password = gethostname() . get_current_user(); //not super secure, but this isint terribly sensitive info we are protecting...
    32
    4 if (!isset($_SERVER['PHP_AUTH_PW'])) { //no password provided, need to authenticate
    5     header('WWW-Authenticate: Basic realm="lw-mwp-tools"'); //the http authentication form. page will reload on submit.
    6     header('HTTP/1.0 401 Unauthorized'); //user clicked cancel or somehow didnt get password
    7     echo 'didnt authenticate';
     3if (!isset( $_GET['lw-mwp-tools'] )) { //to protect access to this file
     4    header('HTTP/1.0 401 Unauthorized');
    85    exit;
    9 } else {
    10     if($_SERVER['PHP_AUTH_PW'] !== $json_password){ //got password but its not right
    11       echo "invalid";
    12       exit;
    13     }
     6}else if( $_GET['lw-mwp-tools'] !== gethostname() . get_current_user() ){ //so the GET parameter is set, now to check what it's set to... not super secure, but this isint terribly sensitive info we are protecting...
     7  header('HTTP/1.0 401 Unauthorized');
     8  exit;
    149}
    1510
  • lw-mwp-tools/trunk/readme.txt

    r1819502 r1820882  
    4141== Changelog ==
    4242
     43= 0.3.1 =
     44* Bug fix on Resource Monitor page.
     45
    4346= 0.3 =
    4447* Rewrite of the system monitor page, resource usage is now updated automatically.
     
    5457== Upgrade Notice ==
    5558
    56 = 0.3 =
    57 * Resource Monitor now updates automatically!
     59= 0.3.1 =
     60* Bug causing a password popup on Resource Monitor page is fixed.
Note: See TracChangeset for help on using the changeset viewer.