DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Allow access to a web folder only to authenticated users

 7 Replies
 2 Subscribed to this topic
 40 Subscribed to this forum
Sort:
Author
Messages
New Around Here
Posts: 9
New Around Here

Hi all.

There is a folder (it's a virtual directory) in my web application, named "WebDocs", that has a lot of PDF and images files.

My program allows the user to load a PDF file using its URL address:

http://MyHost/MyWebApp/WebDocs/1.pdf

However, I need to restrict that functionality only to authenticated users.

The web site is based on DNN 04.08. 

Is it possible to do it? I tried a few soultions like this https://stackoverflow.com...-authenticated-users but it's doesn't have any difference.

If I apply this solution - https://stackoverflow.com...er-access-in-asp-net - it blocks access to this folder for all users regardless they are authnticated or not. Is there any solutions for DNN to do so?

Thanks.

 

Veteran Member
Posts: 1246
Veteran Member
MVP
MVP
You're an MVP!
4.08?????????? Yikes.

The current version of DNN is 9.9.1. Your version is very much out of date with all of the negatives that come with that. May I humbly get your site up to date before addressing the questions you've asked here.

When you say that the folder in question is a Virtual Directory, does that also mean that it is not visible to the DNN File Manager?
New Around Here
Posts: 9
New Around Here

Yes, you're right - it's just a regular virtual directory. It's not visible to DNN file manager. We're uploading documents and images by using a regular asp.net fileupload control.

I don't mind to upgrade but I'm afraid it's too late, I mean upgrade from DNN 4 to the latest version. Am I right?

 

Veteran Member
Posts: 1246
Veteran Member
MVP
MVP
You're an MVP!

No, it's not too late to upgrade DNN 4 to the latest version.  Depending on your website, though, it may be easier to create a new site and move your content and users to it.  It all depends on what you have.

The module DNN Global Storage from evotiva.com is a set of DNN Folder Providers (connectors) that allows your DNN site to connect to folders external to DNN and make them available to DNN users. You can use the usual DNN user and role permissions to control access to those files.

It's a great product, but you'll need to upgrade DNN in order to use it.

New Around Here
Posts: 9
New Around Here

Is there any way to jump from DNN 4 to 9? Or i is better yo start from scratch with 9?

Can I move users by preserving their UserID? I know that passwords are salted in DNN 9 so it can't be done just by using T-SQL statements. If I will use a DNN code - how can I preserve UserID? I need it because I have a lot of tables where UserID if the Foreign Key. 

 

Veteran Member
Posts: 1182
Veteran Member
MVP
MVP
You're an MVP!

There is a suggested upgrade path to follow.

Anyway, to do this I would recommend to set up a testing environment. Before you start: uninstall all extensions that you don't use, and delete all files in the following folders under /install (except the file PlaceHolder.txt):

  • AuthSystem
  • Container
  • Language
  • Library
  • Module
  • Provider
  • Skripts
  • Skin

Backup (files and database) before each upgrade step (see here for details), test the site, find upgrades to the modules that don't work, find fixes for skin issues, check all extensions you use, esp. third party and custom extensions. Then backup, and do the next upgrade step. And so on...

Make a clear documentation about each step you do.

And then, when everything is fine, do the upgrade in the production environment.

By the way: There is an easy way to include an extension upgrade in the DNN upgrade. Let's assume you have a module XY, version 1.0.0 in your DNN 4.8 installation. When you upgrade from DNN 5.6.8 to DNN 6.2.8 it turns out that you need an upgrade for this module to version 1.1.0 as well. You have two options:

  • Unzip the DNN 6.2.8 upgrade package to a local directory, and copy the module installation package for version 1.1.0 to the /install/Module folder, and then re-zip the DNN upgrade package. Use this package to upgrade DNN.
  • Unzip the DNN 6.2.8 upgrade package, and before running the installer, copy the module installation package to the /install/Module folder of your DNN installation.

The same for all other extension types (skins, providers, language packs...). When doing several upgrade steps, I prefer the first method, and have customized upgrade packages for each step, which allows me to speed-up the upgrades in the production environments later.

Happy DNNing!
Michael

Michael Tobisch
DNN★MVP

DNN Connect
New Around Here
Posts: 9
New Around Here

Thank you for your advice. But what about users? How to transfer users from DNN 4 to DNN 9? I need to preserve their UserID - is it possible?

Veteran Member
Posts: 1182
Veteran Member
MVP
MVP
You're an MVP!

If you upgrade, all the users and roles remain in your system.

If you set up up from scratch, there are some user import/export tools, e.g. forDNN.UsersExportImport by fordnn.

Happy DNNing!
Michael

 

Michael Tobisch
DNN★MVP

DNN Connect

These Forums are for the discussion of the open source CMS DNN platform and ecosystem.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved