Example #1
0
$tables = mosGetParam($_POST, "tables", null);
$OutType = mosGetParam($_POST, "OutType", null);
$OutDest = mosGetParam($_POST, "OutDest", null);
$toBackUp = mosGetParam($_POST, "toBackUp", null);
switch ($task) {
    case "dbBackup":
        dbBackup($option);
        break;
    case "doBackup":
        doBackup($tables, $OutType, $OutDest, $toBackUp, $_SERVER['HTTP_USER_AGENT'], $local_backup_path);
        break;
    case "dbRestore":
        dbRestore($local_backup_path);
        break;
    case "doRestore":
        doRestore($file, $upfile, $local_backup_path);
        break;
    case "xquery":
        xquery($option);
        break;
}
function dbBackup($p_option)
{
    global $database;
    $database->setQuery("SHOW tables");
    $tables = $database->loadResultArray();
    $tables2 = array(mosHTML::makeOption('all', T_('All Mambo Tables')));
    foreach ($tables as $table) {
        $tables2[] = mosHTML::makeOption($table);
    }
    $tablelist = mosHTML::selectList($tables2, 'tables[]', 'class="inputbox" size="5" multiple="multiple"', 'value', 'text', 'all');
<?php
error_reporting(0);
ini_set('display_errors', 0);

@session_start();
$sess_id = session_id();

define("UPDATE_SERVER", base64_decode('aHR0cDovL3VwZGF0ZXMudW1pLWNtcy5ydS91cGRhdGVzZXJ2ZXIv'));

if (!defined("PHP_FILES_ACCESS_MODE")) {
	define("PHP_FILES_ACCESS_MODE", octdec(substr(decoct(fileperms(__FILE__)), -4, 4)));
}

if (isset($_REQUEST['doRestore'])) {
	header("Content-type: text/xml; charset=utf-8");
	echo doRestore();
	die();
}

if (isset($_REQUEST['getCodeImage'])) {
	header("Content-type: image/jpeg");
	$url1 = str_replace('updateserver/', base64_decode("Y2FwdGNoYS5waHA/cmVzZXQmUEhQU0VTU0lEPQ=="), UPDATE_SERVER);
	$url2 = str_replace('updateserver/', base64_decode("Y2FwdGNoYS5waHA/UEhQU0VTU0lEPQ=="), UPDATE_SERVER);
	get_file("{$url1}{$sess_id}");
	echo get_file("{$url2}{$sess_id}");
	die();
}
if (isset($_REQUEST['checkCode'])) {
	$code = $_REQUEST['captcha'];
	$url = str_replace('updateserver/', base64_decode("Y2FwdGNoYS5waHA/Y2hlY2s9dHJ1ZSZQSFBTRVNTSUQ9"), UPDATE_SERVER);
	$url.= "{$sess_id}&code={$code}";