本文整理汇总了PHP中MAX_limitationsCheckAcl函数的典型用法代码示例。如果您正苦于以下问题:PHP MAX_limitationsCheckAcl函数的具体用法?PHP MAX_limitationsCheckAcl怎么用?PHP MAX_limitationsCheckAcl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MAX_limitationsCheckAcl函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_MAX_limitationsCheckAcl
/**
* A method test the MAX_limitationsCheckAcl function.
*/
function test_MAX_limitationsCheckAcl()
{
$source = '';
$row['compiledlimitation'] = 'false';
$row['acl_plugins'] = '';
$return = MAX_limitationsCheckAcl($row, $source);
$this->assertFalse($return);
$row['compiledlimitation'] = 'true';
$row['acl_plugins'] = '';
$return = MAX_limitationsCheckAcl($row, $source);
$this->assertTrue($return);
// Test of dummy deliveryLimitation plugin
$row['compiledlimitation'] = 'MAX_checkDummy_Dummy(\'1\', \'==\') and MAX_checkDummy_Dummy(\'2\', \'==\')';
$row['acl_plugins'] = 'deliveryLimitations:Dummy:Dummy';
$return = MAX_limitationsCheckAcl($row, $source);
$this->assertTrue($return);
}
示例2: _adSelectCheckCriteria
function _adSelectCheckCriteria($aAd, $aContext, $source, $richMedia)
{
$conf = $GLOBALS['_MAX']['CONF'];
if (!empty($aAd['expire_time'])) {
$expire = strtotime($aAd['expire_time']);
$now = MAX_commonGetTimeNow();
if ($expire > 0 && $now > $expire) {
OX_Delivery_logMessage('Campaign has expired for bannerid ' . $aAd['ad_id'], 7);
return false;
}
}
if (isset($aContext['banner']['exclude'][$aAd['ad_id']])) {
OX_Delivery_logMessage('List of excluded banners list contains bannerid ' . $aAd['ad_id'], 7);
return false;
}
if (isset($aContext['campaign']['exclude'][$aAd['placement_id']])) {
OX_Delivery_logMessage('List of excluded campaigns contains bannerid ' . $aAd['ad_id'], 7);
return false;
}
if (isset($aContext['client']['exclude'][$aAd['client_id']])) {
OX_Delivery_logMessage('List of excluded clients contains bannerid ' . $aAd['ad_id'], 7);
return false;
}
if (sizeof($aContext['banner']['include']) && !isset($aContext['banner']['include'][$aAd['ad_id']])) {
OX_Delivery_logMessage('List of included banners does not contain bannerid ' . $aAd['ad_id'], 7);
return false;
}
if (sizeof($aContext['campaign']['include']) && !isset($aContext['campaign']['include'][$aAd['placement_id']])) {
OX_Delivery_logMessage('List of included campaigns does not contain bannerid ' . $aAd['ad_id'], 7);
return false;
}
if ($richMedia == false && $aAd['alt_filename'] == '' && !($aAd['contenttype'] == 'jpeg' || $aAd['contenttype'] == 'gif' || $aAd['contenttype'] == 'png') && !($aAd['type'] == 'url' && $aAd['contenttype'] == '')) {
OX_Delivery_logMessage('No alt image specified for richmedia bannerid ' . $aAd['ad_id'], 7);
return false;
}
if (MAX_limitationsIsAdForbidden($aAd)) {
OX_Delivery_logMessage('MAX_limitationsIsAdForbidden = true for bannerid ' . $aAd['ad_id'], 7);
return false;
}
if ($GLOBALS['_MAX']['SSL_REQUEST'] && $aAd['type'] == 'html' && $aAd['html_ssl_unsafe']) {
OX_Delivery_logMessage('"http:" on SSL found for html bannerid ' . $aAd['ad_id'], 7);
return false;
}
if ($GLOBALS['_MAX']['SSL_REQUEST'] && $aAd['type'] == 'url' && $aAd['url_ssl_unsafe']) {
OX_Delivery_logMessage('"http:" on SSL found in imagurl for url bannerid ' . $aAd['ad_id'], 7);
return false;
}
if ($conf['delivery']['acls'] && !MAX_limitationsCheckAcl($aAd, $source)) {
OX_Delivery_logMessage('MAX_limitationsCheckAcl = false for bannerid ' . $aAd['ad_id'], 7);
return false;
}
return true;
}
示例3: _adSelectCheckCriteria
function _adSelectCheckCriteria($aAd, $aContext, $source, $richMedia)
{
$conf = $GLOBALS['_MAX']['CONF'];
// Excludelist banners
if (isset($aContext['banner']['exclude'][$aAd['ad_id']])) {
return false;
}
if (isset($aContext['campaign']['exclude'][$aAd['placement_id']])) {
// Excludelist campaigns
return false;
}
if (isset($aContext['client']['exclude'][$aAd['client_id']])) {
// Excludelist clients
return false;
}
if (sizeof($aContext['banner']['include']) && !isset($aContext['banner']['include'][$aAd['ad_id']])) {
// Includelist banners
return false;
}
if (sizeof($aContext['campaign']['include']) && !isset($aContext['campaign']['include'][$aAd['placement_id']])) {
// Includelist campaigns
return false;
}
if ($richMedia == false && $aAd['alt_filename'] == '' && !($aAd['contenttype'] == 'jpeg' || $aAd['contenttype'] == 'gif' || $aAd['contenttype'] == 'png') && !($aAd['type'] == 'url' && $aAd['contenttype'] == '')) {
return false;
}
if (MAX_limitationsIsAdForbidden($aAd)) {
// Capping & blocking
return false;
}
if ($_SERVER['SERVER_PORT'] == $conf['openads']['sslPort'] && $aAd['type'] == 'html' && ($aAd['adserver'] != 'max' && $aAd['adserver'] != '3rdPartyServers:ox3rdPartyServers:max' || preg_match("#src\\s?=\\s?['\"]http:#", $aAd['htmlcache']))) {
// HTML Banners that contain 'http:' on SSL
return false;
}
if ($_SERVER['SERVER_PORT'] == $conf['openads']['sslPort'] && $aAd['type'] == 'url' && substr($aAd['imageurl'], 0, 5) == 'http:') {
// It only matters if the initial call is to non-SSL (it can/could contain http:)
return false;
}
if ($conf['delivery']['acls'] && !MAX_limitationsCheckAcl($aAd, $source)) {
// Delivery limitations
return false;
}
// If any of the above failed, this function will have already returned false
// So to get this far means that the ad was valid
return true;
}
示例4: _adSelectCheckCriteria
/**
* Enter description here...
*
* @param unknown_type $aAd
* @param unknown_type $context
* @param unknown_type $source
* @param unknown_type $richMedia
*/
function _adSelectCheckCriteria($aAd, $aContext, $source, $richMedia)
{
$conf = $GLOBALS['_MAX']['CONF'];
// Enforce campaign expirations
if (!empty($aAd['expire_time'])) {
$expire = strtotime($aAd['expire_time']);
$now = MAX_commonGetTimeNow();
if ($expire > 0 && $now > $expire) {
OX_Delivery_logMessage('Campaign has expired for bannerid ' . $aAd['ad_id'], 7);
return false;
}
}
// Excludelist banners
if (isset($aContext['banner']['exclude'][$aAd['ad_id']])) {
OX_Delivery_logMessage('List of excluded banners list contains bannerid ' . $aAd['ad_id'], 7);
return false;
}
if (isset($aContext['campaign']['exclude'][$aAd['placement_id']])) {
// Excludelist campaigns
OX_Delivery_logMessage('List of excluded campaigns contains bannerid ' . $aAd['ad_id'], 7);
return false;
}
if (isset($aContext['client']['exclude'][$aAd['client_id']])) {
// Excludelist clients
OX_Delivery_logMessage('List of excluded clients contains bannerid ' . $aAd['ad_id'], 7);
return false;
}
if (sizeof($aContext['banner']['include']) && !isset($aContext['banner']['include'][$aAd['ad_id']])) {
// Includelist banners
OX_Delivery_logMessage('List of included banners does not contain bannerid ' . $aAd['ad_id'], 7);
return false;
}
if (sizeof($aContext['campaign']['include']) && !isset($aContext['campaign']['include'][$aAd['placement_id']])) {
// Includelist campaigns
OX_Delivery_logMessage('List of included campaigns does not contain bannerid ' . $aAd['ad_id'], 7);
return false;
}
if ($richMedia == false && $aAd['alt_filename'] == '' && !($aAd['contenttype'] == 'jpeg' || $aAd['contenttype'] == 'gif' || $aAd['contenttype'] == 'png') && !($aAd['type'] == 'url' && $aAd['contenttype'] == '')) {
OX_Delivery_logMessage('No alt image specified for richmedia bannerid ' . $aAd['ad_id'], 7);
return false;
}
if (MAX_limitationsIsAdForbidden($aAd)) {
// Capping & blocking
OX_Delivery_logMessage('MAX_limitationsIsAdForbidden = true for bannerid ' . $aAd['ad_id'], 7);
return false;
}
if ($GLOBALS['_MAX']['SSL_REQUEST'] && $aAd['type'] == 'html' && $aAd['html_ssl_unsafe']) {
// HTML Banners that contain 'http:' on SSL
OX_Delivery_logMessage('"http:" on SSL found for html bannerid ' . $aAd['ad_id'], 7);
return false;
}
if ($GLOBALS['_MAX']['SSL_REQUEST'] && $aAd['type'] == 'url' && $aAd['url_ssl_unsafe']) {
// It only matters if the initial call is to non-SSL (it can/could contain http:)
OX_Delivery_logMessage('"http:" on SSL found in imagurl for url bannerid ' . $aAd['ad_id'], 7);
return false;
}
if ($conf['delivery']['acls'] && !MAX_limitationsCheckAcl($aAd, $source)) {
// Delivery limitations
OX_Delivery_logMessage('MAX_limitationsCheckAcl = false for bannerid ' . $aAd['ad_id'], 7);
return false;
}
// If any of the above failed, this function will have already returned false
// So to get this far means that the ad was valid
return true;
}
示例5: _adSelectCheckCriteria
/**
* Enter description here...
*
* @param unknown_type $aAd
* @param unknown_type $context
* @param unknown_type $source
* @param unknown_type $richMedia
*/
function _adSelectCheckCriteria($aAd, $aContext, $source, $richMedia)
{
$conf = $GLOBALS['_MAX']['CONF'];
// Excludelist banners
if (isset($aContext['banner']['exclude'][$aAd['ad_id']])) {
###START_STRIP_DELIVERY
OA::debug('List of excluded banners list contains bannerid ' . $aAd['ad_id'] . ' ' . $aAd['name']);
###END_STRIP_DELIVERY
return false;
}
if (isset($aContext['campaign']['exclude'][$aAd['placement_id']])) {
// Excludelist campaigns
###START_STRIP_DELIVERY
OA::debug('List of excluded campaigns contains bannerid ' . $aAd['ad_id'] . ' ' . $aAd['name']);
###END_STRIP_DELIVERY
return false;
}
if (isset($aContext['client']['exclude'][$aAd['client_id']])) {
// Excludelist clients
###START_STRIP_DELIVERY
OA::debug('List of excluded clients contains bannerid ' . $aAd['ad_id'] . ' ' . $aAd['name']);
###END_STRIP_DELIVERY
return false;
}
if (sizeof($aContext['banner']['include']) && !isset($aContext['banner']['include'][$aAd['ad_id']])) {
// Includelist banners
###START_STRIP_DELIVERY
OA::debug('List of included banners does not contain bannerid ' . $aAd['ad_id'] . ' ' . $aAd['name']);
###END_STRIP_DELIVERY
return false;
}
if (sizeof($aContext['campaign']['include']) && !isset($aContext['campaign']['include'][$aAd['placement_id']])) {
// Includelist campaigns
###START_STRIP_DELIVERY
OA::debug('List of included campaigns does not contain bannerid ' . $aAd['ad_id'] . ' ' . $aAd['name']);
###END_STRIP_DELIVERY
return false;
}
if ($richMedia == false && $aAd['alt_filename'] == '' && !($aAd['contenttype'] == 'jpeg' || $aAd['contenttype'] == 'gif' || $aAd['contenttype'] == 'png') && !($aAd['type'] == 'url' && $aAd['contenttype'] == '')) {
###START_STRIP_DELIVERY
OA::debug('No alt image specified for richmedia bannerid ' . $aAd['ad_id'] . ' ' . $aAd['name']);
###END_STRIP_DELIVERY
return false;
}
if (MAX_limitationsIsAdForbidden($aAd)) {
// Capping & blocking
###START_STRIP_DELIVERY
OA::debug('MAX_limitationsIsAdForbidden = true for bannerid ' . $aAd['ad_id'] . ' ' . $aAd['name']);
###END_STRIP_DELIVERY
return false;
}
if ($_SERVER['SERVER_PORT'] == $conf['openads']['sslPort'] && $aAd['type'] == 'html' && ($aAd['adserver'] != 'max' && $aAd['adserver'] != '3rdPartyServers:ox3rdPartyServers:max' || preg_match("#src\\s?=\\s?['\"]http:#", $aAd['htmlcache']))) {
// HTML Banners that contain 'http:' on SSL
###START_STRIP_DELIVERY
OA::debug('"http:" on SSL found for html bannerid ' . $aAd['ad_id'] . ' ' . $aAd['name']);
###END_STRIP_DELIVERY
return false;
}
if ($_SERVER['SERVER_PORT'] == $conf['openads']['sslPort'] && $aAd['type'] == 'url' && substr($aAd['imageurl'], 0, 5) == 'http:') {
// It only matters if the initial call is to non-SSL (it can/could contain http:)
###START_STRIP_DELIVERY
OA::debug('"http:" on SSL found in imagurl for url bannerid ' . $aAd['ad_id'] . ' ' . $aAd['name']);
###END_STRIP_DELIVERY
return false;
}
if ($conf['delivery']['acls'] && !MAX_limitationsCheckAcl($aAd, $source)) {
// Delivery limitations
###START_STRIP_DELIVERY
OA::debug('MAX_limitationsCheckAcl = false for bannerid ' . $aAd['ad_id'] . ' ' . $aAd['name']);
###END_STRIP_DELIVERY
return false;
}
// If any of the above failed, this function will have already returned false
// So to get this far means that the ad was valid
return true;
}