From 801b8bd047b3c2d426c6ef57faf5a0a4fc729e41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Jaussoin?= Date: Tue, 20 May 2025 15:51:32 +0200 Subject: [PATCH] Fix FLEXIAPI-305 Add specific error page for Space Expiration --- CHANGELOG.md | 1 + README.md | 2 +- flexiapi/app/Http/Middleware/SpaceCheck.php | 2 +- flexiapi/lang/fr.json | 4 +++- flexiapi/resources/views/errors/490.blade.php | 11 +++++++++++ 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 flexiapi/resources/views/errors/490.blade.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d88f75..770575d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ v2.0 - Fix FLEXIAPI-293 Remove the (long) outdated general documentation - Fix FLEXIAPI-224 Add a console script to send Space Expiration emails - Fix FLEXIAPI-297 Fix PrId and CallId validations +- Fix FLEXIAPI-305 Add specific error page for Space Expiration v1.6 ---- diff --git a/README.md b/README.md index 3caaab2..6afa2ac 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ The `POST /api/messages` endpoint allows you to send messages on the SIP network APP_LINPHONE_DAEMON_UNIX_PATH=/tmp/ld -If you have issues connecting to that socket check the [`systemd restrictions`](#systemd-restrictions) part of this document. +If you have issues connecting to that socket check the [`systemd restrictions`](INSTALL.md#systemd-restrictions) part of this document. The socket is located in the `/tmp` directory. diff --git a/flexiapi/app/Http/Middleware/SpaceCheck.php b/flexiapi/app/Http/Middleware/SpaceCheck.php index 3bb9feb..ba1abc7 100644 --- a/flexiapi/app/Http/Middleware/SpaceCheck.php +++ b/flexiapi/app/Http/Middleware/SpaceCheck.php @@ -26,7 +26,7 @@ class SpaceCheck Config::set('app.sip_domain', $space->domain); if ($request->user() && !$request->user()->superAdmin && $space?->isExpired()) { - abort(403, 'The related Space has expired'); + abort($request->expectsJson() ? 403 : 490, 'The related Space has expired'); } // Custom email integration diff --git a/flexiapi/lang/fr.json b/flexiapi/lang/fr.json index e49b6cf..aea9481 100644 --- a/flexiapi/lang/fr.json +++ b/flexiapi/lang/fr.json @@ -83,6 +83,7 @@ "Expired": "Expiré", "Export": "Exporter", "External Account": "Compte Externe", + "Expired Space": "Espace expiré", "Features": "Fonctionnalités", "Fill to change": "Remplir pour changer", "Fill the related columns if you want to add an external account as well": "Remplissez également les colonnes suivantes si vous souhaitez ajouter un compte externe", @@ -217,5 +218,6 @@ "You are going to permanently delete your account. Please enter your complete SIP address to confirm.": "Vous allez détruire défitivement votre compte. Veuillez entrer votre addresse SIP complète pour confirmer.", "You can now continue your registration process in the application": "Vous pouvez maintenant continuer le processus d'inscription dans l'application", "You didn't receive the code?": "Vous n'avez pas reçu le code ?", - "Your password was updated properly.": "Votre mot de passe a été mis à jour." + "Your password was updated properly.": "Votre mot de passe a été mis à jour.", + "Your space has expired. Access to your interface is now disabled, and your users can no longer benefit from the service. To reactivate your space, please contact your account manager.": "Votre espace est arrivé à expiration. L’accès à votre interface est désormais désactivé, et vos utilisateurs ne peuvent plus bénéficier du service. Pour réactiver votre espace, veuillez contacter votre responsable de compte." } \ No newline at end of file diff --git a/flexiapi/resources/views/errors/490.blade.php b/flexiapi/resources/views/errors/490.blade.php new file mode 100644 index 0000000..04fa788 --- /dev/null +++ b/flexiapi/resources/views/errors/490.blade.php @@ -0,0 +1,11 @@ +@extends('layouts.main') + +@section('content') + +

globe-hemisphere-west {{ __('Expired Space') }}

+ +

+ {{ __('Your space has expired. Access to your interface is now disabled, and your users can no longer benefit from the service. To reactivate your space, please contact your account manager.') }} +

+ +@endsection \ No newline at end of file