Discussion Locked

FSO / Permission denied

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Our client needs to be able to create a new subsite from time to time within the corporate website. He can do this with an admin page we created, but in order to create a new folder with the FileScriptingObject, the parent folder must have open permissions. Is there any way to use the FSO with the username/password, so the site can remain secure?

5 replies

by esadacca

You probably don't want to give IUSR_MachineName change permissions to the folder. Instead, force an authentication (see VBScript ASP below) and give the individual user the appropriate rights.

sub ForceAuthentication()
dim i, intWhackLoc

if Request.ServerVariables("LOGON_USER") = "" Then
Response.Status = "401 access denied"
else
strLogonUser = ucase(Request.ServerVariables("LOGON_USER"))

intWhackLoc = inStrRev(strLogonUser,"\")

if intWhackLoc <> 0 then
strLogonUser = right(strLogonUser, len(strLogonUser) - intWhackLoc)
end if
end If
end sub

by kirkk

I can't tell whether you are on the right track -- what do I do with strLogonUser once it is set?

by esadacca

Actually, you don't need that part. I just quickly copied the code from one of my pages. The important part is the first few lines. They check the server variables for a logon; if it's not there, they send back a 401 and force the browser (user) to log in.

Here's the revised code:

if Request.ServerVariables("LOGON_USER") = "" Then
Response.Status = "401 access denied"
end If

Once the visitor has been authenticated, FSO follows the user's permission levels on the server, rather than IUSR's.

Be aware that if a "guest" visitor authenticates (this code will allow it), FSO may still not have the appropriate permissions and throw a permission denied.

Sorry for the confusion (and extra code!).

by kirkk

I think I see where you're coming from - you're looking for the Server logon name. Unfortunately, the website is on a third party server which we don't have easy access to. That's why I was trying to use the username/password which comes with the IP address to create new folders in the root directory. There doesn't seem to be a way to do that. But I appreciate your effort enough to give you the points.

This discussion is closed to new replies.