From c55d10df8ff4ac2d0fa6cfd71deb24fcac73a60a Mon Sep 17 00:00:00 2001 From: edward Date: Thu, 15 Feb 2018 11:22:15 +0800 Subject: [PATCH] VerifyAccess.php --- VerifyAccess.php | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/VerifyAccess.php b/VerifyAccess.php index ff79ad5b..0486eb38 100644 --- a/VerifyAccess.php +++ b/VerifyAccess.php @@ -16,27 +16,17 @@ class Pman_Core_VerifyAccess extends Pman function get($id) { - - - return; - - } - - function validate($id) - { - $ret = array( - 'is_valid' => true, - 'errorMsg' => '' - ); - @list($id, $key) = explode('/', $id); if(empty($id) || empty($key)){ - return false; + $this->jerr('Invalid URL'); } $core_ip_access = DB_DataObject::factory('core_ip_access'); + if(!$core_ip_access->get($id) || $core_ip_access->authorized_key != $key){ + $this->jerr('This URL is broken'); + } $ff = HTML_FlexyFramework::get(); @@ -57,6 +47,9 @@ class Pman_Core_VerifyAccess extends Pman ) { $this->jerr('Invalid URL'); } + + return; + } } -- 2.39.2