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

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

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