473,426 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,426 software developers and data experts.

Locking down a directory

I'm currently using my own login/session style access restriction system for
my application. What I'd like to do is restrict access for a certain
directory to registered users only. Is there is a quick-and-easy way to
lock this directory down without having to go to each page in the directory
and put:

if session("userloggedin") <> "" then
'do something
else
response.redirect("/login.aspx")
response.end()
end if

I've looked into Forms Authentication, but I'm not sure how to mesh it with
my current access restriction system.

Thanks.

Matt
Nov 19 '05 #1
2 906
The location tag in web.config is normally ideal for this type of thing if
your using the right approach to authentication, for something more custom
you could easily set an authentication flag in session and create an
ihttpmodule to deny or allow access at the request level based on the value
being set or not. That would save you all the code you suggest you would be
facing.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"Matt" <aw***********@aol.com> wrote in message
news:LojCd.20109$3m6.3496@attbi_s51...
I'm currently using my own login/session style access restriction system for my application. What I'd like to do is restrict access for a certain
directory to registered users only. Is there is a quick-and-easy way to
lock this directory down without having to go to each page in the directory and put:

if session("userloggedin") <> "" then
'do something
else
response.redirect("/login.aspx")
response.end()
end if

I've looked into Forms Authentication, but I'm not sure how to mesh it with my current access restriction system.

Thanks.

Matt

Nov 19 '05 #2
Use FormsAuthentication!!! If you have something like Session("UserName")
replace that with User.Identity.Name and lock dirs using the Web.Config -
the easy way.

--
Daniel Fisher(lennybacon)
MCP ASP.NET C#
Blog: http://www.lennybacon.com/
"Matt" <aw***********@aol.com> wrote in message
news:LojCd.20109$3m6.3496@attbi_s51...
I'm currently using my own login/session style access restriction system
for my application. What I'd like to do is restrict access for a certain
directory to registered users only. Is there is a quick-and-easy way to
lock this directory down without having to go to each page in the
directory and put:

if session("userloggedin") <> "" then
'do something
else
response.redirect("/login.aspx")
response.end()
end if

I've looked into Forms Authentication, but I'm not sure how to mesh it
with my current access restriction system.

Thanks.

Matt

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ryan | last post by:
I have a problem with record locking / blocking within an application. The app is quite straight forward. Written in Delphi 5 using BDE to access a SQL 7 database (Win2K server). Every so often...
5
by: matt dittman | last post by:
I have created a windows service that reads emails from a drop directory and moves them to the appropriate mail folder every 15 seconds. I can move, rename and delete the files as needed, up...
3
by: Wolfgang Bachmann | last post by:
We migrated a database from Version 5.1 to 8.1 and are experiencing massive locking problems. We migrated in the following steps: 0) Server 5.2, Clients 5.2: everithing was fine 1) Server 5.2,...
375
by: rkusenet | last post by:
This article is very bleak about future of DB2. How credible is the author. http://www.eweek.com/article2/0,1895,1839681,00.asp
0
by: John Dalberg | last post by:
I am trying to lock down file access of some sites in a shared hosting environment so that different users can only access their own site's directory with their asp.net code. However there's a...
0
by: Eric S. Johansson | last post by:
are there any simple examples of how to do record locking with bsddb3? the bsddb3 documentation is reasonably opaque. For example, the DB initialization requires a DBEnv instance for certain...
4
Colloid Snake
by: Colloid Snake | last post by:
Hello- I am attempting to lock down a server that has been neglected for a few years, and while I changed most of the permissions to allow the specific group I needed, is seems there is a file...
1
by: ABrown | last post by:
Hello, I have a 2003 database set up with about 20 users (only about 4 at a time) but I repeatedly get a problem with the records all locking. Each User is assigning billing codes to jobs so they...
3
by: HugoVallejo | last post by:
Hi everyone. I've created an ASP.NET web site which uses a .NET assembly to read/write operations using an odbc driver. When a connection to the odbc database is made locking files are created, when...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.