• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New pages not added
#1
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.
  Reply
#2
(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.
  Reply
#3
<?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;
?>
  Reply
#4
Thanks. Let me take a look. I'm wondering about the caps, but I'll try it on mine.
  Reply
#5
(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!
  Reply
#6
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.
  Reply
#7
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.
  Reply
#8
(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/"
  Reply
#9
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.
  Reply
#10
(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?
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)