aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/userController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-04-08 14:49:03 +0200
committerGravatar GitHub <noreply@github.com> 2024-04-08 14:49:03 +0200
commit8280e3d88edb93211fcf2aec15a7b4c1ae4d3813 (patch)
treed4c6595fe0e740abf4f542dcfd5bd0878f3bfece /app/Controllers/userController.php
parent72933b301edf0379778e8c5f8ffee5ac06bb076b (diff)
Allow admins to create user even when there are TOS (#6269)
fix https://github.com/FreshRSS/FreshRSS/issues/5409
Diffstat (limited to 'app/Controllers/userController.php')
-rw-r--r--app/Controllers/userController.php17
1 files changed, 8 insertions, 9 deletions
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php
index 9bcf13d6f..f23ae008e 100644
--- a/app/Controllers/userController.php
+++ b/app/Controllers/userController.php
@@ -317,8 +317,14 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController {
);
}
- $tos_enabled = file_exists(TOS_FILENAME);
- $accept_tos = Minz_Request::paramBoolean('accept_tos');
+ if (!FreshRSS_Auth::hasAccess('admin')) {
+ // TODO: We may want to ask the user to accept TOS before first login
+ $tos_enabled = file_exists(TOS_FILENAME);
+ $accept_tos = Minz_Request::paramBoolean('accept_tos');
+ if ($tos_enabled && !$accept_tos) {
+ Minz_Request::bad(_t('user.tos.feedback.invalid'), $badRedirectUrl);
+ }
+ }
if (FreshRSS_Context::systemConf()->force_email_validation && empty($email)) {
Minz_Request::bad(
@@ -334,13 +340,6 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController {
);
}
- if ($tos_enabled && !$accept_tos) {
- Minz_Request::bad(
- _t('user.tos.feedback.invalid'),
- $badRedirectUrl
- );
- }
-
$ok = self::createUser($new_user_name, $email, $passwordPlain, [
'language' => Minz_Request::paramString('new_user_language') ?: FreshRSS_Context::userConf()->language,
'timezone' => Minz_Request::paramString('new_user_timezone'),