aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/spamd.xml4
-rw-r--r--packages/spamd_whitelist.xml23
2 files changed, 24 insertions, 3 deletions
diff --git a/packages/spamd.xml b/packages/spamd.xml
index f4a3a355..173c322c 100644
--- a/packages/spamd.xml
+++ b/packages/spamd.xml
@@ -122,8 +122,8 @@
}
fclose($fd);
$fd = fopen("/var/mail/whitelist.txt","w");
- if($config['installedpackages']['spamd-whitelist']['config'] != "")
- foreach($config['installedpackages']['spamd-whitelist']['config'] as $spamd) {
+ if($config['installedpackages']['spamdwhitelist']['config'] != "")
+ foreach($config['installedpackages']['spamdwhitelist']['config'] as $spamd) {
fwrite($fd, $spamd['ip'] . "\n");
}
fclose($fd);
diff --git a/packages/spamd_whitelist.xml b/packages/spamd_whitelist.xml
index 770b6f58..7fd25352 100644
--- a/packages/spamd_whitelist.xml
+++ b/packages/spamd_whitelist.xml
@@ -23,7 +23,7 @@
</tabs>
<!-- configpath gets expanded out automatically and config items will be
stored in that location -->
- <configpath>['installedpackages']['spamd-whitelist']['config']</configpath>
+ <configpath>['installedpackages']['spamdwhitelist']['config']</configpath>
<adddeleteeditpagefields>
<columnitem>
<fielddescr>Exempted IP</fielddescr>
@@ -50,4 +50,25 @@
<type>input</type>
</field>
</fields>
+ <custom_php_command_before_form>
+ function sync_package() {
+ global $config;
+ conf_mount_rw();
+ config_lock();
+ $fd = fopen("/var/mail/whitelist.txt","w");
+ if($config['installedpackages']['spamdwhitelist']['config'] != "")
+ foreach($config['installedpackages']['spamdwhitelist']['config'] as $spamd) {
+ fwrite($fd, $spamd['ip'] . "\n");
+ }
+ fclose($fd);
+ conf_mount_ro();
+ config_unlock();
+ }
+ </custom_php_command_before_form>
+ <custom_php_resync_config_command>
+ sync_package();
+ </custom_php_resync_config_command>
+ <custom_delete_php_command>
+ sync_package();
+ </custom_delete_php_command>
</packagegui>