summaryrefslogtreecommitdiffstats
path: root/wp-includes
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-10-22 15:44:26 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-10-22 15:44:26 +0000
commit71c14576f335e1ad1e86b6a0b97603fcd5265a2b (patch)
tree97dd2183be0ef362d4bb838f653a8c62132cdd82 /wp-includes
parent7d2c1782f9d3aa331d37abc80bcb16b11e3e47e0 (diff)
downloadwordpress-mu-71c14576f335e1ad1e86b6a0b97603fcd5265a2b.tar.gz
wordpress-mu-71c14576f335e1ad1e86b6a0b97603fcd5265a2b.tar.xz
wordpress-mu-71c14576f335e1ad1e86b6a0b97603fcd5265a2b.zip
Move wpmu_checkAvailableSpace() to includes/mu.php and add it to upload action.
Use get_space_allowed(), props ktlee, fixes #463 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1118 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes')
-rw-r--r--wp-includes/wpmu-functions.php45
1 files changed, 0 insertions, 45 deletions
diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php
index bfbe5ed..40eb75b 100644
--- a/wp-includes/wpmu-functions.php
+++ b/wp-includes/wpmu-functions.php
@@ -26,51 +26,6 @@ add_action('private_to_published', 'wpmu_update_blogs_date');
add_action('publish_phone', 'wpmu_update_blogs_date');
add_action('publish_post', 'wpmu_update_blogs_date');
-/*
- Determines if the available space defined by the admin has been exceeded by the user
-*/
-/**
- * Returns how much space is available (also shows a picture) for the current client blog, retrieving the value from the master blog 'main' option table
- *
- * @param string $action
- * @return string
- */
-function wpmu_checkAvailableSpace($action) {
- // Using the action.
- // Set the action to 'not-writable' to block the upload
-
- // Default space allowed is 10 MB
- $spaceAllowed = get_site_option( "blog_upload_space" );
- if( $spaceAllowed == false )
- $spaceAllowed = 10;
-
- $dirName = constant( "ABSPATH" ) . constant( "UPLOADS" );
- $dir = dir($dirName);
- $size = 0;
-
- while($file = $dir->read()) {
- if ($file != '.' && $file != '..') {
- if (is_dir($file)) {
- $size += dirsize($dirName . '/' . $file);
- } else {
- $size += filesize($dirName . '/' . $file);
- }
- }
- }
- $dir->close();
- $size = $size / 1024 / 1024;
- $spaceAvailable = sprintf( "%2.2f", ( ($spaceAllowed-$size) ) );
- echo sprintf(__('Space Available (<i>%2.2fMB</i>)'), $spaceAvailable);
-
- if (($spaceAllowed-$size)>0) {
- return $action;
- } else {
- // No space left
- return 'not-writable';
- }
-}
-add_filter('fileupload_init','wpmu_checkAvailableSpace');
-
function get_blogaddress_by_id( $blog_id ) {
$bloginfo = get_blog_details( (int) $blog_id, false ); // only get bare details!
return "http://" . $bloginfo->domain . $bloginfo->path;