3 require_once 'Pman.php';
5 class Pman_Core_VerifyAccess extends Pman
7 var $masterTemplate = 'master-verify-ip-access.html';
10 * This is a public page
19 @list($id, $key) = explode('/', $id);
21 if(empty($id) || empty($key)){
22 $this->jerr('Invalid URL');
25 $core_ip_access = DB_DataObject::factory('core_ip_access');
27 if(!$core_ip_access->get($id) || $core_ip_access->authorized_key != $key){
28 $this->jerr('This URL is broken');
31 $ff = HTML_FlexyFramework::get();
33 if(empty($ff->Pman['ip_management']) || empty($ff->Pman['XMPP']) || empty($ff->Pman['XMPP']['to'])) {
34 $this->jerr('[System Error] This site does not using IP management');
37 $ff->Pman['XMPP']['to'] = 'edward@roojs.com'; // testing...
39 $core_person = DB_DataObject::factory('core_person');
41 if(!$core_person->get('email', $ff->Pman['XMPP']['to'])) {
42 $this->jerr('[System Error] Please setup the XMPP correctly');
51 if(!empty($_REQUEST['_to_data'])){
60 $core_ip_access = DB_DataObject::factory('core_ip_access');
63 empty($_REQUEST['id']) ||
64 empty($_REQUEST['verify_key']) ||
65 !$core_ip_access->get($_REQUEST['id'])
67 $this->jerr('broken_link');
71 if(!empty($coba_application_signup->coba_application_id)){
72 $this->jerr('already_registered');
76 if($coba_application_signup->verify_key != $_REQUEST['verify_key']){
77 $this->jerr('broken_link');
81 if(time() > strtotime($coba_application_signup->expiry_dt)) {
82 $this->jerr('expired');
86 $this->jdata($coba_application_signup->toArray());