Changeset ab0b51a1 in github


Ignore:
Timestamp:
Feb 15, 2011 6:10:59 AM (2 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
dd07e79
Parents:
da142bb
Message:
  • Use only one from IMAP authentication methods to prevent login delays (1487784)
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    rda142bb rab0b51a1  
    22=========================== 
    33 
     4- Use only one from IMAP authentication methods to prevent login delays (1487784) 
    45- Replying to a sent message puts the old recipient as the new recipient (#1487074) 
    56- Fulltext search over (almost) all data for contacts 
  • program/include/rcube_imap_generic.php

    r075ee62a rab0b51a1  
    783783                $auth_methods[] = 'LOGIN'; 
    784784            } 
     785 
     786            // Use best (for security) supported authentication method 
     787            foreach (array('DIGEST-MD5', 'CRAM-MD5', 'CRAM_MD5', 'PLAIN', 'LOGIN') as $auth_method) { 
     788                if (in_array($auth_method, $auth_methods)) { 
     789                    break; 
     790                } 
     791            } 
    785792        } 
    786793        else { 
     
    792799            } 
    793800            // replace AUTH with CRAM-MD5 for backward compat. 
    794             $auth_methods[] = $auth_method == 'AUTH' ? 'CRAM-MD5' : $auth_method; 
     801            if ($auth_method == 'AUTH') { 
     802                $auth_method = 'CRAM-MD5'; 
     803            } 
    795804        } 
    796805 
     
    799808 
    800809        // Authenticate 
    801         foreach ($auth_methods as $method) { 
    802             switch ($method) { 
     810        switch ($auth_method) { 
    803811            case 'CRAM_MD5': 
    804                 $method = 'CRAM-MD5'; 
     812                $auth_method = 'CRAM-MD5'; 
    805813            case 'CRAM-MD5': 
    806814            case 'DIGEST-MD5': 
    807815            case 'PLAIN': 
    808                 $result = $this->authenticate($user, $password, $method); 
     816                $result = $this->authenticate($user, $password, $auth_method); 
    809817                break; 
    810818            case 'LOGIN': 
     
    812820                break; 
    813821            default: 
    814                 $this->setError(self::ERROR_BAD, "Configuration error. Unknown auth method: $method"); 
    815             } 
    816  
    817             if (is_resource($result)) { 
    818                 break; 
    819             } 
     822                $this->setError(self::ERROR_BAD, "Configuration error. Unknown auth method: $auth_method"); 
    820823        } 
    821824 
Note: See TracChangeset for help on using the changeset viewer.