if (!empty($_POST['crypto_hardware']) && !array_key_exists($_POST['crypto_hardware'], $crypto_modules)) { $input_errors[] = gettext("Please select a valid Cryptographic Accelerator."); } if (!empty($_POST['thermal_hardware']) && !array_key_exists($_POST['thermal_hardware'], $thermal_hardware_modules)) { $input_errors[] = gettext("Please select a valid Thermal Hardware Sensor."); } if (!empty($_POST['use_mfs_tmp_size']) && (!is_numeric($_POST['use_mfs_tmp_size']) || $_POST['use_mfs_tmp_size'] < 40)) { $input_errors[] = gettext("/tmp Size must be numeric and should not be less than 40MiB."); } if (!empty($_POST['use_mfs_var_size']) && (!is_numeric($_POST['use_mfs_var_size']) || $_POST['use_mfs_var_size'] < 60)) { $input_errors[] = gettext("/var Size must be numeric and should not be less than 60MiB."); } if (!empty($_POST['proxyport']) && !is_port($_POST['proxyport'])) { $input_errors[] = gettext("Proxy port must be a valid port number, 1-65535."); } if (!empty($_POST['proxyurl']) && !is_fqdn($_POST['proxyurl']) && !is_ipaddr($_POST['proxyurl'])) { $input_errors[] = gettext("Proxy URL must be a valid IP address or FQDN."); } if (!empty($_POST['proxyuser']) && preg_match("/[^a-zA-Z0-9\\.\\-_@]/", $_POST['proxyuser'])) { $input_errors[] = gettext("The proxy username contains invalid characters."); } if ($_POST['proxypass'] != $_POST['proxypass_confirm']) { $input_errors[] = gettext("Proxy password and confirmation must match."); } if (!$input_errors) { if ($_POST['harddiskstandby'] != "") { $config['system']['harddiskstandby'] = $_POST['harddiskstandby']; system_set_harddisk_standby(); } else { unset($config['system']['harddiskstandby']); }
$er .= 'Password and password verification do not match.<br>'; } //if ( ! is_alnum($passwd) or ! is_alnum($passwdv) ) // $er .= 'Password contains invalid characters.<br>'; if ($email && !is_email($email)) { $er .= 'E-mail address (' . htvar($email) . ') may be invalid.<br>'; } $ip_ar = explode("\n", $ip_addr); foreach ($ip_ar as $value) { if ($value && !is_ip($value)) { $er .= 'IP address (' . htvar($value) . ') may be invalid.<br>'; } } $dns_n = explode("\n", $dns_names); foreach ($dns_n as $value) { if ($value && !is_fqdn(trim($value))) { $er .= 'DNS Name (' . htvar($value) . ') may be invalid.<br>'; } } if ($er) { $er = '<h2>ERROR(S) IN FORM:</h2><h4><blockquote>' . $er . '</blockquote></h4>'; } if ($email && ($serial = CAdb_in($email, $common_name))) { $er = ''; $certtext = CA_cert_text($serial); $er .= '<h2>A valid certificate already exists for ' . htvar("{$common_name} <{$email}>") . '</h2>'; $er .= '</font><blockquote><pre> ' . htvar($certtext) . ' </pre></blockquote>'; } if ($er) { printHeader(); ?>