diff --git a/admin/templates/default/group.edit.xet b/admin/templates/default/group.edit.xet index 9c8db5294c..b08c4f914a 100644 --- a/admin/templates/default/group.edit.xet +++ b/admin/templates/default/group.edit.xet @@ -28,19 +28,24 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/api/src/Vfs.php b/api/src/Vfs.php index 1a8b077b10..86cf7e145f 100644 --- a/api/src/Vfs.php +++ b/api/src/Vfs.php @@ -1112,10 +1112,19 @@ class Vfs extends Vfs\Base */ static function hsize($size) { - if ($size < 1024) return $size; - if ($size < 1024*1024) return sprintf('%3.1fk',(float)$size/1024); - if ($size < 1024*1024*1024) return sprintf('%3.1fM',(float)$size/(1024*1024)); - return sprintf('%3.1fG',(float)$size/(1024*1024*1024)); + if($size < 1024) + { + return $size; + } + if($size < 1024 * 1024) + { + return sprintf('%3.2Gk', (float)$size / 1024); + } + if($size < 1024 * 1024 * 1024) + { + return sprintf('%3.4GM', (float)$size / (1024 * 1024)); + } + return sprintf('%3.4GG', (float)$size / (1024 * 1024 * 1024)); } /** @@ -1133,22 +1142,24 @@ class Vfs extends Vfs\Base preg_match('#([0-9.]+)[\s]*([a-z]+)#i', $val, $matches); $last = ''; - if(isset($matches[2])){ + if(isset($matches[2])) + { $last = $matches[2]; } - if(isset($matches[1])){ - $val = (int) $matches[1]; + if(isset($matches[1])) + { + $val = (float)$matches[1]; } - switch (strtolower($last)) + switch(strtolower($last)) { case 'g': case 'gb': - $val *= 1024; + $val *= 1024; case 'm': case 'mb': - $val *= 1024; + $val *= 1024; case 'k': case 'kb': $val *= 1024; diff --git a/filemanager/inc/class.filemanager_ui.inc.php b/filemanager/inc/class.filemanager_ui.inc.php index faa2c5fda7..18ad2903b4 100644 --- a/filemanager/inc/class.filemanager_ui.inc.php +++ b/filemanager/inc/class.filemanager_ui.inc.php @@ -1790,14 +1790,34 @@ class filemanager_ui $tmp_path = ini_get('upload_tmp_dir') . '/' . basename($tmp_name); } - if (Vfs::copy_uploaded($tmp_path, $path, $props, false)) + try { - ++$arr['files']; - $uploaded[] = $data['name']; + if(Vfs::copy_uploaded($tmp_path, $path, $props, false)) + { + ++$arr['files']; + $uploaded[] = $data['name']; + } + else + { + ++$arr['errs']; + } } - else + catch (\EGroupware\Stylite\Vfs\QuotaExceededException $e) { + // File was touched but not written. Might need to delete it + $stat = Vfs::stat($path); + if($stat && $stat['size'] == 0) + { + Vfs::unlink($path); + } + + // Send error ++$arr['errs']; + ++$script_error; + $arr['msg'] = $e->getMessage(); + $arr['msg'] .= "\n" . lang("You can either delete some files or get in touch with your administrator to get more space"); + // No point continuing + break; } } } diff --git a/filemanager/js/filemanager.ts b/filemanager/js/filemanager.ts index 22050800b6..8e27fdf01a 100644 --- a/filemanager/js/filemanager.ts +++ b/filemanager/js/filemanager.ts @@ -544,7 +544,7 @@ export class filemanagerAPP extends EgwApp { if(this.egw.pushAvailable()) { - this.egw.message(_data.msg); + this.egw.message(_data.msg, _data.errs > 0 ? "error" : "success"); } else { diff --git a/filemanager/lang/egw_en.lang b/filemanager/lang/egw_en.lang index 017328d650..60ae9cf9b0 100644 --- a/filemanager/lang/egw_en.lang +++ b/filemanager/lang/egw_en.lang @@ -241,6 +241,7 @@ properties saved. filemanager en Properties saved. protocol to use filemanager en Protocol to use protocols filemanager en Protocols quick jump to filemanager en Quick jump to +quota exceeded filemanager en Quota exceeded read & write access filemanager en Read & write access read access only filemanager en Read access only readonly share link filemanager en Readonly Share link @@ -328,6 +329,7 @@ writable share link filemanager en Writable Share link wrong username or password! filemanager en Wrong username or password! you are not allowed to finally delete older versions and deleted files! filemanager en You are NOT allowed to finally delete older versions and deleted files! you are not allowed to upload a script! filemanager en You are NOT allowed to upload a script! +you can either delete some files or get in touch with your administrator to get more space filemanager en You can either delete some files or get in touch with your administrator to get more space you can only grant additional rights, you can not take rights away! filemanager en You can only grant additional rights, you can NOT take rights away! you can use regular upload [+] button to upload files. filemanager en You can use regular upload [+] button to upload files. you do not have access to %1 filemanager en You do not have access to %1 diff --git a/filemanager/templates/default/quota.xet b/filemanager/templates/default/quota.xet index 393fa0c6bc..e6ab34854d 100644 --- a/filemanager/templates/default/quota.xet +++ b/filemanager/templates/default/quota.xet @@ -4,7 +4,9 @@