当前位置: 首页>>代码示例>>PHP>>正文


PHP MAX_limitationsCheckAcl函数代码示例

本文整理汇总了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);
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:20,代码来源:limitations.del.test.php

示例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;
}
开发者ID:hawodi,项目名称:revive-adserver,代码行数:53,代码来源:al.php

示例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;
}
开发者ID:villos,项目名称:tree_admin,代码行数:46,代码来源:alocal.php

示例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;
}
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:73,代码来源:adSelect.php

示例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;
}
开发者ID:villos,项目名称:tree_admin,代码行数:84,代码来源:adSelect.php


注:本文中的MAX_limitationsCheckAcl函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。