function action() { // Control logic // Do not log if the first_hit cookie is still present. $fh_state_name = owa_coreAPI::getSetting('base', 'first_hit_param'); $fh = owa_coreAPI::getStateParam($fh_state_name); if (!empty($fh)) { $this->e->debug('Clearing left over first first hit cookie.'); owa_coreAPI::clearState($fh_state_name); $this->e->debug('Left over first first hit cookie found...aborting request as likely a robot.'); $this->event->set('do_not_log', true); return; } // set variety of new session properties. if ($this->event->get('is_new_session')) { } }
function action() { $fh_state_name = owa_coreAPI::getSetting('base', 'first_hit_param'); //print_r($fh_state_name); $fh = owa_coreAPI::getStateParam($fh_state_name); owa_coreAPI::debug('cookiename: ' . $fh_state_name); //owa_coreAPI::debug(print_r($_COOKIE, true)); if (!empty($fh)) { $this->event->replaceProperties($fh); $this->event->setEventType('base.first_page_request'); //owa_coreAPI::debug(print_r($this->event, true)); // Delete first_hit Cookie owa_coreAPI::clearState($fh_state_name); } $this->setView('base.pixel'); $this->setViewMethod('image'); }
/** * Logs tracking event * * This function fires a tracking event that will be processed and then dispatched * * @param object $event * @return boolean */ public function trackEvent($event) { // do not track anything if user is in overlay mode if (owa_coreAPI::getStateParam('overlay')) { return false; } $this->setGlobalEventProperty('HTTP_REFERER', owa_coreAPI::getServerParam('HTTP_REFERER')); // needed by helper page tags function so it can append to first hit tag url if (!$this->getSiteId()) { $this->setSiteId($event->get('site_id')); } if (!$this->getSiteId()) { $this->setSiteId(owa_coreAPI::getRequestParam('site_id')); } // set various state properties. $this->manageState($event); $event = $this->setAllGlobalEventProperties($event); // send event to log API for processing. return owa_coreAPI::logEvent($event->getEventType(), $event); }
/** * Used by controllers to check if the user exists and if they are priviledged. * * @param string $necessary_role */ function authenticateUser() { // check existing auth status first in case someone else took care of this already. if (owa_coreAPI::getCurrentUser()->isAuthenticated()) { $ret = true; } elseif (owa_coreAPI::getRequestParam('apiKey')) { // auth user by api key $ret = $this->authByApiKey(owa_coreAPI::getRequestParam('apiKey')); } elseif (owa_coreAPI::getRequestParam('pk') && owa_coreAPI::getStateParam('u')) { // auth user by temporary passkey. used in forgot password situations $ret = $this->authenticateUserByUrlPasskey(owa_coreAPI::getRequestParam('pk')); } elseif (owa_coreAPI::getRequestParam('user_id') && owa_coreAPI::getRequestParam('password')) { // auth user by login form input $ret = $this->authByInput(owa_coreAPI::getRequestParam('user_id'), owa_coreAPI::getRequestParam('password')); } elseif (owa_coreAPI::getStateParam('u') && owa_coreAPI::getStateParam('p')) { // auth user by cookies $ret = $this->authByCookies(owa_coreAPI::getStateParam('u'), owa_coreAPI::getStateParam('p')); // bump expiration time //owa_coreAPI::setState('p', '', owa_coreAPI::getStateParam('p')); } else { $ret = false; owa_coreAPI::debug("Could not find any credentials to authenticate with."); } // filter results for modules can add their own auth logic. $ret = $this->eq->filter('auth_status', $ret); return array('auth_status' => $ret); }