Ok, I have your answer...
In modules/Users/Authenticate.php, line 48 onwards change...
Code:
if(isset($_SESSION['authenticated_user_id'])) {
global $record;
$GLOBALS['module'] = !empty($_REQUEST['login_module']) ? '?module='.$_REQUEST['login_module'] : '?module=Home';
$GLOBALS['action'] = !empty($_REQUEST['login_action']) ? '&action='.$_REQUEST['login_action'] : '&action=index';
$GLOBALS['record']= !empty($_REQUEST['login_record']) ? '&record='.$_REQUEST['login_record'] : ''; to...
Code:
if(isset($_SESSION['authenticated_user_id'])) {
global $record;
global $module;
$GLOBALS['module'] = !empty($_REQUEST['login_module']) ? '?module='.$_REQUEST['login_module'] : '?module=Home';
$GLOBALS['action'] = !empty($_REQUEST['login_action']) ? '&action='.$_REQUEST['login_action'] : '&action=index';
$GLOBALS['record']= !empty($_REQUEST['login_record']) ? '&record='.$_REQUEST['login_record'] : ''; ie. insert the declaration "global $module;" after "global $record;".
Basically, when you're not yet logged in $module hasn't yet been declared as a global variable, so when it is assigned in the statement $GLOBALS['module'] = !empty($_REQUEST['login_module']) ? '?module='.$_REQUEST['login_module'] : '?module=Home'; nothing will happen.
This will depend, to some extent, on which version of PHP you're running as older versions allowed globals to be defined without explicit declarations.
You should raise this as a bug with Sugar but the above change will fix your problem.
Bookmarks