[Svn] r2849 - in trunk/roundcubemail: . program/include

trac at roundcube.net trac at roundcube.net
Fri Aug 7 18:22:30 CEST 2009


Author: thomasb
Date: 2009-08-07 11:22:30 -0500 (Fri, 07 Aug 2009)
New Revision: 2849

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/program/include/rcube_imap.php
Log:
Add 'imap_connect' hook (#1485956)

Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2009-08-07 16:13:35 UTC (rev 2848)
+++ trunk/roundcubemail/CHANGELOG	2009-08-07 16:22:30 UTC (rev 2849)
@@ -1,6 +1,8 @@
 CHANGELOG RoundCube Webmail
 ===========================
 
+- Added 'imap_connect' hook (#1485956)
+- Fix vcard_attachments plugin (#1486035)
 - Updated PEAR::Auth_SASL to 1.0.3 version
 - Use sequence names only with PostgreSQL (#1486018)
 - Re-designed User Preferences interface 

Modified: trunk/roundcubemail/program/include/rcube_imap.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_imap.php	2009-08-07 16:13:35 UTC (rev 2848)
+++ trunk/roundcubemail/program/include/rcube_imap.php	2009-08-07 16:22:30 UTC (rev 2849)
@@ -70,6 +70,8 @@
   var $debug_level = 1;
   var $error_code = 0;
   var $options = array('imap' => 'check');
+  
+  private $host, $user, $pass, $port, $ssl;
 
 
   /**
@@ -101,19 +103,22 @@
     // check for Open-SSL support in PHP build
     if ($use_ssl && extension_loaded('openssl'))
       $ICL_SSL = $use_ssl == 'imaps' ? 'ssl' : $use_ssl;
-    else if ($use_ssl)
-      {
+    else if ($use_ssl) {
       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'];
 
-    $this->conn = iil_Connect($host, $user, $pass, $this->options);
-    $this->host = $host;
-    $this->user = $user;
+    $this->conn = iil_Connect($data['host'], $data['user'], $pass, $this->options);
+    $this->host = $data['host'];
+    $this->user = $data['user'];
     $this->pass = $pass;
     $this->port = $port;
     $this->ssl = $use_ssl;

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



More information about the Svn mailing list