Project

General

Profile

« Previous | Next » 

Revision 7eaf04fd

Added by Erik Fonnesbeck almost 15 years ago

On vpn_pptp.php only unset variables that are set.

View differences:

usr/local/www/vpn_pptp.php
72 72

  
73 73
if ($_POST) {
74 74

  
75
	unset($input_errors);
75
	if (isset($input_errors))
76
		unset($input_errors);
76 77
	$pconfig = $_POST;
77 78

  
78 79
	/* input validation */
......
120 121
		if (($_POST['redir'] && !is_ipaddr($_POST['redir']))) {
121 122
			$input_errors[] = gettext("A valid target address must be specified.");
122 123
		}
123
	} else {
124
	} else if (isset($config['pptpd']['mode'])) {
124 125
		unset($config['pptpd']['mode']);
125 126
	}
126 127

  
......
142 143
		$pptpcfg['radius']['nasip'] = $_POST['radius_nasip'];
143 144
		$pptpcfg['radius']['acct_update'] = $_POST['radius_acct_update'];
144 145

  
145
 		if ($_POST['pptp_dns1'] == "") 
146
        		unset($pptpcfg['dns1']);
147
		else
146
 		if ($_POST['pptp_dns1'] == "") {
147
			if (isset($pptpcfg['dns1']))
148
        			unset($pptpcfg['dns1']);
149
		} else
148 150
			$pptpcfg['dns1'] = $_POST['pptp_dns1'];
149 151

  
150
 		if ($_POST['pptp_dns2'] == "") 
151
        		unset($pptpcfg['dns2']);
152
		else
152
 		if ($_POST['pptp_dns2'] == "") {
153
			if (isset($pptpcfg['dns2']))
154
        			unset($pptpcfg['dns2']);
155
		} else
153 156
			$pptpcfg['dns2'] = $_POST['pptp_dns2'];
154 157

  
155 158
		if($_POST['req128'] == "yes") 
156 159
			$pptpcfg['req128'] = true;
157
		else
160
		else if (isset($pptpcfg['req128']))
158 161
			unset($pptpcfg['req128']);
159 162

  
160 163
		if($_POST['radiusenable'] == "yes") 
161 164
			$pptpcfg['radius']['server']['enable'] = true;
162
		else 
165
		else if (isset($pptpcfg['radius']['server']['enable']))
163 166
			unset($pptpcfg['radius']['server']['enable']);
164 167
			
165 168
		if($_POST['radiussecenable'] == "yes") 
166 169
			$pptpcfg['radius']['server']['enable'] = true;
167
		else 
170
		else if (isset($pptpcfg['radius']['server2']['enable']))
168 171
			unset($pptpcfg['radius']['server2']['enable']);
169 172
			
170 173
		if($_POST['radacct_enable'] == "yes") 
171 174
			$pptpcfg['radius']['accounting'] = true;
172
		else 
175
		else if (isset($pptpcfg['radius']['accounting']))
173 176
			unset($pptpcfg['radius']['accounting']);
174 177
		
175 178
		if($_POST['radiusissueips'] == "yes") {
176 179
			$pptpcfg['radius']['radiusissueips'] = true;
177
		} else
180
		} else if (isset($pptpcfg['radius']['radiusissueips']))
178 181
			unset($pptpcfg['radius']['radiusissueips']);
179 182
		
180 183
		write_config();

Also available in: Unified diff