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(), '');
     }
 }
function generate_site_stream()
{
    $CI =& get_instance();
    if ($CI->config->item('use_facebook') === true) {
        $domain_name = get_site_host();
        echo "<iframe src=\"http://www.facebook.com/plugins/activity.php?site={$domain_name}&amp;width=300&amp;height=300&amp;header=true&amp;colorscheme=light&amp;recommendations=false\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:300px; height:300px;\" allowTransparency=\"true\"></iframe>";
    }
}
示例#3
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)) {
示例#4
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;
}