public RedirectResult RedirectSubdomain(string subdomain)
 {
     //check if subdomain is user or network
     //TODO check if is a network
     try
     {
         UserManager userManager = new UserManager();
         User user = userManager.GetUserByProfileURL(subdomain);
         if (user == null)
         {
             string redirectURL = "http://vestn.com";
             return Redirect(redirectURL);
         }
         else if (user.isPublic == 0)
         {
             string redirectURL = "http://vestn.com/#splash=404";
             return Redirect(redirectURL);
         }
         else
         {
             string redirectURL = "http://vestn.com/#profile=" + user.id.ToString();
             return Redirect(redirectURL);
         }
     }
     catch (Exception ex)
     {
         string redirectURL = "http://vestn.com";
         return Redirect(redirectURL);
     }
 }
Example #2
0
        public static List<string> getUserURLs()
        {
            List<string> urls = new List<string>();
            UserManager UM = new UserManager();

            foreach (User u in UM.GetAllUsers())
            {
                urls.Add(u.profileURL.ToLower());
            }
            return urls;
        }
Example #3
0
        public static List<string> getUserEmails()
        {
            List<string> emails = new List<string>();
            UserManager UM = new UserManager();

            foreach (User u in UM.GetAllUsers())
            {
                emails.Add(u.email.ToLower());
            }
            return emails;
        }
 public RedirectResult RedirectSubdomain(string subdomain)
 {
     //check if subdomain is user or network
     //TODO check if is a network
     try
     {
         UserManager userManager = new UserManager();
         User user = userManager.GetUserByProfileURL(subdomain);
         if (user == null)
         {
             string redirectURL = "http://50.17.232.163";
             return Redirect(redirectURL);
         }
         else
         {
             string redirectURL = "http://50.17.232.163/#profile=" + subdomain;
             return Redirect(redirectURL);
         }
     }
     catch (Exception ex)
     {
         return Redirect("http://50.17.232.163");
     }
 }
Example #5
0
        //private void updatePictureElementsForImageGallery()
        //{
        //    UploadManager uploadManager = new UploadManager();
        //    ProjectManager projectManager = new ProjectManager();
        //    List<ProjectElement> projectElements = new VestnDB().projectElements.ToList();
        //    List<ProjectElement_Picture> pictureElements = new List<ProjectElement_Picture>();
        //    foreach (ProjectElement element in projectElements)
        //    {
        //        if (element.GetType() == typeof(ProjectElement_Picture))
        //        {
        //            pictureElements.Add((ProjectElement_Picture)element);
        //        }
        //    }
        //    foreach (ProjectElement_Picture picture in pictureElements)
        //    {
        //        if (picture.pictureGalleriaThumbnailLocation == null)
        //        {
        //            picture.pictureGalleriaThumbnailLocation = uploadManager.generateThumbnail(picture.pictureLocation, picture.id, "PictureElement_Galleria", 1000, 700);
        //            projectManager.UpdateProjectElement(picture);
        //        }
        //    }
        //}
        private void InitializeConnections()
        {
            UserManager userManager = new UserManager();

            List<User> userList = new VestnDB().users.ToList();
            foreach (User user in userList)
            {
                if (user.connections == null)
                {
                    user.connections = "";
                    userManager.UpdateUser(user);
                }
            }
        }