Example #1
0
        public Account LoadAccount(string username)
        {
            username = username.ToLower();

            try {
                Account acct = Database.SelectObject <Account>("Username='******'");

                if (acct == null)
                {
                    Log.Error("LoadAccount", "Account " + username + " not found.");
                    return(null);
                }

                lock (_accounts)
                    _accounts[username] = acct;

                lock (_pendingAccountIDs)
                    _pendingAccountIDs.Add(acct.AccountId);

                return(acct);
            } catch (Exception e) {
                Log.Error("LoadAccount", e.ToString());
                return(null);
            }
        }