View Full Version : does "login as" really exist?

01-06-2005, 03:30 PM
I am trying to make a page that will allow users to login to a company intranet that contains sensetive memos and documents. The system will contain multiple 'tiers' of access including, but no limited to, finance, HR, accounting, ect...

There will be one login for each department, but each department may have access to more than one section. I.E., accounting will be able to access accounting, finance, and operations. To tackle this, I have a field in the DB that has a letter to represent the sections they can access. The users will carry this value with them by way of a session variable and access whatever page they want, as long as they have permission.

However, people could just 'guess' the location of sensetive documents. To solve this, I was hoping to be able to log in the user onto the server at each page. That way, if they guess the location of a document, they will be greeted with a login. This account will have the same permission as the IUser account. For example, if the user has permission to enter operations, when they go to operations.asp, they will be logged onto the server as 'Operations.'

I heard of a 'login as user' function but haven't been able to find it and am not really sure how to search for it. Could someone help me out a bit? I would really appreciate any help you could lend. Also, if there are any problems with the technique I outlined above, could you let me know?

Hopefully that is enough information...

01-06-2005, 06:16 PM
Found it! Here is an example of the logonuser script.

Hopefully I can make it work now

Dim Server, User
Set Server = CreateObject("UserManager.Server")
Server.LogonUser "Administrator", ""

'Create a new user
Set User = Server.Users.Add("NewUser", "UserPassword")

'Add the new user to the group
User.AddToLocalGroup "Guests"

'Logon new user
Server.LogonUser "NewUser", "UserPassword"

'Some other operations under new user account