add requirement check for php-json as settings import/export uses json_decode/json_encode

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-01-30 07:58:24 +01:00
parent c62dd2ecf4
commit 7ae31496ac
6 changed files with 20 additions and 0 deletions

View File

@@ -292,6 +292,11 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
}
elseif ($page == 'importexport' && $userinfo['change_serversettings'] == '1')
{
// check for json-stuff
if (! extension_loaded('json')) {
standard_error('jsonextensionnotfound');
}
if (isset($_GET['action']) && $_GET['action'] == "export") {
// export
try {

View File

@@ -1032,6 +1032,15 @@ class FroxlorInstall
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
}
// check for json extension
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpjson']);
if (! extension_loaded('json')) {
$content .= $this->_status_message('orange', $this->_lng['requirements']['notinstalled'] . "<br />" . $this->_lng['requirements']['jsondescription']);
} else {
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
}
// check for open_basedir
$content .= $this->_status_message('begin', $this->_lng['requirements']['openbasedir']);
$php_ob = @ini_get("open_basedir");

View File

@@ -35,8 +35,10 @@ $lng['requirements']['phpbcmath'] = 'PHP bcmath-extension...';
$lng['requirements']['phpcurl'] = 'PHP curl-extension...';
$lng['requirements']['phpmbstring'] = 'PHP mbstring-extension...';
$lng['requirements']['phpzip'] = 'PHP zip-extension...';
$lng['requirements']['phpjson'] = 'PHP json-extension...';
$lng['requirements']['bcmathdescription'] = 'Traffic-calculation related functions will not work correctly!';
$lng['requirements']['zipdescription'] = 'The auto-update feature requires the zip extension.';
$lng['requirements']['jsondescription'] = 'The settings import/export feature requires the json extension.';
$lng['requirements']['openbasedir'] = 'open_basedir...';
$lng['requirements']['openbasedirenabled'] = 'Froxlor will not work properly with open_basedir enabled. Please disable open_basedir for Froxlor in the coresponding php.ini';
$lng['requirements']['diedbecauseofrequirements'] = 'Cannot install Froxlor without these requirements! Try to fix them and retry.';

View File

@@ -35,8 +35,10 @@ $lng['requirements']['phpbcmath'] = 'PHP bcmath-Erweiterung...';
$lng['requirements']['phpcurl'] = 'PHP curl-Erweiterung...';
$lng['requirements']['phpmbstring'] = 'PHP mbstring-Erweiterung...';
$lng['requirements']['phpzip'] = 'PHP zip-Erweiterung...';
$lng['requirements']['phpjson'] = 'PHP json-Erweiterung...';
$lng['requirements']['bcmathdescription'] = 'Traffic-Berechnungs bezogene Funktionen stehen nicht vollständig zur Verfügung!';
$lng['requirements']['zipdescription'] = 'Die Auto-Update Funktion benötigt die zip Erweiterung.';
$lng['requirements']['jsondescription'] = 'Die Einstellungen Import/Export Funktion benötigt die json Erweiterung.';
$lng['requirements']['openbasedir'] = 'open_basedir genutzt wird...';
$lng['requirements']['openbasedirenabled'] = 'Froxlor wird mit aktiviertem open_basedir nicht vollständig funktionieren. Bitte deaktivieren Sie open_basedir für Froxlor in der entsprechenden php.ini';
$lng['requirements']['diedbecauseofrequirements'] = 'Kann Froxlor ohne diese Voraussetzungen nicht installieren! Beheben Sie die angezeigten Probleme und versuchen Sie es erneut.';

View File

@@ -2103,3 +2103,4 @@ $lng['phpfpm']['ini_admin_values'] = 'Enter possible <strong>php_admin_value</st
$lng['serversettings']['phpfpm_settings']['envpath'] = 'Paths to add to the PATH environment. Leave empty for no PATH environment variable';
$lng['admin']['configfiles']['importexport'] = 'Import/Export';
$lng['success']['settingsimported'] = 'Settings imported successfully';
$lng['error']['jsonextensionnotfound'] = 'This feature requires the php json-extension.';

View File

@@ -1753,3 +1753,4 @@ $lng['phpfpm']['ini_admin_flags'] = 'Mögliche <strong>php_admin_flag</strong>s
$lng['phpfpm']['ini_admin_values'] = 'Mögliche <strong>php_admin_value</strong>s für die php.ini. Pro Zeile eine Direktive';
$lng['serversettings']['phpfpm_settings']['envpath'] = 'Pfade für die PATH Umgebungsvariable. Leerlassen, um keine PATH Umgebungsvariable zu setzen.';
$lng['success']['settingsimported'] = 'Einstellungnen erfolgreich importiert';
$lng['error']['jsonextensionnotfound'] = 'Diese Funktion benötigt die PHP json-Erweiterung.';