coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: dreams83 on May 12, 2007, 03:23:21 AM

Title: How do you detect user group?
Post by: dreams83 on May 12, 2007, 03:23:21 AM
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.
Title: Re: How do you detect user group?
Post by: Nibbler on May 12, 2007, 12:54:02 PM
The debugger is displaying the $USER_DATA array. The groups are in that - $USER_DATA['groups']
Title: Re: How do you detect user group?
Post by: dreams83 on May 15, 2007, 03:00:59 AM
Got it now

define

global $USER_DATA;

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

Thank You