"For developers", "Server scripts", "Functions description", "Users", "mGetUsersListByEmailAndState".

 

Getting a list of user UINs by their email addresses and network statuses.

 

Syntax

function mGetUsersListByEmailAndState(sEmail: string; iState: integer): string;

 

Parameters and return values

Parameter

Type

Value

sEmail

string

user main email address, the letter case is not important;

iState

integer

user status.

 

Function result

String with user UINs separated by commas. If no use is found, the function returns an empty string.

 

Example

const
  EMAIL = 'support@nsoft-s.com';
var
  sUINS, sUIN, sDisplayName, sRegistered: string;
  
begin
  sUINS := mGetUsersListByEmailAndState(EMAIL, -2);
  
    if length(sUINS) > 0 then begin
      mLogScript(sUINS, '');
        while length(sUINS) > 0 do begin
          sUIN := Fetch(sUINS, ',');
          sDisplayName := mGetUserAttribute(StrToInt(sUIN), 'DisplayName');
          sRegistered := mGetUserAttribute(StrToInt(sUIN), 'Registered');
          
          mLogScript('Name: ' + sDisplayName + ', Registered: ' + sRegistered, 'UIN ' + sUIN);
        end;
    end else mLogScript('No users found', '');
end.

Script work result

[19:02:25] (Log "mGetUsersListByEmailAndState"): 17762,30

[19:02:25] (Log "mGetUsersListByEmailAndState"): [UIN 17762] Name: User, Registered: 14.02.2018.15.50.38

[19:02:25] (Log "mGetUsersListByEmailAndState"): [UIN 30] Name: Cthulhu, Registered: 28.04.2009.17.30.18

[19:02:25] (Run "mGetUsersListByEmailAndState"): Script operation time: 10 ms

[19:02:25] (Run "mGetUsersListByEmailAndState"): Script done successfully.

 

See also

Fetch

Length

mGetUserAttribute

mLogScript

StrToInt