/// <summary> /// ACCT Command - RFC 959 - Section 4.1.1 /// </summary> /// <param name="username"></param> /// <returns></returns> private Response Account(string twoFactorCode) { _currentUser = FtpUserStore.Validate(_username, _password, twoFactorCode); if (_currentUser != null) { Root = _currentUser.GetHomeDir(); CurrentDirectory = Root; return GetResponse(FtpResponses.LOGGED_IN); } else { return GetResponse(FtpResponses.NOT_LOGGED_IN); } }
/// <summary> /// PASS Command - RFC 959 - Section 4.1.1 /// </summary> /// <param name="username"></param> /// <returns></returns> private Response Password(string password) { FtpUser user = FtpUserStore.Validate(_username, password); if (user != null) { if (!string.IsNullOrEmpty(user.TwoFactorSecret)) { _password = password; return GetResponse(FtpResponses.NEED_TWO_FACTOR_CODE); } else { _currentUser = user; Root = _currentUser.GetHomeDir(); CurrentDirectory = Root; return GetResponse(FtpResponses.LOGGED_IN); } } else { return GetResponse(FtpResponses.NOT_LOGGED_IN); } }