if (!empty($GLOBALS[$k])) { $aAuditData[$key]['context'] = $GLOBALS[$k]; } } // Assign vars to template $oTpl->assign('showAdvertisers', $showAdvertisers); $oTpl->assign('showPublishers', $showPublishers); if ($showAdvertisers) { $oTpl->assign('aAdvertiser', $aAdvertiser); $oTpl->assign('aCampaign', $aCampaign); } if ($showPublishers) { $oTpl->assign('aPublisher', $aPublisher); $oTpl->assign('aZone', $aZone); } $oTpl->assign('aAuditEnabled', OA::getConfigOption('audit', 'enabled', false)); $oTpl->assign('aAuditData', $aAuditData); $oTpl->assign('aPeriodPreset', $aPeriodPreset); $oTpl->assign('context', $context); $oTpl->assign('advertiserId', $advertiserId); $oTpl->assign('campaignId', $campaignId); $oTpl->assign('publisherId', $publisherId); $oTpl->assign('zoneId', $zoneId); $oTpl->assign('urlParam', $urlParam); $oTpl->assign('listorder', $listorder); $oTpl->assign('orderdirection', $orderdirection); $oTpl->assign('setPerPage', $setPerPage); $oTpl->assign('pager', $pager); $oTpl->assign('daySpan', $daySpan); // Display page $oTpl->display();
/** * Deletes users who are not linked with any sso account, never logged * in and their account was created before deleteUnverifiedUsersAfter days. * Where deleteUnverifiedUsersAfter is defined in config in * "authentication" section. * * @return boolean */ function deleteUnverifiedUsers($deleteOlderThanSeconds = null) { if (empty($deleteOlderThanSeconds)) { // by default 28 days $deleteOlderThanSeconds = OA::getConfigOption('authentication', 'deleteUnverifiedUsersAfter', 2419200); } $monthAgo = new Date(); $monthAgo->subtractSeconds($deleteOlderThanSeconds); $this->whereAdd('date_created < \'' . $this->formatDate($monthAgo) . '\''); $this->whereAdd('sso_user_id IS NULL'); $this->whereAdd('date_last_login IS NULL'); return $this->delete(DB_DATAOBJECT_WHEREADD_ONLY); }
/** * Enter description here... * * @param integer $actionid One of the following: * - 1 for INSERT * - 2 for UPDATE * - 3 for DELETE * @param unknown_type $oDataObject * @param unknown_type $parentid * @return unknown */ function audit($actionid, $oDataObject = null, $parentid = null) { if (OA::getConfigOption('audit', 'enabled', false)) { if ($this->_auditEnabled()) { if (is_null($this->doAudit)) { $this->doAudit = $this->factory('audit'); } $this->doAudit->actionid = $actionid; $this->doAudit->context = $this->getTableWithoutPrefix(); $this->doAudit->contextid = $this->_getContextId(); $this->doAudit->parentid = $parentid; $this->doAudit->username = OA_Permission::getUsername(); $this->doAudit->userid = OA_Permission::getUserId(); if (!isset($this->doAudit->usertype)) { $this->doAudit->usertype = 0; } // Set the account IDs that need to be used in auditing // this type of entity record $aAccountIds = $this->getOwningAccountIds(); // Set the primary account ID if (isset($aAccountIds[OA_ACCOUNT_MANAGER])) { $this->doAudit->account_id = $aAccountIds[OA_ACCOUNT_MANAGER]; } else { $this->doAudit->account_id = $aAccountIds[OA_ACCOUNT_ADMIN]; } // Set the advertiser account ID, if required if (isset($aAccountIds[OA_ACCOUNT_ADVERTISER])) { $this->doAudit->advertiser_account_id = $aAccountIds[OA_ACCOUNT_ADVERTISER]; } // Set the trafficker account ID, if required if (isset($aAccountIds[OA_ACCOUNT_TRAFFICKER])) { $this->doAudit->website_account_id = $aAccountIds[OA_ACCOUNT_TRAFFICKER]; } // Prepare a generic array of data to be stored in the audit record $aAuditFields = $this->_prepAuditArray($actionid, $oDataObject); // Individual objects can customise this data (add, remove, format...) $this->_buildAuditArray($actionid, $aAuditFields); // Do not audit if nothing has changed if (count($aAuditFields)) { // Serialise the data $this->doAudit->details = serialize($aAuditFields); $this->doAudit->updated = OA::getNowUTC(); // Finally, insert the audit record $id = $this->doAudit->insert(); // Perform post-audit actions $this->_postAuditTrigger($actionid, $oDataObject, $id); return $id; } } } return false; }