How do set one of my pages to require the user to login

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
John Gaby
Ensign (ENS)
Ensign (ENS)
Posts: 19
Joined: Fri Mar 13, 2009 10:34 am

How do set one of my pages to require the user to login

Post by John Gaby » Wed Mar 18, 2009 9:00 am

I have my own custom pages, some of which I need the user to login before visiting. How can I set my pages to be included in the list which requires the user to be logged in?

User avatar
nickc
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Thu Nov 29, 2007 3:48 pm

Re: How do set one of my pages to require the user to login

Post by nickc » Wed Mar 18, 2009 9:30 am

See /App_Data/ablecommerce.config; add an entry to the <securepages> config section.

John Gaby
Ensign (ENS)
Ensign (ENS)
Posts: 19
Joined: Fri Mar 13, 2009 10:34 am

Re: How do set one of my pages to require the user to login

Post by John Gaby » Wed Mar 18, 2009 9:39 am

Thanks for the response.

I have actually already tried that, but it didn't seem to work. In the <securepages>/<directories> section, I added:

<add path="myfolder" recurse = true />

but nothing happened. I also tried removing the entry for members to see if the members pages would no longer ask for a login, but that had no effect either. What might I be doing wrong?

User avatar
nickc
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Thu Nov 29, 2007 3:48 pm

Re: How do set one of my pages to require the user to login

Post by nickc » Wed Mar 18, 2009 9:57 am

Doh. That controls SSL - my mistake. You need to add an authorization reference in a web.config file. See the /Members/Web.config for an example:

Code: Select all

  <system.web>
    <authorization>
      <deny users="?"/>
    </authorization>
  </system.web>

John Gaby
Ensign (ENS)
Ensign (ENS)
Posts: 19
Joined: Fri Mar 13, 2009 10:34 am

Re: How do set one of my pages to require the user to login

Post by John Gaby » Wed Mar 18, 2009 10:44 am

That's the ticket.

Thanks!

sfeher
Captain (CAPT)
Captain (CAPT)
Posts: 220
Joined: Fri Jun 04, 2004 1:58 pm
Location: Steubenville, Ohio

Re: How do set one of my pages to require the user to login

Post by sfeher » Tue Aug 23, 2011 2:59 pm

nickc wrote:

Code: Select all

  <system.web>
    <authorization>
      <deny users="?"/>
    </authorization>
  </system.web>
OK -- That works. Except that once you engage that code in the web.config file and also have a captcha requirement for Admins, the admin users cannot login again because the captcha doesn't display. Seems that the captcha image isn't allowed to display. Remove the code referenced above and the captcha reappears and all is well.

Hmmmm......
Not sure where to start on this one.

sfeher
Captain (CAPT)
Captain (CAPT)
Posts: 220
Joined: Fri Jun 04, 2004 1:58 pm
Location: Steubenville, Ohio

Re: How do set one of my pages to require the user to login

Post by sfeher » Tue Aug 23, 2011 3:04 pm

Actually -- maybe this is the answer here:
viewtopic.php?f=42&t=7286&start=0&hilit=require+login


UPDATE:
Yep..... exactly the answer needed....
Refer to the link in this post for the CORRECT way to ensure that all users are forced to login, but the Captcha is enabled on the login script for Admin accounts.

Post Reply