本文整理汇总了PHP中OA_Permission::enforceAccessToObject方法的典型用法代码示例。如果您正苦于以下问题:PHP OA_Permission::enforceAccessToObject方法的具体用法?PHP OA_Permission::enforceAccessToObject怎么用?PHP OA_Permission::enforceAccessToObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OA_Permission
的用法示例。
在下文中一共展示了OA_Permission::enforceAccessToObject方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: phpAds_registerGlobal
// Required files
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/lib/max/other/html.php';
// Register input variables
phpAds_registerGlobal('action', 'variablemethod');
// Since there may be an unknown number of variables posted (which are accessed by $_POST directly in the code below),
// clean the whole $_POST array
MAX_commonRemoveSpecialChars($_POST);
/*-------------------------------------------------------*/
/* Affiliate interface security */
/*-------------------------------------------------------*/
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
OA_Permission::enforceAccessToObject('clients', $clientid);
OA_Permission::enforceAccessToObject('trackers', $trackerid);
/*-------------------------------------------------------*/
/* Store preferences */
/*-------------------------------------------------------*/
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['clientid'] = $clientid;
phpAds_SessionDataStore();
/*-------------------------------------------------------*/
/* HTML framework */
/*-------------------------------------------------------*/
if (!isset($variables)) {
if (isset($session['prefs']['tracker-variables.php']['variables']) && $session['prefs']['tracker-variables.php']['trackerid'] == $trackerid) {
$variables = $session['prefs']['tracker-variables.php']['variables'];
}
}
if (!empty($trackerid)) {
// Get publisher list
示例2: phpAds_registerGlobalUnslashed
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/www/admin/config.php';
/*-------------------------------------------------------*/
/* Main code */
/*-------------------------------------------------------*/
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/CampaignZoneLink.php';
phpAds_registerGlobalUnslashed('action', 'campaignid', 'allSelected', 'category-linked', 'category-available', 'text-linked', 'text-available');
$agencyId = OA_Permission::getAgencyId();
$oDalZones = OA_Dal::factoryDAL('zones');
$action = $GLOBALS["action"];
$campaignId = $GLOBALS['campaignid'];
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
OA_Permission::enforceAccessToObject('campaigns', $campaignid);
$aZonesIds = array();
$aZonesIdsHash = array();
foreach ($_REQUEST['ids'] as $zone) {
if (substr($zone, 0, 1) == 'z') {
$aZonesIds[] = substr($zone, 1);
$aZonesIdsHash[substr($zone, 1)] = "x";
}
}
// If we're requested to link all matching zones, we need to determine the ids to link
// Ideally, there should be a DAL method to that directly. Note that we're replacing
// only the $aZonesIds array here, and keeping $aZonesIdsHash populated based on the
// zone ids from the request. This way, zones with ids from the request will get
// higlighted as "just linked". It doesn't make to put all zone ids in $aZonesIdsHash as
// only
if ($GLOBALS['allSelected'] == 'true') {
示例3: phpAds_registerGlobalUnslashed
// Register input variables
phpAds_registerGlobalUnslashed('name', 'description', 'comments', 'affiliateid', 'agencyid', 'channelid');
/*-------------------------------------------------------*/
/* Affiliate interface security */
/*-------------------------------------------------------*/
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
OA_Permission::enforceAccessToObject('channel', $channelid, true);
// Initalise data
$doChannel = OA_Dal::factoryDO('channel');
if (!empty($channelid)) {
$doChannel->get($channelid);
$channel = $doChannel->toArray();
} else {
//for new channels set affiliate id (if any)
if (!empty($affiliateid)) {
OA_Permission::enforceAccessToObject('affiliates', $affiliateid);
$channel['affiliateid'] = $affiliateid;
}
}
if (!empty($affiliateid)) {
/*-------------------------------------------------------*/
/* Store preferences */
/*-------------------------------------------------------*/
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['affiliateid'] = $affiliateid;
phpAds_SessionDataStore();
}
/*-------------------------------------------------------*/
/* MAIN REQUEST PROCESSING */
/*-------------------------------------------------------*/
//build form
$channelForm = buildChannelForm($channel);
示例4:
| |
| Copyright: See the COPYRIGHT.txt file. |
| License: GPLv2 or later, see the LICENSE.txt file. |
+---------------------------------------------------------------------------+
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/UserAccess.php';
require_once MAX_PATH . '/lib/max/other/html.php';
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER);
OA_Permission::enforceAccountPermission(OA_ACCOUNT_MANAGER, OA_PERM_SUPER_ACCOUNT);
OA_Permission::enforceAccessToObject('agency', $agencyid);
/*-------------------------------------------------------*/
/* HTML framework */
/*-------------------------------------------------------*/
phpAds_PageHeader('agency-access');
if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
$doAgency = OA_Dal::staticGetDO('agency', $agencyid);
MAX_displayInventoryBreadcrumbs(array(array("name" => $doAgency->name)), "agency");
}
/*-------------------------------------------------------*/
/* Main code */
/*-------------------------------------------------------*/
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
$oTpl = new OA_Admin_Template('agency-user-start.html');
OA_Admin_UI_UserAccess::assignUserStartTemplateVariables($oTpl);
$oTpl->assign('action', 'agency-user.php');
示例5: phpAds_registerGlobal
| License: GPLv2 or later, see the LICENSE.txt file. |
+---------------------------------------------------------------------------+
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-storage.inc.php';
require_once MAX_PATH . '/www/admin/lib-zones.inc.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
// Register input variables
phpAds_registerGlobal('returnurl');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
OA_Permission::enforceAccessToObject('clients', $clientid);
/*-------------------------------------------------------*/
/* Main code */
/*-------------------------------------------------------*/
if (!empty($trackerid)) {
$ids = explode(',', $trackerid);
while (list(, $trackerid) = each($ids)) {
$doTrackers = OA_Dal::factoryDO('trackers');
$doTrackers->trackerid = $trackerid;
if ($doTrackers->find()) {
// Clone the found DB_DataObject, as cannot delete() once
// it has been fetch()ed
$doTrackersClone = clone $doTrackers;
// Fetch the tracker so that we can get the name of the
// tracker for the delete message
$doTrackers->fetch();
示例6: phpAds_registerGlobal
require_once MAX_PATH . '/www/admin/lib-zones.inc.php';
include_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/lib/OA/Maintenance/Priority.php';
require_once MAX_PATH . '/lib/max/other/common.php';
// Register input variables
phpAds_registerGlobal('campaignid', 'clientid', 'newclientid', 'returnurl', 'duplicate');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
if (!empty($duplicate)) {
OA_Permission::enforceAccessToObject('clients', $clientid, false, OA_Permission::OPERATION_VIEW);
OA_Permission::enforceAccessToObject('campaigns', $campaignid, false, OA_Permission::OPERATION_DUPLICATE);
} else {
if (!empty($newclientid)) {
OA_Permission::enforceAccessToObject('clients', $clientid, false, OA_Permission::OPERATION_VIEW);
OA_Permission::enforceAccessToObject('campaigns', $campaignid, false, OA_Permission::OPERATION_MOVE);
OA_Permission::enforceAccessToObject('clients', $newclientid, false, OA_Permission::OPERATION_EDIT);
}
}
/*-------------------------------------------------------*/
/* Main code */
/*-------------------------------------------------------*/
if (!empty($campaignid)) {
if (!empty($duplicate)) {
// Duplicate the campaign
$doCampaigns = OA_Dal::factoryDO('campaigns');
$doCampaigns->get($campaignid);
$oldName = $doCampaigns->campaignname;
$newCampaignId = $doCampaigns->duplicate();
if ($newCampaignId) {
// Queue confirmation message
$newName = $doCampaigns->campaignname;
示例7: phpAds_registerGlobal
require_once MAX_PATH . '/lib/max/other/capping/lib-capping.inc.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-append.inc.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/www/admin/lib-size.inc.php';
require_once MAX_PATH . '/www/admin/lib-zones.inc.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/component/Form.php';
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
// Register input variables
phpAds_registerGlobal('append', 'forceappend', 'appendid', 'appendsave', 'appendtype', 'chaintype', 'chainzone', 'prepend');
/*-------------------------------------------------------*/
/* Security check */
/*-------------------------------------------------------*/
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER, OA_ACCOUNT_TRAFFICKER);
OA_Permission::enforceAccessToObject('affiliates', $affiliateid);
OA_Permission::enforceAccessToObject('zones', $zoneid);
if (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
OA_Permission::enforceAllowed(OA_PERM_ZONE_EDIT);
}
/*-------------------------------------------------------*/
/* Store preferences */
/*-------------------------------------------------------*/
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['affiliateid'] = $affiliateid;
phpAds_SessionDataStore();
/*-------------------------------------------------------*/
/* Initialise data */
/*-------------------------------------------------------*/
$doZones = OA_Dal::factoryDO('zones');
if ($doZones->get($zoneid)) {
$aZone = $doZones->toArray();
}
示例8: phpAds_registerGlobalUnslashed
require_once MAX_PATH . '/lib/max/other/capping/lib-capping.inc.php';
require_once MAX_PATH . '/lib/max/other/html.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/component/Form.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/www/admin/lib-maintenance-priority.inc.php';
require_once MAX_PATH . '/lib/pear/Date.php';
require_once MAX_PATH . '/lib/OA/Admin/NumberFormat.php';
require_once MAX_PATH . '/lib/OX/Util/Utils.php';
require_once MAX_PATH . '/lib/max/Dal/DataObjects/Campaigns.php';
// Register input variables
phpAds_registerGlobalUnslashed('start', 'startSet', 'anonymous', 'campaignname', 'clicks', 'companion', 'show_capped_no_cookie', 'comments', 'conversions', 'end', 'endSet', 'priority', 'high_priority_value', 'revenue', 'revenue_type', 'submit', 'submit_status', 'target_old', 'target_type_old', 'target_value', 'target_type', 'rd_impr_bkd', 'rd_click_bkd', 'rd_conv_bkd', 'impressions', 'weight_old', 'weight', 'clientid', 'status', 'status_old', 'as_reject_reason', 'an_status', 'previousimpressions', 'previousconversions', 'previousclicks');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
OA_Permission::enforceAccessToObject('clients', $clientid, false, OA_Permission::OPERATION_VIEW);
OA_Permission::enforceAccessToObject('campaigns', $campaignid, true, OA_Permission::OPERATION_EDIT);
/*-------------------------------------------------------*/
/* Store preferences */
/*-------------------------------------------------------*/
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['clientid'] = $clientid;
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['campaignid'][$clientid] = $campaignid;
phpAds_SessionDataStore();
/*-------------------------------------------------------*/
/* Initialise data */
/*-------------------------------------------------------*/
if ($campaignid != "") {
// Edit or Convert
// Fetch exisiting settings
// Parent setting for converting, campaign settings for editing
$ID = $campaignid;
// Get the campaign data from the campaign table, and store in $campaign
示例9: phpAds_registerGlobal
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/lib/OA/Dll.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/www/admin/lib-zones.inc.php';
require_once MAX_PATH . '/lib/OA/Maintenance/Priority.php';
phpAds_registerGlobal('value');
if ($value == OA_ENTITY_STATUS_RUNNING) {
$value = OA_ENTITY_STATUS_PAUSED;
} else {
$value = OA_ENTITY_STATUS_RUNNING;
}
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER);
OA_Permission::enforceAccessToObject('clients', $clientid);
OA_Permission::enforceAccessToObject('campaigns', $campaignid);
OA_Permission::enforceAccessToObject('banners', $bannerid, true);
if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
if ($value == OA_ENTITY_STATUS_RUNNING) {
OA_Permission::enforceAllowed(OA_PERM_BANNER_ACTIVATE);
} else {
OA_Permission::enforceAllowed(OA_PERM_BANNER_DEACTIVATE);
}
}
if (!empty($bannerid)) {
$doBanners = OA_Dal::factoryDO('banners');
$doBanners->get($bannerid);
$bannerName = $doBanners->description;
$translation = new OX_Translation();
$message = $value == OA_ENTITY_STATUS_PAUSED ? $GLOBALS['strBannerHasBeenDeactivated'] : $GLOBALS['strBannerHasBeenActivated'];
$translated_message = $translation->translate($message, array("banner-edit.php?clientid={$clientid}&campaignid={$campaignid}&bannerid={$bannerid}", htmlspecialchars($bannerName)));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
示例10: MAX_getStoredValue
+---------------------------------------------------------------------------+
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/lib/OA/Dll/Audit.php';
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
require_once MAX_PATH . '/www/admin/config.php';
// Register input variables
$auditId = MAX_getStoredValue('auditId', 0);
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER);
OA_Permission::enforceAccountPermission(OA_ACCOUNT_ADVERTISER, OA_PERM_USER_LOG_ACCESS);
OA_Permission::enforceAccountPermission(OA_ACCOUNT_TRAFFICKER, OA_PERM_USER_LOG_ACCESS);
OA_Permission::enforceAccessToObject('audit', $auditId);
/*-------------------------------------------------------*/
/* HTML framework */
/*-------------------------------------------------------*/
phpAds_PageHeader('userlog-index');
if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
// Show all "My Account" sections
phpAds_ShowSections(array("5.1", "5.2", "5.3", "5.5", "5.6", "5.4"));
phpAds_UserlogSelection("index");
} else {
if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
// Show the "Preferences", "User Log" and "Channel Management" sections of the "My Account" sections
phpAds_ShowSections(array("5.1", "5.2", "5.4", "5.7"));
} else {
if (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER) || OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
phpAds_ShowSections(array("5.1", "5.2", "5.4"));
示例11: phpAds_registerGlobal
// Required files
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-banner.inc.php';
// Register input variables
phpAds_registerGlobal('returnurl', 'agencyid', 'channelid', 'affiliateid');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
/*-------------------------------------------------------*/
/* Main code */
/*-------------------------------------------------------*/
if (!empty($channelid)) {
$ids = explode(',', $channelid);
while (list(, $channelid) = each($ids)) {
// Security check
OA_Permission::enforceAccessToObject('channel', $channelid);
$doChannel = OA_Dal::factoryDO('channel');
$doChannel->channelid = $channelid;
if ($doChannel->get($channelid)) {
$aChannel = $doChannel->toArray();
}
$doChannel->delete();
}
// Queue confirmation message
$translation = new OX_Translation();
if (count($ids) == 1) {
$translated_message = $translation->translate($GLOBALS['strChannelHasBeenDeleted'], array(htmlspecialchars($aChannel['name'])));
} else {
$translated_message = $translation->translate($GLOBALS['strChannelsHaveBeenDeleted']);
}
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
示例12: while
if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
OA_Permission::enforceAccessToObject('campaigns', $campaignid);
}
$appliedTo = 0;
$doBanners = OA_Dal::factoryDO('banners');
$doBanners->campaignid = $campaignid;
$doBanners->find();
while ($doBanners->fetch()) {
if ($doBanners->bannerid != $bannerid && MAX_AclCopy(basename($_SERVER['PHP_SELF']), $bannerid, $doBanners->bannerid)) {
$appliedTo++;
}
}
$applyto = $bannerid;
} else {
if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
OA_Permission::enforceAccessToObject('banners', $applyto);
}
if (MAX_AclCopy(basename($_SERVER['PHP_SELF']), $bannerid, $applyto)) {
$appliedTo++;
}
}
$translation = new OX_Translation();
$translated_message = $translation->translate($GLOBALS['strBannerAclHasBeenAppliedTo'], array(MAX::constructURL(MAX_URL_ADMIN, "banner-edit.php?clientid={$clientid}&campaignid={$campaignid}&bannerid={$bannerid}"), htmlspecialchars($bannerName), $appliedTo));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
Header("Location: {$returnurl}?clientid={$clientid}&campaignid={$campaignid}&bannerid=" . $applyto);
} elseif (isset($duplicate) && $duplicate == 'true') {
$doBanners = OA_Dal::factoryDO('banners');
$doBanners->get($bannerid);
$oldName = $doBanners->description;
$new_bannerid = $doBanners->duplicate();
// Run the Maintenance Priority Engine process
示例13: phpAds_registerGlobal
// Required files
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/lib/OA/Maintenance/Priority.php';
// Register input variables
phpAds_registerGlobal('returnurl');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
/*-------------------------------------------------------*/
/* Main code */
/*-------------------------------------------------------*/
if (!empty($clientid)) {
$ids = explode(',', $clientid);
while (list(, $clientid) = each($ids)) {
// Security check
OA_Permission::enforceAccessToObject('clients', $clientid, false, OA_Permission::OPERATION_DELETE);
$doClients = OA_Dal::factoryDO('clients');
$doClients->clientid = $clientid;
if ($doClients->get($clientid)) {
$aAdvertiser = $doClients->toArray();
}
$doClients->delete();
}
// Queue confirmation message
$translation = new OX_Translation();
if (count($ids) == 1) {
$translated_message = $translation->translate($GLOBALS['strAdvertiserHasBeenDeleted'], array(htmlspecialchars($aAdvertiser['clientname'])));
} else {
$translated_message = $translation->translate($GLOBALS['strAdvertisersHaveBeenDeleted']);
}
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
示例14: array
$inputVariables = array('entity', 'entityId', 'startDate', 'endDate', 'dimension', 'exportCsv', 'showAs', 'expandId');
MAX_commonRegisterGlobalsArray($inputVariables);
PEAR::pushErrorHandling(null);
require_once 'stats-api.php';
require_once 'stats-debug.php';
include_once 'lib/SmartyFunctions/function.url.php';
include_once 'lib/SmartyFunctions/modifier.formatNumber.php';
include_once 'VastAreaGraph.php';
include_once 'VastMultiAreaGraph.php';
// Entity
$availableEntities = array('advertiser', 'campaign', 'banner', 'website', 'zone');
if (!in_array($entity, $availableEntities)) {
exit("Invalid input parameters");
}
$entityToRequiredAccess = array('advertiser' => 'clients', 'campaign' => 'campaigns', 'banner' => 'banners', 'website' => 'affiliates', 'zone' => 'zones');
OA_Permission::enforceAccessToObject($entityToRequiredAccess[$entity], $entityId);
$entityId = (int) $entityId;
$startDate = urlencode($startDate);
$endDate = urlencode($endDate);
// "Show as" dropdown
$availableShowAs = array('table' => "Table", 'graph-percentage' => "Graph (% of views)", 'graph-count' => "Graph (# of views)");
if (empty($showAs) || !isset($availableShowAs[$showAs])) {
$showAs = 'table';
}
$selectedShowAs = $showAs;
// "View by" dimension
$availableDimensions = array();
if (in_array($entity, array('campaign', 'advertiser'))) {
$availableDimensions['banner'] = "Banner";
if ($entity == 'advertiser') {
$availableDimensions['campaign'] = "Campaign";