コード例 #1
0
 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);
     }
 }
コード例 #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;
        }
コード例 #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;
        }
コード例 #4
0
 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");
     }
 }
コード例 #5
0
ファイル: Global.asax.cs プロジェクト: bcary/Vestn_Backend
        //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);
                }
            }
        }