[Svn] r2861 - trunk/roundcubemail/program/include

trac at roundcube.net trac at roundcube.net
Fri Aug 14 10:24:09 CEST 2009


Author: thomasb
Date: 2009-08-14 03:24:09 -0500 (Fri, 14 Aug 2009)
New Revision: 2861

Modified:
   trunk/roundcubemail/program/include/rcube_imap.php
Log:
Changed imap_connect hook according to suggestions in #1485956

Modified: trunk/roundcubemail/program/include/rcube_imap.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_imap.php	2009-08-14 08:13:23 UTC (rev 2860)
+++ trunk/roundcubemail/program/include/rcube_imap.php	2009-08-14 08:24:09 UTC (rev 2861)
@@ -36,7 +36,7 @@
  *
  * @package    Mail
  * @author     Thomas Bruederli <roundcube at gmail.com>
- * @version    1.40
+ * @version    1.5
  * @link       http://ilohamail.org
  */
 class rcube_imap
@@ -107,16 +107,20 @@
       raise_error(array('code' => 403, 'type' => 'imap', 'file' => __FILE__,
                         'message' => 'Open SSL not available;'), TRUE, FALSE);
       $port = 143;
-  }
+    }
 
     $ICL_PORT = $port;
     $IMAP_USE_INTERNAL_DATE = false;
     
-    $data = rcmail::get_instance()->plugins->exec_hook('imap_connect', array('host' => $host, 'user' => $user));
-    if (!empty($data['pass']))
-      $pass = $data['pass'];
+    $attempt = 0;
+    do {
+      $data = rcmail::get_instance()->plugins->exec_hook('imap_connect', array('host' => $host, 'user' => $user, 'attempt' => ++$attempt));
+      if (!empty($data['pass']))
+        $pass = $data['pass'];
 
-    $this->conn = iil_Connect($data['host'], $data['user'], $pass, $this->options);
+      $this->conn = iil_Connect($data['host'], $data['user'], $pass, $this->options);
+    } while(!$this->conn && $data['retry']);
+
     $this->host = $data['host'];
     $this->user = $data['user'];
     $this->pass = $pass;

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



More information about the Svn mailing list