- Added whitelist site setting for allowed file extensions to upload via media module.

- Hardcoded blacklist: web.config
- Superuser immune to whitelist restriction
- Zip files still allowed even if not in the list since these are expanded by the media module to allow for multi upload.
- Files within a zip must still pass white/black-list test per normal rules (file is skipped if not).

--HG--
branch : dev
This commit is contained in:
Dave Reed
2010-11-04 12:01:07 -07:00
parent e414469e0f
commit 79bec8cee6
10 changed files with 144 additions and 10 deletions

View File

@@ -0,0 +1,15 @@
using System.Net.Mail;
using Orchard.ContentManagement.Records;
using System.ComponentModel.DataAnnotations;
namespace Orchard.Media.Models {
public class MediaSettingsPartRecord : ContentPartRecord {
internal const string DefaultWhitelist = "jpg jpeg gif png txt doc docx xls xlsx pdf ppt pptx pps ppsx odt ods odp";
private string _whitelist = DefaultWhitelist;
public virtual string UploadAllowedFileTypeWhitelist {
get { return _whitelist; }
set { _whitelist = value; }
}
}
}