예제 #1
0
 function _delete_autologin()
 {
     $user_id = $this->get_uuid();
     if ($user_id != null) {
         $this->user_session->clear_sessions($user_id);
         delete_cookie('sg_auth_cookie', get_site_host(), get_site_path(), '');
     }
 }
예제 #2
0
function show_step($show_img = false)
{
    global $folder, $save_file;
    $arrText = array(1 => '| Dwnload  html content<br/>', 2 => '| Get css and javascript files<br/>', 3 => '| Save background images<br/>', 4 => '| Update html content<br/>', 5 => '| Finish!<br/>');
    $step = isset($_SESSION['step']) ? $_SESSION['step'] : 1;
    for ($i = 1; $i <= $step; $i++) {
        echo $arrText[$i];
        if ($i == 3 && $show_img == true && is_array($_SESSION['show_img']) && count($_SESSION['show_img']) > 0) {
            foreach ($_SESSION['show_img'] as $images) {
                echo '|----' . $images . '<br/>';
            }
        }
        if ($i == 5) {
            $site_path = get_site_path();
            echo '<h3>
                    <a href="' . $site_path . 'download.php?f=' . $folder . '">Download</a>&nbsp;&nbsp;/&nbsp;&nbsp;
                    <a href="' . $site_path . 'save/' . $folder . '/' . $save_file . '" target="_blank">View</a>&nbsp;&nbsp;/&nbsp;&nbsp;
                    <a href="' . $site_path . '">Home</a>
                  </h3>';
        }
    }
}
예제 #3
0
<?php

/**
 * @author Nguyen Duc Hanh
 * @copyright 2014
 * @copygith nguyenduchanh.com
 */
include_once 'hzip.class.php';
include_once 'functions.php';
$folder = isset($_REQUEST['f']) ? $_REQUEST['f'] : '';
if ($folder) {
    HZip::zipDir("save/{$folder}", "save/{$folder}.zip");
    $site_path = get_site_path();
    header("location: {$site_path}/save/{$folder}.zip");
}
예제 #4
0
/* This program is free software. You can redistribute it and/or        */
/* modify it under the terms of the GNU General Public License          */
/* as published by the Free Software Foundation.                        */
/************************************************************************/
// $Id$
if (!defined('AT_INCLUDE_PATH')) {
    exit;
}
include_once AT_INCLUDE_PATH . 'lib/vital_funcs.inc.php';
//define('AT_DEVEL', 0);
define('AT_ERROR_REPORTING', E_ERROR | E_WARNING | E_PARSE);
// default is E_ALL ^ E_NOTICE, use E_ALL or E_ALL + E_STRICT for developing
//define('AT_ERROR_REPORTING', E_ALL + E_STRICT); // default is E_ALL ^ E_NOTICE, use E_ALL or E_ALL + E_STRICT for developing
define('AT_DEVEL_TRANSLATE', 0);
// Multisite constants and checks
define('AT_SITE_PATH', get_site_path());
define('AT_SUBSITE_THEME_DIR', realpath(AT_SITE_PATH . "themes") . "/");
define('AT_MULTISITE_CONFIG_FILE', AT_INCLUDE_PATH . 'config_multisite.inc.php');
// Inform IE6 Users They must upgrade
if (isset($_SERVER['HTTP_USER_AGENT'])) {
    if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.') !== FALSE) {
        header("Location: ie6.html");
    }
}
/*
 * structure of this document (in order):
 *
 * 0. load config.inc.php
 * 1. load constants
 * 2. initialize db connection and populate $_config
 * 3. initialize session
예제 #5
0
// if the mysql[i] extension has been loaded, the db_connect function should exist
if (function_exists('db_connect')) {
    // defaults where no database access
    $_OPENDB_THEME = 'default';
    $_OPENDB_LANGUAGE = 'ENGLISH';
    if (is_opendb_configured()) {
        if (is_db_connected()) {
            // Cache often used configuration entries
            $CONFIG_VARS['logging'] = get_opendb_config_var('logging');
            // Buffer output for possible pushing through ob_gzhandler handler
            if (is_gzip_compression_enabled($PHP_SELF)) {
                ob_start('ob_gzhandler');
            }
            // Restrict cookie to site host and path.
            if (get_opendb_config_var('site', 'restrict_session_cookie_to_host_path') === TRUE) {
                session_set_cookie_params(0, get_site_path(), get_site_host());
            }
            if (get_opendb_config_var('session_handler', 'enable') === TRUE) {
                require_once "./lib/dbsession.php";
                if (strtolower(ini_get('session.save_handler')) == 'user' || ini_set('session.save_handler', 'user')) {
                    session_set_save_handler('db_session_open', 'db_session_close', 'db_session_read', 'db_session_write', 'db_session_destroy', 'db_session_gc');
                } else {
                    opendb_logger(OPENDB_LOG_ERROR, __FILE__, NULL, 'Cannot set session.save_handler to \'user\'');
                }
            }
            // We want to start the session here, so we can get access to the $_SESSION properly.
            session_name(get_opendb_session_cookie_name());
            session_start();
            handle_opendb_remember_me();
            //allows specific pages to overide themes
            if (is_exists_theme($_OVRD_OPENDB_THEME)) {
예제 #6
0
파일: http.php 프로젝트: horrabin/opendb
/**
	Fetches site url
*/
function get_site_url()
{
    $protocol = get_site_protocol();
    $host = get_site_host();
    $port = get_site_port();
    $path = get_site_path();
    // do not display port if default port for either protocol.
    if ($protocol == 'http' && $port == '80' || $protocol == 'https' && $port == '443') {
        $port = '';
    }
    return $protocol . "://" . $host . (strlen($port) > 0 ? ":" . $port : "") . $path;
}
예제 #7
0
<?php

define('DEBUG', false);
# page settings
define('BASE_URL', get_site_path());
define('SITENAME', 'Example Company');
# site settings
define('USE_DATABASE', FALSE);
# email settings
define('FROM_EMAIL_ADDRESS', '');
# mysql database settings
if (USE_DATABASE) {
    if (!strstr(BASE_URL, 'projects')) {
        define('DB_HOST', '');
        define('DB_USER', '');
        define('DB_PASS', '');
        define('DB_DATABASE', '');
    } else {
        define('DB_HOST', '127.0.0.1');
        define('DB_USER', 'root');
        define('DB_PASS', 'admin');
        define('DB_DATABASE', 'admin_test');
    }
    connect_database();
}
# data paths
define('EXPORT_PATH', get_root_path() . 'data/exports/');