From 8ef5e3d4a61b90595b03b5cbd529665b7b0b003c Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Thu, 11 Mar 2021 20:01:49 +0800 Subject: [PATCH] fix: load sha1.js --- common.php | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/common.php b/common.php index 5261b6f..c9d7f63 100644 --- a/common.php +++ b/common.php @@ -457,7 +457,10 @@ function compareadminmd5($admincookie, $name, $pass) function compareadminsha1($adminsha1, $timestamp, $pass) { if (!is_numeric($timestamp)) return 'Timestamp not Number'; - if (abs(time()-$timestamp) > 5*60) return 'The timestamp in server is ' . time() . ' (' . date("Y-m-d\TH:i:s\Z") . '),
and your posted timestamp is ' . $timestamp . ' (' . date("Y-m-d\TH:i:s\Z", $timestamp) . ')'; + if (abs(time()-$timestamp) > 5*60) { + date_default_timezone_set('UTC'); + return 'The timestamp in server is ' . time() . ' (' . date("Y-m-d\TH:i:s\Z") . '),
and your posted timestamp is ' . $timestamp . ' (' . date("Y-m-d\TH:i:s\Z", $timestamp) . ')'; + } if ($adminsha1 == sha1($timestamp . $pass)) return ''; else return 'Error password'; } @@ -899,18 +902,23 @@ function adminform($name = '', $pass = '', $path = '') '; $html .= ' - '; + +'; $html .= ''; return output($html, $statusCode); } @@ -1406,7 +1414,7 @@ function EnvOpt($needUpdate = 0) } } $html .= ' - +