#!/usr/local/bin/perl
# save_sync.cgi
# Save unix-samba synchronisation options

require './samba-lib.pl';
&ReadParse();
# check acls
%access = &get_module_acl();
&error_setup("<blink><font color=red>$text{'eacl_aviol'}</font></blink>");
&error("$text{'eacl_np'} $text{'eacl_pmsync'}")
        unless $access{'maint_sync'};
# save
&lock_file("$module_config_directory/config");
foreach $s ("add", "change", "delete") {
	if ($in{$s}) { $config{"sync_$s"} = 1; }
	else { delete($config{"sync_$s"}); }
	}
&write_file("$module_config_directory/config", \%config);
&unlock_file("$module_config_directory/config");
&webmin_log("sync");
&redirect("");

