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


PHP OA_Permission::isAccount方法代码示例

本文整理汇总了PHP中OA_Permission::isAccount方法的典型用法代码示例。如果您正苦于以下问题:PHP OA_Permission::isAccount方法的具体用法?PHP OA_Permission::isAccount怎么用?PHP OA_Permission::isAccount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OA_Permission的用法示例。


在下文中一共展示了OA_Permission::isAccount方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processBanners

function processBanners($commit = false)
{
    $doBanners = OA_Dal::factoryDO('banners');
    if (OA_INSTALLATION_STATUS === OA_INSTALLATION_STATUS_INSTALLED && OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
        $doBanners->addReferenceFilter('agency', $agencyId = OA_Permission::getEntityId());
    }
    $doBanners->find();
    $different = 0;
    $same = 0;
    $errors = array();
    while ($doBanners->fetch()) {
        // Rebuild filename
        if ($doBanners->storagetype == 'sql' || $doBanners->storagetype == 'web') {
            $doBanners->imageurl = '';
        }
        $GLOBALS['_MAX']['bannerrebuild']['errors'] = false;
        if ($commit) {
            $doBannersClone = clone $doBanners;
            $doBannersClone->update();
            $newCache = $doBannersClone->htmlcache;
        } else {
            $newCache = phpAds_getBannerCache($doBanners->toArray());
        }
        if (empty($GLOBALS['_MAX']['bannerrebuild']['errors'])) {
            if ($doBanners->htmlcache != $newCache && $doBanners->storagetype == 'html') {
                $different++;
            } else {
                $same++;
            }
        } else {
            $errors[] = $doBanners->toArray();
        }
    }
    return array('errors' => $errors, 'different' => $different, 'same' => $same);
}
开发者ID:villos,项目名称:tree_admin,代码行数:35,代码来源:lib-banner-cache.inc.php

示例2: beforePageHeader

 public function beforePageHeader(OX_Admin_UI_Event_EventContext $oEventContext)
 {
     $pageId = $oEventContext->data['pageId'];
     $pageData = $oEventContext->data['pageData'];
     $oHeaderModel = $oEventContext->data['headerModel'];
     $agencyId = $pageData['agencyid'];
     $campaignId = $pageData['campaignid'];
     $advertiserId = $pageData['clientid'];
     $oEntityHelper = $this->oMarkedTextAdvertiserComponent->getEntityHelper();
     if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
         switch ($pageId) {
             case 'campaign-banners':
                 $oDalZones = OA_Dal::factoryDAL('zones');
                 $linkedWebsites = $oDalZones->getWebsitesAndZonesListByCategory($agencyId, null, $campaignId, true);
                 $arraylinkedWebsitesKeys = array_keys($linkedWebsites);
                 $linkedWebsitesKey = $arraylinkedWebsitesKeys[0];
                 $arraylinkedZonesKeys = array_keys($linkedWebsites[$linkedWebsitesKey]['zones']);
                 $zoneId = $arraylinkedZonesKeys[0];
                 $aZone = Admin_DA::getZone($zoneId);
                 if ($aZone['type'] == 3) {
                     if (OA_Permission::hasAccessToObject('clients', $clientid) && OA_Permission::hasAccessToObject('campaigns', $campaignid)) {
                         OX_Admin_Redirect::redirect('plugins/' . $this->oMarkedTextAdvertiserComponent->group . "/oxMarkedTextAdvertiser-index.php?campaignid={$campaignId}&clientid={$advertiserId}");
                     }
                 }
                 break;
         }
     }
 }
开发者ID:rcdesign-cemetery,项目名称:openx-markedtext,代码行数:28,代码来源:EntityScreenManager.php

示例3: parseEntityParams

 private function parseEntityParams($aEntityParams)
 {
     $aMap = array('advertiser' => array('clientid'), 'campaign' => array('clientid', 'campaignid'), 'banner' => array('clientid', 'campaignid', 'bannerid'), 'affiliate' => array('affiliateid'), 'zone' => array('affiliateid', 'zoneid'));
     if (empty($aEntityParams['entity'])) {
         if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
             $aEntityParams['entity'] = 'advertiser';
         } elseif (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
             $aEntityParams['entity'] = 'affiliate';
         } else {
             $aEntityParams['entity'] = 'global';
         }
     }
     if ($aEntityParams['entity'] != 'global') {
         $allowed = implode('|', array_keys($aMap));
         if (!preg_match('/^(' . $allowed . ')(?:-(' . $allowed . '))?$/D', $aEntityParams['entity'], $aMatches)) {
             throw new exception("Unsupported entity breakdown");
         }
         array_shift($aMatches);
         $this->entity = join('-', $aMatches);
         foreach ($aMatches as $type) {
             foreach ($aMap[$type] as $inputVar) {
                 $this->aEntityParams[$inputVar] = !empty($aEntityParams[$inputVar]) ? (int) $aEntityParams[$inputVar] : 0;
             }
         }
     } else {
         $this->entity = 'global';
     }
 }
开发者ID:SamWinchester,项目名称:revive-adserver,代码行数:28,代码来源:apGraph.php

示例4: mergeData

 /**
  * Merge aggregate stats with entity properties (name, children, etc)
  *
  * The overridden method also takes care to remove inactive entities
  * and to enforce the anonymous properties when logged in as advertiser
  * or publisher
  *
  * @param array Query parameters
  * @param string Key name
  * @return array Full entity stats with entity data
  */
 function mergeData($aParams, $key)
 {
     $aEntitiesData = parent::mergeData($aParams, $key);
     if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER) || OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
         if (is_null($this->aAnonAdvertisers)) {
             $this->aAnonAdvertisers = array();
             $this->aAnonPlacements = array();
             $aPlacements = Admin_DA::fromCache('getPlacements', array('placement_anonymous' => 't'));
             foreach ($aPlacements as $placementId => $placement) {
                 $this->aAnonAdvertisers[$placement['advertiser_id']] = true;
                 $this->aAnonPlacements[$placementId] = true;
             }
         }
     }
     foreach (array_keys($aEntitiesData) as $entityId) {
         if (!isset($this->data[$key][$entityId])) {
             unset($aEntitiesData[$entityId]);
         } elseif ($key == 'advertiser_id' && isset($this->aAnonAdvertisers[$entityId])) {
             $aEntitiesData[$entityId]['hidden'] = true;
         } elseif ($key == 'placement_id' && isset($this->aAnonPlacements[$entityId])) {
             $aEntitiesData[$entityId]['hidden'] = true;
         } elseif ($key == 'ad_id' && isset($this->aAnonPlacements[$aEntitiesData[$entityId]['placement_id']])) {
             $aEntitiesData[$entityId]['hidden'] = true;
         } elseif (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
             if (isset($aParams['placement_id'])) {
                 $aEntitiesData[$entityId]['hidden'] = isset($this->aAnonPlacements[$aParams['placement_id']]);
             } else {
                 $aEntitiesData[$entityId]['hidden'] = isset($this->aAnonAdvertisers[OA_Permission::getEntityId()]);
             }
         }
     }
     return $aEntitiesData;
 }
开发者ID:hostinger,项目名称:revive-adserver,代码行数:44,代码来源:CommonCrossEntity.php

示例5: start

 /**
  * The final "child" implementation of the parental abstract method.
  *
  * @see OA_Admin_Statistics_Common::start()
  */
 function start()
 {
     // Get parameters
     $advertiserId = $this->_getId('advertiser');
     // Security check
     OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER);
     $this->_checkAccess(array('advertiser' => $advertiserId));
     // Add standard page parameters
     $this->aPageParams = array('clientid' => $advertiserId);
     // Load the period preset and stats breakdown parameters
     $this->_loadPeriodPresetParam();
     $this->_loadStatsBreakdownParam();
     // Load $_GET parameters
     $this->_loadParams();
     // HTML Framework
     if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
         $this->pageId = '2.1.1';
         $this->aPageSections = array('2.1.1', '2.1.2', '2.1.3');
     } elseif (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
         $this->pageId = '1.1';
         $this->aPageSections = array('1.1', '1.2', '1.3');
     }
     // Add breadcrumbs
     $this->_addBreadcrumbs('advertiser', $advertiserId);
     // Add context
     $this->aPageContext = array('advertisers', $advertiserId);
     // Add shortcuts
     if (!OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
         $this->_addShortcut($GLOBALS['strClientProperties'], 'advertiser-edit.php?clientid=' . $advertiserId, 'images/icon-advertiser.gif');
     }
     // Prepare the data for display by output() method
     $aParams = array('advertiser_id' => $advertiserId);
     $this->prepare($aParams, 'stats.php');
 }
开发者ID:hostinger,项目名称:revive-adserver,代码行数:39,代码来源:AdvertiserHistory.php

示例6: display

 /**
  * A method to launch and display the widget
  *
  */
 function display()
 {
     $aConf = $GLOBALS['_MAX']['CONF'];
     $oTpl = new OA_Admin_Template('dashboard/disabled.html');
     $oDashboard = new OA_Central_Dashboard();
     $oTpl->assign('isAdmin', OA_Permission::isAccount(OA_ACCOUNT_ADMIN));
     $oTpl->display();
 }
开发者ID:hostinger,项目名称:revive-adserver,代码行数:12,代码来源:Disabled.php

示例7: OA_footerNavigation

function OA_footerNavigation()
{
    echo "\n    <script language='JavaScript'>\n    <!--\n    ";
    if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
        echo "function MMM_cascadePermissionsChange()\n        {\n            var e = findObj('permissions_" . OA_PERM_ZONE_EDIT . "');\n            var a = findObj('permissions_" . OA_PERM_ZONE_ADD . "');\n            var d = findObj('permissions_" . OA_PERM_ZONE_DELETE . "');\n\n            a.disabled = d.disabled = !e.checked;\n            if (!e.checked) {\n                a.checked = d.checked = false;\n            }\n        }\n        MMM_cascadePermissionsChange();\n        //-->";
    }
    echo "</script>";
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:8,代码来源:affiliate-user.php

示例8: start

 /**
  * The final "child" implementation of the parental abstract method.
  *
  * @see OA_Admin_Statistics_Common::start()
  */
 function start()
 {
     // Get the preferences
     $aPref = $GLOBALS['_MAX']['PREF'];
     // Get parameters
     $advertiserId = $this->_getId('advertiser');
     $placementId = $this->_getId('placement');
     // Security check
     OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER);
     $this->_checkAccess(array('advertiser' => $advertiserId, 'placement' => $placementId));
     // Add standard page parameters
     $this->aPageParams = array('clientid' => $advertiserId, 'campaignid' => $placementId);
     // Load the period preset and stats breakdown parameters
     $this->_loadPeriodPresetParam();
     $this->_loadStatsBreakdownParam();
     // Load $_GET parameters
     $this->_loadParams();
     // HTML Framework
     if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
         $this->pageId = '2.1.2.2';
         $this->aPageSections = array('2.1.2.1', '2.1.2.2', '2.1.2.3', '2.1.2.4');
     } elseif (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
         $this->pageId = '1.2.2';
         $this->aPageSections = array('1.2.1', '1.2.2', '1.2.3');
     }
     // Add breadcrumbs
     $this->_addBreadcrumbs('campaign', $placementId);
     // Add context
     $this->aPageContext = array('campaigns', $placementId);
     // Add shortcuts
     if (!OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
         $this->_addShortcut($GLOBALS['strClientProperties'], 'advertiser-edit.php?clientid=' . $advertiserId, 'images/icon-advertiser.gif');
     }
     $this->_addShortcut($GLOBALS['strCampaignProperties'], 'campaign-edit.php?clientid=' . $advertiserId . '&campaignid=' . $placementId, 'images/icon-campaign.gif');
     $this->hideInactive = MAX_getStoredValue('hideinactive', $aPref['ui_hide_inactive'] == true, null, true);
     $this->showHideInactive = true;
     $this->startLevel = 0;
     // Init nodes
     $this->aNodes = MAX_getStoredArray('nodes', array());
     $expand = MAX_getValue('expand', '');
     $collapse = MAX_getValue('collapse');
     // Adjust which nodes are opened closed...
     MAX_adjustNodes($this->aNodes, $expand, $collapse);
     $aParams = $this->coreParams;
     $aParams['placement_id'] = $placementId;
     $this->aEntitiesData = $this->getBanners($aParams, $this->startLevel, $expand);
     // Summarise the values into a the totals array, & format
     $this->_summariseTotalsAndFormat($this->aEntitiesData);
     $this->showHideLevels = array();
     $this->hiddenEntitiesText = "{$this->hiddenEntities} {$GLOBALS['strInactiveBannersHidden']}";
     // Save prefs
     $this->aPagePrefs['startlevel'] = $this->startLevel;
     $this->aPagePrefs['nodes'] = implode(",", $this->aNodes);
     $this->aPagePrefs['hideinactive'] = $this->hideInactive;
     $this->aPagePrefs['startlevel'] = $this->startLevel;
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:61,代码来源:CampaignBanners.php

示例9: phpAds_MaintenanceSelection

function phpAds_MaintenanceSelection($subSection, $mainSection = 'maintenance')
{
    global $phpAds_TextDirection, $strBanners, $strCache, $strChooseSection, $strPriority, $strSourceEdit, $strStats, $strStorage, $strMaintenance, $strCheckForUpdates, $strViewPastUpdates, $strEncoding, $strDeliveryLimitations, $strAppendCodes, $strMenus, $strPlugins;
    ?>
<script language="JavaScript">
<!--
function maintenance_goto_section()
{
    s = document.maintenance_selection.section.selectedIndex;

    s = document.maintenance_selection.section.options[s].value;
    document.location = '<?php 
    echo $mainSection;
    ?>
-' + s + '.php';
}
// -->
</script>
<?php 
    $conf =& $GLOBALS['_MAX']['CONF'];
    $pref =& $GLOBALS['_MAX']['PREF'];
    echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
    echo "<tr><form name='maintenance_selection'><td height='35'>";
    echo "<b>" . $strChooseSection . ":&nbsp;</b>";
    echo "<select name='section' onChange='maintenance_goto_section();'>";
    if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
        if ($mainSection == 'updates') {
            echo "<option value='product'" . ($subSection == 'product' ? ' selected' : '') . ">" . $strCheckForUpdates . "</option>";
            echo "<option value='history'" . ($subSection == 'history' ? ' selected' : '') . ">" . $strViewPastUpdates . "</option>";
        } else {
            echo "<option value='maintenance'" . ($subSection == 'maintenance' ? ' selected' : '') . ">" . $strMaintenance . "</option>";
            echo "<option value='banners'" . ($subSection == 'banners' ? ' selected' : '') . ">" . $strBanners . "</option>";
            echo "<option value='priority'" . ($subSection == 'priority' ? ' selected' : '') . ">" . $strPriority . "</option>";
            $login = 'ftp://' . $conf['store']['ftpUsername'] . ':' . $conf['store']['ftpPassword'] . '@' . $conf['store']['ftpHost'] . '/' . $conf['store']['ftpPath'];
            if ($conf['allowedBanners']['web'] == true && ($conf['store']['mode'] == 0 && $conf['store']['webDir'] != '' || $conf['store']['mode'] == 1 && $login != '') && $conf['webpath']['images'] != '') {
                echo "<option value='storage'" . ($subSection == 'storage' ? ' selected' : '') . ">" . $strStorage . "</option>";
            }
            //            if (!isset($conf['delivery']['cache']) || $conf['delivery']['cache'] != 'none')
            //                echo "<option value='cache'".($subSection == 'zones' ? ' selected' : '').">".$strCache."</option>";
            if ($conf['delivery']['acls']) {
                echo "<option value='acls'" . ($subSection == 'acls' ? ' selected' : '') . ">" . $strDeliveryLimitations . "</option>";
            }
            echo "<option value='appendcodes'" . ($subSection == 'appendcodes' ? ' selected' : '') . ">" . $strAppendCodes . "</option>";
            echo "<option value='encoding'" . ($subSection == 'encoding' ? ' selected' : '') . ">{$strEncoding}</option>";
            echo "<option value='menus'" . ($subSection == 'menus' ? ' selected' : '') . ">" . $strMenus . "</option>";
            echo "<option value='plugins'" . ($subSection == 'plugins' ? ' selected' : '') . ">" . $strPlugins . "</option>";
        }
    }
    // Switched off
    // echo "<option value='finance'".($subSection == 'finance' ? ' selected' : '').">Finance</option>";
    echo "</select>&nbsp;<a href='javascript:void(0)' onClick='maintenance_goto_section();'>";
    echo "<img src='" . OX::assetPath() . "/images/" . $phpAds_TextDirection . "/go_blue.gif' border='0'></a>";
    echo "</td></form></tr>";
    echo "</table>";
    phpAds_ShowBreak();
}
开发者ID:villos,项目名称:tree_admin,代码行数:56,代码来源:lib-maintenance.inc.php

示例10: start

 /**
  * The final "child" implementation of the parental abstract method.
  *
  * @see OA_Admin_Statistics_Common::start()
  */
 function start()
 {
     // Get the preferences
     $aPref = $GLOBALS['_MAX']['PREF'];
     // Security check
     OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER);
     // HTML Framework
     $this->pageId = '2.4';
     $this->aPageSections = array('2.1', '2.4', '2.2');
     $this->hideInactive = MAX_getStoredValue('hideinactive', $aPref['ui_hide_inactive'] == true, null, true);
     $this->showHideInactive = true;
     $this->startLevel = MAX_getStoredValue('startlevel', 0, null, true);
     // Init nodes
     $this->aNodes = MAX_getStoredArray('nodes', array());
     $expand = MAX_getValue('expand', '');
     $collapse = MAX_getValue('collapse');
     // Adjust which nodes are opened closed...
     MAX_adjustNodes($this->aNodes, $expand, $collapse);
     $aParams = $this->coreParams;
     if (!OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
         $aParams['agency_id'] = OA_Permission::getAgencyId();
     }
     // Add module page parameters
     $this->aPageParams['period_preset'] = MAX_getStoredValue('period_preset', 'today');
     $this->aPageParams['statsBreakdown'] = htmlspecialchars(MAX_getStoredValue('statsBreakdown', 'day'));
     $this->_loadParams();
     switch ($this->startLevel) {
         case 1:
             $this->aEntitiesData = $this->getZones($aParams, $this->startLevel, $expand);
             break;
         default:
             $this->startLevel = 0;
             $this->aEntitiesData = $this->getPublishers($aParams, $this->startLevel, $expand);
             break;
     }
     // Summarise the values into a the totals array, & format
     $this->_summariseTotalsAndFormat($this->aEntitiesData);
     $this->showHideLevels = array();
     switch ($this->startLevel) {
         case 1:
             $this->showHideLevels = array(0 => array('text' => $GLOBALS['strShowParentAffiliates'], 'icon' => 'images/icon-affiliate.gif'));
             $this->hiddenEntitiesText = "{$this->hiddenEntities} {$GLOBALS['strInactiveZonesHidden']}";
             break;
         case 0:
             $this->showHideLevels = array(1 => array('text' => $GLOBALS['strHideParentAffiliates'], 'icon' => 'images/icon-affiliate-d.gif'));
             $this->hiddenEntitiesText = "{$this->hiddenEntities} {$GLOBALS['strInactiveAffiliatesHidden']}";
             break;
     }
     // Save prefs
     $this->aPagePrefs['startlevel'] = $this->startLevel;
     $this->aPagePrefs['nodes'] = implode(",", $this->aNodes);
     $this->aPagePrefs['hideinactive'] = $this->hideInactive;
     $this->aPagePrefs['startlevel'] = $this->startLevel;
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:59,代码来源:GlobalAffiliates.php

示例11: OA_HeaderNavigation

function OA_HeaderNavigation()
{
    global $agencyid;
    if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
        phpAds_PageHeader("agency-access");
        $doAgency = OA_Dal::staticGetDO('agency', $agencyid);
        MAX_displayInventoryBreadcrumbs(array(array("name" => $doAgency->name)), "agency");
    } else {
        phpAds_PageHeader("agency-user");
    }
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:11,代码来源:agency-user.php

示例12: getZones

 function getZones()
 {
     global $list_filters;
     if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
         $aParams = array();
         $aPublishers = Admin_DA::getPublishers($aParams);
         // set publisher id if list is to be filtered by publisher
         if (isset($list_filters['publisher'])) {
             $aParams = array('publisher_id' => $list_filters['publisher']);
         } else {
             // else use all publishers
             $aParams = array('publisher_id' => implode(',', array_keys($aPublishers)));
         }
         if (isset($this->_filter)) {
             $aParams['zone_inventory_forecast_type'] = $this->getForecastType();
         }
         $aZones = Admin_DA::getZones($aParams);
     } elseif (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
         $aParams = array('agency_id' => OA_Permission::getEntityId());
         $aPublishers = Admin_DA::getPublishers($aParams);
         // set publisher id if list is to be filtered by publisher
         if (isset($list_filters['publisher'])) {
             $aParams = array('publisher_id' => $list_filters['publisher']);
         } else {
             // else use all of this agency's publishers
             $aParams = array('publisher_id' => implode(',', array_keys($aPublishers)));
         }
         if (isset($this->_filter)) {
             $aParams['zone_inventory_forecast_type'] = $this->getForecastType();
         }
         $aZones = Admin_DA::getZones($aParams);
     } elseif (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
         $aParams = array('publisher_id' => OA_Permission::getEntityId());
         $aPublishers = Admin_DA::getPublishers($aParams);
         $aParams = array('publisher_id' => implode(',', array_keys($aPublishers)));
         if (isset($this->_filter)) {
             $aParams['zone_inventory_forecast_type'] = $this->getForecastType();
         }
         $aZones = Admin_DA::getZones($aParams);
     } else {
         $aPublishers = array();
         $aZones = array();
     }
     $aZoneArray = array();
     foreach ($aPublishers as $publisherId => $aPublisher) {
         foreach ($aZones as $zoneId => $aZone) {
             if ($aZone['publisher_id'] == $publisherId) {
                 $aZoneArray[$zoneId] = phpads_buildName($publisherId, MAX_getPublisherName($aPublisher['name'])) . " - " . phpAds_buildName($zoneId, MAX_getZoneName($aZone['name']));
             }
         }
     }
     return $aZoneArray;
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:53,代码来源:ZoneIdField.php

示例13: getStats

 function getStats()
 {
     // Set time zone to local
     OA_setTimeZoneLocal();
     $oEnd = new Date();
     $oEnd->setHour(0);
     $oEnd->setMinute(0);
     $oEnd->setSecond(0);
     $oEnd->toUTC();
     $oStart = new Date($oEnd);
     $oStart->subtractSpan(new Date_Span('7-0-0-0'));
     $oStart->toUTC();
     $doDsah = OA_Dal::factoryDO('data_summary_ad_hourly');
     $doDsah->selectAdd();
     $doDsah->selectAdd("DATE_FORMAT(date_time, '%Y-%m-%d') AS day");
     $doDsah->selectAdd('SUM(' . $doDsah->tableName() . '.impressions) AS total_impressions');
     $doDsah->selectAdd('SUM(' . $doDsah->tableName() . '.clicks) AS total_clicks');
     $doDsah->whereAdd("date_time >= '" . $doDsah->escape($oStart->format('%Y-%m-%d %H:%M:%S')) . "'");
     $doDsah->whereAdd("date_time < '" . $doDsah->escape($oEnd->format('%Y-%m-%d %H:%M:%S')) . "'");
     if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
         $doBanners = OA_Dal::factoryDO('banners');
         $doCampaigns = OA_Dal::factoryDO('campaigns');
         $doClients = OA_Dal::factoryDO('clients');
         $doClients->agencyid = OA_Permission::getEntityId();
         $doCampaigns->joinAdd($doClients);
         $doBanners->joinAdd($doCampaigns);
         $doBanners->selectAdd();
         $doBanners->selectAdd("bannerid");
         $doBanners->find();
         $ad_ids = array();
         while ($doBanners->fetch()) {
             $ad_ids[] = $doBanners->bannerid;
         }
         if (empty($ad_ids)) {
             return array();
         }
         $doDsah->whereAdd("ad_id IN (" . implode(",", $ad_ids) . ")");
     }
     $doDsah->groupBy('day');
     $doDsah->orderBy('day');
     $doDsah->find();
     $aStats = array();
     while ($doDsah->fetch()) {
         $row = $doDsah->toArray();
         $aStats[0][date('D', strtotime($row['day']))] = $row['total_impressions'];
         $aStats[1][date('D', strtotime($row['day']))] = $row['total_clicks'];
     }
     return $aStats;
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:49,代码来源:GraphOAP.php

示例14: _getTrackerArray

 function _getTrackerArray()
 {
     $conf = $GLOBALS['_MAX']['CONF'];
     $where = "c.clientid = t.clientid";
     if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
         $where .= " AND c.agencyid = " . OA_Permission::getEntityId();
     } elseif (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
         $where .= " AND t.clientid = " . OA_Permission::getEntityId();
     }
     $query = "\n            SELECT\n                c.clientname AS client_name,\n                c.clientid AS client_id,\n                t.trackername AS tracker_name,\n                t.trackerid AS tracker_id\n            FROM\n                {$conf['table']['trackers']} AS t,\n                {$conf['table']['clients']} AS c\n            WHERE\n                {$where}\n            ORDER BY\n                c.clientname,t.trackername\n        ";
     $res = phpAds_dbQuery($query);
     while ($row = phpAds_dbFetchArray($res)) {
         $trackerArray[$row['tracker_id']] = "<span dir='" . $GLOBALS['phpAds_TextDirection'] . "'>[id" . $row['client_id'] . "] " . $row['client_name'] . " - [id" . $row['tracker_id'] . "] " . $row['tracker_name'] . "</span> ";
     }
     return $trackerArray;
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:16,代码来源:TrackerField.php

示例15: check

 function check($oSection)
 {
     $aAccounts = $this->_getAllowedAccountTypes();
     //no required accounts to show it
     if (empty($aAccounts)) {
         return true;
     }
     $isAllowedAccount = false;
     for ($i = 0; $i < count($aAccounts); $i++) {
         $isAllowedAccount = OA_Permission::isAccount($aAccounts[$i]);
         if ($isAllowedAccount) {
             break;
         }
     }
     return $isAllowedAccount;
 }
开发者ID:villos,项目名称:tree_admin,代码行数:16,代码来源:SectionAccountChecker.php


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