Ejemplo n.º 1
0
 public bool Logout()
 {
     if (this.LoggedIn())
     {
         this.PathResolver = null;
         this.User         = null;
         return(true);
     }
     return(false);
 }
Ejemplo n.º 2
0
        public User Login(string mail, string pass)
        {
            string hash = Hashing.GetHashString(pass);

            this.User = new Db().Users.Where(i => i.Email == mail && i.Pass == hash).FirstOrDefault();
            if (this.LoggedIn())
            {
                this.PathResolver = new RemoteDrivePath(this.User.Root);
                if (!Directory.Exists(this.PathResolver.HostPath))
                {
                    Directory.CreateDirectory(this.PathResolver.HostPath);
                }
                if (!Directory.Exists(this.PathResolver.UserPath))
                {
                    Directory.CreateDirectory(this.PathResolver.UserPath);
                }
            }
            return(this.User);
        }