mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 09:05:53 +00:00
MINOR moved allowed_extensions and friends to the model layer (from r92046)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@96816 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
37dcb0d970
commit
d674e2b032
@ -22,19 +22,6 @@ class AssetAdmin extends LeftAndMain {
|
|||||||
*/
|
*/
|
||||||
public static $allowed_max_file_size;
|
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(
|
static $allowed_actions = array(
|
||||||
'addfolder',
|
'addfolder',
|
||||||
'deletefolder',
|
'deletefolder',
|
||||||
@ -209,11 +196,11 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
// validate files (only if not logged in as admin)
|
// 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;
|
$valid = true;
|
||||||
} else {
|
} else {
|
||||||
$upload = new Upload();
|
$upload = new Upload();
|
||||||
$upload->setAllowedExtensions(self::$allowed_extensions);
|
$upload->setAllowedExtensions(File::$allowed_extensions);
|
||||||
$upload->setAllowedMaxFileSize(self::$allowed_max_file_size);
|
$upload->setAllowedMaxFileSize(self::$allowed_max_file_size);
|
||||||
$valid = $upload->validate($tmpFile);
|
$valid = $upload->validate($tmpFile);
|
||||||
if(!$valid) {
|
if(!$valid) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user