EventView.php
[Pman.Admin] / EventView.php
1 <?php
2
3
4 require_once 'Pman.php';
5
6 class Pman_Admin_EventView extends Pman
7 {
8     
9     function getAuth()
10     {
11         parent::getAuth();
12         $au = $this->getAuthUser();
13         if (!$au || $au->company()->comptype != 'OWNER') {
14             $this->jerrAuth();
15         }
16         return true;
17         
18         
19     }
20     
21     function get($id)
22     {
23         $ev = DB_DataObject::Factory('Events');
24         $ev->get($id);
25         
26         // verify if not admin, then they should 
27         $g = DB_DataObject::Factory('Group_Members');
28         $grps = $g->listGroupMembership($this->authUser);
29        //var_dump($grps);
30         $isAdmin = $g->inAdmin;
31         
32         if (!$isAdmin && $ev->person_id != $this->authUser->id) {
33             $this->jerrAuth();
34         }
35         
36         
37         
38         
39         
40     }
41     
42     
43 }