XF 1.5 Providing links to secure data

Tom McIntyre

Active member
This is not really related to XF1.5, but that is what is running on the system.

Our association has on-line assets, such as databases and articles that require the person who accesses them to be logged in to the associations membership system. Not all of our forum users are members of the association and those who are, may visit the forums without logging in to the membership system.

The membership system implements a login redirection system so that a reference to a protected resource is directed to the login procedure with a URL that contains a pass through to the originally requested URL.

I found that if I urlencode a reference to one of the protected resources and append it to the login redirection URL, I can post that on our forum site and it will navigate to the protected resource if the user is currently logged in to the membership site, or redirect them to log in first and then go to the resource.

Generating the URL by hand is very difficult and I would like to provide a bbCode that can be used to wrap the protected resource's URL and result in the login redirection plus protected URL like the one I created by hand.

I do not know how to do that with an HTML replacement, so I need to use a callback I think. When looking at existing callbacks, they are much more code and structure than I think I need because they are all add-on creations.

Is there some simpler way to just create the callback routine itself without all the extra model elements?

All it really needs is:
Code:
return = 'https://mysite.org/loginredirect?urlencode(protectedUrl)';

I tried using
Code:
<?php
echo '<a href="https://mysite.org/Shared_Content/ContactManagement/NAWCC_Sign_In.aspx?ReturnURL=%2FiParts%2FCustom%2Fsso.aspx%3FPassthru%3D', urlencode({text}), '">';
?>
It appears that the parser strips out the <?php Which is not surprising.
 
Back
Top Bottom