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/userController.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/userController.php')
| -rw-r--r-- | app/Controllers/userController.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index 69c1820e5..ab8dfb0b2 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -281,6 +281,9 @@ class FreshRSS_user_Controller extends Minz_ActionController { $passwordPlain = Minz_Request::param('new_user_passwordPlain', '', true); $new_user_language = Minz_Request::param('new_user_language', FreshRSS_Context::$user_conf->language); + $tos_enabled = file_exists(join_path(DATA_PATH, 'tos.html')); + $accept_tos = Minz_Request::param('accept_tos', false); + if ($system_conf->force_email_validation && empty($email)) { Minz_Request::bad( _t('user.email.feedback.required'), @@ -295,6 +298,13 @@ class FreshRSS_user_Controller extends Minz_ActionController { ); } + if ($tos_enabled && !$accept_tos) { + Minz_Request::bad( + _t('user.tos.feedback.invalid'), + array('c' => 'auth', 'a' => 'register') + ); + } + $ok = self::createUser($new_user_name, $email, $passwordPlain, '', array('language' => $new_user_language)); Minz_Request::_param('new_user_passwordPlain'); //Discard plain-text password ASAP $_POST['new_user_passwordPlain'] = ''; |
