示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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;
        }
示例#4
0
        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;
        }