Changeset 754 for branches/1.1dev/lib


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

Minor backporting

Location:
branches/1.1dev/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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.