diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-03-26 22:53:30 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-03-26 22:53:30 +0000 |
commit | 75434cbeb6e6c2e4107b9932a79b3d146dbdcc0f (patch) | |
tree | 64752a60736e9dff5f4bda45fe22bc4bba599ce3 /lib | |
parent | feffae660e250ba631e74dea0b62088749d10b6b (diff) | |
download | ampache-75434cbeb6e6c2e4107b9932a79b3d146dbdcc0f.tar.gz ampache-75434cbeb6e6c2e4107b9932a79b3d146dbdcc0f.tar.bz2 ampache-75434cbeb6e6c2e4107b9932a79b3d146dbdcc0f.zip |
tweaks to upload
Diffstat (limited to 'lib')
-rw-r--r-- | lib/class/error.class.php | 2 | ||||
-rw-r--r-- | lib/preferences.php | 9 | ||||
-rw-r--r-- | lib/upload.php | 19 |
3 files changed, 21 insertions, 9 deletions
diff --git a/lib/class/error.class.php b/lib/class/error.class.php index b3e74ba5..013a2e08 100644 --- a/lib/class/error.class.php +++ b/lib/class/error.class.php @@ -51,7 +51,7 @@ class Error { $array = array($name=>$description); - error_results($array); + error_results($array,1); $this->error_state = 1; return true; diff --git a/lib/preferences.php b/lib/preferences.php index 1bb9e80f..970a099f 100644 --- a/lib/preferences.php +++ b/lib/preferences.php @@ -225,6 +225,10 @@ function create_preference_input($name,$value) { elseif ($value == '0') { echo "Disabled"; } + elseif ($name == 'upload_dir' || $name == 'quarantine_dir') { + /* Show Nothing */ + echo " "; + } else { echo $value; } @@ -317,6 +321,11 @@ function create_preference_input($name,$value) { } // foreach themes echo "</select>\n"; break; + case 'quarantine_dir': + case 'upload_dir': + if (!$GLOBALS['user']->has_access(100)) { + break; + } default: echo "<input type=\"text\" size=\"$len\" name=\"$name\" value=\"$value\" />"; break; diff --git a/lib/upload.php b/lib/upload.php index a24c55c5..43cfc7bd 100644 --- a/lib/upload.php +++ b/lib/upload.php @@ -38,9 +38,7 @@ function check_upload_extension($name='file') { return true; } - if (conf('debug')) { - log_event($_SESSION['userdata']['username'],' upload ',"Error: Invalid Extension $extension"); - } + debug_event('upload',"Error: Invalid Extension $extension",'2'); return false; @@ -51,16 +49,21 @@ function check_upload_extension($name='file') { @discussion checks the filesize of the upload */ function check_upload_size($name='file') { - + static $total_size; $size = $_FILES[$name]['size']; - + + $total_size = $total_size + $size; + if ($size > conf('max_upload_size')) { - if (conf('debug')) { - log_event($_SESSION['userdata']['username'],' upload ',"Error: Upload to large, $size"); - } + debug_event('upload',"Error: Upload to large, $size",'2'); return false; } + + if ($total_size > conf('max_upload_size')) { + debug_event('upload',"Error: Total Upload to large, $total_size",'2'); + return false; + } return true; |