diff --git a/app/assets/locales/en.json b/app/assets/locales/en.json
index de7aa671bf..18c00753d9 100644
--- a/app/assets/locales/en.json
+++ b/app/assets/locales/en.json
@@ -286,7 +286,11 @@
"allow_users_to_preupload_presentation": "Allow Users to Preupload Presentations",
"allow_users_to_preupload_presentation_description": "Users can preupload a presentation to be used as the default presentation for that specific room",
"default_visibility": "Default Recording Visibility",
- "default_visibility_description": "All newly created recordings will have this visibility by default"
+ "default_visibility_description": "All newly created recordings will have this visibility by default",
+ "confirm_terms": "Confirm terms and conditions",
+ "confirm_terms_description": "Require users to confirm terms and conditions",
+ "disable": "Disable",
+ "enable": "Enable"
},
"registration": {
"registration": "Registration",
@@ -401,7 +405,8 @@
"brand_image_deleted": "The brand image has been deleted.",
"privacy_policy_updated": "The privacy policy has been updated.",
"helpcenter_updated": "The help center link has been updated.",
- "terms_of_service_updated": "The terms of service have been updated."
+ "terms_of_service_updated": "The terms of service have been updated.",
+ "confirm_terms_updated": "The confirmation for terms of service have been updated."
},
"recording": {
"recording_visibility_updated": "The recording visibility has been updated.",
@@ -460,6 +465,11 @@
"resend_activation_link": "If you haven't received an activation email or if you are having a problem using it, click on the button below to request a new activation email.",
"resend_btn_lbl": "Resend Verification"
},
+ "confirm_terms_page": {
+ "title": "Accept Our Terms and Conditions",
+ "message": "To continue using BigBlueButton, please accept our terms and conditions.",
+ "confirm_btn_lbl": "Confirm"
+ },
"forms": {
"validations": {
"full_name": {
@@ -487,6 +497,9 @@
"required": "Please enter a password confirmation",
"match": "The passwords do not match"
},
+ "confirm_terms": {
+ "required": "Please accept the terms and conditions"
+ },
"emails": {
"required": "Please enter at least one valid email",
"list": "Please provide a comma separated list of valid emails (user@users.com,user1@users.com,user2@users.com)"
@@ -560,6 +573,12 @@
"password_confirmation": {
"label": "Confirm Password",
"placeholder": "Confirm password"
+ },
+ "terms": {
+ "label": "I Accept the terms and conditions"
+ },
+ "marketing": {
+ "label": "I would like to receive email updates"
}
}
},
diff --git a/app/assets/stylesheets/application.bootstrap.scss b/app/assets/stylesheets/application.bootstrap.scss
index 57e48faba3..62625d6f91 100644
--- a/app/assets/stylesheets/application.bootstrap.scss
+++ b/app/assets/stylesheets/application.bootstrap.scss
@@ -27,6 +27,7 @@
@import 'admin_panel';
@import 'pagination';
@import 'fonts';
+@import 'signup.scss';
html,
body {
diff --git a/app/assets/stylesheets/signup.scss b/app/assets/stylesheets/signup.scss
new file mode 100644
index 0000000000..8308585f2f
--- /dev/null
+++ b/app/assets/stylesheets/signup.scss
@@ -0,0 +1,39 @@
+// BigBlueButton open source conferencing system - http://www.bigbluebutton.org/.
+//
+// Copyright (c) 2022 BigBlueButton Inc. and by respective authors (see below).
+//
+// This program is free software; you can redistribute it and/or modify it under the
+// terms of the GNU Lesser General Public License as published by the Free Software
+// Foundation; either version 3.0 of the License, or (at your option) any later
+// version.
+//
+// Greenlight is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+// PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License along
+// with Greenlight; if not, see .
+
+// making it look like a normal checkbox removing FormControl Css
+input[type="checkbox"].form-control {
+ width: auto;
+ height: auto;
+ padding: 0;
+ margin: 0;
+ vertical-align: baseline;
+ position: static;
+ display: inline-block;
+ border: none;
+ background: none;
+ box-shadow: none;
+ outline: none;
+ opacity: 1;
+ -webkit-appearance: checkbox; /* for WebKit browsers */
+ -moz-appearance: checkbox; /* for Firefox */
+ appearance: checkbox;
+}
+
+// additional styling
+input[type="checkbox"].form-control {
+ margin-left: 0.5em;
+}
\ No newline at end of file
diff --git a/app/controllers/api/v1/users_controller.rb b/app/controllers/api/v1/users_controller.rb
index 364199ac45..d50a1684a2 100644
--- a/app/controllers/api/v1/users_controller.rb
+++ b/app/controllers/api/v1/users_controller.rb
@@ -100,7 +100,6 @@ def create
# Updates the values of a user
def update
user = User.find(params[:id])
-
# User can't change their own role
if params[:user][:role_id].present? && current_user == user && params[:user][:role_id] != user.role_id
return render_error errors: Rails.configuration.custom_error_msgs[:unauthorized], status: :forbidden
@@ -156,11 +155,13 @@ def change_password
private
def create_user_params
- @create_user_params ||= params.require(:user).permit(:name, :email, :password, :avatar, :language, :role_id, :invite_token)
+ @create_user_params ||= params.require(:user).permit(:name, :email, :password, :avatar, :language, :role_id,
+ :terms, :marketing, :invite_token)
end
def update_user_params
- @update_user_params ||= params.require(:user).permit(:name, :password, :avatar, :language, :role_id, :invite_token)
+ @update_user_params ||= params.require(:user).permit(:name, :password, :avatar, :language, :role_id,
+ :terms, :marketing, :invite_token)
end
def change_password_params
diff --git a/app/javascript/components/admin/site_settings/settings/Settings.jsx b/app/javascript/components/admin/site_settings/settings/Settings.jsx
index 22c9f5b40d..5b0c4f4a22 100644
--- a/app/javascript/components/admin/site_settings/settings/Settings.jsx
+++ b/app/javascript/components/admin/site_settings/settings/Settings.jsx
@@ -26,6 +26,7 @@ export default function Settings() {
const { t } = useTranslation();
const { data: siteSettings, isLoading } = useSiteSettings(['ShareRooms', 'PreuploadPresentation', 'DefaultRecordingVisibility']);
const updateDefaultRecordingVisibility = useUpdateSiteSetting('DefaultRecordingVisibility');
+ const updateConfirmTerms = useUpdateSiteSetting('ConfirmTerms');
if (isLoading) return null;
@@ -77,6 +78,19 @@ export default function Settings() {
{t('recording.unpublished')}
+
+
+ updateConfirmTerms.mutate({ value: 'false' })}>
+ {t('admin.site_settings.settings.disable')}
+
+ updateConfirmTerms.mutate({ value: 'true' })}>
+ {t('admin.site_settings.settings.enable')}
+
+
>
);
}
diff --git a/app/javascript/components/users/account_activation/ConfirmTerms.jsx b/app/javascript/components/users/account_activation/ConfirmTerms.jsx
new file mode 100644
index 0000000000..c83d8a7dc2
--- /dev/null
+++ b/app/javascript/components/users/account_activation/ConfirmTerms.jsx
@@ -0,0 +1,95 @@
+// BigBlueButton open source conferencing system - http://www.bigbluebutton.org/.
+//
+// Copyright (c) 2022 BigBlueButton Inc. and by respective authors (see below).
+//
+// This program is free software; you can redistribute it and/or modify it under the
+// terms of the GNU Lesser General Public License as published by the Free Software
+// Foundation; either version 3.0 of the License, or (at your option) any later
+// version.
+//
+// Greenlight is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+// PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License along
+// with Greenlight; if not, see .
+
+import React, { useState } from 'react';
+import {
+ Button, Card, Stack,
+} from 'react-bootstrap';
+import { useTranslation } from 'react-i18next';
+import Spinner from '../../shared_components/utilities/Spinner';
+import Logo from '../../shared_components/Logo';
+import { useAuth } from '../../../contexts/auth/AuthProvider';
+import useUpdateUser from '../../../hooks/mutations/users/useUpdateUser';
+
+export default function ConfirmTerms() {
+ const { t } = useTranslation();
+
+ const currentUser = useAuth();
+ const updateUserAPI = useUpdateUser(currentUser?.id);
+ const [isCheckedTerms, setIsCheckedTerms] = useState(currentUser?.terms || false);
+ const [isCheckedMarketing, setisCheckedMarketing] = useState(currentUser?.marketing || false);
+
+ // Update the user's confirm_terms value when the button is clicked
+ const handleConfirmTerms = () => {
+ updateUserAPI.mutate({
+ terms: isCheckedTerms,
+ marketing: isCheckedMarketing,
+ });
+ };
+
+ return (
+