Ejemplo n.º 1
0
 public function startMVC()
 {
     $oRequest = new OX_Admin_UI_Controller_Request();
     //setup controller
     $oController = $this->createController();
     ob_start();
     $oController->process($oRequest);
     $actionContent = ob_get_contents();
     ob_end_clean();
     //create view
     if ($oController->hasViewScript()) {
         $view = $this->createView($oController->getAction());
         //pass model variables to view
         $oController->assignModelToView($view);
     }
     //LAYOUT
     // setup dummy installer section display
     $oMenu = OA_Admin_Menu::singleton();
     $oMenu->add(new OA_Admin_Menu_Section('install', '', ''));
     if ($oController->hasLayout()) {
         //layout
         $oPageHeader = $oController->getModelProperty('pageHeader');
         phpAds_PageHeader('install', $oPageHeader, $imgPath, false, true, false);
     }
     if ($view) {
         $view->display();
     }
     echo $actionContent;
     if ($oController->hasLayout()) {
         phpAds_PageFooter($imgPath);
         // Do not remove. This is a marker that AJAX response parsers look for to
         // determine whether the response did not redirect to the installer.
         echo "<!-- install -->";
     }
 }
Ejemplo n.º 2
0
function displayPage($form, $aMessages = '')
{
    phpAds_PageHeader('devtools-plugins', '', '../../');
    $oTpl = new OA_Plugin_Template('oxPlugin.html', 'oxPlugin');
    //$oTpl->debugging = true;
    $oTpl->assign('aMessages', $aMessages);
    $oTpl->assign('form', $form->serialize());
    $oTpl->display();
    phpAds_PageFooter();
}
Ejemplo n.º 3
0
 /**
  * A method to launch and display the widget
  *
  */
 function display()
 {
     $aConf = $GLOBALS['_MAX']['CONF'];
     phpAds_PageHeader(null, new OA_Admin_UI_Model_PageHeaderModel(), '', false, false);
     $oTpl = new OA_Admin_Template('dashboard/main.html');
     if (!$aConf['ui']['dashboardEnabled'] || !$aConf['sync']['checkForUpdates']) {
         $dashboardUrl = MAX::constructURL(MAX_URL_ADMIN, 'dashboard.php?widget=Disabled');
     } else {
         $dashboardUrl = MAX::constructURL(MAX_URL_ADMIN, 'dashboard.php?widget=Grid');
     }
     $oTpl->assign('dashboardURL', $dashboardUrl);
     $oTpl->display();
     phpAds_PageFooter('', true);
 }
Ejemplo n.º 4
0
 /**
  * A method to launch and display the widget
  *
  */
 function display()
 {
     $aConf = $GLOBALS['_MAX']['CONF'];
     phpAds_PageHeader(null, new OA_Admin_UI_Model_PageHeaderModel(), '', false, false);
     $oTpl = new OA_Admin_Template('dashboard/main.html');
     if (!$aConf['ui']['dashboardEnabled'] || !$aConf['sync']['checkForUpdates']) {
         $dashboardUrl = MAX::constructURL(MAX_URL_ADMIN, 'dashboard.php?widget=Disabled');
     } else {
         $m2mTicket = OA_Dal_Central_M2M::getM2MTicket(OA_Permission::getAccountId());
         if (empty($m2mTicket)) {
             $dashboardUrl = MAX::constructURL(MAX_URL_ADMIN, 'dashboard.php?widget=Reload');
         } else {
             $dashboardUrl = $this->buildDashboardUrl($m2mTicket, null, '&amp;');
         }
     }
     $oTpl->assign('dashboardURL', $dashboardUrl);
     $oTpl->display();
     phpAds_PageFooter('', true);
 }
Ejemplo n.º 5
0
function displayPage($zone, $form, $zoneErrors = null)
{
    //header and breadcrumbs
    $pageName = basename($_SERVER['PHP_SELF']);
    $agencyId = OA_Permission::getAgencyId();
    $aEntities = array('affiliateid' => $zone['affiliateid'], 'zoneid' => $zone['zoneid']);
    $aOtherPublishers = Admin_DA::getPublishers(array('agency_id' => $agencyId));
    $aOtherZones = Admin_DA::getZones(array('publisher_id' => $zone['affiliateid']));
    MAX_displayNavigationZone($pageName, $aOtherPublishers, $aOtherZones, $aEntities);
    //get template and display form
    $oTpl = new OA_Admin_Template('zone-edit.html');
    $oTpl->assign('zoneid', $zone['zoneid']);
    $oTpl->assign('zoneHeight', $zone["height"]);
    $oTpl->assign('zoneWidth', $zone["width"]);
    $oTpl->assign('zoneErrors', $zoneErrors);
    $oTpl->assign('form', $form->serialize());
    $oTpl->display();
    //footer
    phpAds_PageFooter();
}
Ejemplo n.º 6
0
function displayPage($aAgency, $form)
{
    if ($aAgency['agencyid'] != '') {
        OA_Admin_Menu::setAgencyPageContext($aAgency['agencyid'], 'agency-edit.php');
        MAX_displayInventoryBreadcrumbs(array(array("name" => $aAgency['name'])), "agency");
        phpAds_PageHeader();
    } else {
        MAX_displayInventoryBreadcrumbs(array(array("name" => "")), "agency", true);
        phpAds_PageHeader("agency-edit_new");
    }
    //get template and display form
    $oTpl = new OA_Admin_Template('agency-edit.html');
    $oTpl->assign('form', $form->serialize());
    $oTpl->display();
    //footer
    phpAds_PageFooter();
}
Ejemplo n.º 7
0
function displayPage($channel, $form)
{
    $pageName = basename($_SERVER['PHP_SELF']);
    $agencyId = OA_Permission::getAgencyId();
    // Obtain the needed data
    if (!empty($channel['affiliateid'])) {
        $aEntities = array('agencyid' => $agencyId, 'affiliateid' => $channel['affiliateid'], 'channelid' => $channel['channelid']);
        // Editing a channel at the publisher level; Only use the
        // channels at this publisher level for the navigation bar
        $aOtherChannels = Admin_DA::getChannels(array('publisher_id' => $channel['affiliateid']));
    } else {
        $aEntities = array('agencyid' => $agencyId, 'channelid' => $channel['channelid']);
        // Editing a channel at the agency level; Only use the
        // channels at this agency level for the navigation bar
        $aOtherChannels = Admin_DA::getChannels(array('agency_id' => $agencyId, 'channel_type' => 'agency'));
    }
    //show header and breadcrumbs
    MAX_displayNavigationChannel($pageName, $aOtherChannels, $aEntities);
    //get template and display form
    $oTpl = new OA_Admin_Template('channel-edit.html');
    $oTpl->assign('form', $form->serialize());
    $oTpl->assign('formId', $form->getId());
    $oTpl->display();
    //show footer
    phpAds_PageFooter();
}
Ejemplo n.º 8
0
 /**
  * Display page footer and make sure that the session gets destroyed
  *
  */
 function pageFooter()
 {
     // Remove session
     unset($GLOBALS['session']);
     phpAds_PageFooter();
 }
 /**
  * A static method to display a login screen
  *
  * @static
  *
  * @param string $sMessage
  * @param string $sessionID
  * @param bool $inlineLogin
  */
 function displayLogin($sMessage = '', $sessionID = 0, $inLineLogin = false)
 {
     global $strUsername, $strPassword, $strLogin, $strWelcomeTo, $strEnterUsername, $strNoAdminInteface, $strForgotPassword;
     $aConf = $GLOBALS['_MAX']['CONF'];
     $aPref = $GLOBALS['_MAX']['PREF'];
     @header('Cache-Control: max-age=0, no-cache, proxy-revalidate, must-revalidate');
     if (!$inLineLogin) {
         phpAds_PageHeader(phpAds_Login);
     }
     // Check environment settings
     $oSystemMgr = new OA_Environment_Manager();
     $aSysInfo = $oSystemMgr->checkSystem();
     foreach ($aSysInfo as $env => $vals) {
         $errDetails = '';
         if (is_array($vals['error']) && !empty($vals['error'])) {
             if ($env == 'PERMS') {
                 // Just note that some file/folders are unwritable and that more information can be found in the debug.log
                 OA_Admin_UI::queueMessage('Error: File permission errors detected.<br />These <em>may</em> impact the accurate delivery of your ads,<br />See the debug.log file for the list of unwritable files', 'global', 'error', 0);
             } else {
                 foreach ($vals['error'] as $key => $val) {
                     $errDetails .= '<li>' . htmlspecialchars($key) . ' &nbsp; => &nbsp; ' . htmlspecialchars($val) . '</li>';
                 }
                 phpAds_Die(' Error: ' . $err, $errDetails);
             }
         }
     }
     $oTpl = new OA_Admin_Template('login.html');
     $appName = !empty($aConf['ui']['applicationName']) ? $aConf['ui']['applicationName'] : PRODUCT_NAME;
     $oTpl->assign('uiEnabled', $aConf['ui']['enabled']);
     $oTpl->assign('sessionID', $sessionID);
     $oTpl->assign('appName', $appName);
     $oTpl->assign('message', $sMessage);
     $oTpl->display();
     phpAds_PageFooter();
     exit;
 }
function displayPage($aAdvertiser, $form)
{
    //header and breadcrumbs
    $oHeaderModel = buildAdvertiserHeaderModel($aAdvertiser);
    if ($aAdvertiser['clientid'] != "") {
        if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
            OA_Admin_Menu::setAdvertiserPageContext($aAdvertiser['clientid'], 'advertiser-index.php');
            addAdvertiserPageToolsAndShortcuts($aAdvertiser['clientid']);
            phpAds_PageHeader(null, $oHeaderModel);
        } else {
            phpAds_PageHeader(null, $oHeaderModel);
        }
    } else {
        //new advertiser
        phpAds_PageHeader('advertiser-edit_new', $oHeaderModel);
    }
    //get template and display form
    $oTpl = new OA_Admin_Template('advertiser-edit.html');
    $oTpl->assign('clientid', $aAdvertiser['clientid']);
    $oTpl->assign('form', $form->serialize());
    $oTpl->display();
    //footer
    phpAds_PageFooter();
}
Ejemplo n.º 11
0
function displayPage($bannerid, $campaignid, $clientid, $bannerTypes, $aBanner, $type, $form, $ext_bannertype, $formDisabled = false)
{
    // Initialise some parameters
    $pageName = basename($_SERVER['SCRIPT_NAME']);
    $aEntities = array('clientid' => $clientid, 'campaignid' => $campaignid, 'bannerid' => $bannerid);
    $entityId = OA_Permission::getEntityId();
    if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
        $entityType = 'advertiser_id';
    } else {
        $entityType = 'agency_id';
    }
    // Display navigation
    $aOtherCampaigns = Admin_DA::getPlacements(array($entityType => $entityId));
    $aOtherBanners = Admin_DA::getAds(array('placement_id' => $campaignid), false);
    // Display banner preview
    MAX_displayNavigationBanner($pageName, $aOtherCampaigns, $aOtherBanners, $aEntities);
    //actual page content - type chooser and form
    /*-------------------------------------------------------*/
    /* Main code                                             */
    /*-------------------------------------------------------*/
    $oTpl = new OA_Admin_Template('banner-edit.html');
    $oTpl->assign('clientId', $clientid);
    $oTpl->assign('campaignId', $campaignid);
    $oTpl->assign('bannerId', $bannerid);
    $oTpl->assign('bannerTypes', $bannerTypes);
    $oTpl->assign('bannerType', $ext_bannertype ? $ext_bannertype : $type);
    $oTpl->assign('bannerHeight', $aBanner["height"]);
    $oTpl->assign('bannerWidth', $aBanner["width"]);
    $oTpl->assign('disabled', $formDisabled);
    $oTpl->assign('form', $form->serialize());
    $oTpl->display();
    /*********************************************************/
    /* HTML framework                                        */
    /*********************************************************/
    phpAds_PageFooter();
}
Ejemplo n.º 12
0
 function display()
 {
     $this->_processHeaderNavigation();
     require_once MAX_PATH . '/lib/OA/Admin/Template.php';
     $oTpl = new OA_Admin_Template($this->pagePrefix . '-user.html');
     $oTpl->assign('action', $this->pagePrefix . '-user.php');
     $oTpl->assign('backUrl', $this->backUrl);
     $oTpl->assign('method', 'POST');
     $oTpl->assign('aErrors', $this->aErrors);
     $this->oPlugin->setTemplateVariables($oTpl);
     $oTpl->assign('existingUser', !empty($this->userid));
     $oTpl->assign('showLinkButton', !empty($this->request['link']));
     $doUsers = OA_Dal::staticGetDO('users', $this->userid);
     $userData = array();
     if ($doUsers) {
         $userData = $doUsers->toArray();
     } else {
         $userData['username'] = $this->request['login'];
         $userData['contact_name'] = $this->request['contact_name'];
         $userData['email_address'] = $this->request['email_address'];
         $userData['language'] = $this->request['language'];
     }
     $userData['userid'] = $this->userid;
     $aTplFields = array(array('title' => $GLOBALS['strUserDetails'], 'fields' => $this->oPlugin->getUserDetailsFields($userData, $this->request['link'])));
     $aPermissionsFields = $this->_builPermissionFields();
     if (!empty($aPermissionsFields)) {
         $aTplFields[] = array('title' => $GLOBALS['strPermissions'], 'fields' => $aPermissionsFields);
     }
     $oTpl->assign('fields', $aTplFields);
     $aHiddenFields = $this->_getHiddenFields($userData, $this->request['link'], $this->aHiddenFields);
     $oTpl->assign('hiddenFields', $aHiddenFields);
     $oTpl->display();
     $this->_processFooterNavigation();
     phpAds_PageFooter();
 }
function display_page($banner_id, $campaign_id, $client_id)
{
    $page_name = basename($_SERVER['PHP_SELF']);
    $entities = array('clientid' => $client_id, 'campaignid' => $campaign_id, 'bannerid' => $banner_id);
    $entity_id = OA_Permission::getEntityId();
    if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
        $entity_type = 'advertiser_id';
    } else {
        $entity_type = 'agency_id';
    }
    // Display navigation
    $other_campaigns = Admin_DA::getPlacements(array($entity_type => $entity_id));
    $other_banners = Admin_DA::getAds(array('placement_id' => $campaign_id), false);
    displayNavigationBanner($page_name, $other_campaigns, $other_banners, $entities);
    if (!empty($banner_id)) {
        $template_id = OA_Dal::factoryDO('Zpbanners')->get_zp_banner_id((int) $banner_id);
        $form = explode('|', form_ajax_request($template_id));
    }
    $template = new OA_Plugin_Template('designer-form.html', 'bannerDesigner');
    //$oTpl->debugging = true;
    $template->assign('bannerid', $banner_id);
    $template->assign('campaignid', $campaign_id);
    $template->assign('clientid', $client_id);
    $template->assign('template_id', $template_id);
    $template->assign('form', $form);
    $template->display();
    phpAds_PageFooter();
}
function phpAds_displayData($source_arr, $pageID)
{
    global $parent;
    echo "<form action='" . $pageID . "' method='post'>\n";
    $parent_arr = explode('/', $parent);
    echo "<h1><a href='" . $pageID . "?parent='>Top</a> : ";
    $tmp_parent = "";
    for ($i = 0; $i < sizeof($parent_arr); $i++) {
        if ($i != 0) {
            echo ' / ';
        }
        $tmp_parent = strlen($tmp_parent) > 0 ? $tmp_parent . '/' . $parent_arr[$i] : $parent_arr[$i];
        echo "<a href='" . $pageID . "?parent=" . urlencode($tmp_parent) . "'>" . $parent_arr[$i] . "</a>";
    }
    echo "</h1>\n";
    echo "<table cellspacing='0' cellpadding='0' border='1'>\n";
    echo "<tr class='data_header_row'>\n";
    echo "\t<td class='data_header_cell'>Views</td>\n";
    echo "\t<td class='data_header_cell'>Source</td>\n";
    echo "\t<td class='data_header_cell'>Modified Source</td>\n";
    echo "\t<td class='data_header_cell'>Remove this part</td>\n";
    echo "\t<td class='data_header_cell'>Remove parent</td>\n";
    echo "</tr>\n";
    for ($i = 0; $i < sizeof($source_arr); $i++) {
        if (is_array($source_arr[$i])) {
            $source_part = $source_arr[$i]['source_part'];
            $sum_views = $source_arr[$i]['sum_views'];
            echo "<tr class='data_row" . ($cnt % 2 == 0 ? "_alt" : "") . "'>\n";
            echo "\t<td class='data_cell'>" . $sum_views . "</td>\n";
            echo "\t<td class='data_cell'>";
            echo "<a href='" . $pageID . "?parent=" . urlencode(strlen($parent) > 0 ? $parent . '/' . $source_part : $source_part) . "'>";
            echo $source_part;
            echo "</td>\n";
            echo "<td>";
            echo "<input type='hidden' name='source_old[]' value='" . $source_part . "'>";
            echo "<input type='text' class='flat' size='26' name='source_new[]' value='" . $source_part . "' style='width:250px;'>";
            echo "</td>\n";
            echo "<td>";
            echo "<input type='checkbox' name='source_del[]' value='" . $source_part . "'>";
            echo "</td>\n";
            echo "<td>";
            if (strlen($parent) > 0) {
                echo "<input type='checkbox' name='source_parent_del[]' value='" . $source_part . "'>";
            } else {
                echo "&nbsp;";
            }
            echo "</td>\n";
            echo "</tr>\n";
        }
    }
    echo "</table>\n";
    echo "<input type='hidden' name='parent' value='" . $parent . "'>\n";
    echo "<input type='submit' name='submit' value='Update Fields'>\n";
    echo "</form>\n";
    phpAds_PageFooter();
}
Ejemplo n.º 15
0
}
// display header and navigation, with proper 'active page' marked using $activeNav[$action]
phpAds_PageHeader($activeNav[$action], new OA_Admin_UI_Model_PageHeaderModel(), $imgPath, false, true, false);
// calculate percentage complete
$currSection = $oMenu->get($currentSectionID);
$showSections = $currSection->getSections();
$totalNav = count($showSections) - 1;
$progressRate = 100 / $totalNav;
for ($i = 0; $i < count($showSections); $i++) {
    if ($activeNav[$action] == $showSections[$i]->getId()) {
        if ($i == 0) {
            $progressVal = 0;
        } elseif ($i == $totalNav) {
            $progressVal = 100;
        } else {
            $progressVal = round($i * $progressRate);
        }
        break;
    } else {
        $progressVal = 0;
    }
}
// display main template
include 'templates/install-index.html';
// Do not remove. This is a marker that AJAX response parsers look for to
// determine whether the response did not redirect to the installer.
echo "<!-- install -->";
//OA::logMem('end installer');
// display footer
phpAds_PageFooter($imgPath);
Ejemplo n.º 16
0
function displayPage($tracker, $form)
{
    //header and breadcrumbs
    if ($tracker['trackerid'] != "") {
        $doClients = OA_Dal::factoryDO('clients');
        $doClients->whereAdd('clientid <>' . $tracker['clientid']);
        if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
            $doClients->agencyid = OA_Permission::getAgencyId();
        }
        $doClients->find();
        $aOtherAdvertisers = array();
        while ($doClients->fetch() && ($row = $doClients->toArray())) {
            $aOtherAdvertisers[] = $row;
        }
        MAX_displayNavigationTracker($tracker['clientid'], $tracker['trackerid'], $aOtherAdvertisers);
    } else {
        // New tracker
        $oHeaderModel = MAX_displayTrackerBreadcrumbs($tracker['clientid'], null);
        phpAds_PageHeader("tracker-edit_new", $oHeaderModel);
    }
    //get template and display form
    $oTpl = new OA_Admin_Template('tracker-edit.html');
    $oTpl->assign('form', $form->serialize());
    $oTpl->assign('formId', $form->getId());
    $oTpl->display();
    //footer
    phpAds_PageFooter();
}
Ejemplo n.º 17
0
function displayPage($campaign, $campaignForm, $statusForm, $campaignErrors = null)
{
    global $conf;
    //header and breadcrumbs
    if ($campaign['campaignid'] != "") {
        //edit campaign
        // Initialise some parameters
        $tabindex = 1;
        $agencyId = OA_Permission::getAgencyId();
        $aEntities = array('clientid' => $campaign['clientid'], 'campaignid' => $campaign['campaignid']);
        // Display navigation
        $aOtherAdvertisers = Admin_DA::getAdvertisers(array('agency_id' => $agencyId));
        $aOtherCampaigns = Admin_DA::getPlacements(array('advertiser_id' => $campaign['clientid']));
        MAX_displayNavigationCampaign($campaign['campaignid'], $aOtherAdvertisers, $aOtherCampaigns, $aEntities);
    } else {
        //new campaign
        $advertiser = phpAds_getClientDetails($campaign['clientid']);
        $advertiserName = $advertiser['clientname'];
        $advertiserEditUrl = "advertiser-edit.php?clientid=" . $campaign['clientid'];
        // New campaign
        $builder = new OA_Admin_UI_Model_InventoryPageHeaderModelBuilder();
        $oHeaderModel = $builder->buildEntityHeader(array(array("name" => $advertiserName, "url" => $advertiserEditUrl), array("name" => "")), "campaign", "edit-new");
        phpAds_PageHeader("campaign-edit_new", $oHeaderModel);
    }
    //get template and display form
    $oTpl = new OA_Admin_Template('campaign-edit.html');
    $oTpl->assign('clientid', $campaign['clientid']);
    $oTpl->assign('campaignid', $campaign['campaignid']);
    $oTpl->assign('calendarBeginOfWeek', $GLOBALS['pref']['begin_of_week'] ? 1 : 0);
    $oTpl->assign('language', $GLOBALS['_MAX']['PREF']['language']);
    $oTpl->assign('conversionsEnabled', $conf['logging']['trackerImpressions']);
    $oTpl->assign('adDirectEnabled', defined('OA_AD_DIRECT_ENABLED') && OA_AD_DIRECT_ENABLED === true);
    $oTpl->assign('impressionsDelivered', isset($campaign['impressions_delivered']) ? $campaign['impressions_delivered'] : 0);
    $oTpl->assign('clicksDelivered', isset($campaign['clicks_delivered']) ? $campaign['clicks_delivered'] : 0);
    $oTpl->assign('conversionsDelivered', isset($campaign['conversions_delivered']) ? $campaign['conversions_delivered'] : 0);
    $oTpl->assign('strCampaignWarningNoTargetMessage', str_replace("\n", '\\n', addslashes($GLOBALS['strCampaignWarningNoTarget'])));
    $oTpl->assign('strCampaignWarningRemnantNoWeight', str_replace("\n", '\\n', addslashes($GLOBALS['strCampaignWarningRemnantNoWeight'])));
    $oTpl->assign('strCampaignWarningEcpmNoRevenue', str_replace("\n", '\\n', addslashes($GLOBALS['strCampaignWarningEcpmNoRevenue'])));
    $oTpl->assign('strCampaignWarningExclusiveNoWeight', str_replace("\n", '\\n', addslashes($GLOBALS['strCampaignWarningExclusiveNoWeight'])));
    $oTpl->assign('campaignErrors', $campaignErrors);
    $oTpl->assign('CAMPAIGN_TYPE_REMNANT', OX_CAMPAIGN_TYPE_REMNANT);
    $oTpl->assign('CAMPAIGN_TYPE_CONTRACT_NORMAL', OX_CAMPAIGN_TYPE_CONTRACT_NORMAL);
    $oTpl->assign('CAMPAIGN_TYPE_CONTRACT_EXCLUSIVE', OX_CAMPAIGN_TYPE_CONTRACT_EXCLUSIVE);
    $oTpl->assign('CAMPAIGN_TYPE_ECPM', OX_CAMPAIGN_TYPE_ECPM);
    $oTpl->assign('CAMPAIGN_TYPE_CONTRACT_ECPM', OX_CAMPAIGN_TYPE_CONTRACT_ECPM);
    $oTpl->assign('PRIORITY_ECPM_FROM', DataObjects_Campaigns::PRIORITY_ECPM_FROM);
    $oTpl->assign('PRIORITY_ECPM_TO', DataObjects_Campaigns::PRIORITY_ECPM_TO);
    $oTpl->assign('MODEL_CPM', MAX_FINANCE_CPM);
    $oTpl->assign('MODEL_CPC', MAX_FINANCE_CPC);
    $oTpl->assign('MODEL_CPA', MAX_FINANCE_CPA);
    if ($conf['logging']['trackerImpressions']) {
        $oTpl->assign('MODEL_MT', MAX_FINANCE_MT);
    }
    $oTpl->assign('campaignFormId', $campaignForm->getId());
    $oTpl->assign('campaignForm', $campaignForm->serialize());
    if (!empty($campaign['campaignid']) && defined('OA_AD_DIRECT_ENABLED') && OA_AD_DIRECT_ENABLED === true) {
        $oTpl->assign('statusForm', $statusForm->serialize());
    }
    $oTpl->display();
    _echoDeliveryCappingJs();
    //footer
    phpAds_PageFooter();
}
Ejemplo n.º 18
0
function phpAds_Die($title = "Error", $message = "Unknown error")
{
    if (defined('OA_WEBSERVICES_API_XMLRPC')) {
        // It's an XML-RPC response
        if (class_exists('XmlRpcUtils')) {
            $oResponse = XmlRpcUtils::generateError($message);
        } else {
            $oResponse = new XML_RPC_Response('', 99999, $message);
        }
        echo $oResponse->serialize();
        exit;
    }
    $conf = $GLOBALS['_MAX']['CONF'];
    global $phpAds_GUIDone, $phpAds_TextDirection;
    $header = $title == $GLOBALS['strAccessDenied'] ? phpAds_Login : phpAds_Error;
    // Header
    if ($phpAds_GUIDone == false) {
        if (!isset($phpAds_TextDirection)) {
            $phpAds_TextDirection = 'ltr';
        }
        phpAds_PageHeader(phpAds_Error);
    }
    echo "<br>";
    echo "<div class='errormessage'><img class='errormessage' src='" . OX::assetPath() . "/images/errormessage.gif' align='absmiddle'> ";
    echo "<span class='tab-r'>" . $title . "</span><br><br>" . $message . "</div><br>";
    // Die
    if ($header == phpAds_Login) {
        $_COOKIE['sessionID'] = phpAds_SessionStart();
        OA_Auth::displayLogin('', $_COOKIE['sessionID'], true);
    }
    phpAds_PageFooter();
    exit;
}
Ejemplo n.º 19
0
 /**
  * A static method to display a login screen
  *
  * @static
  *
  * @param string $sMessage
  * @param string $sessionID
  * @param bool $inlineLogin
  */
 function displayLogin($sMessage = '', $sessionID = 0, $inLineLogin = false)
 {
     global $strUsername, $strPassword, $strLogin, $strWelcomeTo, $strEnterUsername, $strNoAdminInteface, $strForgotPassword;
     $aConf = $GLOBALS['_MAX']['CONF'];
     $aPref = $GLOBALS['_MAX']['PREF'];
     header('Cache-Control: max-age=0, no-cache, proxy-revalidate, must-revalidate');
     if (!$inLineLogin) {
         phpAds_PageHeader(phpAds_Login);
     }
     // Check environment settings
     $oSystemMgr = new OA_Environment_Manager();
     $aSysInfo = $oSystemMgr->checkSystem();
     foreach ($aSysInfo as $env => $vals) {
         $errDetails = '';
         if (is_array($vals['error'])) {
             $errDetails = '<ul>';
             if ($env == 'PERMS') {
                 foreach ($vals['actual'] as $key => $val) {
                     if ($val['error']) {
                         $errDetails .= '<li>' . htmlspecialchars($val['file']) . '  ' . htmlspecialchars($val['result']) . '</li>';
                     }
                 }
             } else {
                 foreach ($vals['actual'] as $key => $val) {
                     $errDetails .= '<li>' . htmlspecialchars($key) . ' &nbsp; => &nbsp; ' . htmlspecialchars($val) . '</li>';
                 }
             }
             $errDetails .= '</ul>';
             foreach ($vals['error'] as $key => $err) {
                 phpAds_Die(' Error: ' . $err, $errDetails);
             }
         }
     }
     $oTpl = new OA_Admin_Template('login.html');
     // we build the URL of the current page to use a redirect URL after login
     // this code should work on all server configurations hence why it is a bit complicated
     // inspired by http://dev.piwik.org/svn/trunk/core/Url.php getCurrentUrl()
     $url = '';
     if (!empty($_SERVER['PATH_INFO'])) {
         $url = $_SERVER['PATH_INFO'];
     } else {
         if (!empty($_SERVER['REQUEST_URI'])) {
             if (($pos = strpos($_SERVER['REQUEST_URI'], "?")) !== false) {
                 $url = substr($_SERVER['REQUEST_URI'], 0, $pos);
             } else {
                 $url = $_SERVER['REQUEST_URI'];
             }
         }
     }
     if (empty($url)) {
         $url = $_SERVER['SCRIPT_NAME'];
     }
     if (!empty($_SERVER['QUERY_STRING'])) {
         $url .= '?' . $_SERVER['QUERY_STRING'];
     }
     if (!empty($url)) {
         // remove any extra slashes that would confuse the browser (see OX-5234)
         $url = '/' . ltrim($url, '/');
     }
     $appName = !empty($aConf['ui']['applicationName']) ? $aConf['ui']['applicationName'] : MAX_PRODUCT_NAME;
     $oTpl->assign('uiEnabled', $aConf['ui']['enabled']);
     $oTpl->assign('formAction', $url);
     $oTpl->assign('sessionID', $sessionID);
     $oTpl->assign('appName', $appName);
     $oTpl->assign('message', $sMessage);
     $oTpl->display();
     phpAds_PageFooter();
     exit;
 }
Ejemplo n.º 20
0
 /**
  * A private method to do part of the work of the
  * {@link OA_Admin_Statistics_Common::output()} method.
  *
  * @access private
  * @param array $aElements An optional array of output elements to display.
  */
 function _output($aElements = array())
 {
     global $graphFilter;
     // Prepare the Flexy output object
     $oOutput = new HTML_Template_Flexy(array('templateDir' => $this->templateDir, 'compileDir' => MAX_PATH . '/var/templates_compiled'));
     // Add global variables for backwards compatibility
     if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
         $GLOBALS['clientid'] = OA_Permission::getEntityId();
     } elseif (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
         $GLOBALS['affiliateid'] = OA_Permission::getEntityId();
     }
     // Add the current page's entity/breakdown values to the page
     // parameters before generating this page's URI
     $this->aPageParams['entity'] = $this->entity;
     $this->aPageParams['breakdown'] = $this->breakdown;
     // Generate URI used to add other parameters
     $this->_generatePageURI();
     $this->assetPath = OX::assetPath();
     phpAds_PageHeader($this->pageId, $this->getHeaderModel());
     // Welcome text
     if (!empty($this->welcomeText)) {
         echo "<br/>";
         echo $this->welcomeText;
         echo "<br/><br/><br/>";
     }
     // Show the page sections
     phpAds_ShowSections($this->aPageSections, $this->aPageParams, $openNewTable = false);
     $graphVals = $graphFilter;
     // Set columns shown by default
     if (!is_array($graphVals)) {
         if (isset($this->aColumns['sum_views'])) {
             $graphVals[] = 'sum_views';
         }
         if (isset($this->aColumns['sum_clicks'])) {
             $graphVals[] = 'sum_clicks';
         }
     }
     // Prepare the data required for displaying graphs
     $graphFilterArray = $graphVals;
     $imageFormat = null;
     if (!extension_loaded('gd')) {
         $this->aGraphData['noGraph'] = true;
     } else {
         $imgPath = rtrim(MAX::constructURL(MAX_URL_IMAGE), '/');
         if (!function_exists('imagecreate')) {
             $this->aGraphData['noGraph'] = $GLOBALS['strGDnotEnabled'];
         } else {
             $tmpUrl = MAX::constructURL(MAX_URL_ADMIN) . 'stats-showgraph.php?' . $_SERVER['QUERY_STRING'];
             if (is_array($graphFilterArray)) {
                 foreach ($graphFilterArray as $k => $v) {
                     $tmpUrl .= '&graphFields[]=' . $v;
                 }
             }
         }
         $formSubmitLink = explode("/", $_SERVER['REQUEST_URI']);
         $formSubmitLink = $formSubmitLink[count($formSubmitLink) - 1];
         $this->aGraphData['imgPath'] = $imgPath;
         $this->aGraphData['tmpUrl'] = $tmpUrl;
         $this->aGraphData['queryString'] = $_SERVER['QUERY_STRING'];
         $this->aGraphData['formSubmitLink'] = $formSubmitLink;
     }
     // Set the Flexy tags to open/close Javascript
     $this->scriptOpen = "\n<script type=\"text/javascript\"> <!--\n";
     $this->scriptClose = "\n//--> </script>\n";
     // Set whether to automatically display the Graph div, will return true if user has just changed the 'graphFields' value
     $this->autoShowGraph = strpos($_SERVER['QUERY_STRING'], 'graphFields');
     // Set the language vars for statistics display
     $this->strShowGraphOfStatistics = $GLOBALS['strShowGraphOfStatistics'];
     $this->strExportStatisticsToExcel = $GLOBALS['strExportStatisticsToExcel'];
     // Set-up Flexy form for displaying graph
     $aElements['graphFilter[]'] = new HTML_Template_Flexy_Element();
     $aElements['graphFilter[]']->setValue($graphVals);
     if ($this->_isEmptyResultArray()) {
         $this->disableGraph = true;
     }
     // Display page content
     $oOutput->compile($this->template);
     $oOutput->outputObject($this, $aElements);
     $this->_savePrefs();
     phpAds_PageFooter();
 }
Ejemplo n.º 21
0
function displayPage($aZone, $form)
{
    $pageName = basename($_SERVER['SCRIPT_NAME']);
    $agencyId = OA_Permission::getAgencyId();
    $aEntities = array('affiliateid' => $aZone['affiliateid'], 'zoneid' => $aZone['zoneid']);
    $aOtherPublishers = Admin_DA::getPublishers(array('agency_id' => $agencyId));
    $aOtherZones = Admin_DA::getZones(array('publisher_id' => $aZone['affiliateid']));
    MAX_displayNavigationZone($pageName, $aOtherPublishers, $aOtherZones, $aEntities);
    //get template and display form
    $oTpl = new OA_Admin_Template('zone-advanced.html');
    $oTpl->assign('form', $form->serialize());
    $oTpl->display();
    _echoDeliveryCappingJs();
    //footer
    phpAds_PageFooter();
}
Ejemplo n.º 22
0
function phpAds_Die($title = "Error", $message = "Unknown error")
{
    global $phpAds_GUIDone, $phpAds_TextDirection, $phpAds_config;
    // Header
    if ($phpAds_GUIDone == false) {
        if (!isset($phpAds_TextDirection)) {
            $phpAds_TextDirection = 'ltr';
        }
        phpAds_PageHeader(phpAds_Error);
    }
    // Message
    echo "<br>";
    echo "<div class='errormessage'><img class='errormessage' src='images/errormessage.gif' align='absmiddle'>";
    echo "<span class='tab-r'>" . $title . "</span><br><br>" . $message . "</div><br><br>";
    // Die
    phpAds_PageFooter();
    exit;
}
Ejemplo n.º 23
0
function displayPage($affiliateid, $form, $oPublisherDll = null)
{
    //header and breadcrumbs
    $oHeaderModel = MAX_displayWebsiteBreadcrumbs($affiliateid);
    if ($affiliateid != "") {
        OA_Admin_Menu::setPublisherPageContext($affiliateid, 'affiliate-edit.php');
        addWebsitePageTools($affiliateid);
        phpAds_PageHeader(null, $oHeaderModel);
    } else {
        phpAds_PageHeader("affiliate-edit_new", $oHeaderModel);
    }
    //get template and display form
    $oTpl = new OA_Admin_Template('affiliate-edit.html');
    $oTpl->assign('affiliateid', $affiliateid);
    $oTpl->assign('form', $form->serialize());
    if (isset($oPublisherDll)) {
        $oTpl->assign('error', $oPublisherDll->_errorMessage);
        $oTpl->assign('notice', $oPublisherDll->_noticeMessage);
    }
    $oTpl->assign('showAdDirect', defined('OA_AD_DIRECT_ENABLED') && OA_AD_DIRECT_ENABLED === true ? true : false);
    $oTpl->assign('keyAddNew', $keyAddNew);
    $oTpl->display();
    //footer
    phpAds_PageFooter();
}
function phpAds_LoginScreen($message = '', $sessionID = 0)
{
    global $phpAds_config, $phpAds_productname;
    global $strUsername, $strPassword, $strLogin, $strWelcomeTo, $strEnterUsername, $strNoAdminInteface;
    phpAds_PageHeader(phpAds_Login);
    if ($phpAds_config['ui_enabled'] == true) {
        echo "<br>";
        phpAds_ShowBreak();
        echo "<br>";
        echo "<form name='login' method='post' action='" . basename($_SERVER['PHP_SELF']);
        echo (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '' ? '?' . htmlentities($_SERVER['QUERY_STRING']) : '') . "'>";
        echo "<input type='hidden' name='phpAds_cookiecheck' value='" . $_COOKIE['sessionID'] . "'>";
        echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'><tr>";
        echo "<td width='80' valign='bottom'><img src='images/login-welcome.gif'>&nbsp;&nbsp;</td>";
        echo "<td width='100%' valign='bottom'>";
        echo "<span class='tab-s'>" . $strWelcomeTo . " " . (isset($phpAds_config['name']) && $phpAds_config['name'] != '' ? $phpAds_config['name'] : $phpAds_productname) . "</span><br>";
        echo "<span class='install'>" . $strEnterUsername . "</span><br>";
        if ($message != "") {
            echo "<div class='errormessage' style='width: 400px;'><img class='errormessage' src='images/errormessage.gif' align='absmiddle'>";
            echo "<span class='tab-r'>{$message}</span></div>";
        } else {
            echo "<img src='images/break-el.gif' width='400' height='1' vspace='8'>";
        }
        echo "</td></tr><tr><td>&nbsp;</td><td>";
        echo "<table cellpadding='0' cellspacing='0' border='0'>";
        echo "<tr height='24'><td>" . $strUsername . ":&nbsp;</td><td><input class='flat' type='text' name='phpAds_username'></td></tr>";
        echo "<tr height='24'><td>" . $strPassword . ":&nbsp;</td><td><input class='flat' type='password' name='phpAds_password'></td></tr>";
        echo "<tr height='24'><td>&nbsp;</td><td><input type='submit' value='" . $strLogin . "'></td></tr>";
        echo "</table>";
        echo "</td></tr></table>";
        echo "</form>";
        phpAds_ShowBreak();
        echo "<script language='JavaScript'>";
        ?>
<!--
		login_focus();
//-->
		<?php 
        echo "</script>";
    } else {
        phpAds_ShowBreak();
        echo "<br><img src='images/info.gif' align='absmiddle'>&nbsp;";
        echo $strNoAdminInteface;
    }
    phpAds_PageFooter();
    exit;
}
    if (!count($aErrormessage)) {
        if ($doUsers->update() === false) {
            // Unable to update the preferences
            $aErrormessage[0][] = $strUnableToWritePrefs;
        } else {
            $translation = new OX_Translation();
            $translated_message = $translation->translate($GLOBALS['strPasswordChanged']);
            OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
            // The "preferences" were written correctly saved to the database,
            // go to the "next" preferences page from here
            OX_Admin_Redirect::redirect(basename($_SERVER['SCRIPT_NAME']));
        }
    }
}
// Set the correct section of the preference pages and display the drop-down menu
$prefSection = "password";
$setPref = $oOptions->getSettingsPreferences($prefSection);
$title = $setPref[$prefSection]['name'];
// Display the settings page's header and sections
$oHeaderModel = new OA_Admin_UI_Model_PageHeaderModel($title);
phpAds_PageHeader('account-user-index', $oHeaderModel);
// Get the current logged in user details
$oUser = OA_Permission::getCurrentUser();
$aUser = $oUser->aUser;
// Prepare an array of HTML elements to display for the form, and
// output using the $oOption object
$aSettings = array(array('text' => $strChangePassword, 'items' => array(array('type' => 'plaintext', 'name' => 'username', 'value' => $aUser['username'], 'text' => $strUsername, 'size' => 35), array('type' => 'break'), array('type' => 'plaintext', 'name' => 'contact_name', 'value' => $aUser['contact_name'], 'text' => $strFullName, 'size' => 35), array('type' => 'break'), array('type' => 'plaintext', 'name' => 'email_address', 'value' => $aUser['email_address'], 'text' => $strEmailAddress, 'size' => 35), array('type' => 'break'), array('type' => 'password', 'name' => 'pwold', 'text' => $strCurrentPassword, 'disabled' => ''), array('type' => 'break'), array('type' => 'password', 'name' => 'pw', 'text' => $strChooseNewPassword), array('type' => 'break'), array('type' => 'password', 'name' => 'pw2', 'text' => $strReenterNewPassword, 'check' => 'compare:pw'))));
$oOptions->show($aSettings, $aErrormessage);
// Display the page footer
phpAds_PageFooter();
function displayPage($bannerid, $campaignid, $clientid, $bannerTypes, $aBanner, $type, $form, $ext_bannertype, $formDisabled = false)
{
    $pageName = 'advertiser-campaigns';
    $aEntities = array('clientid' => $clientid, 'campaignid' => $campaignid, 'bannerid' => $bannerid);
    $entityId = OA_Permission::getEntityId();
    $entityType = 'advertiser_id';
    $aOtherCampaigns = Admin_DA::getPlacements(array($entityType => $entityId));
    $aOtherBanners = Admin_DA::getAds(array('placement_id' => $campaignid), false);
    $advertiserId = $aEntities['clientid'];
    $campaignId = $aEntities['campaignid'];
    $bannerId = $aEntities['bannerid'];
    $entityString = _getEntityString($aEntities);
    $aOtherEntities = $aEntities;
    unset($aOtherEntities['bannerid']);
    $otherEntityString = _getEntityString($aOtherEntities);
    if ($pageName == 'banner-edit.php' && empty($bannerId)) {
        $tabValue = 'banner-edit_new';
        $pageType = 'edit-new';
    } else {
        $pageType = 'edit';
    }
    $advertiserEditUrl = '';
    $campaignEditUrl = '';
    if (OA_Permission::hasAccessToObject('clients', $advertiserId)) {
        $advertiserEditUrl = "advertiser-edit.php?clientid={$advertiserId}";
    }
    if (!OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
        $campaignEditUrl = "campaign-edit.php?clientid={$advertiserId}&campaignid={$campaignId}";
    }
    if ($bannerId && !empty($GLOBALS['_MAX']['PREF']['ui_show_banner_preview']) && empty($_GET['nopreview'])) {
        require_once MAX_PATH . '/lib/max/Delivery/adRender.php';
        $aBanner = Admin_DA::getAd($bannerId);
        $aBanner['storagetype'] = $aBanner['type'];
        $aBanner['bannerid'] = $aBanner['ad_id'];
        $bannerCode = MAX_adRender($aBanner, 0, '', '', '', true, '', false, false);
    } else {
        $bannerCode = '';
    }
    $advertiserDetails = phpAds_getClientDetails($advertiserId);
    $advertiserName = $advertiserDetails['clientname'];
    $campaignDetails = Admin_DA::getPlacement($campaignId);
    $campaignName = $campaignDetails['name'];
    $bannerName = $aOtherBanners[$bannerId]['name'];
    $builder = new OA_Admin_UI_Model_InventoryPageHeaderModelBuilder();
    $oHeaderModel = $builder->buildEntityHeader(array(array("name" => $advertiserName, "url" => $advertiserEditUrl), array("name" => $campaignName, "url" => $campaignEditUrl), array("name" => $bannerName)), "banner", $pageType);
    global $phpAds_breadcrumbs_extra;
    $phpAds_breadcrumbs_extra .= "<div class='bannercode'>{$bannerCode}</div>";
    if ($bannerCode != '') {
        $phpAds_breadcrumbs_extra .= "<br />";
    }
    addPageLinkTool($GLOBALS["strDuplicate"], MAX::constructUrl(MAX_URL_ADMIN, "plugins/oxMarkedTextAdvertiser/banner-modify.php?duplicate=true&clientid={$advertiserId}&campaignid={$campaignId}&bannerid={$bannerId}&returnurl=" . urlencode(basename($_SERVER['SCRIPT_NAME']))), "iconBannerDuplicate");
    addPageShortcut($GLOBALS['strBackToBanners'], MAX::constructUrl(MAX_URL_ADMIN, "campaign-banners.php?clientid={$advertiserId}&campaignid={$campaignId}"), "iconBack");
    $entityString = _getEntityString($aEntities);
    addPageShortcut($GLOBALS['strBannerHistory'], MAX::constructUrl(MAX_URL_ADMIN, "stats.php?entity=banner&breakdown=history&{$entityString}"), 'iconStatistics');
    phpAds_PageHeader('advertiser-campaigns', $oHeaderModel);
    $oTpl = new OA_Admin_Template('banner-edit.html');
    $oTpl->assign('clientId', $clientid);
    $oTpl->assign('campaignId', $campaignid);
    $oTpl->assign('bannerId', $bannerid);
    $oTpl->assign('bannerTypes', $bannerTypes);
    $oTpl->assign('bannerType', 'bannerTypeText:oxMarkedText:oxMarkedTextComponent');
    $oTpl->assign('bannerHeight', $aBanner["height"]);
    $oTpl->assign('bannerWidth', $aBanner["width"]);
    $oTpl->assign('disabled', $formDisabled);
    $oTpl->assign('form', $form->serialize());
    $oTpl->display();
    phpAds_PageFooter();
}