Beispiel #1
0
 function __construct($pagename)
 {
     set_error_handler("debug_handler");
     if (ini_get("magic_quotes_gpc") !== false and get_magic_quotes_gpc()) {
         modify::stripslashes($_REQUEST);
     }
     if (ini_get("register_globals")) {
         modify::dropglobals();
     }
     @ignore_user_abort(0);
     self::$time_start = sys_get_microtime();
     if (!sql_connect(SETUP_DB_HOST, SETUP_DB_USER, sys_decrypt(SETUP_DB_PW, sha1(SETUP_ADMIN_USER)), SETUP_DB_NAME)) {
         $err = sprintf("{t}Cannot connect to database %s on %s.{/t}\n", SETUP_DB_NAME, SETUP_DB_HOST) . sql_error();
         trigger_error($err, E_USER_ERROR);
         sys_die($err);
     }
     session_set_cookie_params(2592000);
     // 1 month
     session_name(SESSION_NAME);
     session_set_save_handler("_login_session_none", "_login_session_none", "_login_session_read", "_login_session_none", "_login_session_destroy", "_login_session_none");
     session_start();
     header("Cache-Control: private, max-age=1, must-revalidate");
     header("Pragma: private");
     $this->template = new template();
     $this->pagename = $pagename;
     class_exists("modify");
     // load class
 }
Beispiel #2
0
 static function init()
 {
     self::$time_start = sys_get_microtime();
     // clean request vars
     if (ini_get("magic_quotes_gpc") !== false and get_magic_quotes_gpc()) {
         modify::stripslashes($_REQUEST);
     }
     foreach ($_REQUEST as $key => $val) {
         if (is_array($val) and count($val) > 0) {
             $_REQUEST[$key] = array();
             foreach ($val as $val2) {
                 if (!is_array($val2)) {
                     $_REQUEST[$key][$val2] = $val2;
                 }
             }
         }
     }
     // set up smarty
     self::$smarty = new Smarty();
     self::$smarty->register_prefilter(array("modify", "urladdon_quote"));
     if (isset($_REQUEST["print"])) {
         self::$smarty->register_outputfilter(array("modify", "striplinksforms"));
     }
     if (isset($_REQUEST["print"])) {
         self::$smarty->assign("print", $_REQUEST["print"]);
     }
     self::$smarty->compile_dir = SIMPLE_CACHE . "/smarty";
     self::$smarty->template_dir = "templates";
     self::$smarty->config_dir = "templates/css";
     self::$smarty->compile_check = false;
     // refresh smarty cache
     if (DEBUG) {
         debug_check_tpl();
     }
     // set up database
     if (!sql_connect(SETUP_DB_HOST, SETUP_DB_USER, sys_decrypt(SETUP_DB_PW, sha1(SETUP_ADMIN_USER)), SETUP_DB_NAME)) {
         $err = sprintf("{t}Cannot connect to database %s on %s.{/t}\n", SETUP_DB_NAME, SETUP_DB_HOST) . sql_error();
         trigger_error($err, E_USER_ERROR);
         sys_die($err);
     }
     // verify credentials
     login_handle_login();
 }
Beispiel #3
0
$cid = sha1(serialize($_GET) . filemtime(__FILE__)) . ".png";
$cache_dir = "cache/";
if (@is_dir("../../../../simple_cache/artichow/")) {
    $cache_dir = "../../../../simple_cache/artichow/";
}
if (file_exists($cache_dir . $cid) and filesize($cache_dir . $cid) > 0) {
    if ($cache_dir == "cache/") {
        header("Location: " . $cache_dir . $cid);
    } else {
        header("Content-Type: image/png; charset=utf-8");
        readfile($cache_dir . $cid);
    }
    exit;
}
if (ini_get("magic_quotes_gpc") !== false and get_magic_quotes_gpc()) {
    modify::stripslashes($_REQUEST);
}
$data = array(0);
if (!empty($_REQUEST["data"])) {
    $data = explode(",", $_REQUEST["data"]);
}
$data2 = array();
if (!empty($_REQUEST["data2"])) {
    $data2 = explode(",", $_REQUEST["data2"]);
}
$data3 = array();
if (!empty($_REQUEST["data3"])) {
    $data3 = explode(",", $_REQUEST["data3"]);
}
$keys = array(0);
if (!empty($_REQUEST["keys"])) {