From 3d55a60feec58264a8c96595345be218e04cc7b0 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 25 Sep 2013 12:21:58 +0000 Subject: [PATCH] 2013-09-25 Miguel de Dios * extensions/update_manager/lib/functions.php: changed the code to show better info about the error when upload a oum with a size biggest than the PHP limit. MERGED FROM THE BRANCH PANDORA_4.0 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8814 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 8 ++++++++ .../extensions/update_manager/lib/functions.php | 13 ++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 78ea972910..a7770ef901 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2013-09-25 Miguel de Dios + + * extensions/update_manager/lib/functions.php: changed the code + to show better info about the error when upload a oum with a size + biggest than the PHP limit. + + MERGED FROM THE BRANCH PANDORA_4.0 + 2013-09-25 Miguel de Dios * extensions/update_manager/lib/libupdate_manager_client.php: fixed diff --git a/pandora_console/extensions/update_manager/lib/functions.php b/pandora_console/extensions/update_manager/lib/functions.php index aeadbeeea3..e3a3c17ee6 100644 --- a/pandora_console/extensions/update_manager/lib/functions.php +++ b/pandora_console/extensions/update_manager/lib/functions.php @@ -572,7 +572,18 @@ function install_offline_enterprise_package(&$settings, $user_key) { } } else { - ui_print_error_message(__('File cannot be uploaded')); + //Check if the file is biggest than the limit in PHP + if ($_FILES["fileloaded"]["error"] === 1) { + $upload_max_filesize = ini_get('upload_max_filesize'); + + ui_print_error_message( + sprintf( + __('File is more biggest than the PHP limit (%s). Please change it in PHP configuration.'), + $upload_max_filesize)); + } + else { + ui_print_error_message(__('File cannot be uploaded')); + } } } ?>