The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
I use an index to call my pages and the premission doesn't work - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28) +--- Forum: Documentation (https://userspice.com/forums/forumdisplay.php?fid=30) +--- Thread: I use an index to call my pages and the premission doesn't work (/showthread.php?tid=507) |
I use an index to call my pages and the premission doesn't work - kwix - 03-28-2017 Hi, Im using an index page which is calling all the pages that i want. For exemple when i click on a lick my url is like Code: index.php?page=APage.php&projectName=name Here a part of the code of my index.php <div id="wrapper-wrapper"> <?php require("partials/nav.php"); ?> <div id="page-wrapper" class="admin"> <?php if (!isset($_GET['page'])){ require("pages/main.php"); }else{ if(isset($_GET['page']) && preg_match("/^[-a-z0-9_&]+$/i",$_GET['page'])){ $page=strtolower($_GET['page']); if (file_exists("pages/$page.php")){ require ("pages/$page.php"); }else if(file_exists("admin/pages/$page.php")){ require ("admin/pages/$page.php"); }else{ require ("pages/404.php"); } }else{ require ("pages/404.php"); } } ?> </div> </div> How can i use the permission without modifying all my php pages ? Regards, I use an index to call my pages and the premission doesn't work - JUG - 03-28-2017 Did you set permissions of these pages in admin dashboard? Also, every page that you need to be secure must have init.php and secure_page lines somewhere. I use an index to call my pages and the premission doesn't work - Brandin - 03-28-2017 If I recall correctly I also have issues where the master page e.g. Code: orders.php Code: ?type=daystats I use an index to call my pages and the premission doesn't work - Brandin - 03-28-2017 I have the following page format to this situation: Code: usersc/report.php Code: usersc/includes/orderreport.php Code: usersc/includes/orders/bo.php Code: report.php Code: orderreport.php However, Code: bo.php All three pages have init and the securePage query. I'm thinking this is similar to your situation, kwix? I use an index to call my pages and the premission doesn't work - kwix - 03-30-2017 Yes i did it jug. @brandin : Yes I think its a bit similar but I have to modify all the code anyway, so I will try to correct that at the beginning. I use an index to call my pages and the premission doesn't work - mudmin - 03-30-2017 Yeah. If you want userspice to restrict a page on its own, you need the securePage line on the each php page. Either way, that's good practice, and you can do a find/replace to probably make that happen pretty easily. The other thing you can do (depending on how many permission levels you're using) is something along the lines of adding a permission restriction to your page calls. So, let's say you only want to let people with permission level 2,3,4 get those pages, you can do something like... Code: if(hasPerm([2,3,4]){ Code: require ("admin/pages/$page.php"); Code: } |