summaryrefslogtreecommitdiff
path: root/calculate_max_upload_inc.php
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2006-06-10 16:18:42 +0000
committerMax Kremmel <xing@synapse.plus.com>2006-06-10 16:18:42 +0000
commitdfb8fef8052a0024737432b293c9229d4aefe309 (patch)
treeb3e305d58a5ce3380783e95007c1b64f9fd20813 /calculate_max_upload_inc.php
parent9b6d981db2dc2284351db17bf69c0ad76085d19f (diff)
downloadliberty-dfb8fef8052a0024737432b293c9229d4aefe309.tar.gz
liberty-dfb8fef8052a0024737432b293c9229d4aefe309.tar.bz2
liberty-dfb8fef8052a0024737432b293c9229d4aefe309.zip
move uploadMax calculation to seperate file for easy inclusion
Diffstat (limited to 'calculate_max_upload_inc.php')
-rw-r--r--calculate_max_upload_inc.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/calculate_max_upload_inc.php b/calculate_max_upload_inc.php
new file mode 100644
index 0000000..c508002
--- /dev/null
+++ b/calculate_max_upload_inc.php
@@ -0,0 +1,17 @@
+<?php
+// settings that are useful to know about at upload time
+$postMax = str_replace( 'M', '', ini_get( 'post_max_size' ));
+$uploadMax = str_replace( 'M', '', ini_get( 'upload_max_filesize' ) );
+
+if( $postMax < $uploadMax ) {
+ $uploadMax = $postMax;
+}
+
+// calculate user quota
+if( $gBitSystem->isPackageActive( 'quota' ) ) {
+ require_once( QUOTA_PKG_PATH.'calculate_quota_inc.php' );
+}
+
+$gBitSmarty->assign( 'uploadMax', $uploadMax );
+?>
+