@@ -53,16 +53,17 @@ public static function go($url = '')
53
53
*/
54
54
public static function session_request_uri ($ logging_in = false , $ user_id = null )
55
55
{
56
- $ no_redirection = isset ($ _SESSION ['noredirection ' ]) ? $ _SESSION ['noredirection ' ] : false ;
56
+ $ no_redirection = $ _SESSION ['noredirection ' ] ?? false ;
57
+ $ no_redirection = $ GLOBALS ['noredirection ' ] ?? $ no_redirection ;
57
58
58
59
if ($ no_redirection ) {
59
60
unset($ _SESSION ['noredirection ' ]);
61
+ unset($ GLOBALS ['noredirection ' ]);
60
62
61
63
return ;
62
64
}
63
65
64
66
$ url = isset ($ _SESSION ['request_uri ' ]) ? Security::remove_XSS ($ _SESSION ['request_uri ' ]) : '' ;
65
- unset($ _SESSION ['request_uri ' ]);
66
67
67
68
$ afterLogin = Session::read ('redirect_after_not_allow_page ' );
68
69
@@ -71,11 +72,11 @@ public static function session_request_uri($logging_in = false, $user_id = null)
71
72
self ::navigate ($ afterLogin );
72
73
}
73
74
if (!empty ($ url )) {
75
+ $ _SESSION ['custom_request_uri ' ] = $ _SERVER ['REQUEST_URI ' ];
76
+ unset($ _SESSION ['request_uri ' ]);
74
77
self ::navigate ($ url );
75
- } elseif ($ logging_in ||
76
- (isset ($ _REQUEST ['sso_referer ' ]) && !empty ($ _REQUEST ['sso_referer ' ]))
77
- ) {
78
- if (isset ($ user_id )) {
78
+ } elseif ($ logging_in || !empty ($ _REQUEST ['sso_referer ' ])) {
79
+ if (!empty ($ user_id )) {
79
80
$ allow = api_get_configuration_value ('plugin_redirection_enabled ' );
80
81
if ($ allow ) {
81
82
$ allow = api_get_configuration_value ('plugin_redirection_enabled ' );
@@ -121,8 +122,8 @@ public static function session_request_uri($logging_in = false, $user_id = null)
121
122
if (api_is_multiple_url_enabled ()) {
122
123
// if multiple URLs are enabled, make sure he's admin of the
123
124
// current URL before redirecting
124
- $ url = api_get_current_access_url_id ();
125
- if (api_is_platform_admin_by_id ($ user_id , $ url )) {
125
+ $ urlId = api_get_current_access_url_id ();
126
+ if (api_is_platform_admin_by_id ($ user_id , $ urlId )) {
126
127
self ::navigate (api_get_path (WEB_CODE_PATH ).'admin/index.php ' );
127
128
}
128
129
} else {
0 commit comments