| 3922 | | $fd = fopen($filename, "w"); |
|---|
| 3923 | | fwrite($fd, "[general]\ncountry=".$result['value']."\n\n"); |
|---|
| 3924 | | |
|---|
| 3925 | | $zonelist = general_get_zonelist(); |
|---|
| 3926 | | foreach ($zonelist as $zone) { |
|---|
| 3927 | | fwrite($fd, "[{$zone['iso']}]\n{$zone['conf']}\n\n"); |
|---|
| 3928 | | } |
|---|
| 3929 | | fclose($fd); |
|---|
| | 3924 | |
|---|
| | 3925 | if (($fd = fopen($filename, "w")) === false) { |
|---|
| | 3926 | $desc = sprintf(_("Failed to open %s for writing, aborting attempt to write the country indications. The file may be readonly or the permissions may be incorrect."), $filename); |
|---|
| | 3927 | $notify->add_error('core','INDICATIONS',_("Failed to write indications.conf"), $desc); |
|---|
| | 3928 | return; |
|---|
| | 3929 | } else { |
|---|
| | 3930 | $notify->delete('core', 'INDICATIONS'); |
|---|
| | 3931 | |
|---|
| | 3932 | fwrite($fd, "[general]\ncountry=".$result['value']."\n\n"); |
|---|
| | 3933 | |
|---|
| | 3934 | $zonelist = general_get_zonelist(); |
|---|
| | 3935 | foreach ($zonelist as $zone) { |
|---|
| | 3936 | fwrite($fd, "[{$zone['iso']}]\n{$zone['conf']}\n\n"); |
|---|
| | 3937 | } |
|---|
| | 3938 | fclose($fd); |
|---|
| | 3939 | } |
|---|