Example #1
0
 function initRequest()
 {
     $this->request = phpAds_registerGlobalUnslashed('userid', 'login', 'passwd', 'passwd2', 'link', 'contact_name', 'email_address', 'permissions', 'submit', 'language');
     // Sanitize userid
     if (!empty($this->request['userid'])) {
         $this->request['userid'] = (int) $this->request['userid'];
     }
     $this->userid = $this->request['userid'];
     if (isset($this->request['permissions'])) {
         $this->aPermissions = $this->request['permissions'];
     }
 }
 public static function createTemplateWithModel($panel, $single = true)
 {
     $agencyId = OA_Permission::getAgencyId();
     $oDalZones = OA_Dal::factoryDAL('zones');
     $infix = $single ? '' : '-' . $panel;
     phpAds_registerGlobalUnslashed('action', 'campaignid', 'clientid', "text{$infix}", "page{$infix}");
     $campaignId = $GLOBALS['campaignid'];
     $text = $GLOBALS["text{$infix}"];
     $linked = $panel == 'linked';
     $showStats = empty($GLOBALS['_MAX']['CONF']['ui']['zoneLinkingStatistics']) ? false : true;
     $websites = $oDalZones->getWebsitesAndZonesList($agencyId, $campaignId, $linked, $text);
     $matchingZones = 0;
     foreach ($websites as $aWebsite) {
         $matchingZones += count($aWebsite['zones']);
     }
     $aZonesCounts = array('all' => $oDalZones->countZones($agencyId, null, $campaignId, $linked), 'matching' => $matchingZones);
     $pagerFileName = 'campaign-zone-zones.php';
     $pagerParams = array('clientid' => $GLOBALS['clientid'], 'campaignid' => $GLOBALS['campaignid'], 'status' => $panel, 'text' => $text);
     $currentPage = null;
     if (!$single) {
         $currentPage = $GLOBALS["page{$infix}"];
     }
     $oTpl = new OA_Admin_Template('campaign-zone-zones.html');
     $oPager = OX_buildPager($websites, self::WEBSITES_PER_PAGE, true, 'websites', 2, $currentPage, $pagerFileName, $pagerParams);
     $oTopPager = OX_buildPager($websites, self::WEBSITES_PER_PAGE, false, 'websites', 2, $currentPage, $pagerFileName, $pagerParams);
     list($itemsFrom, $itemsTo) = $oPager->getOffsetByPageId();
     $websites = array_slice($websites, $itemsFrom - 1, self::WEBSITES_PER_PAGE, true);
     // Add statistics for the displayed zones if required
     if ($showStats) {
         $oDalZones->mergeStatistics($websites, $campaignId);
     }
     // Count how many zone are displayed
     $showingCount = 0;
     foreach ($websites as $website) {
         $showingCount += count($website['zones']);
     }
     $aZonesCounts['showing'] = $showingCount;
     $oTpl->assign('pager', $oPager);
     $oTpl->assign('topPager', $oTopPager);
     $oTpl->assign('websites', $websites);
     $oTpl->assign('zonescounts', $aZonesCounts);
     $oTpl->assign('text', $text);
     $oTpl->assign('status', $panel);
     $oTpl->assign('page', $oTopPager->getCurrentPageID());
     $oTpl->assign('showStats', $showStats);
     $oTpl->assign('colspan', $showStats ? 6 : 3);
     return $oTpl;
 }
Example #3
0
 public static function createTemplateWithModel($panel, $single = true)
 {
     $agencyId = OA_Permission::getAgencyId();
     $oDalZones = OA_Dal::factoryDAL('zones');
     $infix = $single ? '' : '-' . $panel;
     phpAds_registerGlobalUnslashed('action', 'campaignid', 'clientid', "category{$infix}", "category{$infix}-text", "text{$infix}", "page{$infix}");
     $campaignId = $GLOBALS['campaignid'];
     $category = $GLOBALS["category{$infix}"];
     $categoryText = $GLOBALS["category{$infix}-text"];
     $text = $GLOBALS["text{$infix}"];
     $linked = $panel == 'linked';
     $websites = $oDalZones->getWebsitesAndZonesListByCategory($agencyId, $category, $campaignId, $linked, $text);
     $pagerFileName = 'campaign-zone-zones.php';
     $pagerParams = array('clientid' => $GLOBALS['clientid'], 'campaignid' => $GLOBALS['campaignid'], 'status' => $panel, 'category' => $category, 'category-text' => $categoryText, 'text' => $text);
     $currentPage = null;
     if (!$single) {
         $currentPage = $GLOBALS["page{$infix}"];
     }
     $oTpl = new OA_Admin_Template('campaign-zone-zones.html');
     $oPager = OX_buildPager($websites, self::WEBSITES_PER_PAGE, true, 'websites', 2, $currentPage, $pagerFileName, $pagerParams);
     $oTopPager = OX_buildPager($websites, self::WEBSITES_PER_PAGE, false, 'websites', 2, $currentPage, $pagerFileName, $pagerParams);
     list($itemsFrom, $itemsTo) = $oPager->getOffsetByPageId();
     $websites = array_slice($websites, $itemsFrom - 1, self::WEBSITES_PER_PAGE, true);
     $aZonesCounts = array('all' => $oDalZones->countZones($agencyId, null, $campaignId, $linked), 'matching' => $oDalZones->countZones($agencyId, $category, $campaignId, $linked, $text));
     $showingCount = 0;
     // TODO: currently we're calculating the number in PHP code. Once
     // MAX_Dal_Admin_Zones::countZones() supports the limit parameter, we can remove
     // the code below and use the dal.
     foreach ($websites as $website) {
         $showingCount += count($website['zones']);
     }
     $aZonesCounts['showing'] = $showingCount;
     $oTpl->assign('pager', $oPager);
     $oTpl->assign('topPager', $oTopPager);
     $oTpl->assign('websites', $websites);
     $oTpl->assign('zonescounts', $aZonesCounts);
     $oTpl->assign('category', $categoryText);
     $oTpl->assign('text', $text);
     $oTpl->assign('status', $panel);
     $oTpl->assign('page', $oTopPager->getCurrentPageID());
     return $oTpl;
 }
Example #4
0
|                                                                           |
| 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: channel-edit.php 37157 2009-05-28 12:31:10Z andrew.hill $
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/lib/max/other/html.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/component/Form.php';
// Register input variables
phpAds_registerGlobalUnslashed('name', 'description', 'comments', 'affiliateid', 'agencyid', 'channelid');
/*-------------------------------------------------------*/
/* Affiliate interface security                          */
/*-------------------------------------------------------*/
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
OA_Permission::enforceAccessToObject('channel', $channelid, true);
// Initalise data
$doChannel = OA_Dal::factoryDO('channel');
if (!empty($channelid)) {
    $doChannel->get($channelid);
    $channel = $doChannel->toArray();
} else {
    //for new channels set affiliate id (if any)
    if (!empty($affiliateid)) {
        OA_Permission::enforceAccessToObject('affiliates', $affiliateid);
        $channel['affiliateid'] = $affiliateid;
*/
// Require the initialisation file
require_once '../../init.php';
require_once MAX_PATH . '/lib/OX/Util/Utils.php';
// Required files
require_once MAX_PATH . '/www/admin/lib-maintenance-priority.inc.php';
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/lib/OA/Dll.php';
require_once MAX_PATH . '/lib/max/Dal/DataObjects/Campaigns.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/lib/OA/Permission.php';
require_once MAX_PATH . '/lib/pear/Date.php';
require_once MAX_PATH . '/lib/max/other/html.php';
require_once MAX_PATH . '/lib/OX/Admin/UI/ViewHooks.php';
phpAds_registerGlobalUnslashed('hideinactive', 'listorder', 'orderdirection');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER);
if (!empty($clientid) && !OA_Permission::hasAccessToObject('clients', $clientid, OA_Permission::OPERATION_VIEW)) {
    //check if can see given advertiser
    $page = basename($_SERVER['SCRIPT_NAME']);
    OX_Admin_Redirect::redirect($page);
}
/*-------------------------------------------------------*/
/* Init data                                             */
/*-------------------------------------------------------*/
//get advertisers and set the current one
$aAdvertisers = getAdvertiserMap();
if (empty($clientid)) {
    //if it's empty
    if ($session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['clientid']) {
Example #6
0
| 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: affiliate-edit.php 12839 2007-11-27 16:32:39Z bernard.lange@openads.org $
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/www/admin/config.php';
// Register input variables
// TODO: This variable has been added to demonstrate that clicking on
// links from error messages could bring the already entered e-mail address
// to the new form. Feel free to keep it or remove, depending on the
// implementation strategy.
phpAds_registerGlobalUnslashed('email');
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageHeader("4.1.3.4.7.2");
// TODO: The path here should probably start with the advertiser's data
// Not sure if we need to include the campaign and banner in the path though.
// We'll need to clarify this with the Product team.
echo "<img src='" . OX::assetPath() . "/images/icon-affiliate.gif' align='absmiddle'>&nbsp;<b>Create AdSense Account</b><br /><br /><br />";
phpAds_ShowSections(array("4.1.3.4.7.2"));
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
$oTpl = new OA_Admin_Template('adsense-create.html');
$oTpl->assign('fields', array(array('title' => 'Email address for AdSense Account', 'fields' => array(array('name' => 'email', 'label' => 'Email', 'value' => '', 'id' => 'adsenseemail', 'title' => 'Provide valid email', 'clientValid' => 'required:true,email:true'))), array('title' => 'Name for the AdSense Account in Openads', 'fields' => array(array('name' => 'name', 'label' => 'Name for the AdSense Account in Openads', 'value' => '', 'id' => 'accountname', 'title' => 'Provide name in Openads', 'clientValid' => 'required:true')))));
require_once MAX_PATH . '/lib/OA/Admin/UI/UserAccess.php';
require_once MAX_PATH . '/lib/max/Admin/Languages.php';
require_once MAX_PATH . '/lib/max/Plugin/Translation.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/lib/max/Admin/Languages.php';
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER);
// Create a new option object for displaying the setting's page's HTML form
$oOptions = new OA_Admin_Option('user');
$prefSection = "name-language";
// Prepare an array for storing error messages
$aErrormessage = array();
// If the settings page is a submission, deal with the form data
if (isset($_POST['submitok']) && $_POST['submitok'] == 'true') {
    // Register input variables
    phpAds_registerGlobalUnslashed('contact_name', 'language');
    // Get the DB_DataObject for the current user
    $doUsers = OA_Dal::factoryDO('users');
    $doUsers->get(OA_Permission::getUserId());
    // Get the current authentication plugin instance
    $oPlugin = OA_Auth::staticGetAuthPlugin();
    if (isset($contact_name)) {
        $doUsers->contact_name = $contact_name;
    }
    if (isset($language)) {
        $doUsers->language = $language;
    }
    if (!count($aErrormessage)) {
        if ($doUsers->update() === false) {
            // Unable to update the preferences
            $aErrormessage[0][] = $strUnableToWritePrefs;
// Required files
require_once MAX_PATH . '/lib/OA/Admin/Option.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/UserAccess.php';
require_once MAX_PATH . '/lib/RV/Admin/Languages.php';
require_once MAX_PATH . '/lib/max/Plugin/Translation.php';
require_once MAX_PATH . '/www/admin/config.php';
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER);
// Create a new option object for displaying the setting's page's HTML form
$oOptions = new OA_Admin_Option('user');
// Prepare an array for storing error messages
$aErrormessage = array();
// If the settings page is a submission, deal with the form data
if (isset($_POST['submitok']) && $_POST['submitok'] == 'true') {
    // Register input variables
    phpAds_registerGlobalUnslashed('pw', 'email_address');
    OA_Permission::checkSessionToken();
    // Get the DB_DataObject for the current user
    $doUsers = OA_Dal::factoryDO('users');
    $doUsers->get(OA_Permission::getUserId());
    // Set defaults
    $changeEmail = isset($email_address);
    // Get the current authentication plugin instance
    $oPlugin = OA_Auth::staticGetAuthPlugin();
    // Check password
    if (!isset($pw) || !$oPlugin->checkPassword(OA_Permission::getUsername(), $pw)) {
        $aErrormessage[0][] = $GLOBALS['strPasswordWrong'];
    }
    if (isset($pw) && strlen($pw)) {
        if (!strlen($pw) || strstr("\\", $pw)) {
            $aErrormessage[0][] = $GLOBALS['strInvalidPassword'];
Example #9
0
| 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: website-index.php 37157 2009-05-28 12:31:10Z andrew.hill $
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/www/admin/config.php';
// Register input variables
phpAds_registerGlobalUnslashed('hideinactive', 'listorder', 'orderdirection', 'pubid', 'url', 'country', 'language', 'category', 'adnetworks', 'advsignup', 'formId');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageHeader(null, buildHeaderModel());
/*-------------------------------------------------------*/
/* Get preferences                                       */
/*-------------------------------------------------------*/
if (!isset($listorder)) {
    if (isset($session['prefs']['website-index.php']['listorder'])) {
        $listorder = $session['prefs']['website-index.php']['listorder'];
    } else {
        $listorder = '';
    }
Example #10
0
    phpAds_Die($GLOBALS['strErrorDatabaseConnetion'], $translated_message);
}
// First thing to do is clear the $session variable to
// prevent users from pretending to be logged in.
unset($session);
// Authorize the user
OA_Start();
// Load the account's preferences
OA_Preferences::loadPreferences();
$pref = $GLOBALS['_MAX']['PREF'];
// Set time zone to local
OA_setTimeZoneLocal();
// Load the required language files
Language_Loader::load('default');
// Register variables
phpAds_registerGlobalUnslashed('affiliateid', 'agencyid', 'bannerid', 'campaignid', 'channelid', 'clientid', 'day', 'trackerid', 'userlogid', 'zoneid');
if (!isset($affiliateid)) {
    $affiliateid = OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER) ? OA_Permission::getEntityId() : '';
}
if (!isset($agencyid)) {
    $agencyid = OA_Permission::isAccount(OA_ACCOUNT_ADMIN) ? '' : OA_Permission::getAgencyId();
}
if (!isset($bannerid)) {
    $bannerid = '';
}
if (!isset($campaignid)) {
    $campaignid = '';
}
if (!isset($channelid)) {
    $channelid = '';
}
Example #11
0
$Id: banner-acl.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/lib-maintenance-priority.inc.php';
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/lib/max/other/html.php';
require_once MAX_PATH . '/lib/max/Plugin.php';
require_once MAX_PATH . '/lib/max/other/lib-acl.inc.php';
require_once MAX_PATH . '/lib/max/Delivery/cache.php';
require_once MAX_PATH . '/lib/max/other/capping/lib-capping.inc.php';
// Register input variables
phpAds_registerGlobalUnslashed('acl', 'action', 'submit');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
OA_Permission::enforceAccessToObject('clients', $clientid);
OA_Permission::enforceAccessToObject('campaigns', $campaignid);
OA_Permission::enforceAccessToObject('banners', $bannerid);
/*-------------------------------------------------------*/
/* Store preferences									 */
/*-------------------------------------------------------*/
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['clientid'] = $clientid;
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['campaignid'][$clientid] = $campaignid;
phpAds_SessionDataStore();
// Initialise some parameters
$pageName = basename($_SERVER['PHP_SELF']);
$tabindex = 1;
$aEntities = array('clientid' => $clientid, 'campaignid' => $campaignid, 'bannerid' => $bannerid);
| 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 MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/Search.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/www/admin/lib-gui.inc.php';
phpAds_registerGlobalUnslashed('keyword', 'client', 'campaign', 'banner', 'zone', 'affiliate', 'compact');
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
// Check Searchselection
if (!isset($client) || $client != 't') {
    $client = false;
}
if (!isset($campaign) || $campaign != 't') {
    $campaign = false;
}
if (!isset($banner) || $banner != 't') {
    $banner = false;
}
if (!isset($zone) || $zone != 't') {
    $zone = false;
}
if (!isset($affiliate) || $affiliate != 't') {
Example #13
0
 /**
  * Post init session
  *
  */
 function postInitSession()
 {
     global $session, $pref;
     global $affiliateid, $agencyid, $bannerid, $campaignid, $channelid;
     global $clientid, $day, $trackerid, $userlogid, $zoneid;
     // Overwrite certain preset preferences
     if (!empty($session['language']) && $session['language'] != $GLOBALS['pref']['language']) {
         $GLOBALS['_MAX']['CONF']['max']['language'] = $session['language'];
     }
     // Load the user preferences from the database
     OA_Preferences::loadPreferences();
     // Load the required language files
     Language_Loader::load('default');
     // Register variables
     phpAds_registerGlobalUnslashed('affiliateid', 'agencyid', 'bannerid', 'campaignid', 'channelid', 'clientid', 'day', 'trackerid', 'userlogid', 'zoneid');
     if (!isset($affiliateid)) {
         $affiliateid = '';
     }
     if (!isset($agencyid)) {
         $agencyid = OA_Permission::getAgencyId();
     }
     if (!isset($bannerid)) {
         $bannerid = '';
     }
     if (!isset($campaignid)) {
         $campaignid = '';
     }
     if (!isset($channelid)) {
         $channelid = '';
     }
     if (!isset($clientid)) {
         $clientid = '';
     }
     if (!isset($day)) {
         $day = '';
     }
     if (!isset($trackerid)) {
         $trackerid = '';
     }
     if (!isset($userlogid)) {
         $userlogid = '';
     }
     if (!isset($zoneid)) {
         $zoneid = '';
     }
 }
Example #14
0
+---------------------------------------------------------------------------+
$Id: banner-swf.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/lib-maintenance-priority.inc.php';
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/www/admin/lib-storage.inc.php';
require_once MAX_PATH . '/www/admin/lib-swf.inc.php';
require_once MAX_PATH . '/www/admin/lib-banner.inc.php';
require_once MAX_PATH . '/www/admin/lib-zones.inc.php';
// Register input variables
phpAds_registerGlobalUnslashed('convert', 'cancel', 'compress', 'convert_links', 'chosen_link', 'overwrite_link', 'overwrite_target', 'overwrite_source');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER);
OA_Permission::enforceAccessToObject('clients', $clientid);
OA_Permission::enforceAccessToObject('campaigns', $campaignid);
OA_Permission::enforceAccessToObject('banners', $bannerid);
if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
    OA_Permission::enforceAllowed(OA_PERM_BANNER_EDIT);
}
/*-------------------------------------------------------*/
/* Process submitted form                                */
/*-------------------------------------------------------*/
if (isset($convert)) {
    $doBanners = OA_Dal::factoryDO('banners');
    $doBanners->get($bannerid);
    $row = $doBanners->toArray();
Example #15
0
 /**
  * A method for processing settings values from a UI form, and updating the settings
  * values in the configuration file.
  *
  * @param array $aElements An array of arrays, indexed by the HTML form element names,
  *                         and then the top level configuration file item, containing
  *                         the configuration file key.
  *
  *                         The inner array can also contain the fixed keys "preg_match"
  *                         and "preg_replace", and the values will be used as a preg
  *                         pattern on the actual value.
  *
  *                         The inner array can also contain the fixed key "bool", in
  *                         which case the value will be treated as a true/false
  *                         element from the HTML form.
  *
  *                         The inner array can also contain the fixed keys "preg_split"
  *                         and "merge", and the preg_split value will be used to split
  *                         the actual value into an array, and then remove any empty
  *                         values from the result, and then the resulting array will be
  *                         merged with the merge value, and stored. The "merge_unique"
  *                         value can also be set to true, in which case only unique
  *                         values will be stored from the split array values.
  *
  *                         For example:
  *  array(
  *      delivery_cacheExpire => array(
  *                                  delivery     => acls
  *                                  preg_match   => #/$#
  *                                  preg_replace =>
  *                              )
  *  )
  *
  * This array would store the value from the "delivery_cacheExpire" HTML form element
  * in the configuration file under the [delivery] section, acls key; but the value stored
  * would have the "/" character, if it existed, removed from the end of the string value
  * stored.
  *
  * @return boolean True if the configuration file was saved correctly, false otherwise.
  */
 function processSettingsFromForm($aElementNames)
 {
     phpAds_registerGlobalUnslashed('token');
     if (!phpAds_SessionValidateToken($GLOBALS['token'])) {
         return false;
     }
     foreach ($aElementNames as $htmlElement => $aConfigInfo) {
         // Register the HTML element value
         MAX_commonRegisterGlobalsArray(array($htmlElement));
         // Was the HTML element value set?
         if (isset($GLOBALS[$htmlElement])) {
             reset($aConfigInfo);
             if (isset($aConfigInfo['preg_match'])) {
                 $preg_match = $aConfigInfo['preg_match'];
                 unset($aConfigInfo['preg_match']);
             }
             if (isset($aConfigInfo['preg_replace'])) {
                 $preg_replace = $aConfigInfo['preg_replace'];
                 unset($aConfigInfo['preg_replace']);
             }
             $value = stripslashes($GLOBALS[$htmlElement]);
             if (isset($preg_match) && isset($preg_replace)) {
                 $value = preg_replace($preg_match, $preg_replace, $value);
             }
             unset($preg_match);
             unset($preg_replace);
             if (isset($aConfigInfo['bool'])) {
                 $value = 'true';
             }
             if (!empty($aConfigInfo['trim'])) {
                 $value = trim($value);
             }
             unset($aConfigInfo['bool']);
             if (isset($aConfigInfo['preg_split']) && isset($aConfigInfo['merge'])) {
                 $pregSplit = $aConfigInfo['preg_split'];
                 $merge = $aConfigInfo['merge'];
                 $mergeUnique = false;
                 if ($aConfigInfo['merge_unique']) {
                     $mergeUnique = true;
                 }
                 unset($aConfigInfo['preg_split']);
                 unset($aConfigInfo['merge']);
                 unset($aConfigInfo['merge_unique']);
                 foreach ($aConfigInfo as $levelKey => $itemKey) {
                     $aValues = preg_split($pregSplit, $value);
                     if ($mergeUnique) {
                         $aValues = array_unique($aValues);
                     }
                     if (!empty($aConfigInfo['trim'])) {
                         array_walk($aValues, 'trim');
                     }
                     $aEmptyKeys = array_keys($aValues, '');
                     $counter = -1;
                     foreach ($aEmptyKeys as $key) {
                         $counter++;
                         array_splice($aValues, $key - $counter, 1);
                     }
                     $value = implode($merge, $aValues);
                     $this->settingChange($levelKey, $itemKey, $value);
                 }
             } else {
                 unset($aConfigInfo['preg_split']);
                 unset($aConfigInfo['merge']);
                 unset($aConfigInfo['merge_unique']);
                 foreach ($aConfigInfo as $levelKey => $itemKey) {
                     $this->settingChange($levelKey, $itemKey, $value);
                 }
             }
         } else {
             // The element may required "false" to be stored
             if (isset($aConfigInfo['bool'])) {
                 unset($aConfigInfo['bool']);
                 foreach ($aConfigInfo as $levelKey => $itemKey) {
                     $this->settingChange($levelKey, $itemKey, 'false');
                 }
             }
         }
     }
     $writeResult = $this->writeConfigChange();
     return $writeResult;
 }
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/lib/OA/Dll.php';
require_once MAX_PATH . '/lib/OA/Maintenance/Priority.php';
require_once MAX_PATH . '/lib/max/other/common.php';
require_once MAX_PATH . '/lib/max/other/capping/lib-capping.inc.php';
require_once MAX_PATH . '/lib/max/other/html.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/component/Form.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/www/admin/lib-maintenance-priority.inc.php';
require_once MAX_PATH . '/lib/pear/Date.php';
require_once MAX_PATH . '/lib/OA/Admin/NumberFormat.php';
require_once MAX_PATH . '/lib/OX/Util/Utils.php';
require_once MAX_PATH . '/lib/max/Dal/DataObjects/Campaigns.php';
// Register input variables
phpAds_registerGlobalUnslashed('start', 'startSet', 'anonymous', 'campaignname', 'clicks', 'companion', 'show_capped_no_cookie', 'comments', 'conversions', 'end', 'endSet', 'priority', 'high_priority_value', 'revenue', 'revenue_type', 'submit', 'submit_status', 'target_old', 'target_type_old', 'target_value', 'target_type', 'rd_impr_bkd', 'rd_click_bkd', 'rd_conv_bkd', 'impressions', 'weight_old', 'weight', 'clientid', 'status', 'status_old', 'as_reject_reason', 'an_status', 'previousimpressions', 'previousconversions', 'previousclicks');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
OA_Permission::enforceAccessToObject('clients', $clientid, false, OA_Permission::OPERATION_VIEW);
OA_Permission::enforceAccessToObject('campaigns', $campaignid, true, OA_Permission::OPERATION_EDIT);
/*-------------------------------------------------------*/
/* Store preferences									 */
/*-------------------------------------------------------*/
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['clientid'] = $clientid;
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['campaignid'][$clientid] = $campaignid;
phpAds_SessionDataStore();
/*-------------------------------------------------------*/
/* Initialise data                                    */
/*-------------------------------------------------------*/
if ($campaignid != "") {
    // Edit or Convert
 /**
  * check uploaded file
  * check file contents
  * unpack file contents
  *
  * @param array $aFile
  * @return boolean
  */
 function unpackPlugin($aFile, $overwrite = true, $checkOnly = false)
 {
     //OA::logMem('enter unpackPlugin');
     $this->_switchToPluginLog();
     try {
         phpAds_registerGlobalUnslashed('token');
         if (OA_INSTALLATION_STATUS == OA_INSTALLATION_STATUS_INSTALLED && !phpAds_SessionValidateToken($GLOBALS['token'])) {
             throw new Exception('Invalid request token');
         }
         if ($this->configLocked) {
             throw new Exception('Configuration file is locked unable to unpack' . $aFile['name']);
         }
         if (!@file_exists($aFile['tmp_name'])) {
             throw new Exception('Failed to read the uploaded file');
         }
         if (!$this->_unpack($aFile, $overwrite, $checkOnly)) {
             throw new Exception('The uploaded file ' . $aFile['name'] . ' was not unpacked');
         }
         $result = true;
     } catch (Exception $e) {
         $this->_logError($e->getMessage());
         $result = false;
     }
     //OA::logMem('exit unpackPlugin');
     $this->_switchToDefaultLog();
     return $result;
 }
<?php

require_once '../../../../init.php';
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/lib/OA/Creative/File.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/lib/max/other/common.php';
//require_once MAX_PATH . '/lib/max/other/html.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/component/Form.php';
require_once MAX_PATH . '/lib/OA/Maintenance/Priority.php';
require_once LIB_PATH . '/Plugin/Component.php';
$htmltemplate = MAX_commonGetValueUnslashed('htmltemplate');
phpAds_registerGlobalUnslashed('alink', 'alink_chosen', 'alt', 'alt_imageurl', 'asource', 'atar', 'adserver', 'bannertext', 'campaignid', 'checkswf', 'clientid', 'comments', 'description', 'ext_bannertype', 'height', 'imageurl', 'keyword', 'message', 'replaceimage', 'replacealtimage', 'status', 'statustext', 'type', 'submit', 'target', 'transparent', 'upload', 'url', 'weight', 'width');
OA_Permission::enforceAccessToObject('clients', $clientid);
OA_Permission::enforceAccessToObject('campaigns', $campaignid);
OA_Permission::enforceAccessToObject('banners', $bannerid, true);
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['clientid'] = $clientid;
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['campaignid'][$clientid] = $campaignid;
phpAds_SessionDataStore();
if ($bannerid != '') {
    $doBanners = OA_Dal::factoryDO('banners');
    if ($doBanners->get($bannerid)) {
        $aBanner = $doBanners->toArray();
    }
    $type = $aBanner['storagetype'];
    $ext_bannertype = $aBanner['ext_bannertype'];
    $hardcoded_links = array();
    $hardcoded_targets = array();
    $hardcoded_sources = array();
    if (empty($ext_bannertype)) {
        if ($type == 'html') {
+---------------------------------------------------------------------------+
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/lib/RV/Admin/Languages.php';
require_once MAX_PATH . '/lib/OA/Admin/Menu.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/lib/max/other/html.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/component/Form.php';
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/model/InventoryPageHeaderModelBuilder.php';
// Register input variables
phpAds_registerGlobalUnslashed('errormessage', 'clientname', 'contact', 'comments', 'email', 'reportlastdate', 'advertiser_limitation', 'reportprevious', 'reportdeactivate', 'report', 'reportinterval', 'submit');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
OA_Permission::enforceAccessToObject('clients', $clientid, true);
/*-------------------------------------------------------*/
/* Store preferences									 */
/*-------------------------------------------------------*/
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['clientid'] = $clientid;
phpAds_SessionDataStore();
/*-------------------------------------------------------*/
/* Initialise data                                    */
/*-------------------------------------------------------*/
if ($clientid != "") {
    if (!isset($aAdvertiser)) {
        $doClients = OA_Dal::factoryDO('clients');
        if ($doClients->get($clientid)) {
Example #20
0
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/lib/max/Admin/Languages.php';
require_once MAX_PATH . '/lib/OA/Central/AdNetworks.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/www/admin/lib-zones.inc.php';
require_once MAX_PATH . '/lib/OA/Dll/Publisher.php';
require_once MAX_PATH . '/lib/OA/Admin/Menu.php';
require_once MAX_PATH . '/lib/max/other/html.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/component/Form.php';
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
// Register input variables
phpAds_registerGlobalUnslashed('move', 'name', 'website', 'contact', 'email', 'language', 'advsignup', 'errormessage', 'submit', 'publiczones_old', 'formId', 'category', 'country', 'language');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
OA_Permission::enforceAccessToObject('affiliates', $affiliateid, true);
/*-------------------------------------------------------*/
/* Store preferences									 */
/*-------------------------------------------------------*/
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['affiliateid'] = $affiliateid;
phpAds_SessionDataStore();
/*-------------------------------------------------------*/
/* Initialise data                                    */
/*-------------------------------------------------------*/
if ($affiliateid != "") {
    // Do not get this information if the page
    // is the result of an error message
    if (!isset($affiliate)) {
| 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 MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/lib/max/other/html.php';
require_once MAX_PATH . '/lib/max/Plugin.php';
require_once MAX_PATH . '/lib/max/other/lib-acl.inc.php';
// Register input variables
phpAds_registerGlobalUnslashed('acl', 'action', 'submit', 'channelid', 'agencyid');
/*-------------------------------------------------------*/
/* Affiliate interface security                          */
/*-------------------------------------------------------*/
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
OA_Permission::enforceAccessToObject('channel', $channelid);
$pageName = basename($_SERVER['SCRIPT_NAME']);
$agencyId = OA_Permission::getAgencyId();
$tabindex = 1;
if (!empty($affiliateid)) {
    OA_Permission::enforceAccessToObject('affiliates', $affiliateid);
    /*-------------------------------------------------------*/
    /* Store preferences									 */
    /*-------------------------------------------------------*/
    $session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['affiliateid'] = $affiliateid;
    phpAds_SessionDataStore();
Example #22
0
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/lib/max/Admin/Languages.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/lib/OA/Admin/Menu.php';
require_once MAX_PATH . '/lib/max/other/html.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/component/Form.php';
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
// Register input variables
phpAds_registerGlobalUnslashed('errormessage', 'agencyid', 'name', 'contact', 'email', 'submit', 'logout_url');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN);
OA_Permission::enforceAccessToObject('agency', $agencyid, true);
/*-------------------------------------------------------*/
/* Initialise data                                    */
/*-------------------------------------------------------*/
if ($agencyid != '') {
    $doAgency = OA_Dal::staticGetDO('agency', $agencyid);
    // Do not get this information if the page
    // is the result of an error message
    if (!isset($agency)) {
        $doAgency = OA_Dal::factoryDO('agency');
        if ($doAgency->get($agencyid)) {
            $aAgency = $doAgency->toArray();
        }
 /**
  * A static method for processing preference values from a UI form, and
  * updating the preference values in the database.
  *
  * @static
  * @param array $aElementNames An array of HTML form element names, which
  *                             are also the preference value names.
  * @param array $aCheckboxes   An array of the above HTML form element
  *                             names which are checkboxes, as these will not
  *                             be set in the form POST if unchecked, and
  *                             so need to be treated differently.
  * @return boolean True on success, false otherwise.
  */
 function processPreferencesFromForm($aElementNames, $aCheckboxes)
 {
     phpAds_registerGlobalUnslashed('token');
     if (!phpAds_SessionValidateToken($GLOBALS['token'])) {
         return false;
     }
     // Get all of the preference types that exist
     $aPreferenceTypes = array();
     $doPreferences = OA_Dal::factoryDO('preferences');
     $doPreferences->find();
     if ($doPreferences->getRowCount() < 1) {
         return false;
     }
     while ($doPreferences->fetch()) {
         $aPreference = $doPreferences->toArray();
         $aPreferenceTypes[$aPreference['preference_name']] = array('preference_id' => $aPreference['preference_id'], 'account_type' => $aPreference['account_type']);
     }
     // Are there any preference types in the system?
     if (empty($aPreferenceTypes)) {
         return false;
     }
     // Get the type of the current accout
     $currentAccountType = OA_Permission::getAccountType();
     // Get the current account's ID
     $currentAccountId = OA_Permission::getAccountId();
     // Get the parent account preferences
     $aParentPreferences = OA_Preferences::loadPreferences(false, true, true);
     // Prepare the preference values that should be saved or deleted
     $aSavePreferences = array();
     $aDeletePreferences = array();
     foreach ($aElementNames as $preferenceName) {
         // Ensure that the current account has permission to process
         // the preference type
         $access = OA_Preferences::hasAccess($currentAccountType, $aPreferenceTypes[$preferenceName]['account_type']);
         if ($access == false) {
             // Don't process this value
             continue;
         }
         // Register the HTML element value
         phpAds_registerGlobalUnslashed($preferenceName);
         // Is the HTML element value a checkbox, and unset?
         if (isset($aCheckboxes[$preferenceName]) && !isset($GLOBALS[$preferenceName])) {
             // Set the value of the element to the false string ""
             $GLOBALS[$preferenceName] = '';
         } else {
             if (isset($aCheckboxes[$preferenceName]) && $GLOBALS[$preferenceName]) {
                 // Set the value of the element to the true string "1"
                 $GLOBALS[$preferenceName] = '1';
             }
         }
         // Was the HTML element value set?
         if (isset($GLOBALS[$preferenceName])) {
             // Is the preference value different from the parent value?
             if (!isset($aParentPreferences[$preferenceName]) || $GLOBALS[$preferenceName] != $aParentPreferences[$preferenceName]) {
                 // The preference value is different from the parent, so it
                 // needs to be stored
                 $aSavePreferences[$preferenceName] = $GLOBALS[$preferenceName];
             } else {
                 if ($currentAccountType != OA_ACCOUNT_ADMIN) {
                     // The preference value is not different from the parent, so
                     // it should be deleted if not the admin account (in case it
                     // exists for the account, and so would not inherit correctly
                     // if the admin account changes preferences)
                     $aDeletePreferences[$preferenceName] = $GLOBALS[$preferenceName];
                 }
             }
         }
     }
     // Save the required preferences
     foreach ($aSavePreferences as $preferenceName => $preferenceValue) {
         $doAccount_preference_assoc = OA_Dal::factoryDO('account_preference_assoc');
         $doAccount_preference_assoc->account_id = $currentAccountId;
         $doAccount_preference_assoc->preference_id = $aPreferenceTypes[$preferenceName]['preference_id'];
         $doAccount_preference_assoc->find();
         if ($doAccount_preference_assoc->getRowCount() != 1) {
             // Insert the preference
             $doAccount_preference_assoc->value = $preferenceValue;
             $result = $doAccount_preference_assoc->insert();
             if ($result === false) {
                 return false;
             }
         } else {
             // Update the preference
             $doAccount_preference_assoc->fetch();
             $doAccount_preference_assoc->value = $preferenceValue;
             $result = $doAccount_preference_assoc->update();
             if ($result === false) {
                 return false;
             }
         }
     }
     // Delete the required preferences
     foreach ($aDeletePreferences as $preferenceName => $preferenceValue) {
         $doAccount_preference_assoc = OA_Dal::factoryDO('account_preference_assoc');
         $doAccount_preference_assoc->account_id = $currentAccountId;
         $doAccount_preference_assoc->preference_id = $aPreferenceTypes[$preferenceName]['preference_id'];
         $doAccount_preference_assoc->find();
         if ($doAccount_preference_assoc->getRowCount() == 1) {
             // Delete the preference
             $result = $doAccount_preference_assoc->delete();
             if ($result === false) {
                 return false;
             }
         }
     }
     return true;
 }
Example #24
0
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/www/admin/lib-zones.inc.php';
require_once MAX_PATH . '/www/admin/lib-size.inc.php';
require_once MAX_PATH . '/lib/max/Admin_DA.php';
require_once MAX_PATH . '/lib/max/other/html.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/component/Form.php';
require_once MAX_PATH . '/lib/OA/Central/AdNetworks.php';
require_once MAX_PATH . '/lib/OA/Admin/NumberFormat.php';
// Register input variables
phpAds_registerGlobalUnslashed('zonename', 'description', 'delivery', 'sizetype', 'size', 'width', 'height', 'submit', 'comments');
/*-------------------------------------------------------*/
/* Affiliate interface security                          */
/*-------------------------------------------------------*/
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER, OA_ACCOUNT_TRAFFICKER);
OA_Permission::enforceAccessToObject('affiliates', $affiliateid);
OA_Permission::enforceAccessToObject('zones', $zoneid, true);
if (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
    if (!empty($zoneid)) {
        OA_Permission::enforceAllowed(OA_PERM_ZONE_EDIT);
    } else {
        OA_Permission::enforceAllowed(OA_PERM_ZONE_ADD);
    }
}
/*-------------------------------------------------------*/
/* Store preferences									 */
Example #25
0
| 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: campaign-zone-link.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';
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/CampaignZoneLink.php';
phpAds_registerGlobalUnslashed('action', 'campaignid', 'allSelected', 'category-linked', 'category-available', 'text-linked', 'text-available');
$agencyId = OA_Permission::getAgencyId();
$oDalZones = OA_Dal::factoryDAL('zones');
$action = $GLOBALS["action"];
$campaignId = $GLOBALS['campaignid'];
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
OA_Permission::enforceAccessToObject('campaigns', $campaignid);
$aZonesIds = array();
$aZonesIdsHash = array();
foreach ($_REQUEST['ids'] as $zone) {
    if (substr($zone, 0, 1) == 'z') {
        $aZonesIds[] = substr($zone, 1);
        $aZonesIdsHash[substr($zone, 1)] = "x";
    }
}
// If we're requested to link all matching zones, we need to determine the ids to link
Example #26
0
| 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: banner-advanced.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/Dal.php';
// Register input variables
phpAds_registerGlobalUnslashed('append', 'submitbutton');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
OA_Permission::enforceAccessToObject('clients', $clientid);
OA_Permission::enforceAccessToObject('campaigns', $campaignid);
OA_Permission::enforceAccessToObject('banners', $bannerid);
/*-------------------------------------------------------*/
/* Store preferences									 */
/*-------------------------------------------------------*/
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['clientid'] = $clientid;
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['campaignid'][$clientid] = $campaignid;
phpAds_SessionDataStore();
/*-------------------------------------------------------*/
/* Process submitted form                                */
/*-------------------------------------------------------*/
if (isset($submitbutton)) {
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/lib/max/Admin/Languages.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/www/admin/lib-zones.inc.php';
require_once MAX_PATH . '/lib/OA/Dll/Publisher.php';
require_once MAX_PATH . '/lib/OA/Admin/Menu.php';
require_once MAX_PATH . '/lib/max/other/html.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/component/Form.php';
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
// Register input variables
phpAds_registerGlobalUnslashed('move', 'name', 'website', 'contact', 'email', 'errormessage', 'submit', 'publiczones_old', 'formId');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
OA_Permission::enforceAccessToObject('affiliates', $affiliateid, true);
/*-------------------------------------------------------*/
/* Store preferences									 */
/*-------------------------------------------------------*/
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['affiliateid'] = $affiliateid;
phpAds_SessionDataStore();
/*-------------------------------------------------------*/
/* Initialise data                                    */
/*-------------------------------------------------------*/
if ($affiliateid != "") {
    // Do not get this information if the page
    // is the result of an error message
    if (!isset($affiliate)) {
| 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 MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/component/Form.php';
require_once MAX_PATH . '/lib/max/other/html.php';
// Register input variables
phpAds_registerGlobalUnslashed('description', 'move', 'submit', 'trackername', 'status', 'type', 'linkcampaigns');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
OA_Permission::enforceAccessToObject('clients', $clientid);
OA_Permission::enforceAccessToObject('trackers', $trackerid, true);
/*-------------------------------------------------------*/
/* Store preferences									 */
/*-------------------------------------------------------*/
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['clientid'] = $clientid;
phpAds_SessionDataStore();
/*-------------------------------------------------------*/
/* Initialise data                                       */
/*-------------------------------------------------------*/
if ($trackerid != "" || isset($move) && $move == 't') {
    // Edit or Convert
    // Fetch exisiting settings
// Required files
require_once MAX_PATH . '/lib/OA/Admin/Option.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/UserAccess.php';
require_once MAX_PATH . '/lib/max/Admin/Languages.php';
require_once MAX_PATH . '/lib/max/Plugin/Translation.php';
require_once MAX_PATH . '/www/admin/config.php';
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER);
// Create a new option object for displaying the setting's page's HTML form
$oOptions = new OA_Admin_Option('user');
// Prepare an array for storing error messages
$aErrormessage = array();
// If the settings page is a submission, deal with the form data
if (isset($_POST['submitok']) && $_POST['submitok'] == 'true') {
    // Register input variables
    phpAds_registerGlobalUnslashed('pwold', 'pw', 'pw2');
    // Get the DB_DataObject for the current user
    $doUsers = OA_Dal::factoryDO('users');
    $doUsers->get(OA_Permission::getUserId());
    // Set defaults
    $changePassword = false;
    // Get the current authentication plugin instance
    $oPlugin = OA_Auth::staticGetAuthPlugin();
    // Check password
    if (!isset($pwold) || !$oPlugin->checkPassword(OA_Permission::getUsername(), $pwold)) {
        $aErrormessage[0][] = $GLOBALS['strPasswordWrong'];
    }
    if (isset($pw) && strlen($pw) || isset($pw2) && strlen($pw2)) {
        if (!strlen($pw) || strstr("\\", $pw)) {
            $aErrormessage[0][] = $GLOBALS['strInvalidPassword'];
        } elseif (strcmp($pw, $pw2)) {
<?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 MAX_PATH . '/www/admin/config.php';
phpAds_registerGlobalUnslashed('status');
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
OA_Permission::enforceAccessToObject('campaigns', $campaignid);
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/CampaignZoneLink.php';
$oTpl = OA_Admin_UI_CampaignZoneLink::createTemplateWithModel($status);
$oTpl->display();
?>