Fork me on GitHub

Search

Donat-O-Meter

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

Learn XOOPS Core

Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

- 2 2.5 2.6 3.0 4 6 2013 Abuse Android AntiHarvesting AntiMalUser AntiSpam API Apple Battlefield Blocks Bootstrap Captcha cell chronolabs content CĂN demo docek download Dresses evden eve facebook Fat Food for free Gateway Google Guide herre Home Honeypot HP html5 Human HỘ IP iPhone jQuery Law Legal List Loss mobile module modules Monster new newbb news NHÀ online PARK Payment phone PHP Prevention profile project Protector publisher Rapid RESIDENCE responsive review Rights rmcommon Room security Sentry site Smartphone Smarty Solution Spam Studio support tag tags tdmcreate The Theme themes User userlog web weight Wishcraft xoops Xortify

New Users

Registering user

# 137849

hometheater

Welcome to XOOPS!




Bottom   Previous Topic   Next Topic  |  Register To Post



#1 Posted on: 2010/2/13 8:11 getGroups ...
... should get the groups the current user is in. Right?

To get the groups array you can use this code:
$groupsb = (is_object($xoopsUser)) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
echo 
implode(' ',$groupsb);


Test case 1: my user admin with uid 1 is in the groups admins and registered users, so what do you expect to be printed?

Right! 1 2

Test case 2: my user admin with uid 1 is in the groups admins, so what do you expect to be printed?

Right! 1

WRONG! It prints 1 2

Why is this so? I can't find any solution for this "odd" behaviour. When this is expected behaviour, then this is bollocks. I made a fresh install of 2.4.4 to avoid any collisions and if I remember correctly in the 2.0 series it worked as I expected.

Top

frankblack
Joined:
2005/6/13 3:03
From D-Schiefbahn
Group:
Registered Users
Posts: 785
(Show More) (Show Less)


#2 Posted on: 2010/2/13 8:47 Re: getGroups ...
As it should return the group link records, are you sure for case 2 the link to registered users was deleted?
Check with phpMyAdmin the records returned by:
SELECT groupid FROM xoops_groups_users_link WHERE uid1;
(xoops_ = prefix_)

PS: It is possible that you need to log out and in to see the effects of group manipulation!

Top

ghia
Joined:
2008/7/3 14:19
From Belgium
Group:
Registered Users
Posts: 4946
(Show More) (Show Less)


#3 Posted on: 2010/2/13 9:05 Re: getGroups ...
You are correct ghia. You have to log out or manually kill the session/cookies to see an effect. Feeling a bit uncomfortable with this anyway. I know that this is a scenario which will happen not to often (or never): Let's assume the admin gave user frankblack accidently admin rights. frankblack logs in and has admin rights. The admin notices his mistakes and moves frankblack out of the admin group, but while frankblack is online he has still access to admin area?

Theoretically spoken...

Top

frankblack
Joined:
2005/6/13 3:03
From D-Schiefbahn
Group:
Registered Users
Posts: 785
(Show More) (Show Less)


#4 Posted on: 2010/2/13 12:45 Re: getGroups ...
I have this here sometimes on XOOPS also. You have a spammer and deny his rights to post, but he can continue posting until he get logged out.

Top

ghia
Joined:
2008/7/3 14:19
From Belgium
Group:
Registered Users
Posts: 4946
(Show More) (Show Less)


#5 Posted on: 2010/2/14 2:30 Re: getGroups ...
It'd be nice to have a 'Log this user out Now!' button...

Top

sailjapan
Joined:
2005/11/16 5:27
From Osaka
Group:
Registered Users
Posts: 1667
(Show More) (Show Less)


#6 Posted on: 2010/2/14 8:27 Re: getGroups ...
What happens if you delete their sessions file? Dont they sort of automatically get "logged out" as the session no longer exists?

Rodney

Top

redheadedrod
Joined:
2008/2/26 10:05
From Grand Rapids, MI
Group:
Registered Users
Posts: 1263
(Show More) (Show Less)


#7 Posted on: 2010/2/14 10:51 Re: getGroups ...
Added a feature request on sourceforge...

Top

frankblack
Joined:
2005/6/13 3:03
From D-Schiefbahn
Group:
Registered Users
Posts: 785
(Show More) (Show Less)







You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create pdf.
You cannot get print page.

[Advanced Search]