Fork me on GitHub
Get XOOPS XOOPSXOOPS FAQFAQ ForumsForums NewsNews ThemesThemes ModulesModules
New Posts New Topics All Posts All Forums Index General Modules Themes Development International XOOPS.org

Search

Donat-O-Meter

Make donations with PayPal!
Stats
Goal: $100.00
Due Date: Apr 30
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 adslight Android AntiHarvesting AntiMalUser AntiSpam Apple Battlefield billige Blocks Bootstrap Captcha cell cent chronolabs CHUNG 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 List log Loss mobile module modules Monster new newbb news NHÀ online PARK phone PHP Prevention profile project Protector publisher Rapid RESIDENCE responsive review Rights rmcommon Room security Sentry site Smartphone Smarty Spam Studio support tag tags tdmcreate template The Theme themes User userlog web weight xoops Xortify

New Users

Registering user

# 137287

Zafer

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
Just can't stay away
Just can't stay away
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
Community Support Member
Community Support Member
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
Just can't stay away
Just can't stay away
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
Community Support Member
Community Support Member
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
Moderator
Moderator
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
Home away from home
Home away from home
Joined:
2008/2/26 10:05
From Grand Rapids, MI
Group:
Registered Users
Posts: 1248
(Show More) (Show Less)


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

Top

frankblack
Just can't stay away
Just can't stay away
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.

[Advanced Search]