xoops forums

rossb

Just popping in
Posted on: 9/3 10:33
rossb
rossb (Show more)
Just popping in
Posts: 35
Since: 2006/8/28
#1

"The page isn’t redirecting properly" when non-admin (UID not 1) logged in

xoops 2.5.9
php 5.6
anonymous and admin users can view site. Other users get in infinite redirect loop. Firefox displays above error, IE times out.

Have tracked this down to /index.php:

if ($xoopsUser) {
if (!$moduleperm_handler->checkRight('module_read', $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) {
THIS --> redirect_header(XOOPS_URL, 1, _NOPERM, false);
}
$xoopsUserIsAdmin = $xoopsUser->isAdmin($xoopsModule->getVar('mid'));
} else {
if (!$moduleperm_handler->checkRight('module_read', $xoopsModule->getVar('mid'), XOOPS_GROUP_ANONYMOUS)) {
redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
}
}

How can I debug / fix this?

Thanks;
Bill

geekwright

Quite a regular
Posted on: 9/3 20:06
geekwright
geekwright (Show more)
Quite a regular
Posts: 245
Since: 2010/10/15
#2

Re: "The page isn’t redirecting properly" when non-admin (UID not 1) logged in

This code is only used when a "Module for your start page" is specified. The permissions, either the group's "Module Access rights" for that start page module , or for the initial page content in the start page module is not allowing access.

There is an error in the redirect logic, but the group permissions for the module are what is preventing access. Make sure the registered user group has permissions to access the start module and it should work.

I will put in a patch for the redirect. It should redirect to user.php instead of to the start page.

rossb

Just popping in
Posted on: 9/3 20:31
rossb
rossb (Show more)
Just popping in
Posts: 35
Since: 2006/8/28
#3

Re: "The page isn’t redirecting properly" when non-admin (UID not 1) logged in

Thanks fellow geek;

I suspected as much, but it is independent of start module. Have already triple checked user group membership and group perms, but will do again.

Regards;
Bill

rossb

Just popping in
Posted on: 9/4 13:39
rossb
rossb (Show more)
Just popping in
Posts: 35
Since: 2006/8/28
#4

Re: "The page isn’t redirecting properly" when non-admin (UID not 1) logged in

Solved.

The two users I was having trouble with were previously members of the webmaster group on an incarnation of a previous (antique xoops) site, which I recreated (xoops 2.5.9) from scratch and phpmyadmin imported users and other DB tables from.

SOLUTION: edit problematic users for desired attributes, save, clear xoops and browser cache (including cookies)

I also found this thread useful for "what to check":

https://xoops.org/modules/newbb/viewto ... &order=ASC&status=&mode=0

Not sure of other users have same woes. Awaiting complaints.

@geekwright Is this your patch?
redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM, false);

Regards;
Bill

geekwright

Quite a regular
Posted on: 9/4 15:33
geekwright
geekwright (Show more)
Quite a regular
Posts: 245
Since: 2010/10/15
#5

Re: "The page isn’t redirecting properly" when non-admin (UID not 1) logged in

Quote:

rossb wrote:
...
@geekwright Is this your patch?
redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM, false);


Yes. That fixes the bug regarding the infinite redirection loop related to permissions to the start module.

It doesn't fix any underlying permission issues. Some known issues are handled in upgrade, but there can be problems since a lot has changed over time.

Bill, just out of curiosity, what was the version of the "antique xoops?"

rossb

Just popping in
Posted on: 9/4 16:48
rossb
rossb (Show more)
Just popping in
Posts: 35
Since: 2006/8/28
#6

Re: "The page isn’t redirecting properly" when non-admin (UID not 1) logged in

Recognized xoops superiority long ago. Started with 2.0, patched up til 2.5.7, patches upon patches sites became unmaintainable. Bit the bullet, clean break (recreated) to 2.5.9

...B