Added more checks in the update manager.

This commit is contained in:
mdtrooper 2015-02-10 12:54:51 +01:00
parent 077367576b
commit 8968505812
1 changed files with 17 additions and 5 deletions

View File

@ -245,7 +245,10 @@ function update_manager_check_online_free_packages_available() {
//~ html_debug_print($http_status, true);
//~ html_debug_print($result, true);
if ($http_status >= 400 && $http_status < 500) {
if ($result === false) {
return false;
}
elseif ($http_status >= 400 && $http_status < 500) {
return false;
}
elseif ($http_status >= 500) {
@ -299,18 +302,27 @@ function update_manager_check_online_free_packages ($is_ajax=true) {
//~ html_debug_print($http_status, true);
//~ html_debug_print($result, true);
if ($http_status >= 400 && $http_status < 500) {
if ($result === false) {
if ($is_ajax) {
echo __("Could not connect to internet");
}
else {
$update_message = __("Could not connect to internet");
}
}
else if ($http_status >= 400 && $http_status < 500) {
if ($is_ajax) {
echo __("Server not found.");
} else {
}
else {
$update_message = __("Server not found.");
}
}
elseif ($http_status >= 500) {
if ($is_ajax) {
echo $result;
} else {
}
else {
$update_message = $result;
}
}