The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.18 (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
Managing page access for custom dirs
#1
Hello, it's possible I missed this part in the documentation somewhere but basically I would like to manage
which user groups are allowed to visit php pages that are located in 1 or more levels of directories.
CUrrently admin_pages.php only seems to be listing pages in the /users directory, and (custom) pages in the root directory, but not anything else. How do I make sure pages in -let's say- directory /xyz are also listed in order for me to be able to set user group access?

Thanks in advance.
  Reply
#2
I've found the following walkthrough: https://userspice.com/monitoring-additional-folders/
and started following the steps described, however I cannot execute the instructions below:


Then, open the file /users/admin_pages.php
copy this line and paste it right below itself.
$uspages = getUSPageFiles(); //retrieves core UserSpice pages
Change the name of the variable and the function to a unique variable and the name of the function you created.
Finally, just below that you will see a line that reads…
$pages = array_merge($rootpages, $uspages);
After $uspages just add a comma and your variable that links to your new function.
Voila. Save everything. Login and go to admin_pages and all of your files in that new folder will automatically populate the database and be controllable by UserSpice.


admin_pages.php doesn't seem to contain the lines of code mentioned in those instructions.
I am using v4.2.6
  Reply
#3
I'm so sorry. These are outdated. I need a complete redo on my documentation.

Edit the file z_us_root.php and add an additional path to that array on line 2

$path=['users/downloads/','','users/','usersc/','xyzFolder'];
  Reply
#4
I just realized that the documentation is right, but you were following the 4.0 instructions instead of the 4.1 or later. I'm going to get rid of that picture in there because it's confusing. It points you to the old way of doing it.
  Reply
#5
Thanks for the quick reply, I successfully added custom folders as you explained, just hours after your reply, but forgot to say so here Wink
  Reply
#6
Awesome! Glad it worked!
  Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)