Getting a user rights group name by his UIN.
function mGetUserRoleName(iUIN: integer): string;
Parameter |
Type |
Value |
---|---|---|
iUIN |
integer |
unique user ID. |
User rights group name, if he exists. If you specify an invalid UIN, the function returns an empty string.
var
sRoleName: string;
i, iMaxUIN, iGuestsCount, iWEBGuestsCount: integer;
begin
iMaxUIN := mGetMaxRegisteredUIN;
iGuestsCount := 0;
iWEBGuestsCount := 0;
mLogScript('Max registered UIN: ' + inttostr(iMaxUIN), '');
for i := 1 to iMaxUIN do
if mIsUINExists(i) then begin
sRoleName := mGetUserRoleName(i);
if sRoleName = 'Guests' then inc(iGuestsCount) else
if sRoleName = 'WEB guests' then inc(iWEBGuestsCount);
end;
mLogScript('Guests count: ' + inttostr(iGuestsCount), '');
mLogScript('WEB Guests count: ' + inttostr(iWEBGuestsCount), '');
end.
[17:16:28] (Log "mGetUserRoleName"): Max registered UIN: 15868
[17:16:28] (Log "mGetUserRoleName"): Guests count: 3985
[17:16:28] (Log "mGetUserRoleName"): WEB Guests count: 927
[17:16:28] (Run "mGetUserRoleName"): Script operation time: 706 ms
[17:16:28] (Run "mGetUserRoleName"): Script done successfully.