Added displaying of error messages to login page.
[squirrelmail.git] / src / login.php
index 2fea9d046537e942fc77f1ae0d54f28b4fe7e7d4..e5efc68a6091f3f2f6dfa44085b492dad881bc12 100644 (file)
@@ -47,7 +47,6 @@ $_SESSION=array();
  * versions. Produces warning on login page. Bug should be fixed only in 4.3.0
  */
 
-//exit;
 /**
  * This detects if the IMAP server has logins disabled, and if so,
  * squelches the display of the login form and puts up a message
@@ -110,6 +109,10 @@ if (! isset($color) || ! is_array($color)) {
     $color[7]  = '#0000cc';  /* blue          Links                  */
     $color[8]  = '#000000';  /* black         Normal text            */
 }
+/**
+ * send out all the cookies
+ */
+sqsetcookieflush();
 
 displayHtmlHeader( "$org_name - " . _("Login"), $header, FALSE );
 
@@ -127,7 +130,7 @@ if (isset($org_logo) && $org_logo) {
      $org_logo_height>0) {
         $width_and_height .= " height=\"$org_logo_height\"";
     }
-
+    
     $logo_str = '<img src="'.$org_logo.'" ' .
                        'alt="'. sprintf(_("%s Logo"), $org_name).'" ' .
                        $width_and_height .
@@ -157,7 +160,6 @@ $password_field = addPwField($password_form_name).
 
 session_write_close();
 
-$oTemplate->assign('color', $color);
 $oTemplate->assign('logo_str', $logo_str);
 $oTemplate->assign('sm_attribute_str', $sm_attribute_str);
 $oTemplate->assign('org_name_str', sprintf (_("%s Login"), $org_name));
@@ -166,4 +168,10 @@ $oTemplate->assign('password_field', $password_field);
 $oTemplate->assign('submit_field', addSubmit(_("Login")));
 
 $oTemplate->display('login.tpl');
+
+// Turn off delayed error handling to make sure all errors are dumped.
+$oErrorHandler->delayedErrors(false);
+
+trigger_error('login');
+$oTemplate->display('footer.tpl');
 ?>
\ No newline at end of file