Changeset 2143 in subversion for trunk/roundcubemail/program/lib/imap.inc
- Timestamp:
- Dec 11, 2008 3:30:00 AM (4 years ago)
- File:
-
- 1 edited
-
trunk/roundcubemail/program/lib/imap.inc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/lib/imap.inc
r2096 r2143 74 74 - allow iil_C_HandlePartBody() to fetch whole message 75 75 - optimize iil_C_FetchHeaders() to use only one FETCH command 76 - added 4th argument to iil_Connect() 77 - allow setting rootdir and delimiter before connect 76 78 77 79 ********************************************************/ … … 197 199 198 200 function iil_PutLine($fp, $string, $endln=true) { 199 //console('C: '. rtrim($string));201 console('C: '. rtrim($string)); 200 202 return fputs($fp, $string . ($endln ? "\r\n" : '')); 201 203 } … … 477 479 function iil_C_NameSpace(&$conn) { 478 480 global $my_prefs; 481 482 if (isset($my_prefs['rootdir']) && is_string($my_prefs['rootdir'])) { 483 $conn->rootdir = $my_prefs['rootdir']; 484 return true; 485 } 479 486 480 487 if (!iil_C_GetCapability($conn, 'NAMESPACE')) { 481 488 return false; 482 }483 484 if ($my_prefs["rootdir"]) {485 return true;486 489 } 487 490 … … 511 514 $conn->rootdir = $first_userspace[0]; 512 515 $conn->delimiter = $first_userspace[1]; 513 $my_prefs["rootdir"] = substr($conn->rootdir, 0, -1); 516 $my_prefs['rootdir'] = substr($conn->rootdir, 0, -1); 517 $my_prefs['delimiter'] = $conn->delimiter; 514 518 515 519 return true; 516 520 } 517 521 518 function iil_Connect($host, $user, $password ) {522 function iil_Connect($host, $user, $password, $options=null) { 519 523 global $iil_error, $iil_errornum; 520 524 global $ICL_SSL, $ICL_PORT; … … 524 528 $iil_error = ''; 525 529 $iil_errornum = 0; 526 527 //set auth method 528 $auth_method = 'plain'; 529 if (func_num_args() >= 4) { 530 $auth_array = func_get_arg(3); 531 if (is_array($auth_array)) { 532 $auth_method = $auth_array['imap']; 533 } 534 if (empty($auth_method)) { 535 $auth_method = "plain"; 536 } 537 } 530 531 // set some imap options 532 if (is_array($options)) { 533 foreach($options as $optkey => $optval) { 534 if ($optkey == 'imap') { 535 $auth_method = $optval; 536 } else if ($optkey == 'rootdir') { 537 $my_prefs['rootdir'] = $optval; 538 } else if ($optkey == 'delimiter') { 539 $my_prefs['delimiter'] = $optval; 540 } 541 } 542 } 543 544 if (empty($auth_method)) 545 $auth_method = 'plain'; 546 538 547 $message = "INITIAL: $auth_method\n"; 539 548 … … 2139 2148 */ 2140 2149 function iil_C_GetHierarchyDelimiter(&$conn) { 2150 2151 global $my_prefs; 2152 2141 2153 if ($conn->delimiter) { 2142 return $conn->delimiter; 2154 return $conn->delimiter; 2155 } 2156 if (!empty($my_prefs['delimiter'])) { 2157 return ($conn->delimiter = $my_prefs['delimiter']); 2143 2158 } 2144 2159
Note: See TracChangeset
for help on using the changeset viewer.
