Changeset 754


Ignore:
Timestamp:
Nov 15, 2021 10:58:50 PM (2 years ago)
Author:
anonymous
Message:

Minor backporting

Location:
branches/1.1dev
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1dev/bin/module_maker/_config.inc.php

    r109 r754  
    2020}
    2121
     22$CFG = new stdClass;
    2223$CFG->enable_session = false;
    2324$CFG->log_file_priority = false;
     
    2829
    2930require_once dirname(__FILE__) . '/../../config/boot.inc.php';
    30 
    31 
    32 ?>
  • branches/1.1dev/config/boot.inc.php

    r707 r754  
    195195        // Database session handling.
    196196        require_once CODE_BASE . '/lib/MySQLSessionHandler.inc.php';
    197         $sess_mysql['dbh']             =& $dbh;            // MySQL link identifyer, if we are already connected to the database
     197        $sess_mysql['dbh']             =& $dbh;           // MySQL link identifier, if we are already connected to the database
    198198        $sess_mysql['hostname']        = 'localhost';     // MySQL hostname
    199199        $sess_mysql['user']            = $CFG->username;  // MySQL username
     
    218218        $_SESSION['_messages'] = array();
    219219    }
    220 
    221 //     if (isset($_COOKIE[session_name()])) {
    222 //         logMsg(sprintf('Found session in cookie: %s=%s', session_name(), $_COOKIE[session_name()]), LOG_DEBUG, __FILE__, __LINE__);
    223 //     }
    224 //     if (getPost(session_name())) {
    225 //         logMsg(sprintf('Found session in post: %s=%s', session_name(), getPost(session_name())), LOG_DEBUG, __FILE__, __LINE__);
    226 //     }
    227 //     if (getGet(session_name())) {
    228 //         logMsg(sprintf('Found session in get: %s=%s', session_name(), getGet(session_name())), LOG_DEBUG, __FILE__, __LINE__);
    229 //     }
    230 //     logMsg(sprintf('Using session %s=%s', session_name(), session_id()), LOG_DEBUG, __FILE__, __LINE__);
    231 
    232 
    233     /******************************************************************************
    234      * LANGUAGE
    235      *****************************************************************************/
    236 
    237     // Set the language.
    238     if ($lang = getFormData('lang')) {
    239         $_SESSION['_language'] = $lang;
    240     } else if (!isset($_SESSION['_language'])) {
    241         preg_match('/^([-[:alpha:]]+)/i', getenv('HTTP_ACCEPT_LANGUAGE'), $lang);
    242         if (isset($lang[0]) && isset($CFG->site_langs[$lang[0]])) {
    243             $_SESSION['_language'] = $lang[0];
    244         } else {
    245             $_SESSION['_language'] = 'en';
    246         }
    247     }
    248 
    249220} // end enable sessions ______________________________________________________
    250221
     
    298269ini_set('include_path',
    299270    ini_get('include_path') . PATH_SEPARATOR .
    300     SITE_BASE . '/_templates/' . $inc_lang . PATH_SEPARATOR .
    301     CODE_BASE . '/templates/' . $inc_lang . PATH_SEPARATOR .
    302 
    303     SITE_BASE . '/_templates/en' . PATH_SEPARATOR .
    304     CODE_BASE . '/templates/en' . PATH_SEPARATOR .
    305 
    306271    SITE_BASE . '/_templates' . PATH_SEPARATOR .
    307272    CODE_BASE . '/templates' . PATH_SEPARATOR .
     
    309274    SITE_BASE . '/../lib'
    310275);
    311 
    312 ?>
  • branches/1.1dev/config/defaults.inc.php

    r687 r754  
    55
    66/*
    7  * This file contains global configration variables that apply to the underlying
     7 * This file contains global configuration variables that apply to the underlying
    88 * codebase framework. These values can be overwritten in a site-specific config
    99 * file to customize values for a specific site.
  • branches/1.1dev/lib/AuthSQL.inc.php

    r753 r754  
    377377            $remote_ip_is_matched = (isset($_SESSION[$this->_auth_name]['remote_ip']) && $_SESSION[$this->_auth_name]['remote_ip'] == getRemoteAddr() || $user_in_trusted_network);
    378378        } else {
    379             logMsg(sprintf('%s%s exempt from remote_ip match.',
    380                 ucfirst($this->_params['auth_name']),
    381                 ($this->getVal('user_id') ? ' ' . $this->getVal('user_id') . ' (' .  $this->getVal('username') . ')' : '')
    382             ), LOG_DEBUG, __FILE__, __LINE__);
     379            // logMsg(sprintf('%s%s exempt from remote_ip match.',
     380            //     ucfirst($this->_params['auth_name']),
     381            //     ($this->getVal('user_id') ? ' ' . $this->getVal('user_id') . ' (' .  $this->getVal('username') . ')' : '')
     382            // ), LOG_DEBUG, __FILE__, __LINE__);
    383383            $remote_ip_is_matched = true;
    384384        }
  • branches/1.1dev/lib/Utilities.inc.php

    r753 r754  
    726726}
    727727
     728/*
     729* Generates a base-65-encoded sha512 hash of $string truncated to $length.
     730*
     731* @access   public
     732* @param    string  $string Input string to hash.
     733* @param    int     $length Length of output hash string.
     734* @return   string          String of hash.
     735* @author   Quinn Comendant <quinn@strangecode.com>
     736* @version  1.0
     737* @since    03 Apr 2016 19:48:49
     738*/
     739function hash64($string, $length=18)
     740{
     741    $app =& App::getInstance();
     742
     743    return mb_substr(preg_replace('/[^\w]/' . $app->getParam('preg_u'), '', base64_encode(hash('sha512', $string, true))), 0, $length);
     744}
     745
    728746/**
    729747 * Signs a value using md5 and a simple text key. In order for this
Note: See TracChangeset for help on using the changeset viewer.