Ejemplo n.º 1
0
        private static bool ValidateRemoteSync(IAlbum album, string password)
        {
            IGallerySettings gallerySettings = Factory.LoadGallerySetting(album.GalleryId);

            if (!gallerySettings.EnableRemoteSync)
            {
                AppErrorController.LogEvent(String.Format(CultureInfo.CurrentCulture, "Cannot start synchronization: A web service request to start synchronizing album '{0}' (ID {1}) was received, but the gallery is currently configured to disallow remote synchronizations. This feature can be enabled on the Albums page in the Site admin area.", album.Title, album.Id), album.GalleryId);
                return(false);
            }

            if (!gallerySettings.RemoteAccessPassword.Equals(password))
            {
                AppErrorController.LogEvent(String.Format(CultureInfo.CurrentCulture, "Cannot start synchronization: A web service request to start synchronizing album '{0}' (ID {1}) was received, but the specified password is incorrect.", album.Title, album.Id), album.GalleryId);
                return(false);
            }

            return(true);
        }