Beispiel #1
0
        header("Location: " . $_SERVER['PHP_SELF']);
        mysql_close();
        exit;
    } else {
        $error = '#' . mysql_errno() . ': ' . mysql_error();
    }
} elseif (!empty($_COOKIE['sxd'])) {
    $user = explode(":", base64_decode($_COOKIE['sxd']));
    if (@mysql_connect(DBHOST, $user[1], $user[2])) {
        $auth = 1;
    } else {
        $error = '#' . mysql_errno() . ': ' . mysql_error();
    }
}
if (!$auth || isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] == 'reload') {
    echo tpl_page(tpl_auth($error ? tpl_error($error) : ''), "<SCRIPT>if (jsEnabled) {document.write('<INPUT TYPE=submit VALUE=Login>');}</SCRIPT>");
    echo "<SCRIPT>document.getElementById('timer').innerHTML = '" . round(array_sum(explode(' ', microtime())) - $timer, 4) . " sec.'</SCRIPT>";
    exit;
}
if (!file_exists(PATH) && !$is_safe_mode) {
    mkdir(PATH, 0777) || trigger_error("Unable to create a directory for printer ", E_USER_ERROR);
}
$SK = new dumper();
define('C_DEFAULT', 1);
define('C_RESULT', 2);
define('C_ERROR', 3);
define('C_WARNING', 4);
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
switch ($action) {
    case 'backup':
        $SK->backup();
Beispiel #2
0
function app_display_table($tp_table)
{
    global $SCHEMA;
    global $TOOL;
    global $ERROR;
    global $debug;
    _db_temporal($tp_table, $table);
    if (!db_access_table($table, "r")) {
        tpl_error_permission_denied(null);
        return;
    }
    app_tools($table);
    $cond = array();
    if (isset($SCHEMA[$table]["TOOLS"]["tool_search"]) && ($str = trim($TOOL["tool_search"])) && ($field = $TOOL["tool_search_field"])) {
        if ($debug) {
            echo "adding search condition '{$field}'<br>\n";
        }
        $cond["{$field}%"] = "%{$str}%";
    }
    $page_size = @$TOOL["tool_page_size"];
    if (!$page_size || $page_size < 0) {
        $page_size = 1;
    }
    $page_start = @$TOOL["tool_page_start"];
    if (!$page_start || $page_start < 0) {
        $page_start = 1;
    }
    if (!isset($SCHEMA[$table]["TOOLS"]["tool_page"])) {
        $page_size = 0;
    }
    // xxx not generic!!!
    if (@$SCHEMA[$table]["TOOLS"]["tool_level"]) {
        $prio = @$TOOL["tool_level"];
        //$cond["#class_name in (select class_name from classes where class_prio >= $prio)"] = true;
    }
    $tmp = db_read($tp_table, null, $cond, @$TOOL["order"], ($page_start - 1) * $page_size, $page_size);
    if ($ERROR) {
        tpl_error(array("ERROR" => $ERROR));
        return;
    }
    $data = _app_prepare_data($table, $tmp, "invalid");
    if (db_access_table($table, "w")) {
        $data["EXTRAHEAD"] = "extra_3buttons_head";
        $primary = _db_primary($table);
        $data["EXTRA"]["button_edit"] = $primary;
        $data["EXTRA"]["button_clone"] = $primary;
        $data["EXTRA"]["button_delete"] = $primary;
    }
    tpl_display_table($data);
}
        tpl_nav($authCharName, $pNav);
        tpl_map();
        tpl_footer(array('js/intel_settings.js', 'js/intel_map.js', 'js/intel_map_poll.js', 'js/intel_map_draw.js', 'js/intel_map_reports.js', 'js/intel_map_logs.js'));
        return;
    }
    if ($pNav == "settings") {
        tpl_header();
        tpl_nav($authCharName, $pNav);
        tpl_settings();
        tpl_footer(array('js/intel_settings.js'));
        return;
    }
    if ($pNav == "help") {
        tpl_header();
        tpl_nav($authCharName, $pNav);
        tpl_help();
        tpl_footer(array('js/intel_settings.js'));
        return;
    }
    if ($pNav == "uploader") {
        tpl_header();
        tpl_nav($authCharName, $pNav);
        tpl_uploader();
        tpl_footer(array('js/intel_settings.js'));
        return;
    }
    tpl_header();
    tpl_nav_empty();
    tpl_error();
    tpl_footer(array());
}
Beispiel #4
0
	if (@mysql_connect(DBHOST, $user[1], $user[2])){
		$auth = 1;
	}
	else{
		$error = '#' . mysql_errno() . ': ' . mysql_error();
	}
}
*/
if (@mysql_connect(DBHOST, DB_SERVER_USERNAME, DB_SERVER_PASSWORD)) {
    $auth = 1;
} else {
    $error = '#' . mysql_errno() . ': ' . mysql_error();
}
if (!$auth || isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] == 'reload') {
    setcookie("sxd");
    echo tpl_page(tpl_auth($error ? tpl_error($error) : ''), "<script>if (jsEnabled) {document.write('<span class=button><button type=submit value=" . TEXT_DUMPER_SUBMIT . ">" . TEXT_DUMPER_SUBMIT . "</button></span>');}</script>");
    echo "<script>document.getElementById('timer').innerHTML = '" . round(array_sum(explode(' ', microtime())) - $timer, 4) . TEXT_DUMPER_SEC . "'</script>";
    exit;
}
if (!file_exists(PATH) && !$is_safe_mode) {
    mkdir(PATH, 0777) || trigger_error($TEXT_DUMPER_DIR_ERROR, E_USER_ERROR);
}
$SK = new dumper();
define('C_DEFAULT', 1);
define('C_RESULT', 2);
define('C_ERROR', 3);
define('C_WARNING', 4);
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
switch ($action) {
    case 'backup':
        $SK->backup();