4 require_once 'Pman.php';
6 class Pman_Admin_EventView extends Pman
12 $au = $this->getAuthUser();
13 if (!$au || $au->company()->comptype != 'OWNER') {
23 $ev = DB_DataObject::Factory('Events');
24 if (!$ev->get((int)$id)) {
25 $this->jerr("invalid id");
28 // verify if not admin, then they should
29 $g = DB_DataObject::Factory('Group_Members');
30 $grps = $g->listGroupMembership($this->authUser);
32 $isAdmin = $g->inAdmin;
34 if (!$isAdmin && $ev->person_id != $this->authUser->id) {
38 // we have 2 bits of data available at present:
41 $d= DB_DataObject::factory('core_event_audit');
42 if (is_a($d,'DB_DataObject')) {
43 echo "<H2>Changed Data:</H2>";
44 $d->event_id = $ev->id;
45 foreach($d->fetchAll() as $d) {
46 echo "{$d->name} SET TO: " . htmlspecialchars($d->newvalue) . "<br/>\n";
49 $fn = date('/Y/m/d/'). $ev->id . ".php";strtotime($ev->event_when);
53 $wa = DB_DataObject::factory('core_watch');
54 $wa->notifyEvent($e); // trigger any actions..
57 $ff = HTML_FlexyFramework::get();
58 if (empty($ff->Pman['event_log_dir'])) {
61 $file = $ff->Pman['event_log_dir']. date('/Y/m/d/'). $eid . ".php";
62 if (!file_exists(dirname($file))) {
63 mkdir(dirname($file),0700,true);
65 file_put_contents($file, var_export(array(
66 'REQUEST_URI' => empty($_SERVER['REQUEST_URI']) ? 'cli' : $_SERVER['REQUEST_URI'],
67 'GET' => empty($_GET) ? array() : $_GET,
68 'POST' => empty($_POST) ? array() : $_POST,