diff --git a/common/pages.php b/common/pages.php index 50cbfb4..1e0b667 100644 --- a/common/pages.php +++ b/common/pages.php @@ -1,115 +1,49 @@ 'niver', + 'auth' => [ + 'index' => 'Authentification', + 'login' => 'Se connecter', + 'register' => 'Créer un compte', + 'password' => 'Changer la clé de passe', + 'logout' => 'Déconnexion', + ], + 'reg' => [ + 'index' => 'Registre', + 'register' => 'Enregistrer un nouveau domaine', + 'unregister' => 'Effacer un domaine', + 'ns' => 'Ajouter un enregistrement NS', + 'ds' => 'Ajouter un enregistrement DS', + 'glue' => 'Créer un Glue Record', + ], + 'ns' => [ + 'index' => 'Serveurs de noms', + 'zone-add' => 'Ajouter une zone', + 'zone-del' => 'Effacer une zone', + 'dnssec' => 'Afficher les enregistrements DS', + 'ip' => 'Enregistrements A et AAAA', + 'ns' => 'Enregistrement NS', + 'txt' => 'Enregistrement TXT', + 'caa' => 'Enregistrement CAA', + 'srv' => 'Enregistrement SRV', + 'mx' => 'Enregistrement MX', + 'sshfp' => 'Enregistrement SSHFP', + 'tlsa' => 'Enregistrement TLSA', + ], + 'ht' => [ + 'index' => 'Hypertexte', + 'add-http-onion' => 'Ajouter un accès HTTP par Onion', + 'add-http-dns' => 'Ajouter un accès HTTP par DNS+TLS', + 'del-http-onion' => 'Retirer un accès HTTP par Onion', + 'del-http-dns' => 'Retirer un accès HTTP par DNS+TLS', + 'le' => 'Installer un certificat Let\'s Encrypt', + ], + ] +); - case "ns": - $page['service'] = "Serveurs de noms"; - switch (PAGE) { - case "index": - $page['title'] = $page['service']; - break; - case "dnssec": - $page['title'] = "Obtenir les enregistrements DS"; - break; - case "ip": - $page['title'] = "Enregistrements A et AAAA"; - break; - case "ns": - $page['title'] = "Enregistrement NS"; - break; - case "txt": - $page['title'] = "Enregistrement TXT"; - break; - case "caa": - $page['title'] = "Enregistrement CAA"; - break; - case "srv": - $page['title'] = "Enregistrement SRV"; - break; - case "mx": - $page['title'] = "Enregistrement MX"; - break; - case "sshfp": - $page['title'] = "Enregistrement SSHFP"; - break; - case "tlsa": - $page['title'] = "Enregistrement TLSA"; - break; - case "zone": - $page['title'] = "Gérer ses zones"; - break; - } - break; - - case "reg": - $page['service'] = "Registre"; - switch (PAGE) { - case "index": - $page['title'] = $page['service']; - break; - case "ns": - $page['title'] = "Ajouter un enregistrement NS"; - break; - case "register": - $page['title'] = "Enregistrer un nouveau domaine"; - break; - case "unregister": - $page['title'] = "Effacer un domaine"; - break; - case "glue": - $page['title'] = "Créer un Glue Record"; - break; - case "ds": - $page['title'] = "Ajouter un enregistrement DS"; - break; - } - break; - - case "auth": - $page['service'] = "Authentification"; - switch (PAGE) { - case "index": - $page['title'] = $page['service']; - break; - case "login": - $page['title'] = "Se connecter"; - break; - case "register": - $page['title'] = "Créer un compte"; - break; - case "password": - $page['title'] = "Changer la clé de passe"; - break; - case "logout": - $page['title'] = "Déconnexion"; - break; - } - break; - - case "ht": - $page['service'] = "Hypertexte"; - switch (PAGE) { - case "mkdir": - $page['title'] = "Créer un dossier de site"; - break; - case "add-http-onion": - $page['title'] = "Ajouter un accès HTTP par Onion"; - break; - case "add-http-dns": - $page['title'] = "Ajouter un accès HTTP par DNS+TLS"; - break; - case "del-http-onion": - $page['title'] = "Retirer un accès HTTP par Onion"; - break; - case "del-http-dns": - $page['title'] = "Retirer un accès HTTP par DNS+TLS"; - break; - case "le": - $page['title'] = "Installer un certificat Let's Encrypt"; - break; - case "index": - $page['title'] = $page['service']; - break; - } - break; +if (SERVICE !== '') { + $page['service'] = TITLES[SERVICE]['index']; + if (PAGE !== 'index') + $page['title'] = TITLES[SERVICE][PAGE]; } diff --git a/fn/reg.php b/fn/reg.php index 693c2ad..c865a97 100644 --- a/fn/reg.php +++ b/fn/reg.php @@ -19,8 +19,5 @@ function regCheckDomainPossession($domain) { } function regIsFree($domain) { - foreach (query('select', 'registry', ['domain' => $domain], 'domain')) { - - } - + return empty(query('select', 'registry', ['domain' => $domain], 'domain')); } diff --git a/public/ns/index.php b/public/ns/index.php index 2a07480..baee0b3 100644 --- a/public/ns/index.php +++ b/public/ns/index.php @@ -1,10 +1,14 @@