add language strings (english only currently)
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -4,3 +4,38 @@ if (! defined('FROXLOR_INSTALL_DIR')) {
|
||||
require_once FROXLOR_INSTALL_DIR . '/lib/tables.inc.php';
|
||||
require_once FROXLOR_INSTALL_DIR . '/lib/functions.php';
|
||||
}
|
||||
|
||||
// query the whole table
|
||||
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_LANGUAGE . "`");
|
||||
|
||||
$langs = array();
|
||||
// presort languages
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$langs[$row['language']][] = $row;
|
||||
// check for row[iso] cause older froxlor
|
||||
// versions didn't have that and it will
|
||||
// lead to a lot of undfined variables
|
||||
// before the admin can even update
|
||||
if (isset($row['iso'])) {
|
||||
$iso[$row['iso']] = $row['language'];
|
||||
}
|
||||
}
|
||||
|
||||
// set default language before anything else to
|
||||
// ensure that we can display messages
|
||||
$language = Settings::Get('panel.standardlanguage');
|
||||
|
||||
// include every english language file we can get
|
||||
foreach ($langs['English'] as $key => $value) {
|
||||
include_once makeSecurePath($value['file']);
|
||||
}
|
||||
|
||||
// now include the selected language if its not english
|
||||
if ($language != 'English') {
|
||||
foreach ($langs[$language] as $key => $value) {
|
||||
include_once makeSecurePath($value['file']);
|
||||
}
|
||||
}
|
||||
|
||||
// last but not least include language references file
|
||||
include_once makeSecurePath('lng/lng_references.php');
|
||||
|
||||
@@ -181,25 +181,25 @@ class IpsAndPorts extends ApiCommand
|
||||
'id' => $id
|
||||
), true, true);
|
||||
|
||||
$ip = validate_ip2($this->getParam('ip'), false, 'invalidip', false, false, false, true);
|
||||
$port = validate($this->getParam('port'), 'port', '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di', array(
|
||||
$ip = validate_ip2($this->getParam('ip', $result['ip']), false, 'invalidip', false, false, false, true);
|
||||
$port = validate($this->getParam('port', $result['port']), 'port', '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di', array(
|
||||
'stringisempty',
|
||||
'myport'
|
||||
), array(), true);
|
||||
$listen_statement = ! empty($this->getParam('listen_statement')) ? 1 : 0;
|
||||
$namevirtualhost_statement = ! empty($this->getParam('namevirtualhost_statement')) ? 1 : 0;
|
||||
$vhostcontainer = ! empty($this->getParam('vhostcontainer')) ? 1 : 0;
|
||||
$specialsettings = validate(str_replace("\r\n", "\n", $this->getParam('specialsettings')), 'specialsettings', '/^[^\0]*$/', '', array(), true);
|
||||
$vhostcontainer_servername_statement = ! empty($this->getParam('vhostcontainer_servername_statement')) ? 1 : 0;
|
||||
$default_vhostconf_domain = validate(str_replace("\r\n", "\n", $this->getParam('default_vhostconf_domain')), 'default_vhostconf_domain', '/^[^\0]*$/', '', array(), true);
|
||||
$docroot = validate($this->getParam('docroot'), 'docroot', '', '', array(), true);
|
||||
$listen_statement = $this->getParam('listen_statement', $result['listen_statement']);
|
||||
$namevirtualhost_statement = $this->getParam('namevirtualhost_statement', $result['namevirtualhost_statement']);
|
||||
$vhostcontainer = $this->getParam('vhostcontainer', $result['vhostcontainer']);
|
||||
$specialsettings = validate(str_replace("\r\n", "\n", $this->getParam('specialsettings', $result['specialsettings'])), 'specialsettings', '/^[^\0]*$/', '', array(), true);
|
||||
$vhostcontainer_servername_statement = $this->getParam('vhostcontainer_servername_statement', $result['vhostcontainer_servername_statement']);
|
||||
$default_vhostconf_domain = validate(str_replace("\r\n", "\n", $this->getParam('default_vhostconf_domain', $result['default_vhostconf_domain'])), 'default_vhostconf_domain', '/^[^\0]*$/', '', array(), true);
|
||||
$docroot = validate($this->getParam('docroot', $result['docroot']), 'docroot', '', '', array(), true);
|
||||
|
||||
if ((int) Settings::Get('system.use_ssl') == 1) {
|
||||
$ssl = ! empty($this->getParam('ssl')) ? intval($this->getParam('ssl')) : 0;
|
||||
$ssl_cert_file = validate($this->getParam('ssl_cert_file'), 'ssl_cert_file', '', '', array(), true);
|
||||
$ssl_key_file = validate($this->getParam('ssl_key_file'), 'ssl_key_file', '', '', array(), true);
|
||||
$ssl_ca_file = validate($this->getParam('ssl_ca_file'), 'ssl_ca_file', '', '', array(), true);
|
||||
$ssl_cert_chainfile = validate($this->getParam('ssl_cert_chainfile'), 'ssl_cert_chainfile', '', '', array(), true);
|
||||
$ssl = $this->getParam('ssl', $result['ssl']);
|
||||
$ssl_cert_file = validate($this->getParam('ssl_cert_file', $result['ssl_cert_file']), 'ssl_cert_file', '', '', array(), true);
|
||||
$ssl_key_file = validate($this->getParam('ssl_key_file', $result['ssl_key_file']), 'ssl_key_file', '', '', array(), true);
|
||||
$ssl_ca_file = validate($this->getParam('ssl_ca_file', $result['ssl_ca_file']), 'ssl_ca_file', '', '', array(), true);
|
||||
$ssl_cert_chainfile = validate($this->getParam('ssl_cert_chainfile', $result['ssl_cert_chainfile']), 'ssl_cert_chainfile', '', '', array(), true);
|
||||
} else {
|
||||
$ssl = 0;
|
||||
$ssl_cert_file = '';
|
||||
@@ -224,7 +224,7 @@ class IpsAndPorts extends ApiCommand
|
||||
$result_sameipotherport = Database::pexecute_first($result_sameipotherport_stmt, array(
|
||||
'ip' => $ip,
|
||||
'id' => $id
|
||||
));
|
||||
), true, true);
|
||||
|
||||
if ($listen_statement != '1') {
|
||||
$listen_statement = '0';
|
||||
|
||||
@@ -61,7 +61,7 @@ function standard_error($errors = '', $replacer = '', $throw_exception = false)
|
||||
}
|
||||
|
||||
if ($throw_exception) {
|
||||
throw new Exception($error);
|
||||
throw new Exception($error, 400);
|
||||
}
|
||||
eval("echo \"" . getTemplate('misc/error', '1') . "\";");
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user