Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions public/main/auth/inscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,19 @@
$htmlHeadXtra[] = api_get_password_checker_js('#username', '#pass1');
// User is not allowed if Terms and Conditions are disabled and
// registration is disabled too.
$isNotAllowedHere = ('false' === api_get_setting('allow_terms_conditions') && 'false' === api_get_setting('allow_registration'));
if ($isNotAllowedHere) {
api_not_allowed(true, get_lang('Sorry, you are trying to access the registration page for this portal, but registration is currently disabled. Please contact the administrator (see contact information in the footer). If you already have an account on this site.'));
$isCreatingIntroPage = isset($_GET['create_intro_page']);
$isPlatformAdmin = api_is_platform_admin();

$isNotAllowedHere = (
'false' === api_get_setting('allow_terms_conditions') &&
'false' === api_get_setting('allow_registration')
);

if ($isNotAllowedHere && !($isCreatingIntroPage && $isPlatformAdmin)) {
api_not_allowed(
true,
get_lang('Sorry, you are trying to access the registration page for this portal, but registration is currently disabled. Please contact the administrator (see contact information in the footer). If you already have an account on this site.')
);
}

$settingConditions = api_get_setting('profile.show_conditions_to_user', true);
Expand Down Expand Up @@ -633,16 +643,6 @@
$toolName = get_lang('Terms and Conditions');
}

// Forbidden to self-register
if ($isNotAllowedHere) {
api_not_allowed(
true,
get_lang(
'Sorry, you are trying to access the registration page for this portal, but registration is currently disabled. Please contact the administrator (see contact information in the footer). If you already have an account on this site.'
)
);
}

if ('approval' === api_get_setting('allow_registration')) {
$content .= Display::return_message(get_lang('Your account has to be approved'));
}
Expand All @@ -658,7 +658,7 @@
// Terms and conditions
$infoMessage = '';
if ('true' === api_get_setting('allow_terms_conditions')) {
if (!api_is_platform_admin()) {
if (!$isPlatformAdmin) {
if ('true' === api_get_setting('ticket.show_terms_if_profile_completed')) {
$userId = api_get_user_id();
if (empty($userId) && isset($termRegistered['user_id'])) {
Expand Down Expand Up @@ -1381,7 +1381,7 @@
. '</div>' . $content;
}

if (isset($_GET['create_intro_page']) && api_is_platform_admin()) {
if ($isCreatingIntroPage && $isPlatformAdmin) {
$user = api_get_user_entity();

if ($introPage) {
Expand Down
Loading