CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Login Page redirection to dynamic link

Print topic Send  topic

Author Message
Bubba

Posts: 33
Posted: 11/01/2007, 7:22 PM

I want to be able to have a restricted area that the user must login to access.

I am using a directory builder, so the links to the restricted pages is like this:

Newpage.asp?ID=50
Newpage.asp?ID=51
Newpage.asp?ID=52


If the user clicks on the link and they are not logged in, they are redirected to a login in page.

After they login, I want them to be redirected to that page they were trying to access (eg: Newpage.asp?ID=50).

The problem is that the login page will/can only redirect them to Newpage.asp – and not the entire link - Newpage.asp?ID=50

I have been trying to work this out for some time with no luck. Is this a limitation of CCS? If so please tell me and I will move on!

By the way, if the user is already logged in and they click the link, it works fine. Also I have set the login page to redirect to previous page - does not work.

I am using CCS3.2.0.1 - ASP
View profile  Send private message
kevind

Posts: 251
Posted: 11/13/2007, 10:27 AM

in the Before Show Event of the page add some code like this:

if isempty(CCGetLogin()) then
'user not logged in - store the page id to a session variable before logging in
Session("PageToReturnTo")=CCGetParam("ID",empty)

end if

i believe the code might be called before they are bumped because they are not logged in, if you are just restricting the page unless they are logged in and not restricting it based on a user level, you could remove the 'restricted' setting and test it for yourself by adding 'Response.Redirect('..\PathToLoginPage\Login.asp?ret_link=' + "yourpagename.asp") below the Session save line above. this will cause them to be sent there.

let me know if that works our you need further suggestions.




might might
_________________
thanks
Kevin

======================
CCS 3.2.x / ASP / MS Access /mySQL / PHP / jQuery / jQuery UI / jQuery Mobile
View profile  Send private message
Bubba

Posts: 33
Posted: 11/15/2007, 5:07 PM

Thanks for your response.

Unfortunately I couldn't get your example to work, but I appreciate the input.

I have come up with another way round, but still not perfect.

On the restricted page, in the Before Show I have:

If IsEmpty(CCGetParam("ID", Empty)) Then
Response.Redirect FileName & "?" & CCAddParam(Request.ServerVariables("QUERY_STRING"), "ID", 1)
end if

This stops the root page from loading empty after login, but it still does not load the page the user was trying to access prior to login.

If I could figure out a way to capture the "ID" before they login, I may be able to use it as a variable for the above code (in place of "ID",1)

:-/
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.