From cc522e07aeb71a70bb9d2e951a8f85d6dfeaa909 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 13 Apr 2010 03:55:52 +0000 Subject: [PATCH] MINOR moved allowed_extensions and friends to the model layer (from r92046) (from r96816) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@102678 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/AssetAdmin.php | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/code/AssetAdmin.php b/code/AssetAdmin.php index 875e5ccf..01a92f28 100755 --- a/code/AssetAdmin.php +++ b/code/AssetAdmin.php @@ -22,19 +22,6 @@ class AssetAdmin extends LeftAndMain { */ public static $allowed_max_file_size; - /** - * @see Upload->allowedExtensions - * @var array - */ - public static $allowed_extensions = array(); - - /** - * If this is true, then restrictions set in $allowed_max_file_size and - * $allowed_extensions will be applied to users with admin privileges as - * well. - */ - public static $apply_restrictions_to_admin = false; - static $allowed_actions = array( 'deleteUnusedThumbnails', 'doUpload', @@ -190,11 +177,11 @@ JS } // validate files (only if not logged in as admin) - if(!self::$apply_restrictions_to_admin && Permission::check('ADMIN')) { + if(!File::$apply_restrictions_to_admin && Permission::check('ADMIN')) { $valid = true; } else { $upload = new Upload(); - $upload->setAllowedExtensions(array('gif')); + $upload->setAllowedExtensions(File::$allowed_extensions); $upload->setAllowedMaxFileSize(self::$allowed_max_file_size); $valid = $upload->validate($tmpFile); if(!$valid) {