Пример #1
0
        private void ViewAnotherUsersAlbum(string albumPin)
        {
            Album  album           = new Album();
            string albumUserId     = album.GetAlbumUserId(albumPin);
            string albumUserFolder = rootDir + albumUserId + "/";

            RadFileExplorerAlbum.Configuration.MaxUploadFileSize = GetUploadLimit(albumUserId);
            RadFileExplorerAlbum.Configuration.SearchPatterns    = new string[] { "*.jpg", "*.jpeg", "*.gif", "*.png" };
            RadFileExplorerAlbum.Configuration.ViewPaths         = new string[] { albumUserFolder + albumPin };
            RadFileExplorerAlbum.Configuration.UploadPaths       = new string[] { albumUserFolder + albumPin };
            RadFileExplorerAlbum.Configuration.DeletePaths       = new string[] { albumUserFolder + albumPin };
            RadFileExplorerAlbum.InitialPath = Page.ResolveUrl(albumUserFolder + albumPin);
        }
Пример #2
0
 private void ViewAnotherUsersAlbum(string albumPin)
 {
     Album album = new Album();
     string albumUserId = album.GetAlbumUserId(albumPin);
     string albumUserFolder = rootDir + albumUserId + "/";
     RadFileExplorerAlbum.Configuration.MaxUploadFileSize = GetUploadLimit(albumUserId);
     RadFileExplorerAlbum.Configuration.SearchPatterns = new string[] { "*.jpg", "*.jpeg", "*.gif", "*.png" };
     RadFileExplorerAlbum.Configuration.ViewPaths = new string[] { albumUserFolder + albumPin };
     RadFileExplorerAlbum.Configuration.UploadPaths = new string[] { albumUserFolder + albumPin };
     RadFileExplorerAlbum.Configuration.DeletePaths = new string[] { albumUserFolder + albumPin };
     RadFileExplorerAlbum.InitialPath = Page.ResolveUrl(albumUserFolder + albumPin);
 }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Album album = new Album();
            userFolder = rootDir;
            albumPin = Request.QueryString["pin"];

            if (!IsPostBack)
            {
                LabelAlbumPin.Text = albumPin;
                if (User.Identity.IsAuthenticated)
                {
                    string userId = User.Identity.GetUserId();
                    userFolder += userId + "/";

                    if (!String.IsNullOrEmpty(albumPin))
                    {
                        string albumUserId = album.GetAlbumUserId(albumPin);
                        if (albumUserId == userId)
                        {
                            //This album pin belongs to the current users
                            //RadFileExplorerAlbum.InitialPath = Page.ResolveUrl(userFolder);
                            RadFileExplorerAlbum.Configuration.MaxUploadFileSize = GetUploadLimit(userId);
                            RadFileExplorerAlbum.Configuration.ViewPaths = getFolderArray(Request.MapPath(userFolder));
                            RadFileExplorerAlbum.Configuration.UploadPaths = new string[] { userFolder };
                            RadFileExplorerAlbum.Configuration.DeletePaths = new string[] { userFolder };
                        }
                        else
                            // The user is logged in but its not their album.
                            ViewAnotherUsersAlbum(albumPin);
                        LabelAlbumPin.Text = albumPin;
                        RadTextBoxAlbumName.Text = album.GetAlbumName(albumPin);
                    }
                    else
                    {
                        // Load users root folder.
                        RadFileExplorerAlbum.Configuration.MaxUploadFileSize = GetUploadLimit(userId);
                        RadFileExplorerAlbum.Configuration.ViewPaths = getFolderArray(Request.MapPath(userFolder));
                        RadFileExplorerAlbum.Configuration.UploadPaths = new string[] { userFolder };
                        RadFileExplorerAlbum.Configuration.DeletePaths = new string[] { userFolder };
                    }
                }
                else
                {
                    if (!String.IsNullOrEmpty(albumPin))
                    {
                        // The user is not logged in therefor its another users pin.
                        ViewAnotherUsersAlbum(albumPin);
                        LabelAlbumPin.Text = albumPin;
                        RadTextBoxAlbumName.Text = album.GetAlbumName(albumPin);
                    }
                    else
                    {
                        // The user is not logged in and no pin is given. Redirect.
                        Response.Redirect("~/Default.aspx");
                    }
                }
            }
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Album album = new Album();

            userFolder = rootDir;
            albumPin   = Request.QueryString["pin"];

            if (!IsPostBack)
            {
                LabelAlbumPin.Text = albumPin;
                if (User.Identity.IsAuthenticated)
                {
                    string userId = User.Identity.GetUserId();
                    userFolder += userId + "/";

                    if (!String.IsNullOrEmpty(albumPin))
                    {
                        string albumUserId = album.GetAlbumUserId(albumPin);
                        if (albumUserId == userId)
                        {
                            //This album pin belongs to the current users
                            //RadFileExplorerAlbum.InitialPath = Page.ResolveUrl(userFolder);
                            RadFileExplorerAlbum.Configuration.MaxUploadFileSize = GetUploadLimit(userId);
                            RadFileExplorerAlbum.Configuration.ViewPaths         = getFolderArray(Request.MapPath(userFolder));
                            RadFileExplorerAlbum.Configuration.UploadPaths       = new string[] { userFolder };
                            RadFileExplorerAlbum.Configuration.DeletePaths       = new string[] { userFolder };
                        }
                        else
                        {
                            // The user is logged in but its not their album.
                            ViewAnotherUsersAlbum(albumPin);
                        }
                        LabelAlbumPin.Text       = albumPin;
                        RadTextBoxAlbumName.Text = album.GetAlbumName(albumPin);
                    }
                    else
                    {
                        // Load users root folder.
                        RadFileExplorerAlbum.Configuration.MaxUploadFileSize = GetUploadLimit(userId);
                        RadFileExplorerAlbum.Configuration.ViewPaths         = getFolderArray(Request.MapPath(userFolder));
                        RadFileExplorerAlbum.Configuration.UploadPaths       = new string[] { userFolder };
                        RadFileExplorerAlbum.Configuration.DeletePaths       = new string[] { userFolder };
                    }
                }
                else
                {
                    if (!String.IsNullOrEmpty(albumPin))
                    {
                        // The user is not logged in therefor its another users pin.
                        ViewAnotherUsersAlbum(albumPin);
                        LabelAlbumPin.Text       = albumPin;
                        RadTextBoxAlbumName.Text = album.GetAlbumName(albumPin);
                    }
                    else
                    {
                        // The user is not logged in and no pin is given. Redirect.
                        Response.Redirect("~/Default.aspx");
                    }
                }
            }
        }