Ignore:
Timestamp:
Nov 24, 2015 5:38:54 PM (8 years ago)
Author:
anonymous
Message:

Escaped quotes from email from names.
Changed logMsg string truncation method and added version to email log msg.
Better variable testing in carry queries.
Spelling errors.
Added runtime cache to Currency.
Added logging to form validation.
More robust form validation.
Added json serialization methond to Version.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Auth_SQL.inc.php

    r541 r550  
    3232class Auth_SQL
    3333{
    34 
    3534    // Available hash types for class Auth_SQL.
    3635    const ENCRYPT_PLAINTEXT = 1;
     
    7069
    7170        // The type of hash to use for passwords stored in the db_table. Use one of the Auth_SQL::ENCRYPT_* types specified above.
    72         // Hardened password hashes rely on the same key/salt being used to compare hashs.
     71        // Hardened password hashes rely on the same key/salt being used to compare hashes.
    7372        // Be aware that when using one of the hardened types the App signing_key or $more_salt below cannot change!
    7473        'hash_type' => self::ENCRYPT_MD5,
     
    176175            }
    177176
    178             // The minimal columns for a table compatable with the Auth_SQL class.
     177            // The minimal columns for a table compatible with the Auth_SQL class.
    179178            $db->query("CREATE TABLE IF NOT EXISTS " . $db->escapeString($this->getParam('db_table')) . " (
    180179                " . $this->getParam('db_primary_key') . " MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
     
    475474                switch ($user_data['blocked_reason']) {
    476475                    case 'account abuse' :
    477                         $app->raiseMsg(sprintf(_("This account has been blocked due to possible account abuse. Please contact us to reactivate."), null), MSG_WARNING, __FILE__, __LINE__);
     476                        $app->raiseMsg(sprintf(_("This account has been blocked due to possible account abuse. Please contact an administrator to reactivate."), null), MSG_WARNING, __FILE__, __LINE__);
    478477                        break;
    479478                    default :
     
    507506                if ($this->get('abuse_warning_level') < $this->_params['login_abuse_warnings']) {
    508507                    // Warn the user with a password reset.
    509                     $this->resetPassword(null, _("This is a security precaution. We have detected this account has been accessed from multiple computers simultaneously. It is against policy to share login information with others. If further account abuse is detected this account will be blocked."));
     508                    $this->resetPassword(null, _("This is a security precaution. We have detected this account has been accessed from multiple computers simultaneously. It is against policy to share credentials with others. If further account abuse is detected this account will be blocked."));
    510509                    $app->raiseMsg(_("Your password has been reset as a security precaution. Please check your email for more information."), MSG_NOTICE, __FILE__, __LINE__);
    511510                    $app->logMsg(sprintf('Account abuse detected for user_id %s (%s) from IP %s', $this->get('user_id'), $this->get('username'), $this->get('remote_ip')), LOG_WARNING, __FILE__, __LINE__);
     
    652651            if (strtotime($_SESSION['_auth_sql'][$this->_ns]['last_access_datetime']) > (time() - 43200)) {
    653652                // Only raise message if last session is less than 12 hours old.
    654                 $app->raiseMsg(_("Your session has expired. You need to log-in again."), MSG_NOTICE, __FILE__, __LINE__);
     653                $app->raiseMsg(sprintf(_("For your safety we logged you out after being idle for %s. Please log in again."), humanTime($this->_params['idle_timeout'], 'hour', '%01.0f')), MSG_NOTICE, __FILE__, __LINE__);
    655654            }
    656655
     
    10441043            $email = new Email(array(
    10451044                'to' => $user_data['email'],
    1046                 'from' => sprintf('%s <%s>', $app->getParam('site_name'), $app->getParam('site_email')),
     1045                'from' => sprintf('"%s" <%s>', addcslashes($app->getParam('site_name'), '"'), $app->getParam('site_email')),
    10471046                'subject' => sprintf('%s password change', $app->getParam('site_name'))
    10481047            ));
Note: See TracChangeset for help on using the changeset viewer.