Browse Source

Add setting to disable registrations

A new services['auth'] setting is available.
Miraty 2 years ago
parent
commit
337e7ab27e
10 changed files with 68 additions and 50 deletions
  1. 5 4
      DOCS/configuration.md
  2. 1 1
      check.php
  3. 1 0
      config.ini
  4. 25 20
      locales/fr/C/LC_MESSAGES/messages.po
  5. 25 20
      locales/messages.pot
  6. 3 0
      pg-act/auth/register.php
  7. 4 1
      pg-view/auth/register.php
  8. 2 2
      pg-view/index.php
  9. 1 1
      router.php
  10. 1 1
      view.php

+ 5 - 4
DOCS/configuration.md

@@ -30,12 +30,13 @@ Pretty string sometimes prefixed to the service name. Can be empty.
 
 
 ### `services[]`
 ### `services[]`
 
 
-Keys `reg`, `ns` and `ht` are required.
+Keys `auth`, `reg`, `ns` and `ht` are required.
 
 
 Values can be:
 Values can be:
-* `enabled`: the service is provided as usual
-* `error`: the service is temporarily unavailable for maintenance/debugging
-* `disabled`: the service is ignored everywhere ; this installation never provides it
+* `enabled`: The service is provided as usual.
+* `no-registration` (`auth` only): Same as `enabled`, but no new account can be created.
+* `error`: For maintenance/debugging purposes, the service is temporarily unavailable. When used on the `auth` service, users can't submit any form, but this doesn't prevent already logged in SFTP users to act on the filesystem.
+* `disabled` (`reg`, `ns` and `ht` only): The service is ignored everywhere, this installation never provides it.
 
 
 ## `[dns]`
 ## `[dns]`
 
 

+ 1 - 1
check.php

@@ -17,7 +17,7 @@ const LF = "\n";
 
 
 exec(CONF['dns']['kdig_path'] . ' torproject.org AAAA', $output, $return_code);
 exec(CONF['dns']['kdig_path'] . ' torproject.org AAAA', $output, $return_code);
 if (preg_match('/^;; Flags: qr rd ra ad;/Dm', implode("\n", $output)) !== 1)
 if (preg_match('/^;; Flags: qr rd ra ad;/Dm', implode("\n", $output)) !== 1)
-	exit('Unable to do a DNSSEC-validated DNS query.');
+	exit('Unable to do a DNSSEC-validated DNS query.' . LF);
 
 
 if (CONF['common']['services']['ns'] === 'rest') {
 if (CONF['common']['services']['ns'] === 'rest') {
 	echo 'a';
 	echo 'a';

+ 1 - 0
config.ini

@@ -5,6 +5,7 @@ public_domains[] = "servnest.test"
 prefix = ""
 prefix = ""
 service_name = "ServNest"
 service_name = "ServNest"
 service_emoji = "🪺"
 service_emoji = "🪺"
+services[auth] = "enabled"
 services[reg] = "enabled"
 services[reg] = "enabled"
 services[ns] = "enabled"
 services[ns] = "enabled"
 services[ht] = "enabled"
 services[ht] = "enabled"

+ 25 - 20
locales/fr/C/LC_MESSAGES/messages.po

@@ -1,7 +1,7 @@
 msgid ""
 msgid ""
 msgstr ""
 msgstr ""
 "Report-Msgid-Bugs-To: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-05-02 19:17+0200\n"
+"POT-Creation-Date: 2023-05-10 01:29+0200\n"
 "Language: fr\n"
 "Language: fr\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 
 
@@ -274,7 +274,7 @@ msgstr "Supprimer un accès"
 msgid "Delete an existing HTTP access from a subdirectory of the SFTP space"
 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"
 msgstr "Retirer un accès HTTP existant d'un sous-dossier de l'espace SFTP"
 
 
-#: router.php:136 view.php:39
+#: router.php:137 view.php:39
 msgid "This service is currently under maintenance. No action can be taken on it until an administrator finishes repairing it."
 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."
 msgstr "Ce service est en cours de maintenance. Aucune action ne peut être effectuée avant qu'ane administrataire termine de le réparer."
 
 
@@ -332,12 +332,12 @@ msgstr "Adresse IP malformée."
 msgid "Domain malformed."
 msgid "Domain malformed."
 msgstr "Domaine malformé."
 msgstr "Domaine malformé."
 
 
-#: fn/ns.php:40 pg-act/ns/edit.php:25
+#: fn/ns.php:31 pg-act/ns/edit.php:25
 #, php-format
 #, php-format
 msgid "TTLs shorter than %s seconds are forbidden."
 msgid "TTLs shorter than %s seconds are forbidden."
 msgstr "Les TTLs plus courts que %s secondes sont interdits."
 msgstr "Les TTLs plus courts que %s secondes sont interdits."
 
 
-#: fn/ns.php:42 pg-act/ns/edit.php:27
+#: fn/ns.php:33 pg-act/ns/edit.php:27
 #, php-format
 #, php-format
 msgid "TTLs longer than %s seconds are forbidden."
 msgid "TTLs longer than %s seconds are forbidden."
 msgstr "Les TTLs plus longs que %s secondes sont interdits."
 msgstr "Les TTLs plus longs que %s secondes sont interdits."
@@ -371,7 +371,11 @@ msgstr "Clé de passe actuelle incorrecte."
 msgid "Password updated."
 msgid "Password updated."
 msgstr "Clé de passe mise à jour."
 msgstr "Clé de passe mise à jour."
 
 
-#: pg-act/auth/register.php:10 pg-act/auth/username.php:11
+#: pg-act/auth/register.php:4 pg-view/auth/register.php:3
+msgid "Registrations are currently closed on this installation."
+msgstr "Les inscriptions sont actuellement fermées sur cette installation."
+
+#: pg-act/auth/register.php:13 pg-act/auth/username.php:11
 msgid "This username is already taken."
 msgid "This username is already taken."
 msgstr "Cet identifiant est déjà pris."
 msgstr "Cet identifiant est déjà pris."
 
 
@@ -589,15 +593,16 @@ msgstr "L'identifiant interne du compte actuel est %s."
 msgid "New?"
 msgid "New?"
 msgstr "Nouvele ?"
 msgstr "Nouvele ?"
 
 
-#: pg-view/auth/login.php:1 pg-view/auth/register.php:14
+#: pg-view/auth/login.php:1 pg-view/auth/register.php:16
 msgid "Create an account"
 msgid "Create an account"
 msgstr "Créer un compte"
 msgstr "Créer un compte"
 
 
-#: pg-view/auth/login.php:4 pg-view/auth/register.php:4 pg-view/ht/index.php:64
+#: pg-view/auth/login.php:4 pg-view/auth/register.php:6 pg-view/ht/index.php:64
 msgid "Username"
 msgid "Username"
 msgstr "Identifiant"
 msgstr "Identifiant"
 
 
-#: pg-view/auth/login.php:8 pg-view/auth/register.php:9 pg-view/ht/index.php:68
+#: pg-view/auth/login.php:8 pg-view/auth/register.php:11
+#: pg-view/ht/index.php:68
 msgid "Password"
 msgid "Password"
 msgstr "Clé de passe"
 msgstr "Clé de passe"
 
 
@@ -618,7 +623,7 @@ msgstr "Mettre à jour la clé de passe"
 msgid "Already have an account?"
 msgid "Already have an account?"
 msgstr "Déjà un compte ?"
 msgstr "Déjà un compte ?"
 
 
-#: pg-view/auth/register.php:10
+#: pg-view/auth/register.php:12
 #, php-format
 #, php-format
 msgid "Minimum %1$s characters, or %2$s characters if it contains lowercase, uppercase and digit."
 msgid "Minimum %1$s characters, or %2$s characters if it contains lowercase, uppercase and digit."
 msgstr "Minimum %1$s caractères, ou %2$s caractères si elle contient minuscule, majuscule et chiffre."
 msgstr "Minimum %1$s caractères, ou %2$s caractères si elle contient minuscule, majuscule et chiffre."
@@ -652,7 +657,7 @@ msgstr "Un certificat Let's Encrypt sera obtenu."
 msgid "The domain must have the following records when the form is being processed."
 msgid "The domain must have the following records when the form is being processed."
 msgstr "Le domaine doit avoir les enregistrements suivant pendant le traitement du formulaire."
 msgstr "Le domaine doit avoir les enregistrements suivant pendant le traitement du formulaire."
 
 
-#: pg-view/ht/add-dns.php:25 pg-view/ns/form.ns.php:8 pg-view/ns/print.php:32
+#: pg-view/ht/add-dns.php:29 pg-view/ns/form.ns.php:8 pg-view/ns/print.php:32
 #: pg-view/ns/zone-add.php:6 pg-view/reg/ds.php:8 pg-view/reg/glue.php:8
 #: pg-view/ns/zone-add.php:6 pg-view/reg/ds.php:8 pg-view/reg/glue.php:8
 #: pg-view/reg/glue.php:15 pg-view/reg/ns.php:8 pg-view/reg/print.php:2
 #: pg-view/reg/glue.php:15 pg-view/reg/ns.php:8 pg-view/reg/print.php:2
 #: pg-view/reg/print.php:16 pg-view/reg/register.php:7
 #: pg-view/reg/print.php:16 pg-view/reg/register.php:7
@@ -660,12 +665,12 @@ msgstr "Le domaine doit avoir les enregistrements suivant pendant le traitement
 msgid "Domain"
 msgid "Domain"
 msgstr "Domaine"
 msgstr "Domaine"
 
 
-#: pg-view/ht/add-dns.php:27 pg-view/ht/add-onion.php:2
+#: pg-view/ht/add-dns.php:31 pg-view/ht/add-onion.php:2
 #: pg-view/ht/add-subdomain.php:4 pg-view/ht/add-subpath.php:4
 #: pg-view/ht/add-subdomain.php:4 pg-view/ht/add-subpath.php:4
 msgid "Target directory"
 msgid "Target directory"
 msgstr "Dossier ciblé"
 msgstr "Dossier ciblé"
 
 
-#: pg-view/ht/add-dns.php:36 pg-view/ht/add-onion.php:11
+#: pg-view/ht/add-dns.php:40 pg-view/ht/add-onion.php:11
 #: pg-view/ht/add-subdomain.php:13 pg-view/ht/add-subpath.php:13
 #: pg-view/ht/add-subdomain.php:13 pg-view/ht/add-subpath.php:13
 msgid "Setup access"
 msgid "Setup access"
 msgstr "Créer l'accès"
 msgstr "Créer l'accès"
@@ -753,36 +758,36 @@ msgstr "Configuration par <code>.htaccess</code>"
 msgid "You can change the way the HTTP server answers to requests in a directory by setting some directives in a file named <code>.htaccess</code> at the root of this directory. Only the following directives are allowed:"
 msgid "You can change the way the HTTP server answers to requests in a directory by setting some directives in a file named <code>.htaccess</code> 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é <code>.htaccess</code> à la racine de ce dossier. Seules les directives suivantes sont autorisées&nbsp;:"
 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é <code>.htaccess</code> à la racine de ce dossier. Seules les directives suivantes sont autorisées&nbsp;:"
 
 
-#: pg-view/ht/index.php:161
+#: pg-view/ht/index.php:163
 msgid "Accounts capabilities"
 msgid "Accounts capabilities"
 msgstr "Capacités des comptes"
 msgstr "Capacités des comptes"
 
 
-#: pg-view/ht/index.php:163
+#: pg-view/ht/index.php:165
 msgid "Testing"
 msgid "Testing"
 msgstr "De test"
 msgstr "De test"
 
 
-#: pg-view/ht/index.php:166 pg-view/ht/index.php:173
+#: pg-view/ht/index.php:168 pg-view/ht/index.php:175
 #, php-format
 #, php-format
 msgid "%s of SFTP quota"
 msgid "%s of SFTP quota"
 msgstr "Quota SFTP de %s"
 msgstr "Quota SFTP de %s"
 
 
-#: pg-view/ht/index.php:166 pg-view/ht/index.php:173
+#: pg-view/ht/index.php:168 pg-view/ht/index.php:175
 msgid "<abbr title=\"gibibyte\">GiB</abbr>"
 msgid "<abbr title=\"gibibyte\">GiB</abbr>"
 msgstr "<abbr title=\"gibioctet\">Gio</abbr>"
 msgstr "<abbr title=\"gibioctet\">Gio</abbr>"
 
 
-#: pg-view/ht/index.php:166 pg-view/ht/index.php:173
+#: pg-view/ht/index.php:168 pg-view/ht/index.php:175
 msgid "<abbr title=\"mebibyte\">MiB</abbr>"
 msgid "<abbr title=\"mebibyte\">MiB</abbr>"
 msgstr "<abbr title=\"mébioctet\">Mio</abbr>"
 msgstr "<abbr title=\"mébioctet\">Mio</abbr>"
 
 
-#: pg-view/ht/index.php:167
+#: pg-view/ht/index.php:169
 msgid "Let's Encrypt certificate from the staging environment (not trusted by clients)"
 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)"
 msgstr "Certificat Let's Encrypt de test (n'est pas reconnu par les clients)"
 
 
-#: pg-view/ht/index.php:170
+#: pg-view/ht/index.php:172
 msgid "Approved"
 msgid "Approved"
 msgstr "Approuvé"
 msgstr "Approuvé"
 
 
-#: pg-view/ht/index.php:174
+#: pg-view/ht/index.php:176
 msgid "Stable Let's Encrypt certificates"
 msgid "Stable Let's Encrypt certificates"
 msgstr "Vrai certificat Let's Encrypt"
 msgstr "Vrai certificat Let's Encrypt"
 
 

+ 25 - 20
locales/messages.pot

@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-05-02 19:17+0200\n"
+"POT-Creation-Date: 2023-05-10 01:29+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -286,7 +286,7 @@ msgstr ""
 msgid "Delete an existing HTTP access from a subdirectory of the SFTP space"
 msgid "Delete an existing HTTP access from a subdirectory of the SFTP space"
 msgstr ""
 msgstr ""
 
 
-#: router.php:136 view.php:39
+#: router.php:137 view.php:39
 msgid "This service is currently under maintenance. No action can be taken on it until an administrator finishes repairing it."
 msgid "This service is currently under maintenance. No action can be taken on it until an administrator finishes repairing it."
 msgstr ""
 msgstr ""
 
 
@@ -344,12 +344,12 @@ msgstr ""
 msgid "Domain malformed."
 msgid "Domain malformed."
 msgstr ""
 msgstr ""
 
 
-#: fn/ns.php:40 pg-act/ns/edit.php:25
+#: fn/ns.php:31 pg-act/ns/edit.php:25
 #, php-format
 #, php-format
 msgid "TTLs shorter than %s seconds are forbidden."
 msgid "TTLs shorter than %s seconds are forbidden."
 msgstr ""
 msgstr ""
 
 
-#: fn/ns.php:42 pg-act/ns/edit.php:27
+#: fn/ns.php:33 pg-act/ns/edit.php:27
 #, php-format
 #, php-format
 msgid "TTLs longer than %s seconds are forbidden."
 msgid "TTLs longer than %s seconds are forbidden."
 msgstr ""
 msgstr ""
@@ -383,7 +383,11 @@ msgstr ""
 msgid "Password updated."
 msgid "Password updated."
 msgstr ""
 msgstr ""
 
 
-#: pg-act/auth/register.php:10 pg-act/auth/username.php:11
+#: pg-act/auth/register.php:4 pg-view/auth/register.php:3
+msgid "Registrations are currently closed on this installation."
+msgstr ""
+
+#: pg-act/auth/register.php:13 pg-act/auth/username.php:11
 msgid "This username is already taken."
 msgid "This username is already taken."
 msgstr ""
 msgstr ""
 
 
@@ -601,15 +605,16 @@ msgstr ""
 msgid "New?"
 msgid "New?"
 msgstr ""
 msgstr ""
 
 
-#: pg-view/auth/login.php:1 pg-view/auth/register.php:14
+#: pg-view/auth/login.php:1 pg-view/auth/register.php:16
 msgid "Create an account"
 msgid "Create an account"
 msgstr ""
 msgstr ""
 
 
-#: pg-view/auth/login.php:4 pg-view/auth/register.php:4 pg-view/ht/index.php:64
+#: pg-view/auth/login.php:4 pg-view/auth/register.php:6 pg-view/ht/index.php:64
 msgid "Username"
 msgid "Username"
 msgstr ""
 msgstr ""
 
 
-#: pg-view/auth/login.php:8 pg-view/auth/register.php:9 pg-view/ht/index.php:68
+#: pg-view/auth/login.php:8 pg-view/auth/register.php:11
+#: pg-view/ht/index.php:68
 msgid "Password"
 msgid "Password"
 msgstr ""
 msgstr ""
 
 
@@ -630,7 +635,7 @@ msgstr ""
 msgid "Already have an account?"
 msgid "Already have an account?"
 msgstr ""
 msgstr ""
 
 
-#: pg-view/auth/register.php:10
+#: pg-view/auth/register.php:12
 #, php-format
 #, php-format
 msgid "Minimum %1$s characters, or %2$s characters if it contains lowercase, uppercase and digit."
 msgid "Minimum %1$s characters, or %2$s characters if it contains lowercase, uppercase and digit."
 msgstr ""
 msgstr ""
@@ -664,7 +669,7 @@ msgstr ""
 msgid "The domain must have the following records when the form is being processed."
 msgid "The domain must have the following records when the form is being processed."
 msgstr ""
 msgstr ""
 
 
-#: pg-view/ht/add-dns.php:25 pg-view/ns/form.ns.php:8 pg-view/ns/print.php:32
+#: pg-view/ht/add-dns.php:29 pg-view/ns/form.ns.php:8 pg-view/ns/print.php:32
 #: pg-view/ns/zone-add.php:6 pg-view/reg/ds.php:8 pg-view/reg/glue.php:8
 #: pg-view/ns/zone-add.php:6 pg-view/reg/ds.php:8 pg-view/reg/glue.php:8
 #: pg-view/reg/glue.php:15 pg-view/reg/ns.php:8 pg-view/reg/print.php:2
 #: pg-view/reg/glue.php:15 pg-view/reg/ns.php:8 pg-view/reg/print.php:2
 #: pg-view/reg/print.php:16 pg-view/reg/register.php:7
 #: pg-view/reg/print.php:16 pg-view/reg/register.php:7
@@ -672,12 +677,12 @@ msgstr ""
 msgid "Domain"
 msgid "Domain"
 msgstr ""
 msgstr ""
 
 
-#: pg-view/ht/add-dns.php:27 pg-view/ht/add-onion.php:2
+#: pg-view/ht/add-dns.php:31 pg-view/ht/add-onion.php:2
 #: pg-view/ht/add-subdomain.php:4 pg-view/ht/add-subpath.php:4
 #: pg-view/ht/add-subdomain.php:4 pg-view/ht/add-subpath.php:4
 msgid "Target directory"
 msgid "Target directory"
 msgstr ""
 msgstr ""
 
 
-#: pg-view/ht/add-dns.php:36 pg-view/ht/add-onion.php:11
+#: pg-view/ht/add-dns.php:40 pg-view/ht/add-onion.php:11
 #: pg-view/ht/add-subdomain.php:13 pg-view/ht/add-subpath.php:13
 #: pg-view/ht/add-subdomain.php:13 pg-view/ht/add-subpath.php:13
 msgid "Setup access"
 msgid "Setup access"
 msgstr ""
 msgstr ""
@@ -765,36 +770,36 @@ msgstr ""
 msgid "You can change the way the HTTP server answers to requests in a directory by setting some directives in a file named <code>.htaccess</code> at the root of this directory. Only the following directives are allowed:"
 msgid "You can change the way the HTTP server answers to requests in a directory by setting some directives in a file named <code>.htaccess</code> at the root of this directory. Only the following directives are allowed:"
 msgstr ""
 msgstr ""
 
 
-#: pg-view/ht/index.php:161
+#: pg-view/ht/index.php:163
 msgid "Accounts capabilities"
 msgid "Accounts capabilities"
 msgstr ""
 msgstr ""
 
 
-#: pg-view/ht/index.php:163
+#: pg-view/ht/index.php:165
 msgid "Testing"
 msgid "Testing"
 msgstr ""
 msgstr ""
 
 
-#: pg-view/ht/index.php:166 pg-view/ht/index.php:173
+#: pg-view/ht/index.php:168 pg-view/ht/index.php:175
 #, php-format
 #, php-format
 msgid "%s of SFTP quota"
 msgid "%s of SFTP quota"
 msgstr ""
 msgstr ""
 
 
-#: pg-view/ht/index.php:166 pg-view/ht/index.php:173
+#: pg-view/ht/index.php:168 pg-view/ht/index.php:175
 msgid "<abbr title=\"gibibyte\">GiB</abbr>"
 msgid "<abbr title=\"gibibyte\">GiB</abbr>"
 msgstr ""
 msgstr ""
 
 
-#: pg-view/ht/index.php:166 pg-view/ht/index.php:173
+#: pg-view/ht/index.php:168 pg-view/ht/index.php:175
 msgid "<abbr title=\"mebibyte\">MiB</abbr>"
 msgid "<abbr title=\"mebibyte\">MiB</abbr>"
 msgstr ""
 msgstr ""
 
 
-#: pg-view/ht/index.php:167
+#: pg-view/ht/index.php:169
 msgid "Let's Encrypt certificate from the staging environment (not trusted by clients)"
 msgid "Let's Encrypt certificate from the staging environment (not trusted by clients)"
 msgstr ""
 msgstr ""
 
 
-#: pg-view/ht/index.php:170
+#: pg-view/ht/index.php:172
 msgid "Approved"
 msgid "Approved"
 msgstr ""
 msgstr ""
 
 
-#: pg-view/ht/index.php:174
+#: pg-view/ht/index.php:176
 msgid "Stable Let's Encrypt certificates"
 msgid "Stable Let's Encrypt certificates"
 msgstr ""
 msgstr ""
 
 

+ 3 - 0
pg-act/auth/register.php

@@ -1,5 +1,8 @@
 <?php
 <?php
 
 
+if (CONF['common']['services']['auth'] !== 'enabled')
+	output(403, _('Registrations are currently closed on this installation.'));
+
 checkPasswordFormat($_POST['password']);
 checkPasswordFormat($_POST['password']);
 
 
 checkUsernameFormat($_POST['username']);
 checkUsernameFormat($_POST['username']);

+ 4 - 1
pg-view/auth/register.php

@@ -1,5 +1,7 @@
 <p><?= _('Already have an account?') ?> <a href="login"><?= _('Log in') ?></a></p>
 <p><?= _('Already have an account?') ?> <a href="login"><?= _('Log in') ?></a></p>
 
 
+<?= (CONF['common']['services']['auth'] !== 'enabled') ? '<p><strong>' . _('Registrations are currently closed on this installation.') . '</strong></p>' : '' ?>
+
 <form method="post">
 <form method="post">
 	<label for="username"><?= _('Username') ?></label>
 	<label for="username"><?= _('Username') ?></label>
 	<br>
 	<br>
@@ -11,5 +13,6 @@
 	</details>
 	</details>
 	<input autocomplete="new-password" id="password" minlength="8" maxlength="1024" pattern="<?= PASSWORD_REGEX ?>" required="" name="password" type="password" placeholder="<?= PLACEHOLDER_PASSWORD ?>">
 	<input autocomplete="new-password" id="password" minlength="8" maxlength="1024" pattern="<?= PASSWORD_REGEX ?>" required="" name="password" type="password" placeholder="<?= PLACEHOLDER_PASSWORD ?>">
 	<br>
 	<br>
-	<input type="submit" value="<?= _('Create an account') ?>">
+	<input<?= (CONF['common']['services']['auth'] !== 'enabled') ? ' disabled=""' : '' ?> type="submit" value="<?= _('Create an account') ?>">
 </form>
 </form>
+

+ 2 - 2
pg-view/index.php

@@ -2,8 +2,8 @@
 	<dl>
 	<dl>
 <?php
 <?php
 
 
-foreach (array_merge(['auth' => 'enabled'], CONF['common']['services']) as $service => $status) {
-	if ($status !== 'enabled' AND $status !== 'error')
+foreach (CONF['common']['services'] as $service => $status) {
+	if ($status === 'disabled')
 		continue;
 		continue;
 ?>
 ?>
 		<?= ($status === 'error') ? '<s>' : '' ?>
 		<?= ($status === 'error') ? '<s>' : '' ?>

+ 1 - 1
router.php

@@ -133,7 +133,7 @@ function displayFinalMessage($data) {
 }
 }
 
 
 if ($_POST !== []) {
 if ($_POST !== []) {
-	if (in_array(SERVICE, SERVICES_USER, true) AND CONF['common']['services'][SERVICE] !== 'enabled')
+	if (!in_array(CONF['common']['services']['auth'], ['enabled', 'no-registration'], true) OR (in_array(SERVICE, SERVICES_USER, true) AND CONF['common']['services'][SERVICE] !== 'enabled'))
 		output(503, _('This service is currently under maintenance. No action can be taken on it until an administrator finishes repairing it.'));
 		output(503, _('This service is currently under maintenance. No action can be taken on it until an administrator finishes repairing it.'));
 
 
 	// Protect against cross-site request forgery if a POST request is received
 	// Protect against cross-site request forgery if a POST request is received

+ 1 - 1
view.php

@@ -35,7 +35,7 @@ echo str_repeat('</li></ul>', count(TITLES_LINEAGE));
 		<main>
 		<main>
 <?php
 <?php
 
 
-if (in_array(SERVICE, SERVICES_USER, true) AND CONF['common']['services'][SERVICE] === 'error')
+if (CONF['common']['services']['auth'] === 'error' OR (in_array(SERVICE, SERVICES_USER, true) AND CONF['common']['services'][SERVICE] === 'error'))
 	echo '<p><strong>' . _('This service is currently under maintenance. No action can be taken on it until an administrator finishes repairing it.') . '</strong></p>';
 	echo '<p><strong>' . _('This service is currently under maintenance. No action can be taken on it until an administrator finishes repairing it.') . '</strong></p>';
 
 
 require ROOT_PATH . '/pg-view/' . PAGE_ADDRESS . '.php';
 require ROOT_PATH . '/pg-view/' . PAGE_ADDRESS . '.php';