[Svn] r3415 - in trunk/roundcubemail: . config program/include program/lib

trac at roundcube.net trac at roundcube.net
Wed Mar 24 15:45:49 CET 2010


Author: alec
Date: 2010-03-24 09:45:49 -0500 (Wed, 24 Mar 2010)
New Revision: 3415

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/config/main.inc.php.dist
   trunk/roundcubemail/program/include/rcmail.php
   trunk/roundcubemail/program/lib/imap.inc
Log:
- Added 'imap_force_caps' option for after-login CAPABILITY checking (#1485750)


Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2010-03-24 11:56:02 UTC (rev 3414)
+++ trunk/roundcubemail/CHANGELOG	2010-03-24 14:45:49 UTC (rev 3415)
@@ -1,6 +1,7 @@
 CHANGELOG RoundCube Webmail
 ===========================
 
+- Added 'imap_force_caps' option for after-login CAPABILITY checking (#1485750)
 - Password: Support dovecotpw encryption
 - TinyMCE 3.3.1
 - Implemented messages copying using drag&drop + SHIFT (#1484086)

Modified: trunk/roundcubemail/config/main.inc.php.dist
===================================================================
--- trunk/roundcubemail/config/main.inc.php.dist	2010-03-24 11:56:02 UTC (rev 3414)
+++ trunk/roundcubemail/config/main.inc.php.dist	2010-03-24 14:45:49 UTC (rev 3415)
@@ -75,6 +75,11 @@
 $rcmail_config['imap_root'] = null;
 $rcmail_config['imap_delimiter'] = null;
 
+// By default IMAP capabilities are readed after connection to IMAP server
+// In some cases, e.g. when using IMAP proxy, there's a need to refresh the list
+// after login. Set to True if you've got this case.
+$rcmail_config['imap_force_caps'] = false;
+
 // ----------------------------------
 // SMTP
 // ----------------------------------

Modified: trunk/roundcubemail/program/include/rcmail.php
===================================================================
--- trunk/roundcubemail/program/include/rcmail.php	2010-03-24 11:56:02 UTC (rev 3414)
+++ trunk/roundcubemail/program/include/rcmail.php	2010-03-24 14:45:49 UTC (rev 3415)
@@ -426,6 +426,7 @@
       'delimiter' => isset($_SESSION['imap_delimiter']) ? $_SESSION['imap_delimiter'] : $this->config->get('imap_delimiter'),
       'rootdir' => isset($_SESSION['imap_root']) ? $_SESSION['imap_root'] : $this->config->get('imap_root'),
       'debug_mode' => (bool) $this->config->get('imap_debug', 0),
+      'force_caps' => (bool) $this->config->get('imap_force_caps'),
     );
 
     $this->imap->set_options($options);

Modified: trunk/roundcubemail/program/lib/imap.inc
===================================================================
--- trunk/roundcubemail/program/lib/imap.inc	2010-03-24 11:56:02 UTC (rev 3414)
+++ trunk/roundcubemail/program/lib/imap.inc	2010-03-24 14:45:49 UTC (rev 3415)
@@ -389,7 +389,7 @@
 	return false;
 }
 
-function iil_ClearCapability()
+function iil_C_ClearCapability($conn)
 {
 	$conn->capability = array();
 	$conn->capability_readed = false;
@@ -550,26 +550,19 @@
 	$iil_error = '';
 	$iil_errornum = 0;
 
-	// set some imap options
+	// set options
 	if (is_array($options)) {
-		foreach($options as $optkey => $optval) {
-			if ($optkey == 'auth_method') {
-				$auth_method = strtoupper($optval);
-			} else if ($optkey == 'rootdir') {
-    				$my_prefs['rootdir'] = $optval;
-			} else if ($optkey == 'delimiter') {
-    				$my_prefs['delimiter'] = $optval;
-			} else if ($optkey == 'debug_mode') {
-    				$my_prefs['debug_mode'] = $optval;
-			}
-		}
-	}
-
-	if (empty($auth_method))
+        $my_prefs = $options;
+    }
+    // set auth method
+    if (!empty($my_prefs['auth_method'])) {
+            $auth_method = strtoupper($my_prefs['auth_method']);
+	} else {
     		$auth_method = 'CHECK';
-		
+    }
+
 	$message = "INITIAL: $auth_method\n";
-		
+
 	$result = false;
 	
 	// initialize connection
@@ -579,13 +572,13 @@
 	$conn->selected    = '';
 	$conn->user        = $user;
 	$conn->host        = $host;
-	
+
 	if ($my_prefs['sort_field'] == 'INTERNALDATE') {
 		$IMAP_USE_INTERNAL_DATE = true;
 	} else if ($my_prefs['sort_field'] == 'DATE') {
     		$IMAP_USE_INTERNAL_DATE = false;
 	}
-	
+
 	//check input
 	if (empty($host)) {
 		$iil_error = "Empty host";
@@ -660,7 +653,7 @@
 			}
 			
 			// Now we're authenticated, capabilities need to be reread
-			iil_ClearCapability();
+			iil_C_ClearCapability($conn);
         	}
 	}
 
@@ -705,6 +698,9 @@
 	}
 
 	if (is_resource($result)) {
+        if ($my_prefs['force_caps']) {
+			iil_C_ClearCapability($conn);
+        }
 		iil_C_Namespace($conn);
 		return $conn;
 	} else {

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list