From 5d0d7b0f385893e5bedd5d6c4482fc1d54477a86 Mon Sep 17 00:00:00 2001 From: Miraty Date: Thu, 1 Jun 2023 15:14:42 +0200 Subject: [PATCH 1/9] Set a default error/exception handler --- router.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/router.php b/router.php index 258dcd5..74cacd8 100644 --- a/router.php +++ b/router.php @@ -1,5 +1,19 @@ ErrorAn error occured.'; +}); +register_shutdown_function(function () { // Also catch fatal errors + if (($error = error_get_last()) !== NULL) + throw new ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line']); +}); + const ROOT_PATH = __DIR__; define('CONF', parse_ini_file(ROOT_PATH . '/config.ini', true, INI_SCANNER_TYPED)); From a07baa7f62f457ac50525deb942d5e03224015e4 Mon Sep 17 00:00:00 2001 From: Miraty Date: Fri, 2 Jun 2023 22:45:27 +0200 Subject: [PATCH 2/9] Warn testing accounts users on every page --- locales/fr/C/LC_MESSAGES/messages.po | 16 ++++++++++++---- locales/messages.pot | 16 ++++++++++++---- pg-view/auth/index.php | 2 +- view.php | 6 +++--- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/locales/fr/C/LC_MESSAGES/messages.po b/locales/fr/C/LC_MESSAGES/messages.po index 48aa09f..88c8271 100644 --- a/locales/fr/C/LC_MESSAGES/messages.po +++ b/locales/fr/C/LC_MESSAGES/messages.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-18 23:15+0200\n" +"POT-Creation-Date: 2023-06-02 22:42+0200\n" "Language: fr\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -274,18 +274,26 @@ msgstr "Supprimer un accès" 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:151 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:147 +#: router.php:161 msgid "You need to be logged in to do this." msgstr "Vous devez être connecté·e à un compte pour faire cela." -#: router.php:149 +#: router.php:163 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." +#: view.php:19 +msgid "You are using a testing account. It may be deleted anytime." +msgstr "Vous utilisez un compte de test. Il risque d'être supprimé n'importe quand." + +#: view.php:19 +msgid "Read more" +msgstr "En savoir plus" + #: view.php:21 msgid "Anonymous" msgstr "Anonyme" diff --git a/locales/messages.pot b/locales/messages.pot index 0a47c09..0510563 100644 --- a/locales/messages.pot +++ b/locales/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-18 23:15+0200\n" +"POT-Creation-Date: 2023-06-02 22:42+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -286,18 +286,26 @@ msgstr "" msgid "Delete an existing HTTP access from a subdirectory of the SFTP space" msgstr "" -#: router.php:137 view.php:39 +#: router.php:151 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:147 +#: router.php:161 msgid "You need to be logged in to do this." msgstr "" -#: router.php:149 +#: router.php:163 msgid "This account doesn't exist anymore. Log out to end this ghost session." msgstr "" +#: view.php:19 +msgid "You are using a testing account. It may be deleted anytime." +msgstr "" + +#: view.php:19 +msgid "Read more" +msgstr "" + #: view.php:21 msgid "Anonymous" msgstr "" diff --git a/pg-view/auth/index.php b/pg-view/auth/index.php index 47426ee..e0d156b 100644 --- a/pg-view/auth/index.php +++ b/pg-view/auth/index.php @@ -1,6 +1,6 @@ -

+

-

+

- ?') ?> + ?') ?> ' . _('You are using a testing account. It may be deleted anytime.') . ' ' . _('Read more') . '' : '' ?> - +