Project

General

Profile

« Previous | Next » 

Revision 9f200d71

Added by Jim Pingle over 14 years ago

Change OpenVPN wizard to set input_errors when there is a fatal condition that will require preventing a config save.

View differences:

usr/local/www/wizards/openvpn_wizard.inc
185 185
}
186 186

  
187 187
function step7_submitphpaction() {
188
	global $stepid, $savemsg, $_POST, $config;
188
	global $input_errors, $stepid, $savemsg, $_POST, $config;
189 189

  
190 190
	$canames = array();
191 191
	$cacns = array();
......
205 205
	} elseif (has_special_chars($_POST['country']) || has_special_chars($_POST['state']) || 
206 206
	    has_special_chars($_POST['city']) || has_special_chars($_POST['organization'])) {
207 207
		$stepid--;
208
		$savemsg = "Please do not use special characters in Certificate Authority field names.";
208
		$input_errors[] = "Please do not use special characters in Certificate field names.";
209 209
	} elseif (in_array($_POST['descr'], $canames) || in_array($_POST['descr'], $cacns)) {
210 210
		$stepid--;
211 211
		$savemsg = "Please enter a different name for the Certicicate Authority. A Certificate Authority with that name already exists.";
......
275 275
}
276 276

  
277 277
function step9_submitphpaction() {
278
	global $stepid, $savemsg, $_POST, $config;
278
	global $input_errors, $stepid, $savemsg, $_POST, $config;
279 279

  
280 280
	$certnames = array();
281 281
	$certcns = array();
......
295 295
	} elseif (has_special_chars($_POST['country']) || has_special_chars($_POST['state']) || 
296 296
	    has_special_chars($_POST['city']) || has_special_chars($_POST['organization'])) {
297 297
		$stepid--;
298
		$savemsg = "Please do not use special characters in Certificate field names.";
298
		$input_errors[] = "Please do not use special characters in Certificate field names.";
299 299
	} elseif (in_array($_POST['descr'], $certnames) || in_array($_POST['descr'], $certcns)) {
300 300
		$stepid--;
301 301
		$savemsg = "Please enter a different name for the Certicicate. A Certificate with that name/common name already exists.";	

Also available in: Unified diff