Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6852823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:26:17+00:00 2026-05-27T01:26:17+00:00

I am creating an online survey tool. As an administrator, i would like to

  • 0

I am creating an online survey tool.

As an administrator, i would like to see what the users have answered and also be able to answer on their behalf. The system get’s a users answers and other information based on his/her username, when they are logged in, using the built in membership provider.

There are currently three roles: Administrator, Moderator and Respondent

If i would like to show my administrator a list of users,

how would it be possible to create a “backdoor” for the administrator, so that he can “log” in as the user, see the users answers etc ? (Just like the user would be able to if he was logged in to his own account).

When answering and retrieving quyestions, the system is bound to `User.Identity.Name


My suggestion on how to solve this:

Currently, when i want to retrive a users answers i use the following code:

Firma_ID = db.Firma.Single(x => x.CVR_nummer == User.Identity.Name).firma_id;
var answers = db.Tabelform_Answers.Where(x => x.question_id == model.Question_ID && x.respondent == Firma_ID);

This is because i have a table named Firma, that has a column referencing to a users Name, called CVR_Nummer. I then retrieve all the records in the Tabelform_Answers table, that match question_id and Firma_ID (A users answers for a specific question).

Instead of using `Firma_ID = db.Firma.Single(x => x.CVR_nummer == User.Identity.Name).firma_id;

to retrive the Firma_ID of a given user, i could store it in the Session upon Login. When i want to view a specific users Answers as Administrator, i would then just change Firma_ID in the Session. Changing Firma_ID in the Session would only be allowed through a controller which has the following code:

[Authorize(Roles = "Administrator")]

Also, i would set the Session timeout to be the same as the Authentication timeout.

Can somebody tell me which pros and cons of this solution? Are there any other ways of storing a “global” variable for a Session? (Firma_ID)?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:26:18+00:00Added an answer on May 27, 2026 at 1:26 am

    If you only need to log in as your users, I went for a ticket-method.
    I have a special login-page that can take a ticket-id. This ticket is created in the admin-gui when the admin wants to log in as another user. The login-page checks the ticket in the database, logs in the wanted user, and then deletes/marks the ticket as used. As an added security, a ticket is only valid for 10 seconds after creation.

    Another option is to make answers from users available from the admin-gui…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating an online service where special users can upload their images. It
I'm working on creating an online guide. It will survey users, and based on
I am in the midst of creating an online contact management tool for users
I am creating an online exam page for my project. I have a countdown
I'm creating an online game in PHP where users can create playable characters. Each
I am creating an online blog website and for each blog post, I'd like
I'm creating an online based system that has public user profiles for all users..
I'm creating an online dictionary and I have to use three different dictionaries for
We are creating an online service divided like that: - an API, of course
I'm creating an iPhone app which is going to have an online spreadsheet to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.