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
Adding Folders to Permission Handler
#1
Is it possible to add folders which are scanned for permission handling? I can see that it searches / and /user/ (no subdirectories). I wanted to create a folder /binc in the root and have the ability to manage permissions on the pages there.
  Reply
#2
Yes! http://www.userspice.org/monitoring-additional-folders/

Btw, I'm tinkering with out htaccess to get the mudministry.org out of some of our links. If that link dies, just use http://www.userspice.org/monitoring-additional-folders/

We are picking up some additional server resources off of mudministry.org at the moment.
  Reply
#3
Took a look, okay. Any way stuff like that could be added to the core/ini.php file? That way settings are all contained in a single file for updates and such.
  Reply
#4
Yeah. Actually now that you mention it, I'm sure an array or something like that could be created. I'll take a look at that.
  Reply
#5
I think the quick way to do that would be to add this function to the us_helpers.php file

function getMoreFiles($location) {
$directory = "../$location";
$pages = glob($directory . "*.php");
foreach ($pages as $page){
$fixed = str_replace('../$location','',$page);
$row[$fixed] = $fixed;
}
return $row;
}

Then on your admin_pages file you would do something like...
$newFolder="myfolder"; //no beginning slash needed

then below that you would call...
$extraPages = getMoreFiles($newFolder);

Then it's just a matter of adding that $extraPages to the array.
$pages = array_merge($rootpages, $uspages,$extrapages);

I haven't tested it, but that makes sense off the top of my head.
  Reply
#6
hmm, I have lots of other permissions related stuff to explore so I'll come back to it. Off the top of my head though, since managing permissions is the core function, then easily being able to add folders, even through the UI would be helpful.
  Reply
#7
Yeah. You're right. I'll give that a whirl. I don't think it will be too hard to add.
  Reply
#8
probably could be a 4.1 feature, as long as the current method works and isn't too difficult.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)