Hello
I have created a DW Module to deny access based on ip-filtering. I have af field for allow ip addresses and a field for deny ip address.
The modules tests to see if current ip address apply to the ip addresses in the fields. If the rules indicate a deny i send the following back to the browser:
System.Web.HttpContext.Current.Response.StatusCode = 403;
System.Web.HttpContext.Current.Response.End();
It works perfectly in the frontend, but if I deny access for my own/current ip address I also get a 403 in the backend blocking all access to the page i just created/edited.
Does the frontend part of the module render in the backend as well? And how do I test for it?
Customer is running version 19.2.5.2
Best regards
Lars Vistrup Skov
Developer forum
E-mail notifications
Module renders in backend?
Lars Skov
Posted on 14/09/2011 11:30:20
Replies
Nicolai Høeg Pedersen
Posted on 14/09/2011 11:52:13
This post has been marked as an answer
Yes - the pageview is executed when doing a list of paragraphs, and editing the properties of a page.
You can build in a check that HttpContext.Current.Request.Url starts with "default.aspx" - the your code will only execute on the frontend.
You can build in a check that HttpContext.Current.Request.Url starts with "default.aspx" - the your code will only execute on the frontend.
Votes for this answer: 0
Lars Skov
Posted on 14/09/2011 12:46:26
Hi
And when the frontend user uses the syntax http://site.com/default.aspx?id=217 the module don't fire the 403 :-S
Is there no other solution?
Best regards
Lars
And when the frontend user uses the syntax http://site.com/default.aspx?id=217 the module don't fire the 403 :-S
Is there no other solution?
Best regards
Lars
Nicolai Høeg Pedersen
Posted on 14/09/2011 12:59:58
You can easily check if the pageview is executed in frontend or backend. If the HttpContext.Current.Request.Url starts with "default.aspx" it is the frontend, otherwise the backend...
Lars Skov
Posted on 14/09/2011 13:10:41
Sorry, read it wrong....
Nicolai Høeg Pedersen
Posted on 14/09/2011 13:18:16
No problem. I do that all the time :-).
You must be logged in to post in the forum