diff --git a/docs/configuration.md b/docs/configuration.md index 28f2be8..5a670f7 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1800,6 +1800,22 @@ return [ ]; ``` +### Web WHOIS/RDAP Client Configuration (`/var/www/whois/config.php`) + +```php + 'whois.example.com', + 'rdap_url' => 'rdap.example.com', + 'ignore_captcha' => true, + 'registry_name' => 'Domain Registry LLC', + 'registry_url' => 'https://example.com', + 'branding' => false, + 'ignore_case_captcha' => false, +]; +``` + In conclusion, this detailed configuration guide aims to streamline the setup process of the Namingo system for users of all expertise levels. The guide meticulously details each configuration file, providing clear explanations and guidance for customization to suit your specific needs. This approach ensures that you can configure Namingo with confidence, optimizing it for your registry management requirements. We are committed to making the configuration process as straightforward as possible, and we welcome any questions or requests for further assistance. Your successful deployment and efficient management of Namingo is our top priority. After finalizing the configuration of Namingo, the next step is to consult the [Initial Operation Guide](iog.md). This guide provides comprehensive details on configuring your registry, adding registrars, and much more, to ensure a smooth start with your system. \ No newline at end of file diff --git a/whois/web/check.php b/whois/web/check.php index da16dde..ff65473 100644 --- a/whois/web/check.php +++ b/whois/web/check.php @@ -7,9 +7,20 @@ if ($_SERVER['REQUEST_METHOD'] !== 'POST') { exit; } -if ($c['ignore_captcha'] === false && $_POST['captcha'] !== $_SESSION['captcha']) { - echo json_encode(['error' => 'Captcha verification failed.']); - exit; +if ($c['ignore_captcha'] === false) { + $captchaInput = $_POST['captcha']; + $captchaStored = $_SESSION['captcha']; + + if (!empty($c['ignore_case_captcha'])) { + $isValid = strcasecmp($captchaInput, $captchaStored) === 0; + } else { + $isValid = $captchaInput === $captchaStored; + } + + if (!$isValid) { + echo json_encode(['error' => 'Captcha verification failed.']); + exit; + } } $domain = $_POST['domain']; diff --git a/whois/web/config.php.dist b/whois/web/config.php.dist index 8289b66..3598d80 100644 --- a/whois/web/config.php.dist +++ b/whois/web/config.php.dist @@ -7,4 +7,5 @@ return [ 'registry_name' => 'Domain Registry LLC', 'registry_url' => 'https://example.com', 'branding' => false, + 'ignore_case_captcha' => false, ]; \ No newline at end of file diff --git a/whois/web/index.php b/whois/web/index.php index 22c4e1b..1427979 100644 --- a/whois/web/index.php +++ b/whois/web/index.php @@ -237,12 +237,15 @@ $c['branding'] = isset($c['branding']) ? $c['branding'] : false; } document.getElementById('domainInput').addEventListener('keypress', function(event) { - // Check if the key pressed is 'Enter' if (event.key === 'Enter') { - // Prevent the default action to avoid form submission or any other default behavior event.preventDefault(); + document.getElementById('whoisButton').click(); + } + }); - // Trigger the click event of the whoisButton + document.getElementById('captchaInput').addEventListener('keypress', function(event) { + if (event.key === 'Enter') { + event.preventDefault(); document.getElementById('whoisButton').click(); } });