-<?
- /**
- ** display_messages.php
- **
- ** This contains all messages, including information, error, and just
- ** about any other message you can think of.
- **
- **/
-
- function error_username_password_incorrect($color) {
- echo "<BR>";
- echo "<TABLE COLS=1 WIDTH=75% NOBORDER BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
- echo " <TR>";
- echo " <TD BGCOLOR=\"$color[0]\">";
- echo " <FONT FACE=\"Arial,Helvetica\"><B><CENTER>ERROR</CENTER></B></FONT>";
- echo " </TD></TR><TR><TD>";
- echo " <CENTER><FONT FACE=\"Arial,Helvetica\"><BR>". _("Unknown user or password incorrect.") ."<BR><A HREF=\"login.php\" TARGET=_top>". _("Click here to try again") ."</A>.</FONT></CENTER>";
- echo " </TD></TR>";
- echo "</TABLE>";
- echo "</BODY></HTML>";
+<?php
+
+/**
+ * display_messages.php
+ *
+ * This contains all messages, including information, error, and just
+ * about any other message you can think of.
+ *
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
+ */
+
+
+/**
+ * Displays error message and URL to message listing
+ * @param string $message error message
+ * @param string $mailbox mailbox name
+ * @param integer $sort sort order
+ * @param integer $startMessage first message
+ * @param array $color color theme
+ * @since 1.0
+ */
+function error_message($message, $mailbox, $sort, $startMessage) {
+ $urlMailbox = urlencode($mailbox);
+ $link = array (
+ 'URL' => sqm_baseuri()."src/right_main.php?sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox",
+ 'TEXT' => sprintf (_("Click here to return to %s"), strtoupper($mailbox) == 'INBOX' ? _("INBOX") : imap_utf7_decode_local($mailbox))
+ );
+ error_box($message, $link);
+}
+
+/**
+ * Displays error message
+ * @param string $message error message
+ * @param array $color color theme
+ * @since 1.0
+ */
+function plain_error_message($message) {
+ error_box($message);
+}
+
+/**
+ * Displays error when user is logged out
+ *
+ * Error strings can be overriden by logout_error hook
+ * @param string $errString error message
+ * @param string $errTitle title of page with error message
+ * @since 1.2.6
+ */
+function logout_error( $errString, $errTitle = '' ) {
+ global $frame_top, $org_logo, $org_logo_width, $org_logo_height, $org_name,
+ $hide_sm_attributions, $squirrelmail_language, $oTemplate;
+
+ $base_uri = sqm_baseuri();
+
+ list($junk, $errString, $errTitle) = do_hook('logout_error', $errString, $errTitle);
+
+ if ( $errTitle == '' ) {
+ $errTitle = $errString;