The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/printthread.php(287) : eval()'d code 2 errorHandler->error
/printthread.php 287 eval
/printthread.php 117 printthread_multipage



UserSpice
New pages not added - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.4 (https://userspice.com/forums/forumdisplay.php?fid=27)
+--- Thread: New pages not added (/showthread.php?tid=1353)

Pages: 1 2


New pages not added - sayed_hashim808 - 02-26-2019

Hi,

I'm having very strange issue with my US when adding new pages...

I'm writing a script called SRE

My directory looks like this

/SRE
/users
/usersc
.
.
.

I've added "SRE/" to z_us_root.php, and when I go to "Manage Page Access" I can see the list of all pages in SRE, I can edit the page access and everything seems ok.

so SRE/index.php is there and has ID #101

however, I notice the following:
1. The permission level does not work, when I add the USER to access the page it does not work.
2. When try accessing the page from Admin, it redirects me to "Manage Page Access" and says "Please confirm permission settings" and gives me a NEW page ID #102
3. When I add USER again as access, it creates new entry in the "pages" database but the "page" field is blank.
4. Now the page access work and USER can access the page, BUT when Admin edits the page from "Manage Page Access"  it deletes the last entry which is page ID#102 and creates new page ID#103, and same thing happens, it stores it in the Pages DB with a blank "page" field.

I really don't know whats causing this issue.


RE: New pages not added - mudmin - 02-26-2019

(02-26-2019, 11:54 AM)sayed_hashim808 Wrote: Hi,

I'm having very strange issue with my US when adding new pages...

I'm writing a script called SRE

My directory looks like this

/SRE
/users
/usersc
.
.
.

I've added "SRE/" to z_us_root.php, and when I go to "Manage Page Access" I can see the list of all pages in SRE, I can edit the page access and everything seems ok.

so SRE/index.php is there and has ID #101

however, I notice the following:
1. The access level does not work, when I add the USER to access the page it does not work.
2. When try accessing the page from Admin, it redirects me to "Manage Page Access" and says "Please confirm permission settings" and gives my NEW page ID #102
3. When I add USER again as access, it creates new entry in the "pages" database but the "page" field is blank.
4. Now the page access work and USER can access the page, BUT when Admin edits the page from "Manage Page Access"  it deletes the last entry which is page ID#102 and creates new page ID#103, and same thing happens, it stores it in the Pages DB with a blank "page" field.

I really don't know whats causing this issue.

Can you share the top of your z_us_root file? I can try to replicate that.


RE: New pages not added - sayed_hashim808 - 02-26-2019

<?php
$path=['','users/','usersc/','SRE/'];
$abs_us_root=$_SERVER['DOCUMENT_ROOT'];

$self_path=explode("/", $_SERVER['PHP_SELF']);
$self_path_length=count($self_path);
$file_found=FALSE;

for($i = 1; $i < $self_path_length; $i++){
array_splice($self_path, $self_path_length-$i, $i);
$us_url_root=implode("/",$self_path)."/";

if (file_exists($abs_us_root.$us_url_root.'z_us_root.php')){
$file_found=TRUE;
break;
}else{
$file_found=FALSE;
}
}
//redirect back to Userspice URL root (usually /)
header('Location: '.$us_url_root);
exit;
?>


RE: New pages not added - mudmin - 02-26-2019

Thanks. Let me take a look. I'm wondering about the caps, but I'll try it on mine.


RE: New pages not added - sayed_hashim808 - 02-26-2019

(02-26-2019, 11:58 AM)mudmin Wrote: Thanks. Let me take a look.  I'm wondering about the caps, but I'll try it on mine.

Thank you mudmin,

I've tried without the caps .... same issue!


RE: New pages not added - mudmin - 02-26-2019

It worked fine for me, so I'm going to do a little more digging.
I added a folder called SRE and added home.php to it and was able to modify the permissions and access it as user.
Still looking.


RE: New pages not added - mudmin - 02-26-2019

Yeah. It works perfectly for me. When you said you tried lowercase, did you do both the folder on your server and z_us_root as lowercase?

I'm guessing you're on mac/linux.


RE: New pages not added - sayed_hashim808 - 02-26-2019

(02-26-2019, 12:03 PM)mudmin Wrote: It worked fine for me, so I'm going to do a little more digging.
I added a folder called SRE and added home.php to it and was able to modify the permissions and access it as user.
Still looking.

it is very strange ....
I dont understand why its adding new entry in the pages DB with blank "page" field rather than "SRE/index.php"!!!

(02-26-2019, 12:05 PM)mudmin Wrote: Yeah. It works perfectly for me. When you said you tried lowercase, did you do both the folder on your server and z_us_root as lowercase?

I'm guessing you're on mac/linux.

Yes linux

And no, tried different name "sretest/"


RE: New pages not added - mudmin - 02-26-2019

The reason I guessed linux is that I'm guessing it's a file permsision/owner issue.

If your folder is in var/www try
sudo chown -R $USER:$USER /var/www/
sudo chmod -R 755 /var/www

You may have to change $USER:$USER with www-data:www-data
The best thing to do is to figure out what the owner and permission level of the pages/folders that work are and see if the new folder is different.


RE: New pages not added - sayed_hashim808 - 02-27-2019

(02-26-2019, 12:56 PM)mudmin Wrote: The reason I guessed linux is that I'm guessing it's a file permsision/owner issue.  

If your folder is in var/www try
sudo chown -R $USER:$USER /var/www/
sudo chmod -R 755 /var/www

You may have to change $USER:$USER with www-data:www-data
The best thing to do is to figure out what the owner and permission level of the pages/folders that work are and see if the new folder is different.

Looks like the permission is set correctly (755)! 

Any other possibilities?