Skip to content

Commit 3ee3598

Browse files
committed
Display login_top region in Not-Allowed-Login form - refs BT#18759
1 parent bfec28d commit 3ee3598

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

main/inc/lib/api.lib.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3951,7 +3951,8 @@ function api_not_allowed(
39513951
}
39523952

39533953
$tplPlugin = new AppPlugin();
3954-
$pluginRegionContent = $tplPlugin->load_region('login_bottom', $tpl, true);
3954+
$loginTopRegionContent = $tplPlugin->load_region('login_top', $tpl, true);
3955+
$loginBottomRegionContent = $tplPlugin->load_region('login_bottom', $tpl, true);
39553956

39563957
if (!empty($_SERVER['REQUEST_URI']) &&
39573958
(
@@ -3993,15 +3994,15 @@ function api_not_allowed(
39933994
$content .= "<p style='text-align:center'><a href='#' onclick='$(this).parent().next().toggle()'>".get_lang('LoginWithExternalAccount')."</a></p>";
39943995
$content .= "<div style='display:none;'>";
39953996
}
3997+
$content .= PHP_EOL.$loginTopRegionContent;
39963998
$content .= '<div class="well">';
39973999
$content .= $form->returnForm();
39984000
$content .= '</div>';
4001+
$content .= PHP_EOL.$loginBottomRegionContent;
39994002
if (api_is_cas_activated()) {
40004003
$content .= "</div>";
40014004
}
40024005

4003-
$content .= PHP_EOL.$pluginRegionContent;
4004-
40054006
if (!empty($courseCode)) {
40064007
$content .= '<hr/><p style="text-align:center"><a href="'.$home_url.'">'.
40074008
get_lang('ReturnToCourseHomepage').'</a></p>';
@@ -4048,9 +4049,11 @@ function api_not_allowed(
40484049
$msg .= "<div style='display:none;'>";
40494050
}
40504051
$form = api_get_not_allowed_login_form();
4052+
$msg .= PHP_EOL.$loginTopRegionContent;
40514053
$msg .= '<div class="well">';
40524054
$msg .= $form->returnForm();
40534055
$msg .= '</div>';
4056+
$msg .= PHP_EOL.$loginBottomRegionContent;
40544057
if ($casEnabled) {
40554058
$msg .= "</div>";
40564059
}
@@ -4072,14 +4075,14 @@ function api_not_allowed(
40724075

40734076
if (api_is_anonymous()) {
40744077
$form = api_get_not_allowed_login_form();
4078+
$msg .= PHP_EOL.$loginTopRegionContent;
40754079
$msg .= '<div class="well">';
40764080
$msg .= $form->returnForm();
40774081
$msg .= '</div>';
4082+
$msg .= PHP_EOL.$loginBottomRegionContent;
40784083
}
40794084
}
40804085

4081-
$msg .= PHP_EOL.$pluginRegionContent;
4082-
40834086
$tpl->assign('content', $msg);
40844087
$tpl->display_one_col_template();
40854088
exit;

0 commit comments

Comments
 (0)