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
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/printthread.php(287) : eval()'d code 2 errorHandler->error
/printthread.php 287 eval
/printthread.php 117 printthread_multipage



UserSpice
prorecting multiple pages in different folders - 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: prorecting multiple pages in different folders (/showthread.php?tid=405)

Pages: 1 2


prorecting multiple pages in different folders - mudmin - 01-04-2017

Ok. We can figure this out.

What does the error say?

Here are a few things to check.
1. Did you modify helpers.php or us_helpers.php? (This would tell us if a function was broken during modifications).
2. If you go into the admin panel and click on admin pages, does account.php have the "user" permission group assigned to it?
3. Did you modify the header or anything at the top of the page on any of your redirecting pages where you might have gotten rid of the include of the init.php?
4. Last try... go into account.php and change line 25 to
Code:
<?php //if (!securePage($_SERVER['PHP_SELF'])){die();}

Did that fix the error?


prorecting multiple pages in different folders - meetmec12 - 01-04-2017

1. I didnt modify helpers.php or us_helpers.php
2 account.php have the “user” permission group assigned to it?
3 yes i did modifed the top of the page of my redirecting page. am sure the issue started when i created a new folder. my index.php is in another folder : here is the index page am redirecting to. <?php
//require users/init.php in users folder . cc is my app root
require_once $_SERVER['DOCUMENT_ROOT'].'/cc/users/init.php';
//require_once $abs_us_root.$us_url_root.'users/includes/header.php';
//require_once $abs_us_root.$us_url_root.'users/includes/navigation.php';
?>
<?php if (!securePage($_SERVER['PHP_SELF'])){die();}
//will be using theses variables on the page
$get_info_fname = $user->data()->fname;
$get_info_lname = $user->data()->lname;
$get_info_id = $user->data()->id;
$get_info_email = $user->data()->email;
$get_info_username = $user->data()->username;
echo 'Welcome moderator';?>



prorecting multiple pages in different folders - meetmec12 - 01-04-2017

4 slashing out line 25 did not fix it
error:The page isn’t redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

This problem can sometimes be caused by disabling or refusing to accept cookies.

actually i get redirected to the page but the page contents does not load. i see the above error.


prorecting multiple pages in different folders - meetmec12 - 01-04-2017

i av to add this . This error does not occour in pages inside users folder.so am sure //require users/init.php in users folder . cc is my app root
require_once $_SERVER[‘DOCUMENT_ROOT’].’/cc/users/init.php’; is the problem


prorecting multiple pages in different folders - mudmin - 01-04-2017

Ahh. Ok. So don't use $_SERVER[‘DOCUMENT_ROOT’] on your include or figure out where that is pointing you.

The quickest thing to do is to change the line

Code:
require_once $_SERVER[‘DOCUMENT_ROOT’].’/cc/users/init.php’;
to
Code:
require_once 'http://mydomain.com/users/init.php';

See if that fixes it.


prorecting multiple pages in different folders - meetmec12 - 01-05-2017

Warning: require_once(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in C:\xampp\htdocs\cc\ojisedash\index.php on line 2

Warning: require_once(http://localhost/cc/users/init.php): failed to open stream: no suitable wrapper could be found in C:\xampp\htdocs\cc\ojisedash\index.php on line 2

Fatal error: require_once(): Failed opening required 'http://localhost/cc/users/init.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\cc\ojisedash\index.php on line 2


prorecting multiple pages in different folders - meetmec12 - 01-06-2017

i think the solution will be to redirect to a unique pages based on group e.g user to account.php, admin to admerror.php,moderator to moderror.php(not login, i mean redirect after visiting an unauthorized page). ust like we did with login redirect


prorecting multiple pages in different folders - mudmin - 01-08-2017

Yep. Agreed on that.