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
securePage - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: General (https://userspice.com/forums/forumdisplay.php?fid=20)
+--- Forum: New to UserSpice? (https://userspice.com/forums/forumdisplay.php?fid=22)
+--- Thread: securePage (/showthread.php?tid=334)



securePage - sqluser - 11-03-2016

Hello,
the code
Code:
if (!securePage($_SERVER['PHP_SELF'])){die();}
is in my configuration not working in a new file without the link.
Code:
require_once $abs_us_root.$us_url_root.'users/helpers/helpers.php';

Than the page is visible, or redirected to the login screen, nice and perfect coding.
The link for this page is on the main screen, and if the user is not logged in, or has the correct settings for this file, why bother him with a link that he can not activate.
If I disable the link with securePage the error message is on my main page.


Quote:You must go into the Admin Panel and click the Manage Pages button to add this page to the database. Doing so will make this error go away.


How to code this one?


securePage - Brandin - 11-05-2016

I've noticed this error in two cases:
On pages I added to my
Code:
usersc
folder and have NOT gone to the
Code:
admin_pages.php
page, or pages inside of a subfolder in
Code:
usersc
which in that case I have just had to remove the secure page query.


securePage - mudmin - 11-05-2016

I think what is happening is when you create a page, if you absolutely need 2 things for it to work with UserSpice.

You need to require_once/include the init file (which includes those helpers you showed).

And you need that securePage function.

I'm guessing you don't have the proper path to the init in there, so the securePage function is causing you problems.

That's why people have a problem when they copy files to the usersc folder. You need to change that line from "init.php" to ../users/init.php