How do you detect user group? How do you detect user group?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

How do you detect user group?

Started by dreams83, May 12, 2007, 03:23:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dreams83

How do you detect the group that a user belong too? I have a plug-in that is running and I want to be able to detect like if the user belong to a certain group:

Like in the debugger:
USER DATA:
------------------
Array
(
    [user_id] => 2
    [user_name] => ntsuj_plig
    [groups] => Array
        (
            [0] => 102
            [1] => 177
            [2] => 185
            [3] => 232
            [4] => 938
        )


in the plug-in i was able to use like USER_NAME and that will give me ntsuj_plig and same thing for USER_ID to get 2. Is there a similar way I could get the groups array so I can determine which group a user belong to? Maybe if there is a guide on the inner working of coppermine you guys and girls can point me to it because I want to know more about the workings of coppermine too.

Nibbler

The debugger is displaying the $USER_DATA array. The groups are in that - $USER_DATA['groups']

dreams83

Got it now

define

global $USER_DATA;

then I was able to use $USER_DATA['groups']

Thank You