* $base_uri isn't set because it the session is invalid.
*/
-if (! isset($base_uri)) {
- ereg ('(^.*/)[^/]+/[^/]+$', $PHP_SELF, $regs);
- $base_uri = $regs[1];
+if (!isset($base_uri)) {
+ $base_uri = dirname(dirname($PHP_SELF));
}
function is_logged_in() {
*/
set_up_language($squirrelmail_language, TRUE);
-/* Need the base URI to set the cookies. (Same code as in webmail.php). */
-ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
-$base_uri = $regs[1];
+/**
+ * Find out the base URI to set cookies.
+ */
+$base_uri = dirname(dirname($PHP_SELF));
@session_destroy();
/*
* we get a new one.
*/
$cookie_params = session_get_cookie_params();
-setcookie(session_name(),'',0,$cookie_params['path'].$cookie_params['domain']);
+setcookie(session_name(), '', 0, $cookie_params['path'],
+ $cookie_params['domain']);
setcookie('username', '', 0, $base_uri);
setcookie('key', '', 0, $base_uri);
header('Pragma: no-cache');
/* 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];
+$base_uri = dirname(dirname($PHP_SELF));
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)) {
include_once( '../functions/display_messages.php' );
/* If a user hits reload on the last page, $base_uri isn't set
* because it was deleted with the session. */
-if (! isset($base_uri)) {
- ereg ('(^.*/)[^/]+/[^/]+$', $PHP_SELF, $regs);
- $base_uri = $regs[1];
+if (!isset($base_uri)) {
+ $base_uri = dirname(dirname($PHP_SELF));
}
do_hook('logout');
<TD ALIGN="CENTER">
<?php do_hook('logout_above_text'); ?>
<?php echo _("You have been successfully signed out.") ?><BR>
- <A HREF="login.php" TARGET="<?php echo $frame_top ?>">
+ <A HREF="<?php echo "$base_uri/login.php" ?>"
+ TARGET="<?php echo $frame_top ?>">
<?php echo _("Click here to log back in.") ?>
</A><BR><BR>
</TD>
require_once('../functions/i18n.php');
require_once('../functions/auth.php');
-ereg( '(^.*/)[^/]+/[^/]+$', $PHP_SELF, $regs);
-$base_uri = $regs[1];
+$base_uri = dirname(dirname($PHP_SELF));
session_start();
is_logged_in();