Minor fixes

This commit is contained in:
Miraty 2023-03-18 18:38:27 +01:00
parent d41ac85b55
commit 80bef2ca8c
4 changed files with 8 additions and 6 deletions

View file

@ -291,7 +291,7 @@ msgstr "Anonyme"
#: view.php:44 #: view.php:44
#, php-format #, php-format
msgid "This form won't be accepted because you need to %slog in%s first." 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 #: view.php:51
#, php-format #, php-format

View file

@ -93,7 +93,7 @@ $quota = ($_SESSION['type'] ?? '' === 'approved') ? CONF['ht']['user_quota_appro
</dd> </dd>
<dt><?= _('Username') ?></dt> <dt><?= _('Username') ?></dt>
<dd> <dd>
<code><?= isset($_SESSION['display-username']) ? $_SESSION['display-username'] : '&lt;username&gt;'; ?></code> <code><?= defined('DISPLAY_USERNAME') ? DISPLAY_USERNAME : '&lt;username&gt;' ?></code>
</dd> </dd>
<dt><?= _('Password') ?></dt> <dt><?= _('Password') ?></dt>
<dd> <dd>

View file

@ -17,6 +17,9 @@ $username = hashUsername($auth_data['username']);
if (usernameExists($username) !== true) if (usernameExists($username) !== true)
deny(); deny();
if (!in_array('ht', explode(',', query('select', 'users', ['username' => $username], 'services')[0]), true))
deny();
$id = query('select', 'users', ['username' => $username], 'id')[0]; $id = query('select', 'users', ['username' => $username], 'id')[0];
if (checkPassword($id, $auth_data['password']) !== true) if (checkPassword($id, $auth_data['password']) !== true)
@ -36,4 +39,3 @@ echo '
} }
'; ';
http_response_code(200); http_response_code(200);