One way would be a Register postHook that's listed before the redirect hook and sets a secret code in a $_SESSION variable:
$_SESSION['register_code'] = 'someSecretCode';
Then, put this snippet at the top of the downloads page:
/* RegisterCheck snippet */
$code = $modx->getOption('register_code', $_SESSION, '', true);
if ($code !== 'someSecretCode') {
$modx->sendUnauthorizedPage();
}
Instead of the unauthorized page, you could also send them to the register page, like this (replace 12 with the ID of the Register page):
/* RegisterCheck snippet */
$code = $modx->getOption('register_code', $_SESSION, '', true);
if ($code !== 'someSecretCode') {
$url = $modx->makeUrl(12, "", "", "full");
$modx->sendRedirect($url);
}
Note that this is a very specific solution. It will work *only* when the user has just registered. It's of no use to someone trying to secure a page that will be visited at other times.
[ed. note: BobRay last edited this post 8 years, 11 months ago.]