Example #1
0
 * @link www.phpletter.com
 * @since 22/April/2007
 *
 */
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php";
//Code added to adjust for local admin rights.
if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] === false) {
    if (isset($_POST['username'])) {
        if ($auth->login()) {
            header('Location: ' . appendQueryString(CONFIG_URL_HOME, makeQueryString()));
            exit;
        }
    }
} else {
    $_SESSION['ajax_user'] = true;
    header('Location: ' . appendQueryString(CONFIG_URL_HOME, makeQueryString()));
    exit;
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" href="theme/<?php 
echo CONFIG_THEME_NAME;
?>
/css/login.css" rel="stylesheet" />
<title><?php 
echo LOGIN_PAGE_TITLE;
?>
Example #2
0
//include different config base file according to query string "config"
$configBaseFileName = 'config.base.php';
if (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['config']) && file_exists(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'config.' . secureFileName($_GET['config']) . ".php") {
    $configBaseFileName = 'config.' . secureFileName($_GET['config']) . ".php";
}
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . $configBaseFileName;
require_once DIR_AJAX_LANGS . CONFIG_LANG_DEFAULT . ".php";
require_once DIR_AJAX_INC . "function.base.php";
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.session.php";
$session = new Session();
$auth = new Auth();
if (CONFIG_ACCESS_CONTROL_MODE == 1) {
    //access control enabled
    if (!$auth->isLoggedIn() && strtolower(basename($_SERVER['PHP_SELF']) != strtolower(basename(CONFIG_LOGIN_PAGE)))) {
        //
        header('Location: ' . appendQueryString(CONFIG_LOGIN_PAGE, makeQueryString()));
        exit;
    }
}
addNoCacheHeaders();
//URL Declartions
define('CONFIG_URL_IMAGE_PREVIEW', 'ajax_image_preview.php');
define('CONFIG_URL_CREATE_FOLDER', 'ajax_create_folder.php');
define('CONFIG_URL_DELETE', 'ajax_delete_file.php');
define('CONFIG_URL_HOME', 'ajaxfilemanager.php');
define("CONFIG_URL_UPLOAD", 'ajax_file_upload.php');
define('CONFIG_URL_PREVIEW', 'ajax_preview.php');
define('CONFIG_URL_SAVE_NAME', 'ajax_save_name.php');
define('CONFIG_URL_IMAGE_EDITOR', 'ajax_image_editor.php');
define('CONFIG_URL_IMAGE_SAVE', 'ajax_image_save.php');
define('CONFIG_URL_IMAGE_RESET', 'ajax_editor_reset.php');
Example #3
0
echo IMG_BTN_SAVE_AS;
?>
</button>
			<button id="actionClose" class="button" onclick="return editorClose();"><?php 
echo IMG_BTN_CLOSE;
?>
</button></p>
		</form>
	</fieldset>
	<fieldset id="imageInfo">
		<legend id="imageInfoLegend"><?php 
echo IMG_INFO;
?>
</legend>
		<form name="formImageInfo" action="<?php 
echo appendQueryString(CONFIG_URL_IMAGE_SAVE, makeQueryString(array('path')));
?>
" method="post" id="formImageInfo">
			<p><input type="hidden" name="mode" id="image_mode" value="" />
      <input type="hidden" name="new_name" id="hidden_new_name" value="" />
      <input type="hidden" name="save_to" id="hidden_save_to" value="" />
			<input type="hidden" name="path" id="path" value="<?php 
echo $_GET['path'];
?>
"  />
			<input type="hidden" name="flip_angle" id="flip_angle" value="" />
			<label><?php 
echo IMG_LBL_WIDTH;
?>
</label> <input type="text" name="width" id="width" value="" class="input imageInput"  />
			<label><?php 
?>
/css/jqModal.css" type="text/css" rel="stylesheet"/>
    <title>Ajax Text Editor</title>
</head>
<body>

<div id="pageBody">
    <textarea name="content" id="content" style="height:500px; width: 97%;"><?php 
echo getFileContent($path);
?>
</textarea>
</div>
<div id="windowProcessing" class="jqmWindow" style="display:none">
    <form name="frmProcessing" id="frmProcessing" method="post"
          action="<?php 
echo appendQueryString(CONFIG_URL_SAVE_TEXT, makeQueryString(array('path')));
?>
">
        <input type="hidden" name="folder" id="folder" value="<?php 
echo dirname($path);
?>
"/>
        <input type="hidden" name="name" id="name" value="<?php 
echo basename($path);
?>
"/>
        <input type="hidden" name="save_as_request" id="save_as_request" value="0"/>

        <div style="display:none"><textarea name="text" id="text"></textarea></div>
    </form>
    <a href="#" class="jqmClose" id="windowSaveClose"><?php 
Example #5
0
			<!--			<label>Watermark:</label> <input type="radio" name="mode" value="watermark" class="input" onclick="return false;" />-->
			
			<button id="actionRotateLeft" class="disabledButton" onclick="return leftRotate();" disabled><?php echo IMG_BTN_ROTATE_LEFT; ?></button>
			<button id="actionRotateRight" class="disabledButton" onclick="return rightRotate();" disabled><?php echo IMG_BTN_ROTATE_RIGHT; ?></button>
			<button id="actionFlipH" class="disabledButton" onclick="return flipHorizontal();" disabled><?php echo IMG_BTN_FLIP_H; ?></button>
			<button id="actionFlipV" class="disabledButton" onclick="return flipVertical();" disabled><?php echo IMG_BTN_FLIP_V; ?></button>			
			<button id="actionReset" class="button" onclick="return resetEditor();"><?php echo IMG_BTN_RESET; ?></button>
			<button id="actionUndo" class="button" onclick="return undoImage();"><?php echo IMG_BTN_UNDO; ?></button>
			<button id="actionSave" class="button" onclick="return saveImage();"><?php echo IMG_BTN_SAVE; ?></button>
      <button id="actionSaveAs" class="button" onclick="return saveAsImagePre();"><?php echo IMG_BTN_SAVE_AS; ?></button>
			<button id="actionClose" class="button" onclick="return editorClose();"><?php echo IMG_BTN_CLOSE; ?></button></p>
		</form>
	</fieldset>
	<fieldset id="imageInfo">
		<legend id="imageInfoLegend"><?php echo IMG_INFO; ?></legend>
		<form name="formImageInfo" action="<?php echo appendQueryString(CONFIG_URL_IMAGE_SAVE, makeQueryString(array('path'))); ?>" method="post" id="formImageInfo">
			<p><input type="hidden" name="mode" id="image_mode" value="" />
      <input type="hidden" name="new_name" id="hidden_new_name" value="" />
      <input type="hidden" name="save_to" id="hidden_save_to" value="" />
			<input type="hidden" name="path" id="path" value="<?php echo $_GET['path']; ?>"  />
			<input type="hidden" name="flip_angle" id="flip_angle" value="" />
			<label><?php echo IMG_LBL_WIDTH; ?></label> <input type="text" name="width" id="width" value="" class="input imageInput"  />
			<label><?php echo IMG_LBL_HEIGHT; ?></label> <input type="text" name="height" id="height" value="" class="input imageInput" />
			<label><?php echo IMG_LBL_X; ?></label> <input type="text" name="x" id="x" value="" class="input imageInput"/>
			<label><?php echo IMG_LBL_Y; ?></label> <input type="text" name="y" id="y" value="" class="input imageInput"/>
<!--			<b>Percentage:</b> <input type="text" name="percentage" id="percentage" value="" class="input imageInput"/>-->
			<label><?php echo IMG_LBL_RATIO; ?></label> <input type="text" name="ratio" id="ratio" value="" class="input imageInput"/>
			<label><?php echo IMG_LBL_ANGLE; ?></label> <input type="text" name="angle" id="angle" value="" class="input imageInput" />
			
			</p>
		</form>
Example #6
0
//include different config base file according to query string "config"
$configBaseFileName = 'config.base.php';
if (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['config']) && file_exists(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'config.' . secureFileName($_GET['config']) . ".php") {
    $configBaseFileName = 'config.' . secureFileName($_GET['config']) . ".php";
}
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . $configBaseFileName;
require_once DIR_AJAX_LANGS . CONFIG_LANG_DEFAULT . ".php";
require_once DIR_AJAX_INC . "function.base.php";
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.session.php";
$session = new MySession();
$auth = new Auth();
if (CONFIG_ACCESS_CONTROL_MODE == 1) {
    //access control enabled
    if (!$auth->isLoggedIn() && strtolower(basename($_SERVER['PHP_SELF']) != strtolower(basename(CONFIG_LOGIN_PAGE)))) {
        //
        osc_redirect_to(appendQueryString(CONFIG_LOGIN_PAGE, makeQueryString()));
    }
}
addNoCacheHeaders();
//URL Declartions
define('CONFIG_URL_IMAGE_PREVIEW', 'ajax_image_preview.php');
define('CONFIG_URL_CREATE_FOLDER', 'ajax_create_folder.php');
define('CONFIG_URL_DELETE', 'ajax_delete_file.php');
define('CONFIG_URL_HOME', 'ajaxfilemanager.php');
define("CONFIG_URL_UPLOAD", 'ajax_file_upload.php');
define('CONFIG_URL_PREVIEW', 'ajax_preview.php');
define('CONFIG_URL_SAVE_NAME', 'ajax_save_name.php');
define('CONFIG_URL_IMAGE_EDITOR', 'ajax_image_editor.php');
define('CONFIG_URL_IMAGE_SAVE', 'ajax_image_save.php');
define('CONFIG_URL_IMAGE_RESET', 'ajax_editor_reset.php');
define('CONFIG_URL_IMAGE_UNDO', 'ajax_image_undo.php');
">
				<dt id="dt<?php 
    echo $count;
    ?>
" class="<?php 
    echo $file['type'] == 'folder' && empty($file['file']) && empty($file['subdir']) ? 'folderEmpty' : $file['cssClass'];
    ?>
" class="<?php 
    echo $file['cssClass'];
    ?>
">
				<?php 
    switch ($file['cssClass']) {
        case 'filePicture':
            echo '<a id="thumbUrl' . $count . '" rel="thumbPhotos" href="' . $file['path'] . '">';
            echo '<img src="' . appendQueryString($thumbnailBaseUrl, 'path=' . $file['path']) . '" id="thumbImg' . $count . '"></a>' . "\n";
            break;
        case 'fileFlash':
        case 'fileVideo':
        case 'fileMusic':
            break;
        default:
            echo '&nbsp;';
    }
    ?>
				
				</dt>
				<dd id="dd<?php 
    echo $count;
    ?>
" class="thumbnailListing_info"><span id="flag<?php 
		

			
</script>

<link href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/editor.css" type="text/css" rel="stylesheet" />
<link href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/jqModal.css" type="text/css" rel="stylesheet" />
<title>Ajax Text Editor</title>
</head>
<body>

<div id="pageBody">
	<textarea name="content" id="content" style="height:500px; width: 97%;"><?php echo getFileContent($path); ?></textarea>
</div>
<div id="windowProcessing" class="jqmWindow" style="display:none">
	<form name="frmProcessing" id="frmProcessing" method="POST" action="<?php echo appendQueryString(CONFIG_URL_SAVE_TEXT, makeQueryString(array('path')));?>">
		<input type="hidden" name="folder" id="folder" value="<?php echo dirname($path); ?>" />
		<input type="hidden" name="name" id="name" value="<?php echo basename($path); ?>" />	
		<input type="hidden" name="save_as_request" id="save_as_request" value="0" />
		<div style="display:none"><textarea name="text" id="text"></textarea></div> 
	</form> 
	<a href="#" class="jqmClose" id="windowSaveClose"><?php echo IMG_BTN_CANCEL; ?></a>
	<p><img src="theme/<?php echo CONFIG_THEME_NAME; ?>/images/loading.gif" /></p>
</div>
<div id="windowSaveAs" class="jqmWindow" style="display:none">
    	<a href="#" class="jqmClose" id="windowSaveClose"><?php echo IMG_BTN_CANCEL; ?></a>
      <form id="formSaveAs" name="formSaveAs" action="" method="post">
    	<table class="tableForm" cellpadding="0" cellspacing="0">
      	<thead>
        	<tr>
          	<th colspan="2"><?php echo IMG_LBL_SAVE_AS; ?></th>
Example #9
0
<?php

/**
 * access control login form
 * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
 * @link www.phpletter.com
 * @since 22/April/2007
 *
 */
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php";
if (!osc_is_admin_user_logged_in()) {
    exit('Direct access is not allowed.');
}
if (isset($_POST['username'])) {
    if ($auth->login()) {
        osc_redirect_to(appendQueryString(CONFIG_URL_HOME, makeQueryString()));
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" href="theme/<?php 
echo CONFIG_THEME_NAME;
?>
/css/login.css" rel="stylesheet" />
<title><?php 
echo LOGIN_PAGE_TITLE;
?>
</title>
<div id="content">
<?php 
$count = 1;
$thumbnailBaseUrl = appendQueryString(CONFIG_URL_IMG_THUMBNAIL, makeQueryString(array('path')));
foreach ($fileList as $file) {
    ?>

			<dl class="thumbnailListing" id="dl<?php 
    echo $count;
    ?>
">
				<dt id="dt<?php 
    echo $count;
    ?>
" class="<?php 
    echo $file['type'] == 'folder' && empty($file['file']) && empty($file['subdir']) ? 'folderEmpty' : $file['cssClass'];
    ?>
" class="<?php 
    echo $file['cssClass'];
    ?>
">
				<?php 
    switch ($file['cssClass']) {
        case 'filePicture':
            echo '<a id="thumbUrl' . $count . '" rel="thumbPhotos" href="' . $file['path'] . '">';
            //echo '<img src="' . appendQueryString($thumbnailBaseUrl, 'path=' . $file['path']) . '" id="thumbImg' . $count . '"></a>' . "\n";
            echo '<img width="110" height="100" src="' . $file['path'] . '" id="thumbImg' . $count . '"></a>' . "\n";
            break;
        case 'fileFlash':
        case 'fileVideo':
        case 'fileMusic':
 public function saveData($campaign, $cloaked = 0, $outbound_url = '')
 {
     $offer_id = 0;
     $landing_page_id = 0;
     if ($campaign->type == 2) {
         $campoffer = rotateDirectCampaign($campaign);
         if (!$campoffer) {
             BTApp::log("Direct Link: Invalid Offers For Tracker: " . $campaign->id(), 'direct', BT_SYSLOG_CRITICAL);
         }
         $payout = $campoffer->offer->payout;
         $offer_id = $campoffer->offer->id();
     } else {
         if ($campaign->type == 1) {
             $camplp = rotateLPCampaign($campaign);
             $payout = 0;
             $landing_page = $camplp->landing_page;
             $landing_page_id = $landing_page->id();
             if (!$landing_page) {
                 BTApp::log("Landing Page: Invalid Landing Page ID: " . $landing_page_id . " For Tracker: " . $campaign->id(), 'direct', BT_SYSLOG_CRITICAL);
             }
         }
     }
     $ip_id = INDEXES::get_ip_id($_SERVER['REMOTE_ADDR']);
     $click = new ClickModel();
     $click->offer_id = $offer_id;
     $click->landing_page_id = $landing_page_id;
     $click->traffic_source_id = $campaign->traffic_source_id;
     $click->payout = $payout;
     $click->filtered = FILTER::startFilter($ip_id);
     $click->user_id = $campaign->user_id;
     $click->cloaked = $cloaked;
     $click->campaign_id = $campaign->id();
     $click->useRuleSet("track");
     $click->save();
     $vars = saveTrackingVariables($campaign);
     //if behind cloaker scripts, we use $_POST. Otherwise (normally) use HTTP_REFERER
     $referer = isset($_POST['referer']) ? $_POST['referer'] : getArrayVar($_SERVER, 'HTTP_REFERER');
     $keyword = getArrayVar($_GET, $campaign->option('var_kw')->value);
     if (!$keyword) {
         $keyword = getArrayVar($_GET, 'kw');
         if (!$keyword) {
             $keyword = getArrayVar($_GET, 'keyword');
         }
     }
     $keyword_id = INDEXES::get_keyword_id($keyword);
     $platform = INDEXES::get_platform_and_browser_id();
     $organization_id = 0;
     $geo_block_id = 0;
     $device_id = 0;
     require BT_ROOT . '/private/includes/traffic/devices_detect_inc.php';
     $adv = new ClickAdvancedModel();
     $adv->click_id = $click->id();
     $adv->keyword_id = $keyword_id;
     $adv->ip_id = $ip_id;
     $adv->platform_id = $platform['platform'];
     $adv->browser_id = $platform['browser'];
     $adv->org_id = $organization_id;
     $adv->device_id = $device_id;
     $adv->v1_id = $vars['v1_id'];
     $adv->v2_id = $vars['v2_id'];
     $adv->v3_id = $vars['v3_id'];
     $adv->v4_id = $vars['v4_id'];
     $adv->location_id = $geo_block_id;
     $adv->campaign_id = $campaign->id();
     $adv->useRuleSet('track');
     $adv->save();
     $data = $vars;
     $data['keyword'] = $keyword;
     $data['clickid'] = base_convert($click->click_id, 10, 36);
     if ($offer_id) {
         if ($outbound_url) {
             $redirect_url = $outbound_url;
         } else {
             $redirect_url = $campoffer->offer->url;
             $redirect_url = replaceTrackerPlaceholders($redirect_url, $data);
         }
         $landing_url = '';
     } else {
         $redirect_url = '';
         if ($outbound_url) {
             $landing_url = $outbound_url;
         } else {
             $landing_url = $landing_page->url;
         }
     }
     //set the cookie
     setClickIdCookie(base_convert($click->click_id, 10, 36));
     $site = new ClickSiteModel();
     $site->click_id = $click->id();
     $site->referer_url = $referer;
     $site->referer_domain = getUrlDomain($referer);
     $site->offer_url = $redirect_url;
     $site->landing_url = $landing_url;
     $site->useRuleSet('track');
     $site->save();
     $pass_vars = array();
     $to_append = '';
     if ($landing_page_id) {
         $type = 'lp';
     } else {
         $type = 'offer';
     }
     foreach ($campaign->options as $option) {
         if (strpos($option->name, 'pass_') === 0) {
             $var_name = substr($option->name, 5);
             $val = getArrayVar($_GET, $var_name, '');
             $pass = new ClickPassthroughModel();
             $pass->click_id = $click->click_id;
             $pass->name = $var_name;
             $pass->value = $val;
             $pass->useRuleSet('track');
             $pass->save();
             $pass_vars[$var_name] = $pass;
         }
     }
     $to_append = http_build_query($this->getPassthroughsToAppend($campaign, $pass_vars, $type));
     if ($offer_id) {
         //direct
         return appendQueryString($redirect_url, $to_append);
     } else {
         //lp
         return appendQueryString($landing_url, $to_append);
     }
 }