Post feature requests to this forum and a pre-configured poll will automatically be created for you.
- Ensign (ENS)
- Posts: 2
- Joined: Thu Feb 17, 2011 9:14 pm
As a new AC implementer my first site brought a couple of requirements that do not appear to be "in the box". In my site, the users cannot shop without logging in first. I couldn't find any posts describing exactly how this was accomplished by the community so I implemented a simple technique, although I had to insert a function in each page I needed to protect. I did this by inserting the following logic in pre_init on each page:
Code: Select all
protected void Page_PreInit(object sender, EventArgs e)
if (Token.Instance.User == null || Token.Instance.User.IsAnonymous)
This seems to work OK and using source control I can manage this simple difference when I upgrade later without a problem, but, since I am not an AC expert I'm wondering if there is something I overlooked or even a quicker/easier way to do this.
- Commander (CMDR)
- Posts: 112
- Joined: Wed Oct 15, 2008 9:30 pm
- Location: Boston, MA
You can enforce account sign in for all site visitors by adding "allow" authorization rule for authenticated users only. Just add the the code below before the </system.web> in your site
<deny users="?" />
<allow users="*" />
This apples to any asp.net based site and is not specific to AbleCommerce.
- Lieutenant (LT)
- Posts: 55
- Joined: Wed Oct 12, 2011 11:15 am
The changes to web.config do work, but for some reason, the formatting is all messed up as it odes not inherit any css or layout. How can we invoke the same with the css or layout formatting?