The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
File Manager
#2
There are definitely 3rd party solutions for doing this... I'm trying to think through how I would code it if I were doing it in php.

My initial thought is that I would randomize the filenames a little bit so someone couldn't just guess the filename.

Then, you can use the checkMenu function to decide if the link to that particular file shows up for someone.

When you go into the permission levels, you'll notice that each permission has an id. That id gets passed into the checkMenu function along with the user's id. That will tell you if they have permission. So you could do something like this.

Level 2 is Admin by default.
<?php if (checkMenu(2,$user->data()->id)){ ?>
//YourDownloadLink etc
<?php } ?>

The other thing you could do is make a database table that stores each filename and a list of the access levels that can access it. Then you can create a function to check that.

Note that once you give the link to someone, this does not stop them from right clicking the actual file link and sharing it.

If you want to get a little fancier, here is a class...
Code:
http://www.tutorialchip.com/php-download-file-script/

I may implement this in UserSpice. I like it.
  Reply


Messages In This Thread
File Manager - by inugami - 11-27-2016, 03:56 AM
File Manager - by mudmin - 11-27-2016, 04:56 AM
File Manager - by inugami - 11-27-2016, 05:14 AM
File Manager - by dan - 11-27-2016, 05:18 AM
File Manager - by mudmin - 11-27-2016, 02:51 PM
File Manager - by inugami - 12-10-2016, 03:58 AM
File Manager - by dan - 12-10-2016, 04:38 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)