public static FtpUser Validate(string username, string password, string twoFactorCode) { FtpUser user = (from u in _users where u.UserName == username && u.Password == password select u).SingleOrDefault(); if (TwoFactor.TimeBasedOneTimePassword.IsValid(user.TwoFactorSecret, twoFactorCode)) { return(user); } return(null); }
public static FtpUser Validate(string username, string password) { FtpUser user = (from u in _users where u.UserName == username && u.Password == password select u).SingleOrDefault(); if (user == null) { user = new FtpUser { UserName = username, HomeDir = "C:\\Utils", IsAnonymous = true }; } return(user); }
public static FtpUser Validate(string username, string password) { FtpUser user = (from u in _users where u.UserName == username && u.Password == password select u).SingleOrDefault(); if (user == null) { user = new FtpUser { UserName = username, HomeDir = "C:\\Utils", IsAnonymous = true }; } return user; }
public static FtpUser Validate(string username, string password) { FtpUser user = (from u in _users where u.UserName == username && u.Password == password select u).SingleOrDefault(); if (user == null) { user = new FtpUser { UserName = username, Dirs = new VirtualDir[]{new VirtualDir (){ LocalPath= "C:\\Utils", VirtualPath="/"}}, IsAnonymous = true }; } return user; }