From: edward Date: Thu, 15 Feb 2018 03:22:15 +0000 (+0800) Subject: VerifyAccess.php X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=c55d10df8ff4ac2d0fa6cfd71deb24fcac73a60a VerifyAccess.php --- 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; + } }