|
119 | 119 | $htmlHeadXtra[] = api_get_password_checker_js('#username', '#pass1');
|
120 | 120 | // User is not allowed if Terms and Conditions are disabled and
|
121 | 121 | // registration is disabled too.
|
122 |
| -$isNotAllowedHere = ('false' === api_get_setting('allow_terms_conditions') && 'false' === api_get_setting('allow_registration')); |
123 |
| -if ($isNotAllowedHere) { |
124 |
| - 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.')); |
| 122 | +$isCreatingIntroPage = isset($_GET['create_intro_page']); |
| 123 | +$isPlatformAdmin = api_is_platform_admin(); |
| 124 | + |
| 125 | +$isNotAllowedHere = ( |
| 126 | + 'false' === api_get_setting('allow_terms_conditions') && |
| 127 | + 'false' === api_get_setting('allow_registration') |
| 128 | +); |
| 129 | + |
| 130 | +if ($isNotAllowedHere && !($isCreatingIntroPage && $isPlatformAdmin)) { |
| 131 | + api_not_allowed( |
| 132 | + true, |
| 133 | + 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.') |
| 134 | + ); |
125 | 135 | }
|
126 | 136 |
|
127 | 137 | $settingConditions = api_get_setting('profile.show_conditions_to_user', true);
|
|
633 | 643 | $toolName = get_lang('Terms and Conditions');
|
634 | 644 | }
|
635 | 645 |
|
636 |
| -// Forbidden to self-register |
637 |
| -if ($isNotAllowedHere) { |
638 |
| - api_not_allowed( |
639 |
| - true, |
640 |
| - get_lang( |
641 |
| - '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.' |
642 |
| - ) |
643 |
| - ); |
644 |
| -} |
645 |
| - |
646 | 646 | if ('approval' === api_get_setting('allow_registration')) {
|
647 | 647 | $content .= Display::return_message(get_lang('Your account has to be approved'));
|
648 | 648 | }
|
|
658 | 658 | // Terms and conditions
|
659 | 659 | $infoMessage = '';
|
660 | 660 | if ('true' === api_get_setting('allow_terms_conditions')) {
|
661 |
| - if (!api_is_platform_admin()) { |
| 661 | + if (!$isPlatformAdmin) { |
662 | 662 | if ('true' === api_get_setting('ticket.show_terms_if_profile_completed')) {
|
663 | 663 | $userId = api_get_user_id();
|
664 | 664 | if (empty($userId) && isset($termRegistered['user_id'])) {
|
|
1381 | 1381 | . '</div>' . $content;
|
1382 | 1382 | }
|
1383 | 1383 |
|
1384 |
| - if (isset($_GET['create_intro_page']) && api_is_platform_admin()) { |
| 1384 | + if ($isCreatingIntroPage && $isPlatformAdmin) { |
1385 | 1385 | $user = api_get_user_entity();
|
1386 | 1386 |
|
1387 | 1387 | if ($introPage) {
|
|
0 commit comments