VerifyAccess.php
[Pman.Core] / VerifyAccess.php
1 <?php
2
3 require_once 'Pman.php';
4
5 class Pman_Core_VerifyAccess extends Pman
6 {
7     /*
8      * This is a public page
9      */
10     function getAuth() 
11     {
12         return true;
13     }
14     
15     function get($id)
16     {
17         @list($id, $key) = explode('/', $id);
18         
19         $ff = HTML_FlexyFramework::get();
20         
21         $core_person = DB_DataObject::factory('core_person');
22         $core_ip_access = DB_DataObject::factory('core_ip_access');
23         
24         if(
25                 empty($ff->Pman['ip_management']) || 
26                 empty($ff->Pman['XMPP']) ||
27                 empty($ff->Pman['XMPP']['to']) ||
28                 !$core_person->get('email', $ff->Pman['XMPP']['to']) ||
29                 empty($id) ||
30                 empty($key) ||
31                 !$core_ip_access->get($id) ||
32                 $core_ip_access->authorized_key != $key
33         ) {
34             $this->jerr('Invalid URL');
35         }
36         
37         
38         
39         
40         
41         
42     }
43     
44 }