Function to check if a specified user exists at least in one group.

 

Syntax

function mIsUserInGroups(iUIN: integer): boolean;

 

Parameters and return values

Parameter

Type

Value

iUIN

integer

unique user ID, a number is greater than 0.

 

Function result

true — — user added to one group or more;

false — user does not exist or he is not added to any group.

 

Example


const
  UIN = 6;
var
  sDisplayName: string;
begin
  if mIsUserInGroups(UIN) then begin
    sDisplayName := mGetUserAttribute(UIN, 'DisplayName');
    mLogScript('User "' + sDisplayName + '" (UIN ' + IntToStr(UIN) + ') has some groups', '');
  end else mLogScript('User don''t have any groups', '');
end.


Script work result

[15:08:40] (Log "mIsUserInGroups"): User "Alexey pikurov" (UIN 6) has some groups

[15:08:40] (Run "mIsUserInGroups"): Script operation time: 6 ms

[15:08:40] (Run "mIsUserInGroups"): Script done successfully.

 

See also

IntToStr

mGetUserAttribute

mLogScript