$cpent) { if ($cpent['zone'] == $_POST['zone']) { $input_errors[] = sprintf(gettext("Zone [%s] already exists."), $_POST['zone']); break; } } if (!$input_errors) { $cpzone = strtolower($_POST['zone']); $a_cp[$cpzone] = array(); $a_cp[$cpzone]['zone'] = str_replace(" ", "", $_POST['zone']); $a_cp[$cpzone]['descr'] = $_POST['descr']; $a_cp[$cpzone]['localauth_priv'] = true; write_config(); header("Location: services_captiveportal.php?zone={$cpzone}"); exit; } } include("head.inc"); if ($input_errors) { print_input_errors($input_errors); } $form = new Form(false); $section = new Form_Section('Add Captive Portal Zone'); $section->addInput(new Form_Input( 'zone', 'Zone name' ))->setPattern('^[A-Za-z_][0-9A-Za-z_]+')->setHelp('Zone name. Can only contain letters, digits, and underscores (_) and may not start with a digit.'); $section->addInput(new Form_Input( 'descr', 'Zone description' ))->setHelp('A description may be entered here for administrative reference (not parsed).'); $form->add($section); $form->addGlobal(new Form_Button( 'Submit', 'Save & Continue', null, 'fa-save' ))->addClass('btn-primary'); print($form); include("foot.inc");