The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.28 (Linux)
|
![]() |
Securing my own page - 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: Securing my own page (/showthread.php?tid=466) |
Securing my own page - haroldb100 - 02-19-2017 Ok, I just installed userspice and followed the userspice don't care video in order to secure and existing page. The problem is the headers and requires in the video do not match version 4.2. What do I need to put in my pages header and footer to secure the page? Securing my own page - mudmin - 02-21-2017 Sorry. I need to update that video. Basically all you need is a require once/include to the init file and that securepage function. So if you open up any existing userspice page you'll see Code: <?php require_once 'init.php'; ?> Code: <?php if (!securePage($_SERVER['PHP_SELF'])){die();} ?> The second line you paste right after your menus etc. The first line goes at the top and needs to point to yourdomain/users/init.php So, if you are adding a page in the root it's Code: users/init.php Code: ../users/init.php Basically you just need that path to be correct. It's always going to be static, so once you figure it out, it shouldn't be too bad. From there, you can decide if you want to include our header. I would suggest doing it because you will have access to a lot of userspice stuff in there. If you need to put your own stuff in the header and don't want our updates to break it, then create a file called Code: usersc/includes/head_tags.php If you don't want to use our header at all, then you probably want to instnatiate the DB manually and grab the settings table. Code: $db = DB::getInstance(); Code: $settingsQ = $db->query("Select * FROM settings"); Code: $settings = $settingsQ->first(); You'll also want to include and css/js you need. |