diff options
| author | 2019-09-13 17:33:18 +0200 | |
|---|---|---|
| committer | 2019-09-17 09:21:23 +0200 | |
| commit | a2ed6626c2f4e85878f775abcac897a1fd3a1f42 (patch) | |
| tree | 6a12718165c7d054107c587e2b34cdc25c3cc7e7 /app/Controllers/indexController.php | |
| parent | 80590daeb3627e5712be15fdc4bd98f0e2c40ea5 (diff) | |
Add support for terms of service
This feature is optional. It is based on the presence of a
`data/tos.html` file that an administrator can create. If this file
exists, FreshRSS will automatically add a "ToS" checkbox on the
registration page that users must check to be able to create their
account.
Diffstat (limited to 'app/Controllers/indexController.php')
| -rwxr-xr-x | app/Controllers/indexController.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index 4023492d2..2d791ce1d 100755 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -260,6 +260,23 @@ class FreshRSS_index_Controller extends Minz_ActionController { } /** + * This action displays the EULA page of FreshRSS. + * This page is enabled only if admin created a data/tos.html file. + * The content of the page is the content of data/tos.html. + * It returns 404 if there is no EULA. + */ + public function tosAction() { + $terms_of_service = file_get_contents(join_path(DATA_PATH, 'tos.html')); + if (!$terms_of_service) { + Minz_Error::error(404); + } + + $this->view->terms_of_service = $terms_of_service; + $this->view->can_register = !max_registrations_reached(); + Minz_View::prependTitle(_t('index.tos.title') . ' ยท '); + } + + /** * This action displays logs of FreshRSS for the current user. */ public function logsAction() { |
