diff --git a/actions/admin/settings/120.system.php b/actions/admin/settings/120.system.php index b199b36b..ddd30f89 100644 --- a/actions/admin/settings/120.system.php +++ b/actions/admin/settings/120.system.php @@ -59,6 +59,7 @@ return array( 'type' => 'string', 'default' => '', 'save_method' => 'storeSettingHostname', + 'plausibility_check_method' => 'checkHostname', ), 'system_froxlordirectlyviahostname' => array( 'label' => $lng['serversettings']['froxlordirectlyviahostname'], @@ -164,4 +165,4 @@ return array( ), ); -?> \ No newline at end of file +?> diff --git a/lib/functions/validate/function.checkHostname.php b/lib/functions/validate/function.checkHostname.php new file mode 100644 index 00000000..e3f0748c --- /dev/null +++ b/lib/functions/validate/function.checkHostname.php @@ -0,0 +1,27 @@ + (2010-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Functions + * + */ + +function checkHostname($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues) +{ + echo $fieldname . "--" . $fielddata . "--" . $newfieldvalue . "--". $allnewfieldvalues; + if (0 == strlen(trim($fielddata))) + { + return array(FORMFIELDS_PLAUSIBILITY_CHECK_ERROR, 'invalidhostname'); + } else { + return array(FORMFIELDS_PLAUSIBILITY_CHECK_OK); + } +} diff --git a/lng/english.lng.php b/lng/english.lng.php index 8444a910..d3310dba 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -1898,3 +1898,5 @@ $lng['admin']['assignedmax'] = 'Assigned / Max'; $lng['admin']['usedmax'] = 'Used / Max'; $lng['admin']['used'] = 'Used'; $lng['mysql']['size'] = 'Database size (MB)'; + +$lng['error']['invalidhostname'] = 'Hostname can\'t be empty nor can it consist only of whitespaces'; \ No newline at end of file diff --git a/lng/german.lng.php b/lng/german.lng.php index 4cd7cc64..c85a8a3e 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1626,6 +1626,8 @@ $lng['logrotate_binary'] = 'Pfad zum logrotate binary?'; $lng['logrotate_interval'] = 'Intervall?'; $lng['logrotate_keep'] = 'Wie viele Logdateien sollen aufbewahrt werden?'; $lng['admin']['assignedmax'] = 'Zugewiesen / Max.'; -$lng['admin']['usedmax'] = 'Benutzt / Max.'; +$lng['admin']['usedmax'] = 'Benutzt / Max.'; $lng['admin']['used'] = 'Benutzt'; $lng['mysql']['size'] = 'Datenbankgröße (MB)'; + +$lng['error']['invalidhostname'] = 'Hostname darf nicht leer sein oder nur aus Leerzeichen bestehen'; \ No newline at end of file