dcsimg
Results 1 to 8 of 8

Thread: [RESOLVED] Disabling a web page until logging in?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    4,922

    Resolved [RESOLVED] Disabling a web page until logging in?

    I have a web page that will be used as an administrative page for a website. I want to prevent a user from using any of the functionality until they have logged in. How can this be accomplished? I'm pretty sure Javascript would work but just don't know how to accomplish this.

    Thanks,
    Blake

  2. #2
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,177

    Re: Disabling a web page until logging in?

    Don't use javascript for this; it should be a back-end thing.

    What is your backend? Typically you would just set a session for the user when they login and check that session for a specific claim or permission. If they don't have that permission, return a 403 or an error message saying they don't have permission.

    It is really a question that requires you to post code and more detail.

  3. #3
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    CT
    Posts
    17,867

    Re: Disabling a web page until logging in?

    When my users "login" I give them a GUID (supplied from the backend code) that is used for every single AJAX post from that point forward. That's more for security...

    As for UX (user experience), you should not DISPLAY parts of the page that are not for consumption until they successfully login. That way it's intuitive to the user what is available prior to login and after login.

    My 2 cents

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    4,922

    Re: Disabling a web page until logging in?

    Thanks smitty...that helped...and it makes sense as well.
    Blake

  5. #5
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,604

    Re: Disabling a web page until logging in?

    For admin functionality in our apps you just dont see the admin menu options unless you have logged in as an Admin they are hidden.

    You get a different view based upon your UserRole.
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  6. #6
    Junior Member
    Join Date
    Oct 2019
    Posts
    20

    Re: Disabling a web page until logging in?

    hello..
    You Can try Session if user login success than set the session and check condition session is set or not if session is set than other code run other wise send warning.
    < advertising removed by moderator >

  7. #7
    Junior Member
    Join Date
    Oct 2019
    Posts
    20

    Re: Disabling a web page until logging in?

    hello..
    You Can try Session if user login success than set the session and check condition session is set or not if session is set than other code run other wise send warning.
    Last edited by Siddhi Patel; Mar 18th, 2020 at 11:22 PM.
    < advertising removed by moderator >

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    4,922

    Re: Disabling a web page until logging in?

    Thank you Siddhi...that worked!
    Blake

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width