X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=VerifyAccess.php;h=d4433e57b50282bb4e710863e86f8bda5a6d72e2;hb=2216e5c2240f2b2a609954cded9b6c06494ab3c7;hp=ed28a11c5a77468631f3167ed86a6620a4bdfc49;hpb=4d132ef10744ba614029e7073bec3f692e06daa3;p=Pman.Core diff --git a/VerifyAccess.php b/VerifyAccess.php index ed28a11c..d4433e57 100644 --- a/VerifyAccess.php +++ b/VerifyAccess.php @@ -46,4 +46,45 @@ class Pman_Core_VerifyAccess extends Pman } + function post() + { + if(!empty($_REQUEST['_to_data'])){ + $this->toData(); + } + + + } + + function toData() + { + $core_ip_access = DB_DataObject::factory('core_ip_access'); + + if( + empty($_REQUEST['id']) || + empty($_REQUEST['verify_key']) || + !$core_ip_access->get($_REQUEST['id']) + ){ + $this->jerr('broken_link'); + return; + } + + if(!empty($coba_application_signup->coba_application_id)){ + $this->jerr('already_registered'); + return; + } + + if($coba_application_signup->verify_key != $_REQUEST['verify_key']){ + $this->jerr('broken_link'); + return; + } + + if(time() > strtotime($coba_application_signup->expiry_dt)) { + $this->jerr('expired'); + return; + } + + $this->jdata($coba_application_signup->toArray()); + + } + }