diff --git a/cms/envs/common.py b/cms/envs/common.py index 72172c4a5c3e..99aba7a3e3d1 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -344,6 +344,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 014ad2798dbe..b0db120211cb 100644 --- a/cms/templates/howitworks.html +++ b/cms/templates/howitworks.html @@ -153,7 +153,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 eb4431ac0d7f..3bb1f1364f52 100644 --- a/cms/templates/widgets/header.html +++ b/cms/templates/widgets/header.html @@ -264,7 +264,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 431a8bc3bb43..011b2e4c5783 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -765,6 +765,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 295b355b4038..77c65a185cda 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,6 +162,7 @@ supportURL: this.supportURL, passwordResetSupportUrl: this.passwordResetSupportUrl, createAccountOption: this.createAccountOption, + showRegisterLinks: this.showRegisterLinks, hideAuthWarnings: this.hideAuthWarnings, pipelineUserDetails: this.pipelineUserDetails, enterpriseName: this.enterpriseName, @@ -186,7 +188,8 @@ 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 @@ -211,6 +214,7 @@ 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. diff --git a/lms/static/js/student_account/views/FormView.js b/lms/static/js/student_account/views/FormView.js index 676f24fa7a24..ce5cf0f0c7d9 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 19182781842d..9f6f2f3babb0 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 408def9cfad1..ba257c0b876b 100644 --- a/lms/static/js/student_account/views/RegisterView.js +++ b/lms/static/js/student_account/views/RegisterView.js @@ -88,7 +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('
'); diff --git a/lms/templates/header/navbar-not-authenticated.html b/lms/templates/header/navbar-not-authenticated.html index 9bb3023b8fdf..ef9f3039a67e 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() %>