Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

Engine.xAdminUserList


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
// ====================================================================
//  Class:  XAdmin.xAdminUserList
//  Parent: XAdmin.xAdminBase
//
//  <Enter a description here>
// ====================================================================

class xAdminUserList extends xAdminBase;

var private array<xAdminUser>	Users;

// Returns the number of Users in the list
function int Count()		{ return Users.Length; }

/////////////////////////////////////////////////
// CreateUser : Creates a new user 

function xAdminUser Create(string UserName, string Password, string Privileges)
{
local xAdminUser NewUser;

	NewUser = new(None) class'xAdminUser';
	if (NewUser != None)
		NewUser.Init(UserName, Password, Privileges);

	return NewUser;
}

function Add(xAdminUser NewUser)
{
	if (NewUser != None && !Contains(NewUser))
	{
		Users.Length = Users.Length + 1;
		Users[Users.Length - 1] = NewUser;
	}
}

function xAdminUser Get(int i)
{
	return Users[i];
}

function Remove(xAdminUser User)
{
local int i;

	if (User != None)
	{
		for (i=0; i<Users.Length; i++)
			if (Users[i] == User)
			{
				Users.Remove(i, 1);
				return;
			}
	}
}

function Clear()
{
	Users.Length = 0;
}

function bool Contains(xAdminUser User)
{
local int i;

	if (User != None)
	{
		for (i=0; i<Users.Length; i++)
			if (Users[i] == User)
				return true;
	}
	return false;
}

function xAdminUser FindByName(string UserName)
{
local int i;

	if (UserName != "")
	{
		for (i=0; i<Users.Length; i++)
			if (Users[i].UserName == UserName)
				return Users[i];
	}
	return None;
}

defaultproperties
{
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: pr 5-2-2018 12:35:48.000 - Creation time: sk 18-3-2018 09:50:26.273 - Created with UnCodeX