*
* Function is similar to is_logged_in() function. If user is logged in, function
* returns true. If user is not logged in or session is expired, function saves $_POST
- * and $PHP_SELF in session and returns false. POST information is saved in
- * 'session_expired_post' variable, PHP_SELF is saved in 'session_expired_location'.
+ * and PAGE_NAME in session and returns false. POST information is saved in
+ * 'session_expired_post' variable, PAGE_NAME is saved in 'session_expired_location'.
*
* Script that uses this function instead of is_logged_in() function, must handle user
* level messages.
// First we store some information in the new session to prevent
// information-loss.
- sqGetGlobalVar('PHP_SELF', $PHP_SELF, SQ_SERVER);
-
$session_expired_post = $_POST;
- $session_expired_location = $PHP_SELF;
+ $session_expired_location = PAGE_NAME;
if (!sqsession_is_registered('session_expired_post')) {
sqsession_register($session_expired_post,'session_expired_post');
}
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='.urlencode($session_expired_location);
+ $redirect_url = $location.'/webmail.php?right_frame='.urlencode($session_expired_location).'php';
}
}
unset($session_expired_location);