ForumServer.ServerController.Activate C# (CSharp) Метод

Activate() публичный Метод

public Activate ( string username, string password ) : System.Result
username string
password string
Результат System.Result
        public Result Activate(string username, string password)
        {
            try
            {
                log.Info("got request to activate " + username + "'s account");

                User user = dataManager.GetUser(username);
                if (user != null)
                {
                    Result res;
                    if (Result.OK == (res = securityManager.AuthenticateUser(username, password)))
                    {
                        if (Result.OK == (res = policyManager.IsAuthorizedActivate(username)))
                        {
                            dataManager.SetUserState(username, UserState.Active);
                            return Result.OK;
                        }
                        else return res;
                    }
                    else return res;
                }
                else return Result.USER_NOT_FOUND;

            }
            catch (Exception e)
            {
                log.Error("failed to activate " + username + "'s account", e);
                throw e;
            }
        }