1
rossb
"The page isn’t redirecting properly" when non-admin (UID not 1) logged in
  • 2018/9/3 10:33

  • rossb

  • Just popping in

  • Posts: 77

  • Since: 2006/8/28


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

2
geekwright
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.

3
rossb
Re: "The page isn’t redirecting properly" when non-admin (UID not 1) logged in
  • 2018/9/3 20:31

  • rossb

  • Just popping in

  • Posts: 77

  • Since: 2006/8/28


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

4
rossb
Re: "The page isn’t redirecting properly" when non-admin (UID not 1) logged in
  • 2018/9/4 13:39

  • rossb

  • Just popping in

  • Posts: 77

  • Since: 2006/8/28


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/viewtopic.php?start=0&topic_id=1819&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

5
geekwright
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?"

6
rossb
Re: "The page isn’t redirecting properly" when non-admin (UID not 1) logged in
  • 2018/9/4 16:48

  • rossb

  • Just popping in

  • Posts: 77

  • Since: 2006/8/28


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

Login

Who's Online

368 user(s) are online (236 user(s) are browsing Support Forums)


Members: 0


Guests: 368


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits