if (get_magic_quotes_gpc()) {
global $REQUEST_METHOD;
- if ($REQUEST_METHOD == "POST") {
+ if ($REQUEST_METHOD == 'POST') {
global $HTTP_POST_VARS;
RemoveSlashes($HTTP_POST_VARS);
- } else if ($REQUEST_METHOD == "GET") {
+ } else if ($REQUEST_METHOD == 'GET') {
global $HTTP_GET_VARS;
RemoveSlashes($HTTP_GET_VARS);
}
/* Before starting the session, the base URI must be known. Assuming */
/* that this file is in the src/ subdirectory (or something). */
-ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
-$base_uri = $regs[1];
+if (!function_exists('sqm_baseuri')){
+ require_once('../functions/display_messages.php');
+}
+$base_uri = sqm_baseuri();
header('Pragma: no-cache');
$location = get_location();
}
set_up_language($squirrelmail_language, true);
/* Refresh the language cookie. */
-setcookie('squirrelmail_language', $squirrelmail_language, time()+2592000,$base_uri);
+setcookie('squirrelmail_language', $squirrelmail_language, time()+2592000,
+ $base_uri);
if (!isset($login_username)) {
- displayHtmlHeader( _("You must be logged in to access this page.") );
- echo "<BODY BGCOLOR=\"#ffffff\">\n" .
- "<BR> <BR>\n" .
- "<CENTER>\n" .
- '<B>' . _("You must be logged in to access this page.") . "</B><BR>" .
- '<A HREF="../src/login.php">' . _("Go to the login page") . "</A>\n" .
- "</CENTER>\n" .
- "</BODY></HTML>\n";
+ include_once( '../functions/display_messages.php' );
+ logout_error( _("You must be logged in to access this page.") );
exit;
}
$imapConnection = sqimap_login($login_username, $key, $imapServerAddress, $imapPort, 0);
if (!$imapConnection) {
- displayHtmlHeader( _("There was an error contacting the mail server.") );
- echo "<body bgcolor=\"#ffffff\">\n".
- "<br> <br>\n".
- "<center>\n".
- '<b>' . _("There was an error contacting the mail server.") . "</b><br>\n".
- _("Contact your administrator for help.") . "\n".
- "</center>\n".
- "</body></html>\n";
+ $errTitle = _("There was an error contacting the mail server.");
+ $errString = $errTitle . "<br>\n".
+ _("Contact your administrator for help.");
+ include_once( '../functions/display_messages.php' );
+ logout_error( _("You must be logged in to access this page.") );
exit;
} else {
$delimiter = sqimap_get_delimiter ($imapConnection);
$debug = false;
if (isset($HTTP_SERVER_VARS['HTTP_ACCEPT']) &&
- !isset($attachment_common_types_parsed[$HTTP_SERVER_VARS['HTTP_ACCEPT']]))
+ !isset($attachment_common_types_parsed[$HTTP_SERVER_VARS['HTTP_ACCEPT']])) {
attachment_common_parse($HTTP_SERVER_VARS['HTTP_ACCEPT'], $debug);
+}
if (isset($HTTP_ACCEPT) &&
- !isset($attachment_common_types_parsed[$HTTP_ACCEPT]))
+ !isset($attachment_common_types_parsed[$HTTP_ACCEPT])) {
attachment_common_parse($HTTP_ACCEPT, $debug);
-
+}
/* Complete autodetection of Javascript. */
$javascript_setting = getPref
/* Compute the URL to forward the user to. */
if(isset($rcptemail)) {
$redirect_url = 'webmail.php?right_frame=compose.php&rcptaddress=';
- $redirect_url .= urlencode($rcptemail);
+ $redirect_url .= $rcptemail;
} else {
$redirect_url = 'webmail.php';
}
}
-?>
+?>
\ No newline at end of file