X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fredirect.php;h=ae1fedf616353b82afd2d97e8339b91f530a05c3;hb=b953f34f3599975505663213e14e7868ac8c5816;hp=17623d817dd29c54695729986b9df15bf5382fc5;hpb=7e2ff8448ac2f801e4ffc43c1149c94a8a760800;p=squirrelmail.git diff --git a/src/redirect.php b/src/redirect.php index 17623d81..ae1fedf6 100644 --- a/src/redirect.php +++ b/src/redirect.php @@ -5,12 +5,14 @@ * * Derived from webmail.php by Ralf Kraudelt * - * @copyright © 1999-2006 The SquirrelMail Project Team + * @copyright © 1999-2007 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail */ -$sInitLocation = 'redirect'; + +/** This is the redirect page */ +define('PAGE_NAME', 'redirect'); /** * Include the SquirrelMail initialization file. @@ -52,7 +54,7 @@ if (!isset($login_username)) { } if (!sqsession_is_registered('user_is_logged_in')) { - do_hook ('login_before'); + do_hook('login_before', $null); $onetimepad = OneTimePadCreate(strlen($secretkey)); $key = OneTimePadEncrypt($secretkey, $onetimepad); @@ -79,13 +81,9 @@ if (!sqsession_is_registered('user_is_logged_in')) { * function which gives us full control how the cookie is set. We do that * to add the HttpOnly cookie attribute which blocks javascript access on * IE6 SP1. - * sqsetcookieflush is needed to send out the headers. sqsetcookie caches - * the cookies to be send. If we don't do that we only can send 1 single cookie - * which is not sufficient. */ sqsetcookie(session_name(),session_id(),false,$base_uri); sqsetcookie('key', $key, false, $base_uri); - sqsetcookieflush(); sqsession_register($onetimepad, 'onetimepad'); @@ -116,7 +114,7 @@ if (!sqsession_is_registered('user_is_logged_in')) { $username = $login_username; sqsession_register ($username, 'username'); - do_hook ('login_verified'); + do_hook('login_verified', $null); } /* Set the login variables. */ @@ -133,11 +131,9 @@ $attachment_common_types_parsed = array(); sqsession_register($attachment_common_types, 'attachment_common_types'); sqsession_register($attachment_common_types_parsed, 'attachment_common_types_parsed'); -$debug = false; - if ( sqgetGlobalVar('HTTP_ACCEPT', $http_accept, SQ_SERVER) && !isset($attachment_common_types_parsed[$http_accept]) ) { - attachment_common_parse($http_accept, $debug); + attachment_common_parse($http_accept); } /* Complete autodetection of Javascript. */ @@ -148,14 +144,14 @@ $redirect_url = $location . '/webmail.php'; if ( sqgetGlobalVar('session_expired_location', $session_expired_location, SQ_SESSION) ) { sqsession_unregister('session_expired_location'); - if ( strpos($session_expired_location, 'compose.php') !== FALSE ) { + if ( $session_expired_location == 'compose' ) { $compose_new_win = getPref($data_dir, $username, 'compose_new_win', 0); if ($compose_new_win) { - // do not prefix $location here because $session_expired_location is set to PHP_SELF + // do not prefix $location here because $session_expired_location is set to the PAGE_NAME // of the last page - $redirect_url = $session_expired_location; + $redirect_url = $session_expired_location.'.php'; } else { - $redirect_url = $location.'/webmail.php?right_frame='.urldecode($session_expired_location); + $redirect_url = $location.'/webmail.php?right_frame='.urlencode($session_expired_location).'php'; } } unset($session_expired_location); @@ -173,11 +169,9 @@ exit; /* --------------------- end main ----------------------- */ -function attachment_common_parse($str, $debug) { +function attachment_common_parse($str) { global $attachment_common_types, $attachment_common_types_parsed; - $attachment_common_types_parsed[$str] = true; - /* * Replace ", " with "," and explode on that as Mozilla 1.x seems to * use "," to seperate whilst IE, and earlier versions of Mozilla use @@ -197,4 +191,7 @@ function attachment_common_parse($str, $debug) { } } sqsession_register($attachment_common_types, 'attachment_common_types'); + + /* mark as parsed */ + $attachment_common_types_parsed[$str] = true; }