Changeset 890eae6 in github


Ignore:
Timestamp:
Feb 9, 2011 6:33:49 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:
a97937a
Parents:
ea23df6
Message:
  • Use IMAP's ID extension (RFC2971) to print more info into debug log
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    ra77cf22 r890eae6  
    22=========================== 
    33 
     4- Use IMAP's ID extension (RFC2971) to print more info into debug log 
    45- Security: add optional referer check to prevent CSRF in GET requests 
    56- Fix email_dns_check setting not used for identities/contacts (#1487740) 
  • program/include/rcube_imap.php

    rd755ead r890eae6  
    149149        $this->options['port'] = $port; 
    150150 
    151         if ($this->options['debug']) 
     151        if ($this->options['debug']) { 
    152152            $this->conn->setDebug(true, array($this, 'debug_handler')); 
     153 
     154            $this->options['ident'] = array( 
     155                'name' => 'Roundcube Webmail', 
     156                'version' => RCMAIL_VERSION, 
     157                'php' => PHP_VERSION, 
     158                'os' => PHP_OS, 
     159                'command' => $_SERVER['REQUEST_URI'], 
     160            ); 
     161        } 
    153162 
    154163        $attempt = 0; 
  • program/include/rcube_imap_generic.php

    r62481f3 r890eae6  
    760760        } 
    761761 
     762        // Send ID info 
     763        if (!empty($this->prefs['ident']) && $this->getCapability('ID')) { 
     764            $this->id($this->prefs['ident']); 
     765        } 
     766 
    762767        $auth_methods = array(); 
    763768        $result       = null; 
     
    11531158        if (is_array($index)) { 
    11541159            return (int) $index['COUNT']; 
     1160        } 
     1161 
     1162        return false; 
     1163    } 
     1164 
     1165    /** 
     1166     * Executes ID command (RFC2971) 
     1167     * 
     1168     * @param array $items Client identification information key/value hash 
     1169     * 
     1170     * @return array Server identification information key/value hash 
     1171     * @access public 
     1172     * @since 0.6 
     1173     */ 
     1174    function id($items=array()) 
     1175    { 
     1176        if (is_array($items) && !empty($items)) { 
     1177            foreach ($items as $key => $value) { 
     1178                $args[] = $this->escape($key); 
     1179                $args[] = $this->escape($value); 
     1180            } 
     1181        } 
     1182 
     1183        list($code, $response) = $this->execute('ID', array( 
     1184            !empty($args) ? '(' . implode(' ', (array) $args) . ')' : $this->escape(null) 
     1185        )); 
     1186 
     1187 
     1188        if ($code == self::ERROR_OK && preg_match('/\* ID /i', $response)) { 
     1189            $response = substr($response, 5); // remove prefix "* ID " 
     1190            $items    = $this->tokenizeResponse($response); 
     1191            $result   = null; 
     1192 
     1193            for ($i=0, $len=count($items); $i<$len; $i += 2) { 
     1194                $result[$items[$i]] = $items[$i+1]; 
     1195            } 
     1196 
     1197            return $result; 
    11551198        } 
    11561199 
Note: See TracChangeset for help on using the changeset viewer.