/* hash */ unset($error_bucket); /* simple error list */ unset($input_errors); unset($do_action); $reqdfields = explode(" ", "action object"); $reqdfieldsn = explode(",", "Action,Object"); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); if (is_array($error_bucket)) { foreach ($error_bucket as $elem) { $input_errors[] =& $elem["error"]; } } /* if this is an AJAX caller then handle via JSON */ if (isAjax() && is_array($error_bucket)) { input_errors2Ajax(NULL, $error_bucket); exit; } if (!$input_errors) { $do_action = true; $action = $_POST['action']; $object = $_POST['object']; } } if (!isset($do_action)) { $do_action = false; $action = ''; $object = ''; } include "head.inc"; /* put your custom HTML head content here */
} if (!$input_errors) { $_POST['remoteip'] = $pconfig['remoteip'] = gen_subnet($_POST['remoteip'], $_POST['l2tp_subnet']); $subnet_start = ip2ulong($_POST['remoteip']); $subnet_end = ip2ulong($_POST['remoteip']) + $_POST['n_l2tp_units'] - 1; if (ip2ulong($_POST['localip']) >= $subnet_start && ip2ulong($_POST['localip']) <= $subnet_end) { $input_errors[] = gettext("The specified server address lies in the remote subnet."); } if ($_POST['localip'] == get_interface_ip("lan")) { $input_errors[] = gettext("The specified server address is equal to the LAN interface address."); } } } /* if this is an AJAX caller then handle via JSON */ if (isAjax() && is_array($input_errors)) { input_errors2Ajax($input_errors); exit; } if (!$input_errors) { $l2tpcfg['remoteip'] = $_POST['remoteip']; $l2tpcfg['localip'] = $_POST['localip']; $l2tpcfg['l2tp_subnet'] = $_POST['l2tp_subnet']; $l2tpcfg['mode'] = $_POST['mode']; $l2tpcfg['interface'] = $_POST['interface']; $l2tpcfg['n_l2tp_units'] = $_POST['n_l2tp_units']; $l2tpcfg['radius']['server'] = $_POST['radiusserver']; if ($_POST['radiussecret'] != DMYPWD) { $l2tpcfg['radius']['secret'] = $_POST['radiussecret']; } if ($_POST['secret'] != DMYPWD) { $l2tpcfg['secret'] = $_POST['secret'];