diff --git a/fn/auth.php b/fn/auth.php index 788125d..7f6927f 100644 --- a/fn/auth.php +++ b/fn/auth.php @@ -95,6 +95,7 @@ function rateLimit() { rateLimitInstance(PAGE_METADATA['tokens_instance_cost']); } +const MAX_ACCOUNT_TOKENS = 86400; function rateLimitAccount($requestedTokens) { // Get $userData = query('select', 'users', ['id' => $_SESSION['id']]); @@ -102,20 +103,24 @@ function rateLimitAccount($requestedTokens) { $bucketLastUpdate = $userData[0]['bucket_last_update']; // Compute - $tokens = min(86400, $tokens + (time() - $bucketLastUpdate)); + $tokens = min(MAX_ACCOUNT_TOKENS, $tokens + (time() - $bucketLastUpdate)); - if ($requestedTokens > $tokens) - output(453, _('Account rate limit reached, try again later.')); + if ($requestedTokens > 0) { + if ($requestedTokens > $tokens) + output(453, _('Account rate limit reached, try again later.')); - $tokens -= $requestedTokens; + $tokens -= $requestedTokens; - // Update - DB->prepare('UPDATE users SET bucket_tokens = :bucket_tokens, bucket_last_update = :bucket_last_update WHERE id = :id') - ->execute([ - ':bucket_tokens' => $tokens, - ':bucket_last_update' => time(), - ':id' => $_SESSION['id'] - ]); + // Update + DB->prepare('UPDATE users SET bucket_tokens = :bucket_tokens, bucket_last_update = :bucket_last_update WHERE id = :id') + ->execute([ + ':bucket_tokens' => $tokens, + ':bucket_last_update' => time(), + ':id' => $_SESSION['id'] + ]); + } + + return $tokens; } function rateLimitInstance($requestedTokens) { diff --git a/locales/fr/C/LC_MESSAGES/messages.po b/locales/fr/C/LC_MESSAGES/messages.po index a8b4be6..2e1a5db 100644 --- a/locales/fr/C/LC_MESSAGES/messages.po +++ b/locales/fr/C/LC_MESSAGES/messages.po @@ -1,5 +1,7 @@ msgid "" msgstr "" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-05-02 19:17+0200\n" "Language: fr\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -52,235 +54,235 @@ msgstr "Passer à un compte approuvé" msgid "Switch to an approved account using an approval key" msgstr "Utiliser une clé d'approbation pour passer à un compte approuvé" -#: pages.php:36 +#: pages.php:37 msgid "Change password" msgstr "Changer la clé de passe" -#: pages.php:37 +#: pages.php:38 msgid "Change the character string used to authenticate yourself" msgstr "Changer la chaîne de caractères utilisée pour s'authentifier" -#: pages.php:40 +#: pages.php:42 msgid "Change username" msgstr "Changer l'identifiant" -#: pages.php:41 +#: pages.php:43 msgid "Change the name used to identify your account when logging in and displayed at the start of every page" msgstr "Changer le nom utilisé pour identifier le compte à la connexion et affiché au début de toutes les pages" -#: pages.php:46 +#: pages.php:49 #, php-format msgid "%s registry" msgstr "Registre %s" -#: pages.php:47 +#: pages.php:50 #, php-format msgid "Register and delegate a %s subdomain" msgstr "Obtenir et déléguer un domaine %s" -#: pages.php:50 +#: pages.php:53 msgid "Register domain" msgstr "Enregistrer un domaine" -#: pages.php:51 +#: pages.php:54 #, php-format msgid "Get a %s subdomain" msgstr "Obtenir un sous-domaine de %s" -#: pages.php:55 +#: pages.php:58 msgid "Unregister domain" msgstr "Désenregistrer un domaine" -#: pages.php:56 +#: pages.php:59 msgid "Delete all data related to a domain and make it available to the public again" msgstr "Supprimer toutes les informations liées à un domaine et le redisponibiliser au public" -#: pages.php:59 +#: pages.php:62 msgid "Display domain records" msgstr "Afficher les enregistrements" -#: pages.php:60 +#: pages.php:63 msgid "Print every record related to a domain and served by the registry" msgstr "Montrer tous les enregistrements liés à un domaine et servis par le registre" -#: pages.php:63 pages.php:67 pages.php:107 pages.php:111 pages.php:115 -#: pages.php:119 pages.php:123 pages.php:127 pages.php:131 pages.php:135 -#: pages.php:139 pages.php:143 +#: pages.php:67 pages.php:72 pages.php:117 pages.php:122 pages.php:127 +#: pages.php:132 pages.php:137 pages.php:142 pages.php:147 pages.php:152 +#: pages.php:157 pages.php:162 #, php-format msgid "%s records" msgstr "Enregistrements %s" -#: pages.php:64 +#: pages.php:68 #, php-format msgid "Indicate the name servers of a %s subdomain" msgstr "Indiquer les serveurs de nom d'un sous-domaine de %s" -#: pages.php:68 +#: pages.php:73 msgid "Delegate DNSSEC trust" msgstr "Déléguer la confiance DNSSEC" -#: pages.php:71 +#: pages.php:77 msgid "Receive a domain transfer" msgstr "Recevoir un transfert de domaine" -#: pages.php:72 +#: pages.php:78 msgid "Transfer a domain owned by another account to the current account" msgstr "Transférer vers le compte actuel un domaine possédé par un autre compte" -#: pages.php:75 +#: pages.php:82 msgid "Glue records" msgstr "Glue records" -#: pages.php:76 +#: pages.php:83 msgid "Advanced: store the IP address of a name server whose domain is inside the domain it serves" msgstr "Avancé : indiquer l'adresse IP d'un serveur de nom dont le domaine descend de la zone qu'il sert" -#: pages.php:81 pg-view/ns/index.php:24 +#: pages.php:89 pg-view/ns/index.php:24 msgid "Name servers" msgstr "Serveurs de nom" -#: pages.php:82 +#: pages.php:90 msgid "Host and manage domain's records" msgstr "Héberger et gérer les enregistrements d'un domaine" -#: pages.php:85 +#: pages.php:93 msgid "Add zone" msgstr "Ajouter une zone" -#: pages.php:86 +#: pages.php:94 #, php-format msgid "The zone will be managed by %s name servers" msgstr "La zone sera gérée par les serveurs de nom de %s" -#: pages.php:90 +#: pages.php:98 msgid "Delete zone" msgstr "Supprimer une zone" -#: pages.php:91 +#: pages.php:99 msgid "Erase all zone data" msgstr "Effacer tous les enregistrements d'une zone" -#: pages.php:94 +#: pages.php:102 msgid "Display zone" msgstr "Afficher une zone" -#: pages.php:95 +#: pages.php:103 msgid "Print zonefile content" msgstr "Montrer le contenu d'un fichier de zone" -#: pages.php:98 +#: pages.php:107 msgid "Edit zone" msgstr "Modifier une zone" -#: pages.php:99 +#: pages.php:108 msgid "Change zonefile content" msgstr "Éditer le contenu d'un fichier de zone" -#: pages.php:103 +#: pages.php:112 msgid "AAAA and A records" msgstr "Enregistrements AAAA et A" -#: pages.php:104 +#: pages.php:113 msgid "Store domain's IP address" msgstr "Indiquer l'adresse IP d'un domaine" -#: pages.php:108 +#: pages.php:118 msgid "Store zone's name server" msgstr "Indiquer les serveurs de nom d'une zone" -#: pages.php:112 +#: pages.php:123 msgid "Associate text to domain" msgstr "Associer du texte à un domaine" -#: pages.php:116 +#: pages.php:128 msgid "Limit the certificate authorities allowed to certify the domain" msgstr "Limiter les autorités de certification autorisées à certifier un domaine" -#: pages.php:120 +#: pages.php:133 msgid "Store the location of a domain's service" msgstr "Indiquer l'adresse exacte d'un service pour un domaine" -#: pages.php:124 +#: pages.php:138 msgid "Store the email server's address" msgstr "Indiquer l'adresse d'un serveur de courriels" -#: pages.php:128 +#: pages.php:143 msgid "Store SSH public keys fingerprints" msgstr "Indiquer les empreintes de clés publiques SSH" -#: pages.php:132 +#: pages.php:148 msgid "Setup DANE by publishing the TLS certificate fingerprint" msgstr "Mettre en place DANE et publiant l'empreinte d'un certificat TLS" -#: pages.php:136 +#: pages.php:153 msgid "Define a domain as an alias of another" msgstr "Définir un domaine comme étant l'alias d'un autre" -#: pages.php:140 +#: pages.php:158 msgid "Define all subdomains of a domain as aliases of subdomains of another domain" msgstr "Définir la descendance d'un domaine comme alias de la descendance d'un autre domaine" -#: pages.php:144 +#: pages.php:163 msgid "Store geographic coordinates" msgstr "Indiquer des coordonnées géographiques" -#: pages.php:149 +#: pages.php:169 msgid "Web" msgstr "Web" -#: pages.php:150 +#: pages.php:170 msgid "Upload a static website into an SFTP space" msgstr "Téléverser un site statique dans un espace SFTP" -#: pages.php:153 +#: pages.php:173 #, php-format msgid "%s subpath access" msgstr "Accès par sous-chemin de %s" -#: pages.php:154 pages.php:159 pages.php:164 +#: pages.php:174 pages.php:179 pages.php:184 #, php-format msgid "Its URL will look like %s" msgstr "Son URL ressemblera à %s" -#: pages.php:154 pages.php:159 pages.php:164 +#: pages.php:174 pages.php:179 pages.php:184 msgid "mysite" msgstr "monsite" -#: pages.php:158 +#: pages.php:178 #, php-format msgid "%s subdomain access" msgstr "Accès par sous-domaine de %s" -#: pages.php:163 +#: pages.php:183 msgid "Dedicated domain with Let's Encrypt certificate access" msgstr "Accès par domaine dédié avec certificat Let's Encrypt" -#: pages.php:168 +#: pages.php:188 msgid "Onion service access" msgstr "Accès par service Onion" -#: pages.php:169 +#: pages.php:189 #, php-format msgid "Its URL will look like %s, and work only through the Tor network" msgstr "Son URL ressemblera à %s, et ne fonctionnera que par le réseau Tor" -#: pages.php:173 pg-view/ht/del.php:18 +#: pages.php:193 pg-view/ht/del.php:18 msgid "Delete access" msgstr "Supprimer un accès" -#: pages.php:174 +#: pages.php:194 msgid "Delete an existing HTTP access from a subdirectory of the SFTP space" msgstr "Retirer un accès HTTP existant d'un sous-dossier de l'espace SFTP" -#: router.php:137 view.php:39 +#: router.php:136 view.php:39 msgid "This service is currently under maintenance. No action can be taken on it until an administrator finishes repairing it." msgstr "Ce service est en cours de maintenance. Aucune action ne peut être effectuée avant qu'ane administrataire termine de le réparer." -#: router.php:148 +#: router.php:147 msgid "You need to be logged in to do this." msgstr "Vous devez être connecté·e à un compte pour faire cela." -#: router.php:150 +#: router.php:149 msgid "This account doesn't exist anymore. Log out to end this ghost session." msgstr "Ce compte n'existe plus. Déconnectez-vous pour terminer cette session fantôme." @@ -298,11 +300,11 @@ msgstr "Ce formulaire ne sera pas accepté car il faut %sse connecter%s d'abord. msgid "%sSource code%s available under %s." msgstr "%sCode source%s disponible sous %s." -#: fn/auth.php:108 +#: fn/auth.php:110 msgid "Account rate limit reached, try again later." msgstr "Limite de taux pour ce compte atteinte, réessayez plus tard." -#: fn/auth.php:130 +#: fn/auth.php:135 msgid "Global rate limit reached, try again later." msgstr "Limite de taux globale atteinte, réessayez plus tard." @@ -322,11 +324,11 @@ msgstr "Erreur du serveur : " msgid "Wrong proof." msgstr "Preuve incorrecte." -#: fn/dns.php:62 +#: fn/dns.php:63 msgid "IP address malformed." msgstr "Adresse IP malformée." -#: fn/dns.php:67 fn/ht.php:25 +#: fn/dns.php:68 fn/ht.php:28 msgid "Domain malformed." msgstr "Domaine malformé." @@ -344,11 +346,11 @@ msgstr "Les TTLs plus longs que %s secondes sont interdits." msgid "This account is already approved." msgstr "Ce compte est déjà approuvé." -#: pg-act/auth/approval.php:7 +#: pg-act/auth/approval.php:9 msgid "This approval key is not available. It has been mistyped, used for another account, or has expired." msgstr "Cette clé d'approbation n'est pas disponible. Elle a pu être mal saisie, utilisée pour un autre compte, ou a expiré." -#: pg-act/auth/approval.php:18 +#: pg-act/auth/approval.php:20 msgid "Account approved." msgstr "Compte approuvé." @@ -365,7 +367,7 @@ msgstr "Clé de passe incorrecte." msgid "Wrong current password." msgstr "Clé de passe actuelle incorrecte." -#: pg-act/auth/password.php:10 +#: pg-act/auth/password.php:12 msgid "Password updated." msgstr "Clé de passe mise à jour." @@ -386,7 +388,7 @@ msgstr "Votre compte ne peut pas être supprimé car le service %s est actuellem msgid "Account deleted." msgstr "Compte supprimé." -#: pg-act/auth/username.php:20 +#: pg-act/auth/username.php:22 msgid "Username updated." msgstr "Identifiant mis à jour." @@ -408,13 +410,13 @@ msgstr "Ce domaine doit avoir %2$s pour unique enregistrement %1$s." msgid "No TXT record with the expected format has been found." msgstr "Aucun enregistrement TXT avec le format attendu n'a été trouvé." -#: pg-act/ht/add-dns.php:41 pg-act/ht/add-onion.php:31 +#: pg-act/ht/add-dns.php:41 pg-act/ht/add-onion.php:37 #: pg-act/ht/add-subdomain.php:19 pg-act/ht/add-subpath.php:19 #, php-format msgid "%s added on this directory." msgstr "%s ajouté sur ce dossier." -#: pg-act/ht/add-onion.php:31 +#: pg-act/ht/add-onion.php:37 #, php-format msgid "Its address is: %s" msgstr "Son adresse est : %s" @@ -435,11 +437,11 @@ msgstr "Ce chemin est déjà pris sur ce service. Utilisez-en un autre." msgid "Access removed." msgstr "Accès retiré." -#: pg-act/ns/caa.php:23 pg-act/ns/cname.php:14 pg-act/ns/dname.php:14 -#: pg-act/ns/ip.php:14 pg-act/ns/loc.php:70 pg-act/ns/mx.php:18 -#: pg-act/ns/ns.php:14 pg-act/ns/srv.php:26 pg-act/ns/sshfp.php:23 -#: pg-act/ns/tlsa.php:27 pg-act/ns/txt.php:15 pg-act/reg/ds.php:30 -#: pg-act/reg/glue.php:12 pg-act/reg/ns.php:12 +#: pg-act/ns/caa.php:25 pg-act/ns/cname.php:16 pg-act/ns/dname.php:16 +#: pg-act/ns/ip.php:16 pg-act/ns/loc.php:72 pg-act/ns/mx.php:20 +#: pg-act/ns/ns.php:16 pg-act/ns/srv.php:28 pg-act/ns/sshfp.php:25 +#: pg-act/ns/tlsa.php:29 pg-act/ns/txt.php:17 pg-act/reg/ds.php:32 +#: pg-act/reg/glue.php:14 pg-act/reg/ns.php:14 msgid "Modification done." msgstr "Modification effectuée." @@ -465,15 +467,15 @@ msgstr "Le contenu de zone envoyé n'est pas correct (selon kzonechecktesting account." +msgstr "Vous utilisez actuellement un compte de test." + +#: pg-view/auth/index.php:10 +msgid "You are currently using an approved account." +msgstr "Vous utilisez actuellement un compte approuvé." + +#: pg-view/auth/index.php:13 msgid "You are not logged in." msgstr "Vous n'êtes connecté·e à aucun compte." -#: pg-view/auth/index.php:13 -msgid "Account types" -msgstr "Types de comptes" - -#: pg-view/auth/index.php:16 -msgid "Testing" -msgstr "De test" - #: pg-view/auth/index.php:18 -msgid "It's the default account type, with limited capabilities in order to avoid abuses:" -msgstr "C'est le type de compte par défaut, avec des capacités limitées afin de limiter les abus :" +msgid "When an account is created, it's a testing account. A testing account is only temporary and with limited capabilities on the services. Once the account is validated by using an approval key requested to an administrator, it becomes an approved account." +msgstr "Quand un compte est créé, c'est un compte de test. Un compte de test est seulement temporaire et avec de capacités restreintes sur les services. Une fois le compte validé en utilisant une clé d'approbation demandée à ane administrataire, il devient un compte approuvé." -#: pg-view/auth/index.php:20 -msgid "May be deleted anytime" -msgstr "Peut être supprimé n'importe quand" - -#: pg-view/auth/index.php:21 pg-view/auth/index.php:29 -#, php-format -msgid "%s of SFTP quota" -msgstr "Quota SFTP de %s" - -#: pg-view/auth/index.php:21 pg-view/auth/index.php:29 pg-view/ht/index.php:51 -msgid "GiB" -msgstr "Gio" - -#: pg-view/auth/index.php:21 pg-view/auth/index.php:29 pg-view/ht/index.php:51 -msgid "MiB" -msgstr "Mio" - -#: pg-view/auth/index.php:22 -msgid "Let's Encrypt certificate from the staging environment (not trusted by clients)" -msgstr "Certificat Let's Encrypt de test (n'est pas reconnu par les clients)" +#: pg-view/auth/index.php:21 +msgid "Rate limit" +msgstr "Limite de débit" #: pg-view/auth/index.php:25 -msgid "Approved" -msgstr "Approuvé" +#, php-format +msgid "Your account is at %s%% of the rate limit." +msgstr "Votre compte est à %s%% de la limite de débit." #: pg-view/auth/index.php:27 -msgid "It was originally a testing account, but has been approved by an administrator, and is suitable for stable use cases:" -msgstr "C'est originellement un compte de test, mais qui a été approuvé par ane administrataire, et qui permet une utilisation stable :" +msgid "Most of the form submissions bring you closer to the rate limit. If you reach it, you need to wait in order to be able to submit forms again." +msgstr "La plupart des traitements de formulaires vous rapprochent de la limite de débit. Si vous l'atteignez, vous devez attendre avant de pouvoir envoyer des formulaires à nouveau." -#: pg-view/auth/index.php:30 -msgid "Stable Let's Encrypt certificates" -msgstr "Vrai certificat Let's Encrypt" +#: pg-view/auth/index.php:31 +msgid "Internal ID" +msgstr "Identifiant interne" + +#: pg-view/auth/index.php:33 +#, php-format +msgid "The current account's internal ID is %s." +msgstr "L'identifiant interne du compte actuel est %s." #: pg-view/auth/login.php:1 msgid "New?" @@ -611,11 +593,11 @@ msgstr "Nouvele ?" msgid "Create an account" msgstr "Créer un compte" -#: pg-view/auth/login.php:4 pg-view/auth/register.php:4 pg-view/ht/index.php:94 +#: pg-view/auth/login.php:4 pg-view/auth/register.php:4 pg-view/ht/index.php:64 msgid "Username" msgstr "Identifiant" -#: pg-view/auth/login.php:8 pg-view/auth/register.php:9 pg-view/ht/index.php:98 +#: pg-view/auth/login.php:8 pg-view/auth/register.php:9 pg-view/ht/index.php:68 msgid "Password" msgstr "Clé de passe" @@ -719,63 +701,91 @@ msgstr "Ajouter un accès de site" msgid "In order to be able to set up an HTTP site with this service, a subdirectory for this site must be created inside the SFTP space first. The name of this subdirectory can only contain %1$s, %2$s, %3$s, %4$s and %5$s." msgstr "Pour pouvoir créer un site HTTP avec ce service, un sous-dossier pour ce site doit d'abord être créé dans l'espace SFTP. Le nom de ce sous-dossier ne peut contenir que %1$s, %2$s, %3$s, %4$s et %5$s." -#: pg-view/ht/index.php:51 -#, php-format -msgid "The SFTP space is limited to %s. Indicate the following values to your SFTP client to access it." -msgstr "L'espace SFTP est limité à %s. Indiquez les valeurs suivantes à votre client pour y accéder." +#: pg-view/ht/index.php:44 +msgid "Connecting to the SFTP server" +msgstr "Se connecter au serveur SFTP" -#: pg-view/ht/index.php:55 -msgid "Authenticating the server" -msgstr "Authentifier le serveur" - -#: pg-view/ht/index.php:57 -msgid "An SSHFP record is available." -msgstr "Un enregistrement SSHFP est disponible." - -#: pg-view/ht/index.php:60 -msgid "Plain public key" -msgstr "Clé publique" - -#: pg-view/ht/index.php:65 -msgid "Public key fingerprint" -msgstr "Empreinte de la clé publique" - -#: pg-view/ht/index.php:70 -msgid "ASCII art" -msgstr "Art ASCII" - -#: pg-view/ht/index.php:77 -msgid "Connecting to the server" -msgstr "Se connecter au serveur" - -#: pg-view/ht/index.php:82 +#: pg-view/ht/index.php:52 msgid "Server" msgstr "Serveur" -#: pg-view/ht/index.php:86 pg-view/ns/srv.php:16 +#: pg-view/ht/index.php:56 pg-view/ns/srv.php:16 msgid "Port" msgstr "Port" -#: pg-view/ht/index.php:90 +#: pg-view/ht/index.php:60 msgid "Directory" msgstr "Dossier" -#: pg-view/ht/index.php:100 +#: pg-view/ht/index.php:70 msgid "The one of your account" msgstr "Celle de votre compte" -#: pg-view/ht/index.php:111 +#: pg-view/ht/index.php:74 +msgid "Authenticating the server" +msgstr "Authentifier le serveur" + +#: pg-view/ht/index.php:76 +msgid "An SSHFP record is available." +msgstr "Un enregistrement SSHFP est disponible." + +#: pg-view/ht/index.php:79 +msgid "Plain public key" +msgstr "Clé publique" + +#: pg-view/ht/index.php:84 +msgid "Public key fingerprint" +msgstr "Empreinte de la clé publique" + +#: pg-view/ht/index.php:89 +msgid "ASCII art" +msgstr "Art ASCII" + +#: pg-view/ht/index.php:102 msgid "A content security policy (CSP) forbids Web browsers from loading JavaScript or third-party resources." msgstr "Une politique de sécurité du contenu (CSP) interdit l'intégration de ressources tierces ou de JavaScript." -#: pg-view/ht/index.php:114 +#: pg-view/ht/index.php:105 msgid ".htaccess configuration" msgstr "Configuration par .htaccess" -#: pg-view/ht/index.php:116 +#: pg-view/ht/index.php:107 msgid "You can change the way the HTTP server answers to requests in a directory by setting some directives in a file named .htaccess at the root of this directory. Only the following directives are allowed:" msgstr "Vous pouvez modifier la façon dont le serveur HTTP répond aux requêtes dans un dossier en indiquant des directives dans un fichier nommé .htaccess à la racine de ce dossier. Seules les directives suivantes sont autorisées :" +#: pg-view/ht/index.php:161 +msgid "Accounts capabilities" +msgstr "Capacités des comptes" + +#: pg-view/ht/index.php:163 +msgid "Testing" +msgstr "De test" + +#: pg-view/ht/index.php:166 pg-view/ht/index.php:173 +#, php-format +msgid "%s of SFTP quota" +msgstr "Quota SFTP de %s" + +#: pg-view/ht/index.php:166 pg-view/ht/index.php:173 +msgid "GiB" +msgstr "Gio" + +#: pg-view/ht/index.php:166 pg-view/ht/index.php:173 +msgid "MiB" +msgstr "Mio" + +#: pg-view/ht/index.php:167 +msgid "Let's Encrypt certificate from the staging environment (not trusted by clients)" +msgstr "Certificat Let's Encrypt de test (n'est pas reconnu par les clients)" + +#: pg-view/ht/index.php:170 +msgid "Approved" +msgstr "Approuvé" + +#: pg-view/ht/index.php:174 +msgid "Stable Let's Encrypt certificates" +msgstr "Vrai certificat Let's Encrypt" + #: pg-view/ns/caa.php:3 msgid "Flag" msgstr "Flag" @@ -1086,6 +1096,18 @@ msgstr "Ce registre de noms de domaine permet d'enregistrer des domaines se term msgid "Currently registered domains" msgstr "Domaines actuellement enregistrés" +#: pg-view/reg/index.php:27 +msgid "Both testing and 👤 approved accounts can register a domain under these suffixes:" +msgstr "Les comptes de test et 👤 approuvés peuvent enregistrer un domaine sous ces suffixes :" + +#: pg-view/reg/index.php:38 +msgid "Only 👤 approved accounts can register a domain under these suffixes:" +msgstr "Seuls les comptes 👤 approuvés peuvent enregistrer un domaine sous ces suffixes :" + +#: pg-view/reg/index.php:49 +msgid "Nobody can register a domain under these suffixes:" +msgstr "Personne ne peut enregistrer un domain sous ces suffixes :" + #: pg-view/reg/register.php:2 msgid "Register a new domain on your account. It must consist of between 4 and 63 letters and digits." msgstr "Enregistrer un nouveau domaine sur son compte. Il doit être composé d'entre 4 et 63 lettres et chiffres." diff --git a/locales/messages.pot b/locales/messages.pot index 0f27226..9319f13 100644 --- a/locales/messages.pot +++ b/locales/messages.pot @@ -1,6 +1,21 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy msgid "" msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-05-02 19:17+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" #: pages.php:9 msgid "Authentication" @@ -51,235 +66,235 @@ msgstr "" msgid "Switch to an approved account using an approval key" msgstr "" -#: pages.php:36 +#: pages.php:37 msgid "Change password" msgstr "" -#: pages.php:37 +#: pages.php:38 msgid "Change the character string used to authenticate yourself" msgstr "" -#: pages.php:40 +#: pages.php:42 msgid "Change username" msgstr "" -#: pages.php:41 +#: pages.php:43 msgid "Change the name used to identify your account when logging in and displayed at the start of every page" msgstr "" -#: pages.php:46 +#: pages.php:49 #, php-format msgid "%s registry" msgstr "" -#: pages.php:47 +#: pages.php:50 #, php-format msgid "Register and delegate a %s subdomain" msgstr "" -#: pages.php:50 +#: pages.php:53 msgid "Register domain" msgstr "" -#: pages.php:51 +#: pages.php:54 #, php-format msgid "Get a %s subdomain" msgstr "" -#: pages.php:55 +#: pages.php:58 msgid "Unregister domain" msgstr "" -#: pages.php:56 +#: pages.php:59 msgid "Delete all data related to a domain and make it available to the public again" msgstr "" -#: pages.php:59 +#: pages.php:62 msgid "Display domain records" msgstr "" -#: pages.php:60 +#: pages.php:63 msgid "Print every record related to a domain and served by the registry" msgstr "" -#: pages.php:63 pages.php:67 pages.php:107 pages.php:111 pages.php:115 -#: pages.php:119 pages.php:123 pages.php:127 pages.php:131 pages.php:135 -#: pages.php:139 pages.php:143 +#: pages.php:67 pages.php:72 pages.php:117 pages.php:122 pages.php:127 +#: pages.php:132 pages.php:137 pages.php:142 pages.php:147 pages.php:152 +#: pages.php:157 pages.php:162 #, php-format msgid "%s records" msgstr "" -#: pages.php:64 +#: pages.php:68 #, php-format msgid "Indicate the name servers of a %s subdomain" msgstr "" -#: pages.php:68 +#: pages.php:73 msgid "Delegate DNSSEC trust" msgstr "" -#: pages.php:71 +#: pages.php:77 msgid "Receive a domain transfer" msgstr "" -#: pages.php:72 +#: pages.php:78 msgid "Transfer a domain owned by another account to the current account" msgstr "" -#: pages.php:75 +#: pages.php:82 msgid "Glue records" msgstr "" -#: pages.php:76 +#: pages.php:83 msgid "Advanced: store the IP address of a name server whose domain is inside the domain it serves" msgstr "" -#: pages.php:81 pg-view/ns/index.php:24 +#: pages.php:89 pg-view/ns/index.php:24 msgid "Name servers" msgstr "" -#: pages.php:82 +#: pages.php:90 msgid "Host and manage domain's records" msgstr "" -#: pages.php:85 +#: pages.php:93 msgid "Add zone" msgstr "" -#: pages.php:86 +#: pages.php:94 #, php-format msgid "The zone will be managed by %s name servers" msgstr "" -#: pages.php:90 +#: pages.php:98 msgid "Delete zone" msgstr "" -#: pages.php:91 +#: pages.php:99 msgid "Erase all zone data" msgstr "" -#: pages.php:94 +#: pages.php:102 msgid "Display zone" msgstr "" -#: pages.php:95 +#: pages.php:103 msgid "Print zonefile content" msgstr "" -#: pages.php:98 +#: pages.php:107 msgid "Edit zone" msgstr "" -#: pages.php:99 +#: pages.php:108 msgid "Change zonefile content" msgstr "" -#: pages.php:103 +#: pages.php:112 msgid "AAAA and A records" msgstr "" -#: pages.php:104 +#: pages.php:113 msgid "Store domain's IP address" msgstr "" -#: pages.php:108 +#: pages.php:118 msgid "Store zone's name server" msgstr "" -#: pages.php:112 +#: pages.php:123 msgid "Associate text to domain" msgstr "" -#: pages.php:116 +#: pages.php:128 msgid "Limit the certificate authorities allowed to certify the domain" msgstr "" -#: pages.php:120 +#: pages.php:133 msgid "Store the location of a domain's service" msgstr "" -#: pages.php:124 +#: pages.php:138 msgid "Store the email server's address" msgstr "" -#: pages.php:128 +#: pages.php:143 msgid "Store SSH public keys fingerprints" msgstr "" -#: pages.php:132 +#: pages.php:148 msgid "Setup DANE by publishing the TLS certificate fingerprint" msgstr "" -#: pages.php:136 +#: pages.php:153 msgid "Define a domain as an alias of another" msgstr "" -#: pages.php:140 +#: pages.php:158 msgid "Define all subdomains of a domain as aliases of subdomains of another domain" msgstr "" -#: pages.php:144 +#: pages.php:163 msgid "Store geographic coordinates" msgstr "" -#: pages.php:149 +#: pages.php:169 msgid "Web" msgstr "" -#: pages.php:150 +#: pages.php:170 msgid "Upload a static website into an SFTP space" msgstr "" -#: pages.php:153 +#: pages.php:173 #, php-format msgid "%s subpath access" msgstr "" -#: pages.php:154 pages.php:159 pages.php:164 +#: pages.php:174 pages.php:179 pages.php:184 #, php-format msgid "Its URL will look like %s" msgstr "" -#: pages.php:154 pages.php:159 pages.php:164 +#: pages.php:174 pages.php:179 pages.php:184 msgid "mysite" msgstr "" -#: pages.php:158 +#: pages.php:178 #, php-format msgid "%s subdomain access" msgstr "" -#: pages.php:163 +#: pages.php:183 msgid "Dedicated domain with Let's Encrypt certificate access" msgstr "" -#: pages.php:168 +#: pages.php:188 msgid "Onion service access" msgstr "" -#: pages.php:169 +#: pages.php:189 #, php-format msgid "Its URL will look like %s, and work only through the Tor network" msgstr "" -#: pages.php:173 pg-view/ht/del.php:18 +#: pages.php:193 pg-view/ht/del.php:18 msgid "Delete access" msgstr "" -#: pages.php:174 +#: pages.php:194 msgid "Delete an existing HTTP access from a subdirectory of the SFTP space" msgstr "" -#: router.php:137 view.php:39 +#: router.php:136 view.php:39 msgid "This service is currently under maintenance. No action can be taken on it until an administrator finishes repairing it." msgstr "" -#: router.php:148 +#: router.php:147 msgid "You need to be logged in to do this." msgstr "" -#: router.php:150 +#: router.php:149 msgid "This account doesn't exist anymore. Log out to end this ghost session." msgstr "" @@ -297,11 +312,11 @@ msgstr "" msgid "%sSource code%s available under %s." msgstr "" -#: fn/auth.php:108 +#: fn/auth.php:110 msgid "Account rate limit reached, try again later." msgstr "" -#: fn/auth.php:130 +#: fn/auth.php:135 msgid "Global rate limit reached, try again later." msgstr "" @@ -321,11 +336,11 @@ msgstr "" msgid "Wrong proof." msgstr "" -#: fn/dns.php:62 +#: fn/dns.php:63 msgid "IP address malformed." msgstr "" -#: fn/dns.php:67 fn/ht.php:25 +#: fn/dns.php:68 fn/ht.php:28 msgid "Domain malformed." msgstr "" @@ -343,11 +358,11 @@ msgstr "" msgid "This account is already approved." msgstr "" -#: pg-act/auth/approval.php:7 +#: pg-act/auth/approval.php:9 msgid "This approval key is not available. It has been mistyped, used for another account, or has expired." msgstr "" -#: pg-act/auth/approval.php:18 +#: pg-act/auth/approval.php:20 msgid "Account approved." msgstr "" @@ -364,7 +379,7 @@ msgstr "" msgid "Wrong current password." msgstr "" -#: pg-act/auth/password.php:10 +#: pg-act/auth/password.php:12 msgid "Password updated." msgstr "" @@ -385,7 +400,7 @@ msgstr "" msgid "Account deleted." msgstr "" -#: pg-act/auth/username.php:20 +#: pg-act/auth/username.php:22 msgid "Username updated." msgstr "" @@ -407,13 +422,13 @@ msgstr "" msgid "No TXT record with the expected format has been found." msgstr "" -#: pg-act/ht/add-dns.php:41 pg-act/ht/add-onion.php:31 +#: pg-act/ht/add-dns.php:41 pg-act/ht/add-onion.php:37 #: pg-act/ht/add-subdomain.php:19 pg-act/ht/add-subpath.php:19 #, php-format msgid "%s added on this directory." msgstr "" -#: pg-act/ht/add-onion.php:31 +#: pg-act/ht/add-onion.php:37 #, php-format msgid "Its address is: %s" msgstr "" @@ -434,11 +449,11 @@ msgstr "" msgid "Access removed." msgstr "" -#: pg-act/ns/caa.php:23 pg-act/ns/cname.php:14 pg-act/ns/dname.php:14 -#: pg-act/ns/ip.php:14 pg-act/ns/loc.php:70 pg-act/ns/mx.php:18 -#: pg-act/ns/ns.php:14 pg-act/ns/srv.php:26 pg-act/ns/sshfp.php:23 -#: pg-act/ns/tlsa.php:27 pg-act/ns/txt.php:15 pg-act/reg/ds.php:30 -#: pg-act/reg/glue.php:12 pg-act/reg/ns.php:12 +#: pg-act/ns/caa.php:25 pg-act/ns/cname.php:16 pg-act/ns/dname.php:16 +#: pg-act/ns/ip.php:16 pg-act/ns/loc.php:72 pg-act/ns/mx.php:20 +#: pg-act/ns/ns.php:16 pg-act/ns/srv.php:28 pg-act/ns/sshfp.php:25 +#: pg-act/ns/tlsa.php:29 pg-act/ns/txt.php:17 pg-act/reg/ds.php:32 +#: pg-act/reg/glue.php:14 pg-act/reg/ns.php:14 msgid "Modification done." msgstr "" @@ -464,15 +479,15 @@ msgstr "" msgid "This zone already exists on the service." msgstr "" -#: pg-act/ns/zone-add.php:10 +#: pg-act/ns/zone-add.php:12 msgid "Parent zone's name servers not found." msgstr "" -#: pg-act/ns/zone-add.php:16 pg-act/reg/transfer.php:16 +#: pg-act/ns/zone-add.php:18 pg-act/reg/transfer.php:18 msgid "NS authentication record not found." msgstr "" -#: pg-act/ns/zone-add.php:52 +#: pg-act/ns/zone-add.php:54 msgid "Zone created." msgstr "" @@ -520,7 +535,7 @@ msgstr "" msgid "The current account already owns this domain." msgstr "" -#: pg-act/reg/transfer.php:29 +#: pg-act/reg/transfer.php:33 msgid "The domain has been transferred to the current account ; the NS authentication record has been automatically deleted." msgstr "" @@ -540,66 +555,46 @@ msgstr "" msgid "Use for this account" msgstr "" -#: pg-view/auth/index.php:5 -msgid "You are currently using a testing account." -msgstr "" - -#: pg-view/auth/index.php:6 -msgid "You are currently using an approved account." -msgstr "" - -#: pg-view/auth/index.php:7 -#, php-format -msgid "It's internal ID is %s." +#: pg-view/auth/index.php:3 +msgid "Account type" msgstr "" #: pg-view/auth/index.php:9 -msgid "You are not logged in." +msgid "You are currently using a testing account." +msgstr "" + +#: pg-view/auth/index.php:10 +msgid "You are currently using an approved account." msgstr "" #: pg-view/auth/index.php:13 -msgid "Account types" -msgstr "" - -#: pg-view/auth/index.php:16 -msgid "Testing" +msgid "You are not logged in." msgstr "" #: pg-view/auth/index.php:18 -msgid "It's the default account type, with limited capabilities in order to avoid abuses:" +msgid "When an account is created, it's a testing account. A testing account is only temporary and with limited capabilities on the services. Once the account is validated by using an approval key requested to an administrator, it becomes an approved account." msgstr "" -#: pg-view/auth/index.php:20 -msgid "May be deleted anytime" -msgstr "" - -#: pg-view/auth/index.php:21 pg-view/auth/index.php:29 -#, php-format -msgid "%s of SFTP quota" -msgstr "" - -#: pg-view/auth/index.php:21 pg-view/auth/index.php:29 pg-view/ht/index.php:51 -msgid "GiB" -msgstr "" - -#: pg-view/auth/index.php:21 pg-view/auth/index.php:29 pg-view/ht/index.php:51 -msgid "MiB" -msgstr "" - -#: pg-view/auth/index.php:22 -msgid "Let's Encrypt certificate from the staging environment (not trusted by clients)" +#: pg-view/auth/index.php:21 +msgid "Rate limit" msgstr "" #: pg-view/auth/index.php:25 -msgid "Approved" +#, php-format +msgid "Your account is at %s%% of the rate limit." msgstr "" #: pg-view/auth/index.php:27 -msgid "It was originally a testing account, but has been approved by an administrator, and is suitable for stable use cases:" +msgid "Most of the form submissions bring you closer to the rate limit. If you reach it, you need to wait in order to be able to submit forms again." msgstr "" -#: pg-view/auth/index.php:30 -msgid "Stable Let's Encrypt certificates" +#: pg-view/auth/index.php:31 +msgid "Internal ID" +msgstr "" + +#: pg-view/auth/index.php:33 +#, php-format +msgid "The current account's internal ID is %s." msgstr "" #: pg-view/auth/login.php:1 @@ -610,11 +605,11 @@ msgstr "" msgid "Create an account" msgstr "" -#: pg-view/auth/login.php:4 pg-view/auth/register.php:4 pg-view/ht/index.php:94 +#: pg-view/auth/login.php:4 pg-view/auth/register.php:4 pg-view/ht/index.php:64 msgid "Username" msgstr "" -#: pg-view/auth/login.php:8 pg-view/auth/register.php:9 pg-view/ht/index.php:98 +#: pg-view/auth/login.php:8 pg-view/auth/register.php:9 pg-view/ht/index.php:68 msgid "Password" msgstr "" @@ -718,63 +713,91 @@ msgstr "" msgid "In order to be able to set up an HTTP site with this service, a subdirectory for this site must be created inside the SFTP space first. The name of this subdirectory can only contain %1$s, %2$s, %3$s, %4$s and %5$s." msgstr "" -#: pg-view/ht/index.php:51 -#, php-format -msgid "The SFTP space is limited to %s. Indicate the following values to your SFTP client to access it." +#: pg-view/ht/index.php:44 +msgid "Connecting to the SFTP server" msgstr "" -#: pg-view/ht/index.php:55 -msgid "Authenticating the server" -msgstr "" - -#: pg-view/ht/index.php:57 -msgid "An SSHFP record is available." -msgstr "" - -#: pg-view/ht/index.php:60 -msgid "Plain public key" -msgstr "" - -#: pg-view/ht/index.php:65 -msgid "Public key fingerprint" -msgstr "" - -#: pg-view/ht/index.php:70 -msgid "ASCII art" -msgstr "" - -#: pg-view/ht/index.php:77 -msgid "Connecting to the server" -msgstr "" - -#: pg-view/ht/index.php:82 +#: pg-view/ht/index.php:52 msgid "Server" msgstr "" -#: pg-view/ht/index.php:86 pg-view/ns/srv.php:16 +#: pg-view/ht/index.php:56 pg-view/ns/srv.php:16 msgid "Port" msgstr "" -#: pg-view/ht/index.php:90 +#: pg-view/ht/index.php:60 msgid "Directory" msgstr "" -#: pg-view/ht/index.php:100 +#: pg-view/ht/index.php:70 msgid "The one of your account" msgstr "" -#: pg-view/ht/index.php:111 +#: pg-view/ht/index.php:74 +msgid "Authenticating the server" +msgstr "" + +#: pg-view/ht/index.php:76 +msgid "An SSHFP record is available." +msgstr "" + +#: pg-view/ht/index.php:79 +msgid "Plain public key" +msgstr "" + +#: pg-view/ht/index.php:84 +msgid "Public key fingerprint" +msgstr "" + +#: pg-view/ht/index.php:89 +msgid "ASCII art" +msgstr "" + +#: pg-view/ht/index.php:102 msgid "A content security policy (CSP) forbids Web browsers from loading JavaScript or third-party resources." msgstr "" -#: pg-view/ht/index.php:114 +#: pg-view/ht/index.php:105 msgid ".htaccess configuration" msgstr "" -#: pg-view/ht/index.php:116 +#: pg-view/ht/index.php:107 msgid "You can change the way the HTTP server answers to requests in a directory by setting some directives in a file named .htaccess at the root of this directory. Only the following directives are allowed:" msgstr "" +#: pg-view/ht/index.php:161 +msgid "Accounts capabilities" +msgstr "" + +#: pg-view/ht/index.php:163 +msgid "Testing" +msgstr "" + +#: pg-view/ht/index.php:166 pg-view/ht/index.php:173 +#, php-format +msgid "%s of SFTP quota" +msgstr "" + +#: pg-view/ht/index.php:166 pg-view/ht/index.php:173 +msgid "GiB" +msgstr "" + +#: pg-view/ht/index.php:166 pg-view/ht/index.php:173 +msgid "MiB" +msgstr "" + +#: pg-view/ht/index.php:167 +msgid "Let's Encrypt certificate from the staging environment (not trusted by clients)" +msgstr "" + +#: pg-view/ht/index.php:170 +msgid "Approved" +msgstr "" + +#: pg-view/ht/index.php:174 +msgid "Stable Let's Encrypt certificates" +msgstr "" + #: pg-view/ns/caa.php:3 msgid "Flag" msgstr "" @@ -1085,6 +1108,18 @@ msgstr "" msgid "Currently registered domains" msgstr "" +#: pg-view/reg/index.php:27 +msgid "Both testing and 👤 approved accounts can register a domain under these suffixes:" +msgstr "" + +#: pg-view/reg/index.php:38 +msgid "Only 👤 approved accounts can register a domain under these suffixes:" +msgstr "" + +#: pg-view/reg/index.php:49 +msgid "Nobody can register a domain under these suffixes:" +msgstr "" + #: pg-view/reg/register.php:2 msgid "Register a new domain on your account. It must consist of between 4 and 63 letters and digits." msgstr "" diff --git a/pg-view/auth/index.php b/pg-view/auth/index.php index ec2010f..47426ee 100644 --- a/pg-view/auth/index.php +++ b/pg-view/auth/index.php @@ -1,33 +1,33 @@ + +

+

- _('You are currently using a testing account.'), - 'approved' => _('You are currently using an approved account.'), - } . ' ' . sprintf(_('It\'s internal ID is %s.'), '' . $_SESSION['id'] . ''); -} else { + 'testing' => _('You are currently using a testing account.'), + 'approved' => _('You are currently using an approved account.'), + }; +else echo _('You are not logged in.'); -} ?> +?>

-

+

+ testing account. A testing account is only temporary and with limited capabilities on the services. Once the account is validated by using an approval key requested to an administrator, it becomes an approved account.') ?> +

-
-
-
- -
    -
  • -
  • > 30) >= 1) ? CONF['ht']['user_quota_testing'] >> 30 . ' ' . _('GiB') : CONF['ht']['user_quota_testing'] >> 20 . ' ' . _('MiB')) ?>
  • -
  • -
-
-
-
- -
    -
  • > 30) >= 1) ? CONF['ht']['user_quota_approved'] >> 30 . ' ' . _('GiB') : CONF['ht']['user_quota_approved'] >> 20 . ' ' . _('MiB')) ?>
  • -
  • -
-
-
+

+ +
+ + ' . abs(intval($tokens / MAX_ACCOUNT_TOKENS * 100)-100) . '') ?> +

+ +

+
+ +

+ +

' . ($_SESSION['id'] ?? '—') . '') ?>

diff --git a/pg-view/ht/index.php b/pg-view/ht/index.php index 45ee6eb..92956c3 100644 --- a/pg-view/ht/index.php +++ b/pg-view/ht/index.php @@ -41,16 +41,35 @@ else {
-

SFTP

+

+ -

- > 30) >= 1) ? $quota >> 30 . ' ' . _('GiB') : $quota >> 20 . ' ' . _('MiB')) ?> -

- +
+
+
+ +
+
+
+ +
+
+
+ / +
+
+
+ +
+
+
+ +
+

@@ -72,40 +91,9 @@ $quota = (($_SESSION['type'] ?? '') === 'approved') ? CONF['ht']['user_quota_app
- -
-

- - - - -
-
-
- -
-
-
- -
-
-
- / -
-
-
- -
-
-
- -
-
-
+

HTTP

@@ -168,3 +156,23 @@ $sftp_url = 'sftp://' . (defined('DISPLAY_USERNAME') ? DISPLAY_USERNAME : '<u
  • IndexStyleSheet
  • + +
    +

    +
    +
    +
    +
      +
    • > 30) >= 1) ? CONF['ht']['user_quota_testing'] >> 30 . ' ' . _('GiB') : CONF['ht']['user_quota_testing'] >> 20 . ' ' . _('MiB')) ?>
    • +
    • +
    +
    +
    +
    +
      +
    • > 30) >= 1) ? CONF['ht']['user_quota_approved'] >> 30 . ' ' . _('GiB') : CONF['ht']['user_quota_approved'] >> 20 . ' ' . _('MiB')) ?>
    • +
    • +
    +
    +
    +
    diff --git a/pg-view/reg/index.php b/pg-view/reg/index.php index dc2f138..495f797 100644 --- a/pg-view/reg/index.php +++ b/pg-view/reg/index.php @@ -17,3 +17,44 @@ else { echo '
  • ' . $domain . '
  • ' . LF; echo '' . LF; } + +?> + +
    +

    Current subdomain registration policy

    +
    + +
    testing and approved accounts can register a domain under these suffixes:') ?>
    +
    +
      + $condition) + if ($condition === 'all') + echo '
    • ' . $suffix . '
    • '; +?> +
    +
    + +
    👤 approved accounts can register a domain under these suffixes:') ?>
    +
    +
      + $condition) + if ($condition === 'approved') + echo '
    • ' . $suffix . '
    • '; +?> +
    +
    + +
    +
    +
      + $condition) + if ($condition === 'none') + echo '
    • ' . $suffix . '
    • '; +?> +
    +
    +
    +