summaryrefslogtreecommitdiffstats
path: root/wp-admin/includes
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
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')
-rw-r--r--wp-admin/includes/mu.php6
-rw-r--r--wp-admin/includes/upload.php14
2 files changed, 18 insertions, 2 deletions
diff --git a/wp-admin/includes/mu.php b/wp-admin/includes/mu.php
index 7cdbdec..297f10e 100644
--- a/wp-admin/includes/mu.php
+++ b/wp-admin/includes/mu.php
@@ -1,4 +1,5 @@
<?php
+
function wpmu_delete_blog($blog_id, $drop = false) {
global $wpdb, $wpmuBaseTablePrefix;
@@ -327,9 +328,10 @@ function wpmu_checkAvailableSpace() {
$size = $size / 1024 / 1024;
if( ($spaceAllowed - $size) <= 0 ) {
- wp_die( __( 'Sorry, you need to delete some files before you can upload any more.' ) );
+ define( 'DISABLE_UPLOADS', true );
+ define( 'DISABLE_UPLOADS_MESSAGE', 'Sorry, you must delete files before you can upload any more, or <a target="_new" href="paid-upgrades.php">buy more space</a>' );
}
}
-add_filter('upload_files_upload','wpmu_checkAvailableSpace');
+add_action('upload_files_upload','wpmu_checkAvailableSpace');
?>
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';