59177427 |
1 | <?php |
2ba13803 |
2 | |
35586184 |
3 | /** |
4 | * display_messages.php |
5 | * |
15e6162e |
6 | * Copyright (c) 1999-2002 The SquirrelMail Project Team |
35586184 |
7 | * Licensed under the GNU GPL. For full terms see the file COPYING. |
8 | * |
9 | * This contains all messages, including information, error, and just |
10 | * about any other message you can think of. |
11 | * |
12 | * $Id$ |
13 | */ |
3302d0d4 |
14 | |
ec5b189b |
15 | function error_username_password_incorrect() { |
1cf38f19 |
16 | global $frame_top, $color; |
76b684a5 |
17 | /* XXX: Should really not start the HTML before this, or close off more |
18 | cleanly. */ |
2ba13803 |
19 | |
d03f3582 |
20 | if (!isset($frame_top)) { |
21 | $frame_top = '_top'; |
22 | } |
23 | |
35586184 |
24 | echo '<BR>'. |
76b684a5 |
25 | '<TABLE COLS=1 WIDTH="75%" BORDER="0" BGCOLOR="' . $color[4] . '" ALIGN=CENTER>'. |
26f277a6 |
26 | '<TR BGCOLOR="' . $color[0] . '">'. |
ec5b189b |
27 | '<TH>' . _("ERROR") . '</TH>'. |
28 | '</TR>' . |
29 | '<TR><TD>'. |
30 | '<CENTER><BR>' . _("Unknown user or password incorrect.") . |
80e86e94 |
31 | '<BR><A HREF="login.php" TARGET='.$frame_top.'>' . |
ec5b189b |
32 | _("Click here to try again") . |
33 | '</A>.</CENTER>'. |
34 | '</TD></TR>'. |
2ba13803 |
35 | '</TABLE>'. |
36 | '</BODY></HTML>'; |
ec5b189b |
37 | } |
2ba13803 |
38 | |
ec5b189b |
39 | function general_info($motd, $org_logo, $version, $org_name, $color) { |
b6d8d08d |
40 | |
41 | echo '<BR>'. |
76b684a5 |
42 | "<TABLE COLS=1 WIDTH=\"80%\" CELLSPACING=0 CELLPADDING=2 BORDER=\"0\" ALIGN=CENTER><TR><TD BGCOLOR=\"$color[9]\">". |
43 | '<TABLE COLS=1 WIDTH="100%" CELLSPACING=0 CELLPADDING=3 BORDER="0" BGCOLOR="' . $color[4] . '" ALIGN=CENTER>'. |
b6d8d08d |
44 | '<TR>' . |
45 | "<TD BGCOLOR=\"$color[0]\">" . |
46 | '<B><CENTER>'; |
ec5b189b |
47 | printf (_("Welcome to %s's WebMail system"), $org_name); |
b6d8d08d |
48 | echo '</CENTER></B>'. |
49 | '<TR><TD BGCOLOR="' . $color[4] . '">'. |
76b684a5 |
50 | '<TABLE COLS=2 WIDTH="90%" CELLSPACING=0 CELLPADDING=3 BORDER="0" align="center">'. |
b6d8d08d |
51 | '<TR>'. |
52 | '<TD BGCOLOR="' . $color[4] . '"><CENTER>'; |
ec5b189b |
53 | if ( strlen($org_logo) > 3 ) { |
b6d8d08d |
54 | echo "<IMG SRC=\"$org_logo\">"; |
ec5b189b |
55 | } else { |
b6d8d08d |
56 | echo "<B>$org_name</B>"; |
3302d0d4 |
57 | } |
b6d8d08d |
58 | echo '<BR><CENTER>'; |
ec5b189b |
59 | printf (_("Running SquirrelMail version %s (c) 1999-2001."), $version); |
b6d8d08d |
60 | echo '</CENTER><BR>'. |
61 | '</CENTER></TD></TR><TR>' . |
62 | '<TD BGCOLOR="' . $color[4] . '">' . |
63 | $motd. |
64 | '</TD>'. |
65 | '</TR>'. |
66 | '</TABLE>'. |
67 | '</TD></TR>'. |
68 | '</TABLE>'. |
69 | '</TD></TR></TABLE>'; |
ec5b189b |
70 | } |
3302d0d4 |
71 | |
ec5b189b |
72 | function error_message($message, $mailbox, $sort, $startMessage, $color) { |
73 | $urlMailbox = urlencode($mailbox); |
b6d8d08d |
74 | |
75 | echo '<BR>'. |
76b684a5 |
76 | "<TABLE COLS=1 WIDTH=\"70%\" BORDER=\"0\" BGCOLOR=\"$color[4]\" ALIGN=CENTER>". |
b6d8d08d |
77 | '<TR>'. |
78 | "<TD BGCOLOR=\"$color[0]\">". |
79 | "<FONT COLOR=\"$color[2]\"><B><CENTER>" . _("ERROR") . '</CENTER></B></FONT>'. |
80 | '</TD></TR><TR><TD>'. |
81 | "<CENTER><BR>$message<BR>\n". |
82 | '<BR>'. |
7d89b19d |
83 | "<A HREF=\"right_main.php?sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\">"; |
ec5b189b |
84 | printf (_("Click here to return to %s"), $mailbox); |
b6d8d08d |
85 | echo '</A>.'. |
86 | '</TD></TR>'. |
87 | '</TABLE>'; |
ec5b189b |
88 | } |
aa4c3749 |
89 | |
ec5b189b |
90 | function plain_error_message($message, $color) { |
9be8198d |
91 | echo "<br><TABLE COLS=1 WIDTH=\"70%\" BORDER=\"0\" BGCOLOR=\"$color[4]\" ALIGN=CENTER>". |
b6d8d08d |
92 | '<TR>'. |
93 | "<TD BGCOLOR=\"$color[0]\">". |
94 | "<FONT COLOR=\"$color[2]\"><B><CENTER>" . _("ERROR") . '</CENTER></B></FONT>'. |
95 | '</TD></TR><TR><TD>'. |
96 | "<CENTER><BR>$message". |
97 | '</CENTER>'. |
98 | '</TD></TR>'. |
99 | '</TABLE>'; |
ec5b189b |
100 | } |
b6d8d08d |
101 | |
9be8198d |
102 | function logout_error( $errString, $errTitle = '' ) { |
103 | |
104 | GLOBAL $frame_top, $org_logo, $org_name, $org_logo_width, $org_logo_height, |
105 | $hide_sm_attributions, $version; |
106 | |
107 | include_once( '../functions/page_header.php' ); |
108 | if ( !isset( $org_logo ) ) { |
109 | // Don't know yet why, but in some accesses $org_logo is not set. |
110 | include( '../config/config.php' ); |
111 | } |
112 | /* Display width and height like good little people */ |
113 | $width_and_height = ''; |
114 | if (isset($org_logo_width) && is_int($org_logo_width) && $org_logo_width>0) { |
115 | $width_and_height = " WIDTH=\"$org_logo_width\""; |
116 | } |
117 | if (isset($org_logo_height) && is_int($org_logo_height) && $org_logo_height>0) { |
118 | $width_and_height .= " HEIGHT=\"$org_logo_height\""; |
119 | } |
120 | |
121 | if (!isset($frame_top) || $frame_top == '' ) { |
122 | $frame_top = '_top'; |
123 | } |
124 | |
125 | if ( !isset( $color ) ) { |
126 | $color = array(); |
127 | $color[0] = '#DCDCDC'; /* light gray TitleBar */ |
128 | $color[1] = '#800000'; /* red */ |
129 | $color[2] = '#CC0000'; /* light red Warning/Error Messages */ |
130 | $color[3] = '#A0B8C8'; /* green-blue Left Bar Background */ |
131 | $color[4] = '#FFFFFF'; /* white Normal Background */ |
132 | $color[5] = '#FFFFCC'; /* light yellow Table Headers */ |
133 | $color[6] = '#000000'; /* black Text on left bar */ |
134 | $color[7] = '#0000CC'; /* blue Links */ |
135 | $color[8] = '#000000'; /* black Normal text */ |
136 | $color[9] = '#ABABAB'; /* mid-gray Darker version of #0 */ |
137 | $color[10] = '#666666'; /* dark gray Darker version of #9 */ |
138 | $color[11] = '#770000'; /* dark red Special Folders color */ |
139 | $color[12] = '#EDEDED'; |
140 | $color[15] = '#002266'; /* (dark blue) Unselectable folders */ |
141 | } |
142 | |
143 | if ( $errTitle == '' ) { |
144 | $errTitle = $errString; |
145 | } |
146 | set_up_language($squirrelmail_language, true); |
147 | displayHtmlHeader( $errTitle ); |
148 | |
149 | echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n\n" . |
150 | '<CENTER>'. |
151 | "<IMG SRC=\"$org_logo\" ALT=\"" . sprintf(_("%s Logo"), $org_name) . |
152 | "\"$width_and_height><BR>\n". |
153 | ( $hide_sm_attributions ? '' : |
154 | '<SMALL>' . sprintf (_("SquirrelMail version %s"), $version) . "<BR>\n". |
155 | ' ' . _("By the SquirrelMail Development Team") . "<BR></SMALL>\n" ) . |
156 | "<table cellspacing=1 cellpadding=0 bgcolor=\"$color[1]\" width=\"70%\"><tr><td>". |
157 | "<TABLE COLS=1 WIDTH=\"100%\" BORDER=\"0\" BGCOLOR=\"$color[4]\" ALIGN=CENTER>". |
158 | "<TR><TD BGCOLOR=\"$color[0]\">". |
159 | "<FONT COLOR=\"$color[2]\"><B><CENTER>" . _("ERROR") . |
160 | '</CENTER></B></FONT></TD></TR>'. |
161 | '<TR><TD><CENTER>' . $errString . '</CENTER></TD></TR>'. |
162 | "<TR><TD BGCOLOR=\"$color[0]\">". |
163 | "<FONT COLOR=\"$color[2]\"><B><CENTER>". |
164 | '<a href="' . $base_uri . '" target="' . $frame_top . '">' . |
165 | _("Go to the login page") . "</a></CENTER></B></FONT>". |
166 | '</TD></TR>'. |
167 | '</TABLE></td></tr></table></body></html>'; |
168 | } |
169 | |
170 | ?> |