Project

General

Profile

Bug #11180 ยป 18.diff

Viktor Gurov, 12/31/2020 02:10 AM

View differences:

sysutils/pfSense-pkg-filer/Makefile
2 2

  
3 3
PORTNAME=	pfSense-pkg-Filer
4 4
PORTVERSION=	0.60.6
5
PORTREVISION=	2
5
PORTREVISION=	3
6 6
CATEGORIES=	sysutils
7 7
MASTER_SITES=	# empty
8 8
DISTFILES=	# empty
sysutils/pfSense-pkg-filer/files/usr/local/pkg/filer.inc
31 31
	return preg_replace('/\r\n/', "\n", base64_decode($text));
32 32
}
33 33

  
34
function sync_package_filer() {
34
function sync_package_filer($post = array()) {
35 35
	global $config, $g;
36 36
	$update_conf = 0;
37 37

  
38

  
39 38
	/* Loop on configured files. */
40 39
	if ($config['installedpackages']['filer']['config'] != "") {
41 40
		$count = 0;
......
46 45
				$update_conf++;
47 46
			}
48 47
			$count++;
48
			if (!empty($post) && ($post['id'] != ($count - 1))) {
49
				continue;
50
			}
49 51
			if (preg_match("/0?[0-7]{3}/", $file['mod'])) {
50 52
				$mod = octdec($file['mod']);
51 53
			} else {
......
57 59
			chmod($file['fullfile'], $mod);
58 60

  
59 61
			/* Check if there is a script to run after file save. */
60
			if ($file['cmd'] != "") {
62
			if (!empty($file['cmd'])) {
61 63
				switch ($file['background']) {
62 64
					case "background":
63 65
						mwexec_bg($file['cmd']);
......
65 67
					case "foreground":
66 68
						mwexec($file['cmd']);
67 69
						break;
70
					default:
71
						break;
68 72
				}
69 73
			}
70 74
		}
......
74 78
			write_config("Filer: Settings saved");
75 79
		}
76 80
	}
77

  
78 81
	
79 82
	filer_sync_on_changes();
80 83
}
sysutils/pfSense-pkg-filer/files/usr/local/pkg/filer.xml
135 135
		sync_package_filer();
136 136
	</custom_delete_php_command> 
137 137
	<custom_php_resync_config_command>
138
		sync_package_filer();
138
		sync_package_filer($_POST);
139 139
	</custom_php_resync_config_command>
140 140
</packagegui>
    (1-1/1)