Commit 02855726 authored by Nigel McNie's avatar Nigel McNie

If your session times out and you've just hit a public page, make the URL to...

If your session times out and you've just hit a public page, make the URL to trigger the transient login page remember any GET parameters.

This makes it so that if you hit a public view (view.php?id=8 for example) and your session has just timed out, after you submit the login form you will continue to view.php?id=8 rather than just view.php. The latter is very annoying because it's not what you were after and will cause the script to bail anyway.
parent e87d5032
......@@ -394,7 +394,10 @@ function auth_setup () {
// @todo this links to ?login - later it should do magic to make
// sure that whatever GET string is made it includes the old data
// correctly
$SESSION->add_info_msg(get_string('sessiontimedoutpublic'), false);
$loginurl = $_SERVER['REQUEST_URI'];
$loginurl .= (false === strpos($loginurl, '?')) ? '?' : '&';
$loginurl .= 'login';
$SESSION->add_info_msg(get_string('sessiontimedoutpublic', 'mahara', hsc($loginurl)), false);
return;
}
......
......@@ -185,7 +185,7 @@ $string['passwordsdonotmatch'] = 'The passwords do not match';
$string['passwordtooeasy'] = 'Your password is too easy! Please choose a harder password';
$string['register'] = 'Register';
$string['sessiontimedout'] = 'Your session has timed out, please enter your login details to continue';
$string['sessiontimedoutpublic'] = 'Your session has timed out. You may <a href="?login">log in</a> to continue browsing';
$string['sessiontimedoutpublic'] = 'Your session has timed out. You may <a href="%s">log in</a> to continue browsing';
$string['sessiontimedoutreload'] = 'Your session has timed out. Reload the page to log in again';
$string['username'] = 'Username';
$string['preferredname'] = 'Preferred Name';
......@@ -357,7 +357,7 @@ $string['preferences'] = 'Preferences';
$string['activityprefs'] = 'Activity preferences';
$string['changepassword'] = 'Change password';
$string['notifications'] = 'Notifications';
$string['institutionmembership'] = 'Institution membership';
$string['institutionmembership'] = 'Institution Membership';
$string['youareamemberof'] = 'You are a member of %s';
$string['leaveinstitution'] = 'Leave institution';
$string['reallyleaveinstitution'] = 'Are you sure you want to leave this institution?';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment