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
Existing site question - 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: Existing site question (/showthread.php?tid=933)



Existing site question - simplymarkb - 02-05-2018

I have an existing site that I added US to. When I look in page management I dont see all of my PHP files. How can I add existing files in my root and the subdirs? I have sub dirs that have thier own index.php. Is there a way I can protect those as well? I am guessing something with .htaccess. I dont want people going directly to http://mysite.com/subdir/index.php for example.

Thanks in advance!


Existing site question - mudmin - 02-05-2018

Yep. That's not a problem at all. You just have to add the folders that you want to protect in the z_us_root file.

Open the file z_us_root.php.

Line 2 has an array,

$path=[”,’users/’,’usersc/’];

https://mydomain.com and you already have https://mydomain.com/users, https://mydomain.com/usersc and you want to add a folder called ‘app’ (which would be https://mydomain.com/app

Edit the file z_us_root.php line two to say

$path=[”,’users/’,’usersc/’,’app/’];

and your php files should show right up in the admin_pages section of the dashboard and in your database.

Wordpress uses curly quotation marks. Make sure you use straight ones (' & ")and that you don't have any spaces in your array.

Also, in order for UserSpice to actually protect the page, you need 2 lines of code at the top of each page.

Code:
<?php require_once 'init.php'; ?>
and
Code:
<?php if (!securePage($_SERVER['PHP_SELF'])){die();} ?>

Note that you want the actual relative path to init.php so if you have the folders
/
/users
/usersc
/yoursubdir
and your file is in /yoursubdir
the init line should be
Code:
<?php require_once '../users/init.php'; ?>



Existing site question - simplymarkb - 02-06-2018

Awesome! Thank you!!

-M