Skip to content

Commit 4881433

Browse files
authored
Merge pull request #6021 from christianbeeznest/ras-22335
User: Add custom login template support for session expiration page - refs BT#22335
2 parents 27b344e + b7accd6 commit 4881433

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

main/inc/lib/api.lib.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4030,6 +4030,18 @@ function api_not_allowed(
40304030

40314031
global $this_section;
40324032

4033+
// Check if a custom file (login.tpl) exists for custompages included overrides
4034+
if ((!isset($user_id) || api_is_anonymous()) && CustomPages::enabled()) {
4035+
$customLoginTemplate = Template::findTemplateFilePath('custompage/login.tpl');
4036+
if (file_exists(api_get_path(SYS_TEMPLATE_PATH) . $customLoginTemplate)) {
4037+
$tpl = new Template(null, false, false);
4038+
$content = $tpl->fetch($customLoginTemplate);
4039+
$tpl->assign('content', $content);
4040+
$tpl->display_one_col_template();
4041+
exit;
4042+
}
4043+
}
4044+
40334045
if (CustomPages::enabled() && !isset($user_id)) {
40344046
if (empty($user_id)) {
40354047
// Why the CustomPages::enabled() need to be to set the request_uri

0 commit comments

Comments
 (0)