summaryrefslogtreecommitdiffstats
path: root/wp-admin/includes/upload.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-10-22 16:42:10 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-10-22 16:42:10 +0000
commitf1ddafe372c7c84d2251a3ea78496cf76f29c737 (patch)
treecc2c81aa11168600271cb2d179b96e439486f09f /wp-admin/includes/upload.php
parent71c14576f335e1ad1e86b6a0b97603fcd5265a2b (diff)
downloadwordpress-mu-f1ddafe372c7c84d2251a3ea78496cf76f29c737.tar.gz
wordpress-mu-f1ddafe372c7c84d2251a3ea78496cf76f29c737.tar.xz
wordpress-mu-f1ddafe372c7c84d2251a3ea78496cf76f29c737.zip
Added "DISABLE_UPLOADS" and "DISABLE_UPLOADS_MESSAGE"
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1119 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/includes/upload.php')
-rw-r--r--wp-admin/includes/upload.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/wp-admin/includes/upload.php b/wp-admin/includes/upload.php
index 9d3fda1..61b0302 100644
--- a/wp-admin/includes/upload.php
+++ b/wp-admin/includes/upload.php
@@ -102,6 +102,13 @@ function wp_upload_view() {
}
function wp_upload_form() {
+ if ( defined('DISABLE_UPLOADS') && constant('DISABLE_UPLOADS') ) {
+ if ( defined('DISABLE_UPLOADS_MESSAGE') && constant('DISABLE_UPLOADS_MESSAGE') ) {
+ return print(__(DISABLE_UPLOADS_MESSAGE));
+ } else {
+ return print(__('Sorry, uploads are temporarily disabled.'));
+ }
+ }
$id = get_the_ID();
global $post_id, $tab, $style;
$enctype = $id ? '' : ' enctype="multipart/form-data"';
@@ -194,6 +201,13 @@ function wp_upload_tab_upload_action() {
switch ( $action ) :
case 'upload' :
+ if ( defined('DISABLE_UPLOADS') && constant('DISABLE_UPLOADS') ) {
+ if ( defined('DISABLE_UPLOADS_MESSAGE') && constant('DISABLE_UPLOADS_MESSAGE') ) {
+ return die(__(DISABLE_UPLOADS_MESSAGE));
+ } else {
+ return die(__('Sorry, uploads are temporarily disabled.'));
+ }
+ }
global $from_tab, $post_id, $style;
if ( !$from_tab )
$from_tab = 'upload';