コード例 #1
0
ファイル: index.php プロジェクト: riki343/MyPrivateDesktop
/**
 * This file is a part of MyWebSQL package
 * @file:      index.php
 * @author     Samnan ur Rehman
 * @copyright  (c) 2008-2014 Samnan ur Rehman
 * @web        http://mywebsql.net
 * @license    http://mywebsql.net/license
 */
define('BASE_PATH', dirname(__FILE__));
header("Content-Type: text/html;charset=utf-8");
include_once BASE_PATH . "/lib/session.php";
Session::init();
date_default_timezone_set('UTC');
include BASE_PATH . '/modules/configuration.php';
initConfiguration();
// buffer unless we are in the download module (it will handle the buffering itself)
if (v($_REQUEST["type"]) != "dl") {
    include_once BASE_PATH . "/lib/output.php";
    Output::buffer();
} else {
    $_REQUEST["type"] = 'download';
}
if (defined("TRACE_FILEPATH") && TRACE_FILEPATH && defined("TRACE_MESSAGES") && TRACE_MESSAGES) {
    ini_set("error_log", TRACE_FILEPATH);
}
include_once BASE_PATH . "/lib/util.php";
require BASE_PATH . '/modules/auth.php';
$auth_module = new MyWebSQL_Authentication();
if (!$auth_module->authenticate()) {
    if (v($_REQUEST["q"]) == "wrkfrm") {
コード例 #2
0
ファイル: cache.php プロジェクト: nisnaker/MyWebSQL
<?php

/**
 * This file is a part of MyWebSQL package
 * outputs scripts and stylesheets for the application
 * @file:      cache.php
 * @author     Samnan ur Rehman
 * @copyright  (c) 2008-2014 Samnan ur Rehman
 * @web        http://mywebsql.net
 * @license    http://mywebsql.net/license
 */
define('BASE_PATH', dirname(__FILE__));
$useCache = file_exists('js/min/minify.txt');
include BASE_PATH . '/modules/configuration.php';
initConfiguration(false);
$fileList = v($_REQUEST["script"]);
// concat theme path to make etags unique per theme
if ($fileList == '') {
    $fileList = THEME_PATH . v($_REQUEST["css"]);
}
if ($fileList == '') {
    exit;
}
header("X-Frame-Options: SAMEORIGIN");
// cache scripts and css per version, if not in development mode
if ($useCache) {
    $versionTag = md5($fileList . APP_VERSION);
    $eTag = v($_SERVER['HTTP_IF_NONE_MATCH']);
    if ($eTag != '' && $versionTag == $eTag) {
        header($_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified');
        header('Content-Length: 0');