- /**
- ** display_messages.php
- **
- ** This contains all messages, including information, error, and just
- ** about any other message you can think of.
- **
- ** $Id$
- **/
-
- $display_messages_php = true;
-
- 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 ' <B><CENTER>ERROR</CENTER></B>';
- echo ' </TD></TR><TR><TD>';
- echo ' <CENTER><BR>' . _("Unknown user or password incorrect.") . '<BR><A HREF="login.php" TARGET=_top>' . _("Click here to try again") . '</A>.</CENTER>';
- echo ' </TD></TR>';
- echo '</TABLE>';
- echo '</BODY></HTML>';
+
+/**
+ * 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
+ */
+
+/** @ignore */
+if (! defined('SM_PATH')) define('SM_PATH','../');
+
+/**
+ * including plugin functions
+ */
+include_once(SM_PATH . 'functions/plugin.php');
+
+/**
+ * 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, $color) {
+ $urlMailbox = urlencode($mailbox);
+ $string = '<tr><td align="center">' . $message . '</td></tr>'.
+ '<tr><td align="center">'.
+ '<a href="'.sqm_baseuri()."src/right_main.php?sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\">".
+ sprintf (_("Click here to return to %s"),
+ strtoupper($mailbox) == 'INBOX' ? _("INBOX") : imap_utf7_decode_local($mailbox)).
+ '</a></td></tr>';
+ error_box($string, $color);
+}
+
+/**
+ * Displays error message
+ * @param string $message error message
+ * @param array $color color theme
+ * @since 1.0
+ */
+function plain_error_message($message, $color) {
+ error_box($message, $color);
+}
+
+/**
+ * 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_name, $org_logo_width, $org_logo_height,
+ $hide_sm_attributions, $version, $squirrelmail_language,
+ $color, $theme, $theme_default;
+
+ $base_uri = sqm_baseuri();
+
+ include_once( SM_PATH . 'functions/page_header.php' );
+ if ( !isset( $org_logo ) ) {
+ // Don't know yet why, but in some accesses $org_logo is not set.
+ include( SM_PATH . 'config/config.php' );
+ }
+ /* Display width and height like good little people */
+ $width_and_height = '';
+ if (isset($org_logo_width) && is_numeric($org_logo_width) && $org_logo_width>0) {
+ $width_and_height = " width=\"$org_logo_width\"";
+ }
+ if (isset($org_logo_height) && is_numeric($org_logo_height) && $org_logo_height>0) {
+ $width_and_height .= " height=\"$org_logo_height\"";