diff --git a/cms/envs/common.py b/cms/envs/common.py index c0104badced7..5ede0b2acb94 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -347,6 +347,9 @@ # Allow public account creation 'ALLOW_PUBLIC_ACCOUNT_CREATION': True, + # Allow showing the registration links + 'SHOW_REGISTRATION_LINKS': True, + # Whether or not the dynamic EnrollmentTrackUserPartition should be registered. 'ENABLE_ENROLLMENT_TRACK_USER_PARTITION': True, diff --git a/cms/templates/howitworks.html b/cms/templates/howitworks.html index b04a207eba6f..d21dff2d66a5 100644 --- a/cms/templates/howitworks.html +++ b/cms/templates/howitworks.html @@ -154,7 +154,7 @@

${_("Work in Teams")}

-% if static.get_value('ALLOW_PUBLIC_ACCOUNT_CREATION', settings.FEATURES.get('ALLOW_PUBLIC_ACCOUNT_CREATION')): +% if static.get_value('ALLOW_PUBLIC_ACCOUNT_CREATION', settings.FEATURES.get('ALLOW_PUBLIC_ACCOUNT_CREATION')) and settings.FEATURES.get('SHOW_REGISTRATION_LINKS', True):
diff --git a/cms/templates/widgets/header.html b/cms/templates/widgets/header.html index 48b818da95a5..6f110caf2e88 100644 --- a/cms/templates/widgets/header.html +++ b/cms/templates/widgets/header.html @@ -268,7 +268,7 @@

${_("Account Navigation")}

- % if static.get_value('ALLOW_PUBLIC_ACCOUNT_CREATION', settings.FEATURES.get('ALLOW_PUBLIC_ACCOUNT_CREATION')): + % if static.get_value('ALLOW_PUBLIC_ACCOUNT_CREATION', settings.FEATURES.get('ALLOW_PUBLIC_ACCOUNT_CREATION')) and settings.FEATURES.get('SHOW_REGISTRATION_LINKS', True): diff --git a/lms/envs/common.py b/lms/envs/common.py index 2b2af836c059..2b1f8ce22e35 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -777,6 +777,15 @@ # .. toggle_tickets: https://openedx.atlassian.net/browse/YONK-513 'ALLOW_PUBLIC_ACCOUNT_CREATION': True, + # .. toggle_name: FEATURES['SHOW_REGISTRATION_LINKS'] + # .. toggle_implementation: DjangoSetting + # .. toggle_default: True + # .. toggle_description: Allow registration links. If this is disabled, users will no longer see buttons to the + # the signup page. + # .. toggle_use_cases: open_edx + # .. toggle_creation_date: 2023-03-27 + 'SHOW_REGISTRATION_LINKS': True, + # .. toggle_name: FEATURES['ENABLE_COOKIE_CONSENT'] # .. toggle_implementation: DjangoSetting # .. toggle_default: False diff --git a/lms/static/js/student_account/views/AccessView.js b/lms/static/js/student_account/views/AccessView.js index 7a2e1a858d36..6c5b3d2be696 100644 --- a/lms/static/js/student_account/views/AccessView.js +++ b/lms/static/js/student_account/views/AccessView.js @@ -75,7 +75,8 @@ this.platformName = options.platform_name; this.supportURL = options.support_link; this.passwordResetSupportUrl = options.password_reset_support_link; - this.createAccountOption = options.account_creation_allowed; + this.createAccountOption = options.account_creation_allowed && options.register_links_allowed; + this.showRegisterLinks = options.register_links_allowed this.hideAuthWarnings = options.hide_auth_warnings || false; this.pipelineUserDetails = options.third_party_auth.pipeline_user_details; this.enterpriseName = options.enterprise_name || ''; @@ -161,7 +162,7 @@ supportURL: this.supportURL, passwordResetSupportUrl: this.passwordResetSupportUrl, createAccountOption: this.createAccountOption, - hideAuthWarnings: this.hideAuthWarnings, + showRegisterLinks: this.showRegisterLinks,hideAuthWarnings: this.hideAuthWarnings, pipelineUserDetails: this.pipelineUserDetails, enterpriseName: this.enterpriseName, enterpriseSlugLoginURL: this.enterpriseSlugLoginURL, @@ -186,8 +187,9 @@ this.subview.passwordHelp = new PasswordResetView({ fields: data.fields, - model: this.resetModel - }); + model: this.resetModel, + showRegisterLinks: this.showRegisterLinks + }); // Listen for 'password-email-sent' event to toggle sub-views this.listenTo(this.subview.passwordHelp, 'password-email-sent', this.passwordEmailSent); @@ -211,7 +213,8 @@ hideAuthWarnings: this.hideAuthWarnings, is_require_third_party_auth_enabled: this.is_require_third_party_auth_enabled, enableCoppaCompliance: this.enable_coppa_compliance, - }); + showRegisterLinks: this.showRegisterLinks + }); // Listen for 'auth-complete' event so we can enroll/redirect the user appropriately. this.listenTo(this.subview.register, 'auth-complete', this.authComplete); diff --git a/lms/static/js/student_account/views/FormView.js b/lms/static/js/student_account/views/FormView.js index d5cbb75868bd..5a9a269612af 100644 --- a/lms/static/js/student_account/views/FormView.js +++ b/lms/static/js/student_account/views/FormView.js @@ -35,6 +35,7 @@ initialize: function(data) { this.model = data.model; + this.showRegisterLinks = data.showRegisterLinks; this.preRender(data); this.tpl = $(this.tpl).html(); @@ -97,6 +98,7 @@ supplementalText: data[i].supplementalText || '', supplementalLink: data[i].supplementalLink || '', loginIssueSupportLink: data[i].loginIssueSupportLink || '', + showRegisterLinks: this.showRegisterLinks, isEnterpriseEnable: this.isEnterpriseEnable }))); } diff --git a/lms/static/js/student_account/views/LoginView.js b/lms/static/js/student_account/views/LoginView.js index 10c6bc309cdd..8357ac6fa885 100644 --- a/lms/static/js/student_account/views/LoginView.js +++ b/lms/static/js/student_account/views/LoginView.js @@ -52,6 +52,7 @@ this.supportURL = data.supportURL; this.passwordResetSupportUrl = data.passwordResetSupportUrl; this.createAccountOption = data.createAccountOption; + this.showRegisterLinks = data.showRegisterLinks; this.accountActivationMessages = data.accountActivationMessages; this.accountRecoveryMessages = data.accountRecoveryMessages; this.hideAuthWarnings = data.hideAuthWarnings; diff --git a/lms/static/js/student_account/views/RegisterView.js b/lms/static/js/student_account/views/RegisterView.js index af6353ac407a..f463c6bfd2f6 100644 --- a/lms/static/js/student_account/views/RegisterView.js +++ b/lms/static/js/student_account/views/RegisterView.js @@ -88,8 +88,8 @@ requiredStr: this.requiredStr, optionalStr: fields[i].name === 'marketing_emails_opt_in' ? '' : this.optionalStr, supplementalText: fields[i].supplementalText || '', - supplementalLink: fields[i].supplementalLink || '' - }))); + supplementalLink: fields[i].supplementalLink || '', + showRegisterLinks: this.showRegisterLinks}))); } html.push('
'); return html; diff --git a/lms/templates/header/navbar-not-authenticated.html b/lms/templates/header/navbar-not-authenticated.html index 47aa9abd2ced..945e494bb0a7 100644 --- a/lms/templates/header/navbar-not-authenticated.html +++ b/lms/templates/header/navbar-not-authenticated.html @@ -19,7 +19,7 @@ courses_are_browsable = settings.FEATURES.get('COURSES_ARE_BROWSABLE') allows_login = not settings.FEATURES['DISABLE_LOGIN_BUTTON'] and not combined_login_and_register can_discover_courses = settings.FEATURES.get('ENABLE_COURSE_DISCOVERY') - allow_public_account_creation = static.get_value('ALLOW_PUBLIC_ACCOUNT_CREATION', settings.FEATURES.get('ALLOW_PUBLIC_ACCOUNT_CREATION')) + allow_public_account_creation = static.get_value('ALLOW_PUBLIC_ACCOUNT_CREATION', settings.FEATURES.get('ALLOW_PUBLIC_ACCOUNT_CREATION')) and settings.FEATURES.get('SHOW_REGISTRATION_LINKS', True) should_redirect_to_authn_mfe = should_redirect_to_authn_microfrontend() %>