cant stop migrating to new Settings class, refs #1325
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user