From 80bef2ca8c457fc54de6e312dfa4edc6c86c1cba Mon Sep 17 00:00:00 2001 From: Miraty Date: Sat, 18 Mar 2023 18:38:27 +0100 Subject: [PATCH] Minor fixes --- locales/fr/C/LC_MESSAGES/messages.po | 4 ++-- locales/messages.pot | 2 +- pg-view/ht/index.php | 4 ++-- sftpgo-auth.php | 4 +++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/locales/fr/C/LC_MESSAGES/messages.po b/locales/fr/C/LC_MESSAGES/messages.po index 741c314..4ec02f6 100644 --- a/locales/fr/C/LC_MESSAGES/messages.po +++ b/locales/fr/C/LC_MESSAGES/messages.po @@ -291,7 +291,7 @@ msgstr "Anonyme" #: view.php:44 #, php-format msgid "This form won't be accepted because you need to %slog in%s first." -msgstr "Ce forumulaire ne sera pas accepté car il faut %sse connecter%s d'abord." +msgstr "Ce formulaire ne sera pas accepté car il faut %sse connecter%s d'abord." #: view.php:51 #, php-format @@ -694,7 +694,7 @@ msgstr "Ajouter un accès de site" #: pg-view/ht/index.php:40 #, php-format -msgid "In order to be able to setup 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." +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 diff --git a/locales/messages.pot b/locales/messages.pot index 04f3a94..20ee9ac 100644 --- a/locales/messages.pot +++ b/locales/messages.pot @@ -693,7 +693,7 @@ msgstr "" #: pg-view/ht/index.php:40 #, php-format -msgid "In order to be able to setup 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." +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 diff --git a/pg-view/ht/index.php b/pg-view/ht/index.php index 841e69c..c196d38 100644 --- a/pg-view/ht/index.php +++ b/pg-view/ht/index.php @@ -37,7 +37,7 @@ else {

-

a-z', 'A-Z', '0-9', '_', '-') ?>

+

a-z', 'A-Z', '0-9', '_', '-') ?>

@@ -93,7 +93,7 @@ $quota = ($_SESSION['type'] ?? '' === 'approved') ? CONF['ht']['user_quota_appro
- +
diff --git a/sftpgo-auth.php b/sftpgo-auth.php index 92a12ed..16741c8 100644 --- a/sftpgo-auth.php +++ b/sftpgo-auth.php @@ -17,6 +17,9 @@ $username = hashUsername($auth_data['username']); if (usernameExists($username) !== true) deny(); +if (!in_array('ht', explode(',', query('select', 'users', ['username' => $username], 'services')[0]), true)) + deny(); + $id = query('select', 'users', ['username' => $username], 'id')[0]; if (checkPassword($id, $auth_data['password']) !== true) @@ -36,4 +39,3 @@ echo ' } '; http_response_code(200); -