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;
         }
     }
 }
 function process()
 {
     if (!empty($this->request['submit'])) {
         $this->aErrors = $this->oPlugin->validateUsersData($this->request);
         if (empty($this->aErrors)) {
             $this->userid = $this->oPlugin->saveUser($this->userid, $this->request['login'], $this->request['passwd'], $this->request['contact_name'], $this->request['email_address'], $this->request['language'], $this->accountId);
             if ($this->userid) {
                 OA_Admin_UI_UserAccess::linkUserToAccount($this->userid, $this->accountId, $this->aPermissions, $this->aAllowedPermissions);
                 OX_Admin_Redirect::redirect($this->getRedirectUrl());
             } else {
                 $this->aErrors = $this->oPlugin->getSignupErrors();
             }
         }
     }
     $this->display();
 }
Example #3
0
 /**
  * A private method to generate a report plugin.
  *
  * @access private
  * @param Plugins_Reports $oPlugin The report plugin.
  *
  * @TODO Extend to allow use of other report writers, if required.
  */
 function _runReport($oPlugin)
 {
     if (!$oPlugin->isAllowedToExecute()) {
         // User cannot execute this report
         OX_Admin_Redirect::redirect('report-index.php');
     }
     $aInfo = $oPlugin->info();
     // Get the variables for running the report plugin
     $aVariables = $this->_getVariablesForReport($aInfo['plugin-import']);
     // Set the Excel Report writer
     $oWriter = new OA_Admin_ExcelWriter();
     $oPlugin->useReportWriter($oWriter);
     // Generate the report by calling the report plugin's
     // execute method with the required variables
     $aCallback = array(&$oPlugin, 'execute');
     $result = call_user_func_array($aCallback, $aVariables);
     if (!empty($result)) {
         OX_Admin_Redirect::redirect('report-generation.php?report=' . $oPlugin->getComponentIdentifier() . '&error=' . $result);
     }
 }
 function handlePost($vars)
 {
     $codes = array();
     if (isset($vars['tag']) && is_array($vars['tag'])) {
         foreach ($vars['tag'] as $k => $v) {
             $codes[$k] = array('tagcode' => stripslashes($v), 'paused' => false);
             $codes[$k]['autotrack'] = isset($vars['autotrack'][$k]);
         }
     }
     if (isset($vars['t_paused'])) {
         foreach (explode(',', $vars['t_paused']) as $k) {
             if (isset($codes[$k])) {
                 $codes[$k]['paused'] = true;
             }
         }
     }
     if (isset($vars['t_action'])) {
         switch ($vars['t_action']) {
             case 'new':
                 $codes[] = array('tagcode' => '', 'paused' => false);
                 break;
             case 'del':
                 if (isset($vars['t_id']) && isset($codes[$vars['t_id']])) {
                     unset($codes[$vars['t_id']]);
                 }
                 break;
             case 'up':
                 if (isset($vars['t_id']) && isset($codes[$vars['t_id']]) && isset($codes[$vars['t_id'] - 1])) {
                     $tmp = $codes[$vars['t_id']];
                     $codes[$vars['t_id']] = $codes[$vars['t_id'] - 1];
                     $codes[$vars['t_id'] - 1] = $tmp;
                 }
                 break;
             case 'down':
                 if (isset($vars['t_id']) && isset($codes[$vars['t_id']]) && isset($codes[$vars['t_id'] + 1])) {
                     $tmp = $codes[$vars['t_id']];
                     $codes[$vars['t_id']] = $codes[$vars['t_id'] + 1];
                     $codes[$vars['t_id'] + 1] = $tmp;
                 }
                 break;
             case 'pause':
             case 'restart':
                 if (isset($vars['t_id']) && isset($codes[$vars['t_id']])) {
                     $codes[$vars['t_id']]['paused'] = $vars['t_action'] == 'pause';
                 }
                 break;
         }
     }
     if (isset($vars['save'])) {
         $this->_dal->setAppendCodes($this->tracker_id, $codes);
         // Queue confirmation message
         $doTrackers = OA_Dal::factoryDO('trackers');
         $doTrackers->get($this->tracker_id);
         $translation = new OX_Translation();
         $translated_message = $translation->translate($GLOBALS['strTrackerAppendHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, "tracker-edit.php?clientid=" . $this->advertiser_id . "&trackerid=" . $this->tracker_id), htmlspecialchars($doTrackers->trackername)));
         OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
         OX_Admin_Redirect::redirect("tracker-append.php?clientid={$this->advertiser_id}&trackerid={$this->tracker_id}");
     } else {
         $this->codes = $codes;
         $this->showReminder = true;
     }
 }
//require_once MAX_PATH . '/lib/max/deliverycache/cache-'.$conf['delivery']['cache'].'.inc.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-storage.inc.php';
require_once MAX_PATH . '/www/admin/lib-zones.inc.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/lib/OA/Maintenance/Priority.php';
require_once OX_PATH . '/lib/pear/DB/DataObject.php';
// Register input variables
phpAds_registerGlobal('returnurl', 'agencyid');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN);
// CVE-2013-5954 - see OA_Permission::checkSessionToken() method for details
OA_Permission::checkSessionToken();
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
if (!empty($agencyid)) {
    $doAgency = OA_Dal::factoryDO('agency');
    $doAgency->agencyid = $agencyid;
    $doAgency->get($agencyid);
    $doAgency->delete();
}
// Run the Maintenance Priority Engine process
OA_Maintenance_Priority::scheduleRun();
// Rebuild cache
// phpAds_cacheDelete();
if (!isset($returnurl) || $returnurl == '') {
    $returnurl = 'advertiser-index.php';
}
OX_Admin_Redirect::redirect($returnurl);
        $sessionClientId = $session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['clientid'];
        if (isset($aAdvertisers[$sessionClientId])) {
            //check if 'id' from session was not removed
            $clientid = $sessionClientId;
        }
    }
    if (empty($clientid)) {
        //was empty, is still empty - just pick one, no need for redirect
        $ids = array_keys($aAdvertisers);
        $clientid = !empty($ids) ? $ids[0] : -1;
        //if no advertisers set to non-existent id
    }
} else {
    if (!isset($aAdvertisers[$clientid])) {
        $page = basename($_SERVER['SCRIPT_NAME']);
        OX_Admin_Redirect::redirect($page);
    }
}
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
$oHeaderModel = buildHeaderModel($clientid, $aAdvertisers);
phpAds_PageHeader(null, $oHeaderModel);
/*-------------------------------------------------------*/
/* Get preferences                                       */
/*-------------------------------------------------------*/
if (!isset($hideinactive)) {
    if (isset($session['prefs']['advertiser-campaigns.php'][$clientid]['hideinactive'])) {
        $hideinactive = $session['prefs']['advertiser-campaigns.php'][$clientid]['hideinactive'];
    } else {
        $pref =& $GLOBALS['_MAX']['PREF'];
function processForm($aZone, $form, $oComponent = null)
{
    $aFields = $form->exportValues();
    if (empty($aFields['zoneid'])) {
        return;
    }
    $doZones = OA_Dal::factoryDO('zones');
    $doZones->get($aFields['zoneid']);
    // Determine chain
    if ($aFields['chaintype'] == '1' && $aFields['chainzone'] != '') {
        $chain = 'zone:' . $aFields['chainzone'];
    } else {
        $chain = '';
    }
    $doZones->chain = $chain;
    if (!isset($aFields['prepend'])) {
        $aFields['prepend'] = '';
    }
    $aFields['prepend'] = MAX_commonGetValueUnslashed('prepend');
    $doZones->prepend = $aFields['prepend'];
    // Do not save append until not finished with zone appending, if present
    if (!empty($aFields['appendsave'])) {
        if (!isset($aFields['append'])) {
            $aFields['append'] = '';
        }
        if (!isset($aFields['appendtype'])) {
            $aFields['appendtype'] = phpAds_ZoneAppendZone;
        }
        $aFields['append'] = MAX_commonGetValueUnslashed('append');
        $doZones->append = $aFields['append'];
        $doZones->appendtype = $aFields['appendtype'];
    }
    if (isset($aFields['forceappend'])) {
        $doZones->forceappend = $aFields['forceappend'];
    }
    $block = _initCappingVariables($aFields['time'], $aFields['capping'], $aFields['session_capping']);
    // Set adselection PCI if required
    if (isset($aFields['ext_adselection'])) {
        $doZones->ext_adselection = $aFields['ext_adselection'] == 'none' ? OX_DATAOBJECT_NULL : $aFields['ext_adselection'];
    }
    $doZones->block = $block;
    $doZones->capping = $aFields['capping'];
    $doZones->session_capping = $aFields['session_capping'];
    if ($aFields['show_capped_no_cookie'] != 1) {
        $aFields['show_capped_no_cookie'] = 0;
    }
    $doZones->show_capped_no_cookie = $aFields['show_capped_no_cookie'];
    $doZones->update();
    // Queue confirmation message
    $translation = new OX_Translation();
    $translated_message = $translation->translate($GLOBALS['strZoneAdvancedHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, 'zone-edit.php?affiliateid=' . $aFields['affiliateid'] . '&zoneid=' . $aFields['zoneid']), htmlspecialchars($doZones->zonename)));
    OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
    // Rebuild Cache
    // require_once MAX_PATH . '/lib/max/deliverycache/cache-'.$conf['delivery']['cache'].'.inc.php';
    // phpAds_cacheDelete('what=zone:'.$zoneid);
    $oUI = OA_Admin_UI::getInstance();
    OX_Admin_Redirect::redirect("zone-advanced.php?affiliateid=" . $aFields['affiliateid'] . "&zoneid=" . $aFields['zoneid']);
}
            $sessionCampaignId = $session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['campaignid'][$clientid];
            if (isset($aCampaigns[$sessionCampaignId])) {
                //check if 'id' from session was not removed
                $campaignid = $sessionCampaignId;
            }
        }
        if (empty($campaignid)) {
            //was empty, is still empty - just pick one, no need for redirect
            $ids = array_keys($aCampaigns);
            $campaignid = !empty($ids) ? $ids[0] : -1;
            //if no campaigns set to non-existent id
        }
    } else {
        if (!isset($aCampaigns[$campaignid])) {
            $page = basename($_SERVER['SCRIPT_NAME']);
            OX_Admin_Redirect::redirect("{$page}?clientid={$clientid}");
        }
    }
}
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
// Initialise some parameters
$pageName = basename($_SERVER['SCRIPT_NAME']);
$tabindex = 1;
$agencyId = OA_Permission::getAgencyId();
$aEntities = array('clientid' => $clientid, 'campaignid' => $campaignid);
$oTrans = new OX_Translation();
// Display navigation
$aOtherAdvertisers = Admin_DA::getAdvertisers(array('agency_id' => $agencyId));
$aOtherCampaigns = Admin_DA::getPlacements(array('advertiser_id' => $clientid));
    if (isset($language)) {
        $doUsers->language = $language;
    }
    if (!count($aErrormessage)) {
        if ($doUsers->update() === false) {
            // Unable to update the preferences
            $aErrormessage[0][] = $strUnableToWritePrefs;
        } else {
            //Add the new username to the session
            $oUser =& OA_Permission::getCurrentUser();
            $oUser->aUser['contact_name'] = $contact_name;
            $oUser->aUser['language'] = $language;
            phpAds_SessionDataStore();
            // The "preferences" were written correctly saved to the database,
            // go to the "next" preferences page from here
            OX_Admin_Redirect::redirect('account-user-email.php');
        }
    }
}
// Display the settings page's header and sections
phpAds_PageHeader("5.1");
if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
    // Show all "Preferences" sections
    phpAds_ShowSections(array("5.1", "5.2", "5.3", "5.5", "5.6", "5.4"));
} else {
    if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
        // Show the "Account Preferences", "User Log" and "Channel Management" sections of the "Preferences" sections
        phpAds_ShowSections(array("5.1", "5.2", "5.4", "5.7"));
    } else {
        if (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER) || OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
            // Show the "User Preferences" section of the "Preferences" sections
function processStatusForm($form)
{
    $aFields = $form->exportValues();
    if (empty($aFields['campaignid'])) {
        return;
    }
    //update status for existing campaign
    $doCampaigns = OA_Dal::factoryDO('campaigns');
    $doCampaigns->campaignid = $aFields['campaignid'];
    $doCampaigns->as_reject_reason = $aFields['as_reject_reason'];
    $doCampaigns->status = $aFields['status'];
    $doCampaigns->update();
    // Run the Maintenance Priority Engine process
    OA_Maintenance_Priority::scheduleRun();
    OX_Admin_Redirect::redirect("campaign-edit.php?clientid=" . $aFields['clientid'] . "&campaignid=" . $aFields['campaignid']);
}
function processForm($form)
{
    $aFields = $form->exportValues();
    // If ID is not set, it should be a null-value for the auto_increment
    if (empty($aFields['trackerid'])) {
        $aFields['trackerid'] = "null";
    }
    $doTrackers = OA_Dal::factoryDO('trackers');
    $doTrackers->trackername = $aFields['trackername'];
    $doTrackers->description = $aFields['description'];
    $doTrackers->status = $aFields['status'];
    $doTrackers->type = $aFields['type'];
    $doTrackers->linkcampaigns = $aFields['linkcampaigns'] == "t" ? "t" : "f";
    $doTrackers->clientid = $aFields['clientid'];
    if (empty($aFields['trackerid']) || $aFields['trackerid'] == "null") {
        $aFields['trackerid'] = $doTrackers->insert();
        // Queue confirmation message
        $translation = new OX_Translation();
        $translated_message = $translation->translate($GLOBALS['strTrackerHasBeenAdded'], array(MAX::constructURL(MAX_URL_ADMIN, "tracker-edit.php?clientid=" . $aFields['clientid'] . "&trackerid=" . $aFields['trackerid']), htmlspecialchars($aFields['trackername'])));
        OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
        OX_Admin_Redirect::redirect('advertiser-trackers.php?clientid=' . $aFields['clientid']);
    } else {
        $doTrackers->trackerid = $aFields['trackerid'];
        $doTrackers->update();
        // Queue confirmation message
        $translation = new OX_Translation();
        $translated_message = $translation->translate($GLOBALS['strTrackerHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, "tracker-edit.php?clientid=" . $aFields['clientid'] . "&trackerid=" . $aFields['trackerid']), htmlspecialchars($aFields['trackername'])));
        OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
        OX_Admin_Redirect::redirect("tracker-edit.php?clientid=" . $aFields['clientid'] . "&trackerid=" . $aFields['trackerid']);
    }
    exit;
}
Example #12
0
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/lib/OA/Permission.php';
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER);
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
    // Show Dashboard if Dashboard is enabled
    if ($GLOBALS['_MAX']['CONF']['ui']['dashboardEnabled']) {
        OX_Admin_Redirect::redirect('dashboard.php');
    } else {
        OX_Admin_Redirect::redirect('agency-index.php');
    }
}
if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
    // Show Dashboard if Dashboard is enabled, Sync is enabled and PHP is SSL enabled
    if ($GLOBALS['_MAX']['CONF']['ui']['dashboardEnabled'] && $GLOBALS['_MAX']['CONF']['sync']['checkForUpdates'] && OA::getAvailableSSLExtensions()) {
        OX_Admin_Redirect::redirect('dashboard.php');
    } else {
        OX_Admin_Redirect::redirect('advertiser-index.php');
    }
}
if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
    OX_Admin_Redirect::redirect('stats.php?entity=advertiser&breakdown=history&clientid=' . OA_Permission::getEntityId());
}
if (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
    OX_Admin_Redirect::redirect('stats.php?entity=affiliate&breakdown=history&affiliateid=' . OA_Permission::getEntityId());
}
        case '4-1':
            OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN);
            $message = 'Dynamic submenu 4-1';
            $menu = 'demo-menu-4';
            // PageHeader function needs to know the *parent* menu
            setCurrentLeftMenuSubItem('demo-menu-4-1');
            break;
        case '4-2':
            OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN);
            $message = 'Dynamic submenu 4-2';
            $menu = 'demo-menu-4';
            // PageHeader function needs to know the *parent* menu
            setCurrentLeftMenuSubItem('demo-menu-4-2');
            break;
    }
    $colour = $GLOBALS['_MAX']['PREF']['demoUserInterface_demopref_' . OA_Permission::getAccountType(true)];
    //$image   = 'demoUI'.$i.'.jpg';
    $message = $message;
    addLeftMenuSubItem('demo-menu-4-1', 'demo submenu 4-1', 'plugins/demoUserInterface/demoUI-page.php?action=4-1');
    addLeftMenuSubItem('demo-menu-4-2', 'demo submenu 4-2', 'plugins/demoUserInterface/demoUI-page.php?action=4-2');
    phpAds_PageHeader($menu, '', '../../');
    $oTpl = new OA_Plugin_Template('demoUI.html', 'demoUserInterface');
    //$oTpl->assign('image',$image);
    $oTpl->assign('message', $message);
    $oTpl->assign('colour', $colour);
    $oTpl->display();
    phpAds_PageFooter();
} else {
    require_once LIB_PATH . '/Admin/Redirect.php';
    OX_Admin_Redirect::redirect('plugins/demoUserInterface/demoUI-index.php');
}
            if (method_exists($oPlugin, 'validate')) {
                $aErrormessage = array();
                $valid = $oPlugin->validate($aErrormessage);
            }
        }
    }
    if ($valid) {
        // Create a new settings object, and save the settings!
        $result = OA_Preferences::processPreferencesFromForm($aElements, $aCheckboxes);
        if ($result) {
            // Queue confirmation message
            $title = $group . ' ' . $GLOBALS['strPluginPreferences'];
            $translation = new OX_Translation();
            $translated_message = $translation->translate($GLOBALS['strXPreferencesHaveBeenUpdated'], array(htmlspecialchars($title)));
            OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
            OX_Admin_Redirect::redirect('account-preferences-plugin.php?group=' . $group);
        }
        // Could not write the settings configuration file, store this
        // error message and continue
        $aErrormessage[0][] = $strUnableToWritePrefs;
    }
}
// Display the preference page's header and sections
phpAds_PageHeader("account-preferences-index");
// Set the correct section of the preference pages and display the drop-down menu
$oOptions->selection($group);
// Prepare an array of HTML elements to display for the form, and
// output using the $oOption object
foreach ($aGroup['preferences'] as $k => $v) {
    $aPreferences[0]['text'] = $group . ($disabled ? ' - the Administrator has disabled this plugin, you may only change preferences when it is enabled.' : '');
    $aPreferences[0]['items'][] = array('type' => $v['type'], 'name' => $group . '_' . $v['name'], 'text' => $v['label'], 'req' => $v['required'], 'size' => $v['size'], 'value' => $v['value'], 'visible' => $v['visible'], 'disabled' => $disabled);
$aErrormessage = array();
// If the settings page is a submission, deal with the form data
if (isset($_POST['submitok']) && $_POST['submitok'] == 'true') {
    // Prepare an array of the HTML elements to process, and which
    // of the preferences are checkboxes
    $aElements = array();
    $aCheckboxes = array();
    // Tracker
    $aElements[] = 'tracker_default_status';
    $aElements[] = 'tracker_default_type';
    $aElements[] = 'tracker_link_campaigns';
    $aCheckboxes['tracker_link_campaigns'] = true;
    // Save the preferences
    $result = OA_Preferences::processPreferencesFromForm($aElements, $aCheckboxes);
    if ($result) {
        OX_Admin_Redirect::redirect('account-preferences-tracker.php');
    }
    // Could not write the preferences to the database, store this
    // error message and continue
    $aErrormessage[0][] = $strUnableToWritePrefs;
}
// Display the settings page's header and sections
phpAds_PageHeader("account-preferences-index");
// Set the correct section of the preference pages and display the drop-down menu
$oOptions->selection("tracker");
// Get the details of possible tracker statuses
$aStatuses = array();
foreach ($GLOBALS['_MAX']['STATUSES'] as $statusId => $statusName) {
    $aStatuses[$statusId] = $GLOBALS[$statusName];
}
// Get the details of possible tracker types
    $aElements[] = 'warn_email_manager_day_limit';
    // Advertiser email Warnings
    $aElements[] = 'warn_email_advertiser';
    $aCheckboxes['warn_email_advertiser'] = true;
    $aElements[] = 'warn_email_advertiser_impression_limit';
    $aElements[] = 'warn_email_advertiser_day_limit';
    // Save the preferences
    $result = OA_Preferences::processPreferencesFromForm($aElements, $aCheckboxes);
    if ($result) {
        // Queue confirmation message
        $setPref = $oOptions->getSettingsPreferences($prefSection);
        $title = $setPref[$prefSection]['name'];
        $translation = new OX_Translation();
        $translated_message = $translation->translate($GLOBALS['strXPreferencesHaveBeenUpdated'], array(htmlspecialchars($title)));
        OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
        OX_Admin_Redirect::redirect(basename($_SERVER['PHP_SELF']));
    }
    // Could not write the preferences to the database, store this
    // error message and continue
    $aErrormessage[0][] = $strUnableToWritePrefs;
}
// Set the correct section of the preference pages and display the drop-down menu
$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-preferences-index', $oHeaderModel);
// Prepare an array of HTML elements to display for the form, and
// output using the $oOption object
$aSettings = array(array('text' => $strAdminEmailWarnings, 'items' => array(array('type' => 'checkbox', 'name' => 'warn_email_admin', 'text' => $strWarnAdmin), array('type' => 'break'), array('type' => 'text', 'name' => 'warn_email_admin_impression_limit', 'text' => $strWarnLimit, 'size' => 12, 'depends' => 'warn_email_admin==true', 'req' => true, 'check' => 'wholeNumber'), array('type' => 'break'), array('type' => 'text', 'name' => 'warn_email_admin_day_limit', 'text' => $strWarnLimitDays, 'size' => 12, 'depends' => 'warn_email_admin==true', 'req' => true, 'check' => 'wholeNumber'))), array('text' => $strAgencyEmailWarnings, 'items' => array(array('type' => 'checkbox', 'name' => 'warn_email_manager', 'text' => $strWarnAgency), array('type' => 'break'), array('type' => 'text', 'name' => 'warn_email_manager_impression_limit', 'text' => $strWarnLimit, 'size' => 12, 'depends' => 'warn_email_manager==true', 'req' => true, 'check' => 'wholeNumber'), array('type' => 'break'), array('type' => 'text', 'name' => 'warn_email_manager_day_limit', 'text' => $strWarnLimitDays, 'size' => 12, 'depends' => 'warn_email_manager==true', 'req' => true, 'check' => 'wholeNumber'))), array('text' => $strAdveEmailWarnings, 'items' => array(array('type' => 'checkbox', 'name' => 'warn_email_advertiser', 'text' => $strWarnClient), array('type' => 'break'), array('type' => 'text', 'name' => 'warn_email_advertiser_impression_limit', 'text' => $strWarnLimit, 'size' => 12, 'depends' => 'warn_email_advertiser==true', 'req' => true, 'check' => 'wholeNumber'), array('type' => 'break'), array('type' => 'text', 'name' => 'warn_email_advertiser_day_limit', 'text' => $strWarnLimitDays, 'size' => 12, 'depends' => 'warn_email_advertiser==true', 'req' => true, 'check' => 'wholeNumber'))));
$oOptions->show($aSettings, $aErrormessage);
 public function uptodateAction()
 {
     $this->finalizeInstallation();
     if ($this->getRequest()->isPost()) {
         $this->resetInstaller();
         require_once LIB_PATH . '/Admin/Redirect.php';
         OX_Admin_Redirect::redirect('advertiser-index.php');
     }
 }
                $valid = $oPlugin->validate($aErrormessage);
            }
        }
    }
    if ($valid) {
        // Create a new preferences object, and save the preferences!
        $result = OA_Preferences::processPreferencesFromForm($aElements, $aCheckboxes);
        if ($result) {
            // Queue confirmation message
            $title = $group . ' ' . $GLOBALS['strPluginPreferences'];
            $translation = new OX_Translation();
            $translated_message = $translation->translate($GLOBALS['strXPreferencesHaveBeenUpdated'], array(htmlspecialchars($title)));
            OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
            // The settings configuration file was written correctly,
            // go back to the plugins main page from here
            OX_Admin_Redirect::redirect($backURL);
        }
        // Could not write the settings configuration file, store this
        // error message and continue
        $aErrormessage[0][] = $strUnableToWritePrefs;
    }
}
// Set the correct section of the settings pages and display the drop-down menu
//$oOptions->selection('email');
// Prepare an array of HTML elements to display for the form, and
// output using the $oOption object
$aPreferences[0]['text'] = $group . ' ' . $strPreferences;
$count = count($aConfig['preferences']);
$i = 0;
foreach ($aConfig['preferences'] as $k => $v) {
    $aPreferences[0]['items'][] = array('type' => $v['type'], 'name' => $group . '_' . $v['name'], 'text' => $v['label'], 'req' => $v['required'], 'size' => $v['size'], 'value' => $v['value'], 'visible' => $v['visible']);
Example #19
0
                     $oTpl = new OA_Admin_Template('plugin-group-view.html');
                     $aGroupInfo = $oComponentGroupManager->getComponentGroupInfo($group);
                     $aGroupInfo['pluginGroupComponents'] = $oComponentGroupManager->getComponentGroupObjectsInfo($aGroupInfo['extends'], $group);
                     $oTpl->assign('aPlugin', $aGroupInfo);
                     $oTpl->assign('parent', $parent);
                     $oTpl->assign('backURL', MAX::constructURL(MAX_URL_ADMIN, "plugin-index.php?action=info&package={$parent}"));
                 }
             }
         } else {
             if ('settings' == $action) {
                 require_once LIB_PATH . '/Admin/Redirect.php';
                 OX_Admin_Redirect::redirect("plugin-settings.php?group={$group}&parent={$parent}");
             } else {
                 if ('preferences' == $action) {
                     require_once LIB_PATH . '/Admin/Redirect.php';
                     OX_Admin_Redirect::redirect("plugin-preferences.php?group={$group}&parent={$parent}");
                 } else {
                     if (array_key_exists('checkdb', $_GET)) {
                         $aInfo = $oComponentGroupManager->getComponentGroupInfo($_GET['checkdb']);
                         $aSchema = $oComponentGroupManager->checkDatabase($_GET['checkdb'], $aInfo);
                         $oTpl = new OA_Admin_Template('plugin-group-index.html');
                         $oTpl->assign('parent', $_GET['parent']);
                         $oTpl->assign('parenturl', MAX::constructURL(MAX_URL_ADMIN, "plugin-index.php?info={$_GET['parent']}&package=true"));
                         $oTpl->assign('aHeader', $aInfo);
                         $oTpl->assign('aPluginDB', $aSchema);
                     }
                 }
             }
         }
     }
 }
function processForm($aAdvertiser, $form)
{
    $aFields = $form->exportValues();
    // Name
    if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
        $aAdvertiser['clientname'] = $aFields['clientname'];
    }
    // Default fields
    $aAdvertiser['contact'] = $aFields['contact'];
    $aAdvertiser['email'] = $aFields['email'];
    $aAdvertiser['comments'] = $aFields['comments'];
    // Same advertiser limitation
    $aAdvertiser['advertiser_limitation'] = $aFields['advertiser_limitation'] == '1' ? 1 : 0;
    // Reports
    $aAdvertiser['report'] = $aFields['report'] == 't' ? 't' : 'f';
    $aAdvertiser['reportdeactivate'] = $aFields['reportdeactivate'] == 't' ? 't' : 'f';
    $aAdvertiser['reportinterval'] = (int) $aFields['reportinterval'];
    if ($aAdvertiser['reportinterval'] == 0) {
        $aAdvertiser['reportinterval'] = 1;
    }
    if ($aFields['reportlastdate'] == '' || $aFields['reportlastdate'] == '0000-00-00' || $aFields['reportprevious'] != $aAdvertiser['report']) {
        $aAdvertiser['reportlastdate'] = date("Y-m-d");
    }
    if (empty($aAdvertiser['clientid'])) {
        // Set agency ID
        $aAdvertiser['agencyid'] = OA_Permission::getAgencyId();
        $doClients = OA_Dal::factoryDO('clients');
        $doClients->setFrom($aAdvertiser);
        $doClients->updated = OA::getNow();
        // Insert
        $aAdvertiser['clientid'] = $doClients->insert();
        // Queue confirmation message
        $translation = new OX_Translation();
        $translated_message = $translation->translate($GLOBALS['strAdvertiserHasBeenAdded'], array(MAX::constructURL(MAX_URL_ADMIN, 'advertiser-edit.php?clientid=' . $aAdvertiser['clientid']), htmlspecialchars($aAdvertiser['clientname']), MAX::constructURL(MAX_URL_ADMIN, 'campaign-edit.php?clientid=' . $aAdvertiser['clientid'])));
        OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
        // Go to next page
        OX_Admin_Redirect::redirect("advertiser-index.php");
    } else {
        $doClients = OA_Dal::factoryDO('clients');
        $doClients->get($aAdvertiser['clientid']);
        $doClients->setFrom($aAdvertiser);
        $doClients->updated = OA::getNow();
        $doClients->update();
        // Queue confirmation message
        $translation = new OX_Translation();
        $translated_message = $translation->translate($GLOBALS['strAdvertiserHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, 'advertiser-edit.php?clientid=' . $aAdvertiser['clientid']), htmlspecialchars($aAdvertiser['clientname'])));
        OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
        OX_Admin_Redirect::redirect('advertiser-edit.php?clientid=' . $aAdvertiser['clientid']);
    }
    exit;
}
<?php

/*
+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once LIB_PATH . '/Admin/Redirect.php';
// Redirect to the appropriate "My Account" page
OX_Admin_Redirect::redirect('account-user-index.php');
        if (!isset($aCampaigns[$campaignid])) {
            $page = basename($_SERVER['SCRIPT_NAME']);
            OX_Admin_Redirect::redirect("{$page}?clientid={$clientid}");
        }
    }
}
$agencyId = OA_Permission::getAgencyId();
$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) {
    OX_Admin_Redirect::redirect("campaign-banners.php?clientid={$clientid}&campaignid={$campaignid}");
}
$pageName = 'campaign-banners';
$tabindex = 1;
$aEntities = array('clientid' => $clientid, 'campaignid' => $campaignid);
$oTrans = new OX_Translation();
$oHeaderModel = buildHeaderModel($aEntities);
phpAds_PageHeader('advertiser-campaigns', $oHeaderModel);
if (!isset($hideinactive)) {
    if (isset($session['prefs']['campaign-banners.php'][$campaignid]['hideinactive'])) {
        $hideinactive = $session['prefs']['campaign-banners.php'][$campaignid]['hideinactive'];
    } else {
        $pref =& $GLOBALS['_MAX']['PREF'];
        $hideinactive = $pref['ui_hide_inactive'] == true;
    }
}
 /**
  * Display an entire page with the password recovery form.
  *
  * This method, combined with handleGet allows semantic, REST-style
  * actions.
  */
 function handlePost($vars)
 {
     $this->pageHeader();
     if (empty($vars['id'])) {
         if (empty($vars['email'])) {
             $this->displayRecoveryRequestForm($GLOBALS['strEmailRequired']);
         } else {
             $sent = $this->sendRecoveryEmail(stripslashes($vars['email']));
             if ($sent) {
                 $this->displayMessage($GLOBALS['strNotifyPageMessage']);
             } else {
                 $this->displayRecoveryRequestForm($GLOBALS['strPwdRecEmailNotFound']);
             }
         }
     } else {
         if (empty($vars['newpassword']) || empty($vars['newpassword2']) || $vars['newpassword'] != $vars['newpassword2']) {
             $this->displayRecoveryResetForm($vars['id'], $GLOBALS['strNotSamePasswords']);
         } elseif ($this->_dal->checkRecoveryId($vars['id'])) {
             $userId = $this->_dal->saveNewPasswordAndLogin($vars['id'], stripslashes($vars['newpassword']));
             OX_Admin_Redirect::redirect();
         } else {
             $this->displayRecoveryRequestForm($GLOBALS['strPwdRecWrongId']);
         }
     }
     $this->pageFooter();
 }
Example #24
0
                $aFields = array('campaignid', 'trackerid', 'status');
                $values = array($campaignid, $trackerids[$i], $statusids[$i]);
                $fieldsSize = count($aFields);
                $doCampaigns_trackers = OA_Dal::factoryDO('campaigns_trackers');
                for ($k = 0; $k < $fieldsSize; $k++) {
                    $field = $aFields[$k];
                    $doCampaigns_trackers->{$field} = $values[$k];
                }
                $doCampaigns_trackers->insert();
            }
        }
        // Queue confirmation message
        $translation = new OX_Translation();
        $translated_message = $translation->translate($GLOBALS['strCampaignTrackersHaveBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, "campaign-edit.php?clientid=" . $clientid . "&campaignid=" . $campaignid), htmlspecialchars($doCampaigns->campaignname)));
        OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
        OX_Admin_Redirect::redirect("campaign-trackers.php?clientid=" . $clientid . "&campaignid=" . $campaignid);
    }
}
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
if (!isset($listorder)) {
    if (isset($session['prefs']['campaign-trackers.php']['listorder'])) {
        $listorder = $session['prefs']['campaign-trackers.php']['listorder'];
    } else {
        $listorder = '';
    }
}
if (!isset($orderdirection)) {
    if (isset($session['prefs']['campaign-trackers.php']['orderdirection'])) {
        $orderdirection = $session['prefs']['campaign-trackers.php']['orderdirection'];
function processForm($affiliateid, $form, $oComponent)
{
    $aFields = $form->exportValues();
    $newWebsite = empty($aFields['affiliateid']);
    // Setup a new publisher object and set the fields passed in from the form:
    $oPublisher = new OA_Dll_PublisherInfo();
    $oPublisher->agencyId = $aFields['agencyid'];
    $oPublisher->contactName = $aFields['contact'];
    $oPublisher->emailAddress = $aFields['email'];
    $oPublisher->publisherId = $aFields['affiliateid'];
    $oPublisher->publisherName = $aFields['name'];
    $oPublisher->website = $aFields['website'];
    // process form data for oxThorium if this is edit existing website
    if (!$newWebsite && $oComponent) {
        $aFields['affiliateid'] = $oPublisher->publisherId;
        $oComponent->processAffiliateForm($aFields);
    }
    $oPublisherDll = new OA_Dll_Publisher();
    if ($oPublisherDll->modify($oPublisher) && !$oPublisherDll->_noticeMessage) {
        // Queue confirmation message
        $translation = new OX_Translation();
        if ($newWebsite) {
            //process form data for oxThorium for new website
            if ($oComponent) {
                $aFields['affiliateid'] = $oPublisher->publisherId;
                $oComponent->processAffiliateForm($aFields);
            }
            $translated_message = $translation->translate($GLOBALS['strWebsiteHasBeenAdded'], array(MAX::constructURL(MAX_URL_ADMIN, 'affiliate-edit.php?affiliateid=' . $oPublisher->publisherId), htmlspecialchars($oPublisher->publisherName), MAX::constructURL(MAX_URL_ADMIN, 'zone-edit.php?affiliateid=' . $oPublisher->publisherId)));
            OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
            $redirectURL = "website-index.php";
        } else {
            $translated_message = $translation->translate($GLOBALS['strWebsiteHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, 'affiliate-edit.php?affiliateid=' . $oPublisher->publisherId), htmlspecialchars($oPublisher->publisherName)));
            $redirectURL = "affiliate-edit.php?affiliateid={$oPublisher->publisherId}";
        }
        OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
        OX_Admin_Redirect::redirect($redirectURL);
    }
    return $oPublisherDll;
}
Example #26
0
 /**
  * Redirect to the parent page (if exists) or to the start page if account
  * has been switched manually
  *
  */
 public static function redirectIfManualAccountSwitch()
 {
     if (self::isManualAccountSwitch()) {
         require_once LIB_PATH . '/Admin/Redirect.php';
         OX_Admin_Redirect::redirect(null, true);
     }
 }
Example #27
0
function processForm($form)
{
    $aFields = $form->exportValues();
    if (empty($aFields['affiliateid'])) {
        $aFields['affiliateid'] = 0;
    }
    if ($aFields['channelid']) {
        $doChannel = OA_Dal::factoryDO('channel');
        $doChannel->get($aFields['channelid']);
        $doChannel->name = $aFields['name'];
        $doChannel->description = $aFields['description'];
        $doChannel->comments = $aFields['comments'];
        $ret = $doChannel->update();
        // Queue confirmation message
        $translation = new OX_Translation();
        $channelURL = "channel-edit.php?" . (empty($aFields['affiliateid']) ? "agencyid=" . $aFields['agencyid'] . "&channelid=" . $aFields['channelid'] : "affiliateid=" . $aFields['affiliateid'] . "&channelid=" . $aFields['channelid']);
        $translated_message = $translation->translate($GLOBALS['strChannelHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, $channelURL), htmlspecialchars($aFields['name'])));
        OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
        if (!empty($aFields['affiliateid'])) {
            header("Location: channel-edit.php?affiliateid=" . $aFields['affiliateid'] . "&channelid=" . $aFields['channelid']);
        } else {
            header("Location: channel-edit.php?agencyid=" . $aFields['agencyid'] . "&channelid=" . $aFields['channelid']);
        }
        exit;
    } else {
        $doChannel = OA_Dal::factoryDO('channel');
        $doChannel->agencyid = $aFields['agencyid'];
        $doChannel->affiliateid = $aFields['affiliateid'];
        $doChannel->name = $aFields['name'];
        $doChannel->description = $aFields['description'];
        $doChannel->comments = $aFields['comments'];
        $doChannel->compiledlimitation = 'true';
        $doChannel->acl_plugins = 'true';
        $doChannel->active = 1;
        $aFields['channelid'] = $doChannel->insert();
        // Queue confirmation message
        $translation = new OX_Translation();
        $translated_message = $translation->translate($GLOBALS['strChannelHasBeenAdded'], array(MAX::constructURL(MAX_URL_ADMIN, 'channel-edit.php?affiliateid=' . $aFields['affiliateid'] . '&channelid=' . $aFields['channelid']), htmlspecialchars($aFields['name']), MAX::constructURL(MAX_URL_ADMIN, 'channel-acl.php?affiliateid=' . $aFields['affiliateid'] . '&channelid=' . $aFields['channelid'])));
        OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
        if (!empty($aFields['affiliateid'])) {
            OX_Admin_Redirect::redirect("affiliate-channels.php?affiliateid=" . $aFields['affiliateid']);
        } else {
            OX_Admin_Redirect::redirect("channel-index.php");
        }
    }
}
<?php

/*
+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once LIB_PATH . '/Admin/Redirect.php';
// Redirect to the main "Preferences" page
OX_Admin_Redirect::redirect('account-user-name-language.php');
        $result = $oPlugin->changePassword($doUsers, $pw, $pwold);
        if (PEAR::isError($result)) {
            $aErrormessage[0][] = $result->getMessage();
        }
    }
    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
| the Free Software Foundation; either version 2 of the License, or         |
| (at your option) any later version.                                       |
|                                                                           |
| This program is distributed in the hope that it will be useful,           |
| but WITHOUT ANY WARRANTY; without even the implied warranty of            |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             |
| GNU General Public License for more details.                              |
|                                                                           |
| You should have received a copy of the GNU General Public License         |
| along with this program; if not, write to the Free Software               |
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA |
+---------------------------------------------------------------------------+
$Id: maintenance-priority-calculate.php 37157 2009-05-28 12:31:10Z andrew.hill $
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/lib/OA/Maintenance/Priority.php';
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN);
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
// Run the Maintenance Priority Engine process
OA_Maintenance_Priority::run();
// Rebuild cache
// include_once MAX_PATH . '/lib/max/deliverycache/cache-'.$conf['delivery']['cache'].'.inc.php';
// phpAds_cacheDelete();
OX_Admin_Redirect::redirect('maintenance-priority.php');