Copy link to clipboard
Copied
I'm using the DW functionality to confirm that a user is logged in before allowing access to a page. Everything works except successfully redirecting to the previous URL. Here's the situation:
My login page does attempt to direct the user to the previous url (if it exists). I'm not sure if there is a simple way to make the variable $_SESSION['PrevUrl'], used by DW to redirect, store the entire url.
Any help is appreciated.
Elie Chocron
The problem lies with some obsolete code in the Restrict access to page server behavior. Fortunately, the fix is quite simple.
The affected section of code is as follows:
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" ...
Copy link to clipboard
Copied
The problem lies with some obsolete code in the Restrict access to page server behavior. Fortunately, the fix is quite simple.
The affected section of code is as follows:
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}All that is necessary is to replace the three instances of $QUERY_STRING like this:
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
$MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
The redirect will then work correctly.
Copy link to clipboard
Copied
Thanks! That did the trick.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now