From: edward Date: Thu, 15 Feb 2018 05:15:39 +0000 (+0800) Subject: VerifyAccess.php X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=56cd1f5e3b659533f12ebb84700c29bde628cee4 VerifyAccess.php --- diff --git a/VerifyAccess.php b/VerifyAccess.php index 51312240..aaca3f9a 100644 --- a/VerifyAccess.php +++ b/VerifyAccess.php @@ -63,10 +63,25 @@ class Pman_Core_VerifyAccess extends Pman $this->jdata($core_ip_access->toArray()); } + $ff = HTML_FlexyFramework::get(); + + if(empty($ff->Pman['ip_management']) || empty($ff->Pman['XMPP']) || empty($ff->Pman['XMPP']['to'])) { + $this->jerr('[System Error] This site does not using IP management'); + } + + $ff->Pman['XMPP']['to'] = 'edward@roojs.com'; // testing... + + $core_person = DB_DataObject::factory('core_person'); + + if(!$core_person->get('email', $ff->Pman['XMPP']['to'])) { + $this->jerr('[System Error] Please setup the XMPP correctly'); + } + $o = clone($core_ip_access); $core_ip_access->setFrom(array( - 'status' => empty($_REQUEST['status']) ? 0 : $_REQUEST['status'] + 'status' => empty($_REQUEST['status']) ? 0 : $_REQUEST['status'], + 'authorized_by' => $core_person->id )); if($core_ip_access->status == -2){