getAuthUser(); if (!$au || $au->company()->comptype != 'OWNER') { $this->jerrAuth(); } return true; } function get($id, $opts = Array()) { $ev = DB_DataObject::Factory('Events'); if (!$ev->get((int)$id)) { $this->jerr("invalid id"); } // verify if not admin, then they should $g = DB_DataObject::Factory('core_group_member'); if (is_a($g, 'DB_DataObject')) { $grps = $g->listGroupMembership($this->authUser); //var_dump($grps); $isAdmin = $g->inAdmin; if (!$isAdmin && $ev->person_id != $this->authUser->id) { $this->jerrAuth(); } } echo '
'.htmlspecialchars(print_r($ev->toArray(),true)).""; // we have 2 bits of data available at present: // core_event_audit // the event file.. $d= DB_DataObject::factory('core_event_audit'); $d->event_id = $ev->id; // we can set that as the above returns error or dataobject.. if (is_a($d,'DB_DataObject') && $d->count()) { echo "
' . htmlspecialchars(file_get_contents($file)). ''; } $file = $logdir. date('/Y/m/d/',strtotime($ev->event_when)). $ev->id . ".json"; if (!file_exists($file)) { echo "not available (missing file) $file"; exit; } echo '
' . htmlspecialchars(print_r(json_decode(file_get_contents($file)), true)) . ''; if (!empty($ev->remarks)) { echo "
'. htmlspecialchars($ev->remarks) . ''; } $json = json_decode($ev->remarks, JSON_PRETTY_PRINT); if(json_last_error() == JSON_ERROR_NONE){ echo "
' . print_r($json, true) . ''; } $filesJ = json_decode(file_get_contents($file)); if (!empty($filesJ->FILES )) { echo "