Quote from: lmv at Jan 06, 2008, 07:45 AM
in our concept we want the form before we link to the protected page on an unprotected explanatory page;
the webuser fills in the password there and.. is then transferred/allowed into the protected page.
You should be able to accomplish exactly that. That said, how should DocPassword (your explanatory page) know what page to "redirect" to upon entering a correct password if you don’t tell it?
1. Make your custom unauthorized page, placing the DocPassword snippet call (w/ &redirect=`[*id*]`)
This should allow the page to be displayed without problem, where you can place any Explanatory text you want. However, at this point, there would be no form present.
2. To enable the form,
you’ll need to tell your "explanatory" page what protected page to authenticate against. (redirect to) You accomplish this by passing the
?unauthid=modx_doc_id in your HTTP request. (GET or POST)
Basically, you can treat your explanatory page as an "entry page", you just have to tell it where to go. Otherwise, the form will cannot be displayed.
Say you always wanted it to go to the most recent month’s content, write a snippet to determine that month’s page’s doc_id and feed it into your Wayfinder call (placeholder), else build an alternate way to select which "protected" pages to navigate to so that the DocPassword has a document to compare the submitted password against.