S
seguso
Hello, I have a very simple problem I don't know how to approach. I
need a suggestion about the general approach to take.
I have a bunch of html pages on a machine, all in the same folder
"logs". Each html page contains a log. The filenames look like
logs/log-xxxx.html
where xxxx is a user-id. (Each file logically belongs to a different
user).
I am developing a web site in asp.net which allows each user to see
his own log.
The obvious approach is to have a page where I dynamically create a
link <a href="logs/log-xxxx.html">, where xxxx depends on the user
authenticated in asp.net. This works: when the user clicks the link,
the html opens in a new window. But, in the browser's location bar,
the user sees the full path of the file, e.g.
http://localhost/WebSite/Docs/log-1234.html
Now, if he were to manually change the number on the location bar,
either by mistake or intentionally, he would see the log of another
user! This is not acceptable for privacy reasons.
What is a general approach to solve this problem? I mean, allowing the
user to only obtain his html file and not somebody else's. Have I to
write a httphandler, or is there a simpler solution?
Thanks a lot for any help,
Maurizio
need a suggestion about the general approach to take.
I have a bunch of html pages on a machine, all in the same folder
"logs". Each html page contains a log. The filenames look like
logs/log-xxxx.html
where xxxx is a user-id. (Each file logically belongs to a different
user).
I am developing a web site in asp.net which allows each user to see
his own log.
The obvious approach is to have a page where I dynamically create a
link <a href="logs/log-xxxx.html">, where xxxx depends on the user
authenticated in asp.net. This works: when the user clicks the link,
the html opens in a new window. But, in the browser's location bar,
the user sees the full path of the file, e.g.
http://localhost/WebSite/Docs/log-1234.html
Now, if he were to manually change the number on the location bar,
either by mistake or intentionally, he would see the log of another
user! This is not acceptable for privacy reasons.
What is a general approach to solve this problem? I mean, allowing the
user to only obtain his html file and not somebody else's. Have I to
write a httphandler, or is there a simpler solution?
Thanks a lot for any help,
Maurizio