[Svn] r4202 - trunk/roundcubemail

trac at roundcube.net trac at roundcube.net
Tue Nov 9 14:21:02 CET 2010


Author: alec
Date: 2010-11-09 07:21:02 -0600 (Tue, 09 Nov 2010)
New Revision: 4202

Modified:
   trunk/roundcubemail/index.php
Log:
- Handle situation when $IMAP object isn't initialized on log in


Modified: trunk/roundcubemail/index.php
===================================================================
--- trunk/roundcubemail/index.php	2010-11-09 11:26:06 UTC (rev 4201)
+++ trunk/roundcubemail/index.php	2010-11-09 13:21:02 UTC (rev 4202)
@@ -118,9 +118,11 @@
     $OUTPUT->redirect($redir);
   }
   else {
-    $OUTPUT->show_message($IMAP->get_error_code() < -1 ? 'imaperror' : 'loginfailed', 'warning');
+    $error_code = is_object($IMAP) ? $IMAP->get_error_code() : -1;
+
+    $OUTPUT->show_message($error_code < -1 ? 'imaperror' : 'loginfailed', 'warning');
     $RCMAIL->plugins->exec_hook('login_failed', array(
-      'code' => $IMAP->get_error_code(), 'host' => $auth['host'], 'user' => $auth['user']));
+      'code' => $error_code, 'host' => $auth['host'], 'user' => $auth['user']));
     $RCMAIL->kill_session();
   }
 }

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



More information about the Svn mailing list