Example #1
0
     }
 }
 if (isset($_POST['ftp_enable'])) {
     $reqdfields = array_merge($reqdfields, explode(" ", "ftp_address ftp_port"));
     $reqdfieldsn = array_merge($reqdfieldsn, array(gettext("Address"), gettext("Port")));
     $reqdfieldst = array_merge($reqdfieldst, array("string", "numeric"));
     if (isset($_POST['ftp_auth'])) {
         $reqdfields = array_merge($reqdfields, explode(" ", "ftp_username ftp_password"));
         $reqdfieldsn = array_merge($reqdfieldsn, array(gettext("User"), gettext("Password")));
         $reqdfieldst = array_merge($reqdfieldst, array("string", "password"));
     }
 }
 do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
 do_input_validation_type($_POST, $reqdfields, $reqdfieldsn, $reqdfieldst, $input_errors);
 if (isset($_POST['http_auth'])) {
     if ($_POST['http_password'] && !is_validpassword($_POST['http_password'])) {
         $input_errors[] = gettext("The password contains the illegal character ':'.");
     }
 }
 if (empty($input_errors)) {
     $config['system']['proxy']['http']['enable'] = isset($pconfig['http_enable']) ? true : false;
     $config['system']['proxy']['http']['address'] = $pconfig['http_address'];
     $config['system']['proxy']['http']['port'] = $pconfig['http_port'];
     $config['system']['proxy']['http']['auth'] = isset($pconfig['http_auth']) ? true : false;
     $config['system']['proxy']['http']['username'] = $pconfig['http_username'];
     $config['system']['proxy']['http']['password'] = $pconfig['http_password'];
     $config['system']['proxy']['ftp']['enable'] = isset($pconfig['ftp_enable']) ? true : false;
     $config['system']['proxy']['ftp']['address'] = $pconfig['ftp_address'];
     $config['system']['proxy']['ftp']['port'] = $pconfig['ftp_port'];
     $config['system']['proxy']['ftp']['auth'] = isset($pconfig['ftp_auth']) ? true : false;
     $config['system']['proxy']['ftp']['username'] = $pconfig['ftp_username'];
     }
 }
 if ($_POST['ftp_enable']) {
     $reqdfields = array_merge($reqdfields, explode(" ", "ftp_address ftp_port"));
     $reqdfieldsn = array_merge($reqdfieldsn, array(gettext("Address"), gettext("Port")));
     $reqdfieldst = array_merge($reqdfieldst, array("string", "numeric"));
     if ($_POST['ftp_auth']) {
         $reqdfields = array_merge($reqdfields, explode(" ", "ftp_username ftp_password"));
         $reqdfieldsn = array_merge($reqdfieldsn, array(gettext("User"), gettext("Password")));
         $reqdfieldst = array_merge($reqdfieldst, array("string", "password"));
     }
 }
 do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
 do_input_validation_type($_POST, $reqdfields, $reqdfieldsn, $reqdfieldst, &$input_errors);
 if ($_POST['http_auth']) {
     if ($_POST['password'] && !is_validpassword($_POST['password'])) {
         $input_errors[] = gettext("The password contains the illegal character ':'.");
     }
 }
 if (!$input_errors) {
     $config['system']['proxy']['http']['enable'] = $pconfig['http_enable'] ? true : false;
     $config['system']['proxy']['http']['address'] = $pconfig['http_address'];
     $config['system']['proxy']['http']['port'] = $pconfig['http_port'];
     $config['system']['proxy']['http']['auth'] = $pconfig['http_auth'] ? true : false;
     $config['system']['proxy']['http']['username'] = $pconfig['http_username'];
     $config['system']['proxy']['http']['password'] = $pconfig['http_password'];
     $config['system']['proxy']['ftp']['enable'] = $pconfig['ftp_enable'] ? true : false;
     $config['system']['proxy']['ftp']['address'] = $pconfig['ftp_address'];
     $config['system']['proxy']['ftp']['port'] = $pconfig['ftp_port'];
     $config['system']['proxy']['ftp']['auth'] = $pconfig['ftp_auth'] ? true : false;
     $config['system']['proxy']['ftp']['username'] = $pconfig['ftp_username'];