The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once



UserSpice
Adding Folders to Permission Handler - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: Adding Folders to Permission Handler (/showthread.php?tid=87)



Adding Folders to Permission Handler - brian - 02-24-2016

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.


Adding Folders to Permission Handler - mudmin - 02-24-2016

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.


Adding Folders to Permission Handler - brian - 02-24-2016

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.



Adding Folders to Permission Handler - mudmin - 02-24-2016

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.


Adding Folders to Permission Handler - mudmin - 02-24-2016

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.



Adding Folders to Permission Handler - brian - 02-24-2016

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.


Adding Folders to Permission Handler - mudmin - 02-24-2016

Yeah. You're right. I'll give that a whirl. I don't think it will be too hard to add.


Adding Folders to Permission Handler - brian - 02-24-2016

probably could be a 4.1 feature, as long as the current method works and isn't too difficult.