Project

General

Profile

« Previous | Next » 

Revision 68071477

Added by Ermal LUÇI almost 15 years ago

Just take action when there is a file otherwise just call filter_reload.

View differences:

usr/local/www/firewall_virtual_ip.php
62 62
	$pconfig = $_POST;
63 63

  
64 64
	if ($_POST['apply']) {
65
		$toapplylist = array();
66
		if (file_exists("{$g['tmp_path']}/.firewall_virtual_ip.apply"))
65
		if (file_exists("{$g['tmp_path']}/.firewall_virtual_ip.apply")) {
67 66
                        $toapplylist = unserialize(file_get_contents("{$g['tmp_path']}/.firewall_virtual_ip.apply"));
68
		foreach ($toapplylist as $vid => $ovip) {
69
			if (!empty($ovip))
70
				interface_vip_bring_down($ovip);
71
			if ($a_vip[$vid]) {
72
                		switch ($a_vip[$vid]['mode']) {
73
                		case "ipalias":
74
                        		interface_ipalias_configure($a_vip[$vid]);
75
                        		break;
76
                		case "proxyarp":
77
                        		interface_proxyarp_configure($a_vip[$vid]['interface']);
78
                        		break;
79
                		case "carp":
80
                        		interface_carp_configure($a_vip[$vid]);
81
					break;
82
                		case "carpdev-dhcp":
83
                        		interface_carpdev_configure($a_vip[$vid]);
84
                        		break;
85
                		default:
86
                        		break;
87
				}
88
                	}
89
        	}
90
		@unlink("{$g['tmp_path']}/.firewall_virtual_ip.apply");
67
			foreach ($toapplylist as $vid => $ovip) {
68
				if (!empty($ovip))
69
					interface_vip_bring_down($ovip);
70
				if ($a_vip[$vid]) {
71
                			switch ($a_vip[$vid]['mode']) {
72
                			case "ipalias":
73
                        			interface_ipalias_configure($a_vip[$vid]);
74
                        			break;
75
                			case "proxyarp":
76
                        			interface_proxyarp_configure($a_vip[$vid]['interface']);
77
                        			break;
78
                			case "carp":
79
                        			interface_carp_configure($a_vip[$vid]);
80
						break;
81
                			case "carpdev-dhcp":
82
                        			interface_carpdev_configure($a_vip[$vid]);
83
                        			break;
84
                			default:
85
                        			break;
86
					}
87
                		}
88
        		}
89
			@unlink("{$g['tmp_path']}/.firewall_virtual_ip.apply");
90
		}
91 91
		$retval = 0;
92 92
		$retval |= filter_configure();
93 93
		$savemsg = get_std_save_message($retval);

Also available in: Unified diff