× 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
securePage
#1
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?
  Reply
#2
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.
  Reply
#3
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

  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)