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         // we have 2 bits of data available at present:
37         // core_event_audit
38         // the event file..
39         $d= DB_DataObject::factory('core_event_audit');
40         if (is_a($d,'DB_DataObject')) {
41             echo "<H2>Changed Data:</H2>";
42             $d->event_id = $id;
43             foreach($d->fetchAll() as $d) {
44                 echo "{$d->name} SET TO: " . htmlspecialchars($d->newvalue) . "<br/>\n";
45             }
46         }
47         if (file_exists())
48         
49         
50     }
51     
52     
53 }