The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
![]() |
Managing page access for custom dirs - 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: Managing page access for custom dirs (/showthread.php?tid=577) |
Managing page access for custom dirs - Alan - 05-29-2017 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. Managing page access for custom dirs - Alan - 05-29-2017 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 Managing page access for custom dirs - mudmin - 05-29-2017 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']; Managing page access for custom dirs - mudmin - 05-29-2017 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. Managing page access for custom dirs - Alan - 06-11-2017 Thanks for the quick reply, I successfully added custom folders as you explained, just hours after your reply, but forgot to say so here ![]() Managing page access for custom dirs - mudmin - 06-12-2017 Awesome! Glad it worked! |