Пример #1
0
            show_download('win');
        }
    } else {
        if (strstr($client_info, 'Mac')) {
            if (strstr($client_info, 'PPC Mac OS X')) {
                show_download('macppc');
            } else {
                show_download('mac');
            }
        } else {
            if (strstr($client_info, 'Android')) {
                // Check for Android before Linux,
                // since Android contains the Linux kernel and the
                // web browser user agent string lists Linux too.
                //
                show_download('android');
            } else {
                if (strstr($client_info, 'Linux')) {
                    if (strstr($client_info, 'x86_64')) {
                        show_download('linuxx64');
                    } else {
                        show_download('linux');
                    }
                } else {
                    show_download(null);
                }
            }
        }
    }
}
page_tail(true);
Пример #2
0
    my_session_login($_POST['username'], $_POST['password']);
} elseif (isset($_GET['logout'])) {
    my_session_logout();
} elseif (my_session_valid()) {
    $path = $GLOBALS['config']['my_file_path'];
    if (isset($_GET['c'])) {
        $path = my_validate_path($_GET['c']);
    }
    if (isset($_GET['p'])) {
        $path = my_validate_path($_GET['p']);
    }
    if (is_file($path) && !is_link($path)) {
        if (isset($_GET['c'])) {
            show_checksum($path);
        } else {
            show_download($path);
        }
    } elseif (is_dir($path)) {
        show_files($path);
    } else {
        header("HTTP/1.0 404 Not Found");
        show_error("404 - Not found");
    }
} else {
    show_login();
}
exit;
################################################################################
function my_init()
{
    if (is_readable('../depot.conf')) {