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
Page Permissions Error - 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: Page Permissions Error (/showthread.php?tid=957)



Page Permissions Error - AnasAZ - 02-16-2018

Hi,
When I add a page, the page permission appears. I set permissions and I'm able to see the page. but when I go to page permission page from the admin dashboard to search for that page, I cannot find it! then when I try to access the page, the page permission page appears again! why page permissions are not saved!
I have the latest version.


Page Permissions Error - AnasAZ - 02-16-2018

I guess the page id for the same page is somehow not fixed! when I check the table permission_page_matches it get an entry such as:
68 | 1 | 93 |
| 69 | 2 | 93 |
| 70 | 1 | 94 |
| 71 | 2 | 94 |
| 72 | 2 | 96 |
| 73 | 1 | 98 |
| 74 | 2 | 98 |
| 75 | 1 | 100 |
| 76 | 2 | 100 |
+----+---------------+---------+

but when I click on the page again, it gives new ID?

admin_page.php?err=Please+confirm+permission+settings.&new=yes&id=101




Page Permissions Error - AnasAZ - 02-16-2018

Further to my findings.
the page table does not contains the new pages. its not saving new pages! how come?

| 84 | users/join_AZ.php | | 1 | 0 |
| 86 | users/enable2fa.php | Enable 2 Factor Auth | 1 | 0 |
| 87 | users/disable2fa.php | Enable 2 Factor Auth | 2 | 0 |
| 88 | test.php | | 1 | 0 |
| 89 | users/twofa.php | | 1 | 0 |
+----+---------------------------------+--------------------------+---------+---------+



Page Permissions Error - AnasAZ - 02-16-2018

If I create a new page in the root of my project (test1.php):
-------------------------------------------
<pre>
Code:
<?php require_once 'users/init.php'; ?>
<?php require_once $abs_us_root.$us_url_root.'users/includes/header.php'; ?>
<?php require_once $abs_us_root.$us_url_root.'users/includes/navigation.php'; ?>
<?php if (!securePage($_SERVER['PHP_SELF'])){die();} ?>
<?php
echo "Hello World";
?>
<?php require_once $abs_us_root.$us_url_root.'users/includes/html_footer.php'; // currently just the closing /body and /html ?>
</pre>

-------------------------------------------
it worked fine:

| 89 | users/twofa.php | | 1 | 0 |
| 103 | test1.php | | 1 | 0 |
+-----+---------------------------------+--------------------------+---------+---------+


but when I create a folder such as testFolder and then add a new test page (test2.php) with the following

----------------------------------------------
<pre>
Code:
<?php require_once '../users/init.php'; ?>
<?php require_once $abs_us_root.$us_url_root.'users/includes/header.php'; ?>
<?php require_once $abs_us_root.$us_url_root.'users/includes/navigation.php'; ?>
<?php if (!securePage($_SERVER['PHP_SELF'])){die();} ?>
<?php

echo "Hello World!";

?>
<?php require_once $abs_us_root.$us_url_root.'users/includes/html_footer.php'; // currently just the closing /body and /html ?>
</pre>

--------------------------------------------

it creates the page

| 103 | test1.php | | 1 | 0 |
| 104 | testFolder/test2.php | | 1 | 0 |
+-----+---------------------------------+--------------------------+---------+---------+

but after I visit page permission it delete the entry from the table (pages)
| 89 | users/twofa.php | | 1 | 0 |
| 103 | test1.php | | 1 | 0 |
+-----+---------------------------------+--------------------------+---------+---------+


This is really weird!



Page Permissions Error - AnasAZ - 02-16-2018

I solved the problem. in the file z_us_root.php I had the following
$path=['','users/','usersc/','testFolder'];

I just added/ at the end of the folder!
$path=['','users/','usersc/','testFolder/'];

sorry to bother you!
Thanks!


Page Permissions Error - dan - 02-16-2018

Sorry I didn't get to this faster. Yeah. That / makes a difference! Glad you got it sorted!