show whether curl extension is installed when trying to check for a new version in admin-dashboard

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-03-29 11:11:39 +02:00
parent be0099bf01
commit e58192edc2

View File

@@ -85,6 +85,7 @@ if ($page == 'overview') {
if ((isset($_GET['lookfornewversion']) && $_GET['lookfornewversion'] == 'yes') if ((isset($_GET['lookfornewversion']) && $_GET['lookfornewversion'] == 'yes')
|| (isset($lookfornewversion) && $lookfornewversion == 'yes') || (isset($lookfornewversion) && $lookfornewversion == 'yes')
) { ) {
if (function_exists('curl_version')) {
$update_check_uri = 'http://version.froxlor.org/Froxlor/legacy/' . $version; $update_check_uri = 'http://version.froxlor.org/Froxlor/legacy/' . $version;
$latestversion = HttpClient::urlGet($update_check_uri); $latestversion = HttpClient::urlGet($update_check_uri);
$latestversion = explode('|', $latestversion); $latestversion = explode('|', $latestversion);
@@ -115,6 +116,12 @@ if ($page == 'overview') {
} else { } else {
redirectTo($update_check_uri.'/pretty', NULL, false); redirectTo($update_check_uri.'/pretty', NULL, false);
} }
} else {
$lookfornewversion_lable = "Version-check not available due to missing php-curl extension";
$lookfornewversion_link = htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
$lookfornewversion_addinfo = '';
$isnewerversion = 0;
}
} else { } else {
$lookfornewversion_lable = $lng['admin']['lookfornewversion']['clickhere']; $lookfornewversion_lable = $lng['admin']['lookfornewversion']['clickhere'];
$lookfornewversion_link = htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes'); $lookfornewversion_link = htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');