Ejemplo n.º 1
0
/* ===========                                                          */
/*                                                                      */
/* Copyright (c) 2000-2007 by the Openads developers                    */
/* For more information visit: http://www.openads.org                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
// Include required files
require "config.php";
require "lib-statistics.inc.php";
// Register input variables
phpAds_registerGlobal('move', 'submit', 'clientname', 'views', 'clicks', 'unlimitedviews', 'unlimitedclicks', 'priority', 'targetviews', 'weight', 'expire', 'expireSet', 'expireDay', 'expireMonth', 'expireYear', 'activateSet', 'activateDay', 'activateMonth', 'activateYear', 'target_old', 'weight_old', 'active_old');
// Security check
phpAds_checkAccess(phpAds_Admin);
/*********************************************************/
/* Process submitted form                                */
/*********************************************************/
if (isset($submit)) {
    // If ID is not set, it should be a null-value for the auto_increment
    if (empty($campaignid)) {
        $campaignid = "null";
    }
    // set expired
    if ($views == '-') {
        $views = 0;
    }
    if ($clicks == '-') {
        $clicks = 0;
    }
/* ===========                                                          */
/*                                                                      */
/* Copyright (c) 2000-2002 by the phpAdsNew developers                  */
/* For more information visit: http://www.phpadsnew.com                 */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
// Include required files
require "config.php";
require "lib-statistics.inc.php";
// Register input variables
phpAds_registerGlobal('action', 'trackerids', 'clickwindowday', 'clickwindowhour', 'clickwindowminute', 'clickwindows', 'clickwindowsecond', 'hideinactive', 'logids', 'submit', 'viewwindowday', 'viewwindowhour', 'viewwindowminute', 'viewwindows', 'viewwindowsecond');
// Security check
phpAds_checkAccess(phpAds_Admin + phpAds_Agency);
if (phpAds_isUser(phpAds_Agency)) {
    if (isset($campaignid) && $campaignid != '') {
        $query = "SELECT c.clientid" . " FROM " . $phpAds_config['tbl_clients'] . " AS c" . "," . $phpAds_config['tbl_campaigns'] . " AS m" . " WHERE c.clientid=m.clientid" . " AND c.clientid=" . $clientid . " AND m.campaignid=" . $campaignid . " AND agencyid=" . phpAds_getUserID();
    } else {
        $query = "SELECT c.clientid" . " FROM " . $phpAds_config['tbl_clients'] . " AS c" . " WHERE c.clientid=" . $clientid . " AND agencyid=" . phpAds_getUserID();
    }
    $res = phpAds_dbQuery($query) or phpAds_sqlDie();
    if (phpAds_dbNumRows($res) == 0) {
        phpAds_PageHeader("2");
        phpAds_Die($strAccessDenied, $strNotAdmin);
    }
}
/*********************************************************/
/* Process submitted form                                */
/*********************************************************/
/************************************************************************/
/* phpAdsNew 2                                                          */
/* ===========                                                          */
/*                                                                      */
/* Copyright (c) 2000-2002 by the phpAdsNew developers                  */
/* For more information visit: http://www.phpadsnew.com                 */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
// Include required files
require "config.php";
require "lib-statistics.inc.php";
// Security check
phpAds_checkAccess(phpAds_Admin + phpAds_Agency + phpAds_Client);
/*********************************************************/
/* Client interface security                             */
/*********************************************************/
if (phpAds_isUser(phpAds_Client)) {
    $clientid = phpAds_getUserID();
    $query = "SELECT campaignid" . " FROM " . $phpAds_config['tbl_campaigns'] . " WHERE clientid=" . $clientid . " AND campaignid=" . $campaignid;
    $res = phpAds_dbQuery($query) or phpAds_sqlDie();
    if (phpAds_dbNumRows($res) == 0) {
        phpAds_PageHeader("1");
        phpAds_Die($strAccessDenied, $strNotAdmin);
    }
} elseif (phpAds_isUser(phpAds_Agency)) {
    $clientid = phpAds_getUserID();
    $query = "SELECT campaignid" . " FROM " . $phpAds_config['tbl_campaigns'] . "," . $phpAds_config['tbl_clients'] . " WHERE clientid=" . $clientid . " AND campaignid=" . $campaignid . " AND agencyid=" . phpAds_getUserID();
    $res = phpAds_dbQuery($query) or phpAds_sqlDie();
/*                                                                      */
/* Copyright (c) 2000-2007 by the Openads developers                    */
/* For more information visit: http://www.openads.org                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
// Include required files
require "config.php";
require "lib-statistics.inc.php";
require "lib-expiration.inc.php";
// Register input variables
phpAds_registerGlobal('period', 'start', 'limit', 'source');
// Security check
phpAds_checkAccess(phpAds_Admin + phpAds_Affiliate);
/*********************************************************/
/* Affiliate interface security                          */
/*********************************************************/
if (phpAds_isUser(phpAds_Affiliate)) {
    if (isset($zoneid) && $zoneid > 0) {
        $result = phpAds_dbQuery("\n\t\t\tSELECT\n\t\t\t\taffiliateid\n\t\t\tFROM\n\t\t\t\t" . $phpAds_config['tbl_zones'] . "\n\t\t\tWHERE\n\t\t\t\tzoneid = '{$zoneid}'\n\t\t\t") or phpAds_sqlDie();
        $row = phpAds_dbFetchArray($result);
        if ($row["affiliateid"] == '' || phpAds_getUserID() != $row["affiliateid"]) {
            phpAds_PageHeader("1");
            phpAds_Die($strAccessDenied, $strNotAdmin);
        } else {
            $affiliateid = phpAds_getUserID();
        }
    } else {
        phpAds_PageHeader("1");
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
// Include required files
require "config.php";
require "lib-statistics.inc.php";
// Register input variables
phpAds_registerGlobal('plugin', 'delimiter', 'quotes');
if (isset($plugin) && $plugin != '') {
    $filename = 'report-plugins/' . $plugin . '.plugin.php';
    if (file_exists($filename)) {
        include $filename;
        $plugininfo = $plugin_info_function();
        // Check security
        phpAds_checkAccess($plugininfo["plugin-authorize"]);
        $plugin_execute_function = $plugininfo["plugin-execute"];
        $plugin_import = $plugininfo["plugin-import"];
        $plugin_variables = array();
        foreach (array_keys($plugin_import) as $key) {
            // Register needed plugin variables
            phpAds_registerGlobal($key);
            if (isset(${$key}) && ${$key} != '') {
                $plugin_variables[] = "'" . addslashes(${$key}) . "'";
            } else {
                $plugin_variables[] = "''";
            }
        }
        $executestring = $plugin_execute_function . "(" . implode(",", $plugin_variables) . ");";
        @eval($executestring);
    }
Ejemplo n.º 6
0
// $Revision: 2.2 $
/************************************************************************/
/* phpAdsNew 2                                                          */
/* ===========                                                          */
/*                                                                      */
/* Copyright (c) 2000-2002 by the phpAdsNew developers                  */
/* For more information visit: http://www.phpadsnew.com                 */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
// Include required files
require "config.php";
// Security check
phpAds_checkAccess(phpAds_Admin + phpAds_Agency + phpAds_Client + phpAds_Affiliate);
/*********************************************************/
/* Main code                                             */
/*********************************************************/
if (phpAds_isUser(phpAds_Admin)) {
    Header("Location: " . $phpAds_config['admin_url_prefix'] . "/admin/advertiser-index.php");
    exit;
}
if (phpAds_isUser(phpAds_Agency)) {
    Header("Location: " . $phpAds_config['admin_url_prefix'] . "/admin/advertiser-index.php");
    exit;
}
if (phpAds_isUser(phpAds_Client)) {
    Header("Location: " . $phpAds_config['admin_url_prefix'] . "/admin/stats-advertiser-history.php?clientid=" . phpAds_getUserID());
    exit;
}