cant stop migrating to new Settings class, refs #1325

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-12-15 15:21:30 +01:00
parent 7f565c305c
commit 352749c798
11 changed files with 43 additions and 92 deletions

View File

@@ -17,21 +17,24 @@
*
*/
function storeSettingIpAddress($fieldname, $fielddata, $newfieldvalue)
{
function storeSettingIpAddress($fieldname, $fielddata, $newfieldvalue) {
$returnvalue = storeSettingField($fieldname, $fielddata, $newfieldvalue);
if($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'system' && isset($fielddata['varname']) && $fielddata['varname'] == 'ipaddress')
{
$mysql_access_host_array = array_map('trim', explode(',', getSetting('system', 'mysql_access_host')));
if ($returnvalue !== false
&& is_array($fielddata)
&& isset($fielddata['settinggroup'])
&& $fielddata['settinggroup'] == 'system'
&& isset($fielddata['varname'])
&& $fielddata['varname'] == 'ipaddress'
) {
$mysql_access_host_array = array_map('trim', explode(',', Settings::Get('system.mysql_access_host')));
$mysql_access_host_array[] = $newfieldvalue;
$mysql_access_host_array = array_unique(array_trim($mysql_access_host_array));
$mysql_access_host = implode(',', $mysql_access_host_array);
correctMysqlUsers($mysql_access_host_array);
saveSetting('system', 'mysql_access_host', $mysql_access_host);
Settings::Set('system.mysql_access_host', $mysql_access_host);
}
return $returnvalue;
}
?>