From 3f454ff73cb6ebf591e49001e802cc6dd985c65d Mon Sep 17 00:00:00 2001 From: Ben0it-T <37017213+Ben0it-T@users.noreply.github.com> Date: Sun, 6 Oct 2024 10:15:59 +0200 Subject: [PATCH] Fix custom_logo Fix custom_logo if file not exists --- initialize.php | 9 +++++++-- password_change.php | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/initialize.php b/initialize.php index 18946798..362c9f7a 100644 --- a/initialize.php +++ b/initialize.php @@ -136,8 +136,13 @@ import('ttUser'); $user = new ttUser(null, $auth->getUserId()); if ($user->custom_logo) { - $smarty->assign('custom_logo', 'img/'.$user->group_id.'.png'); - $smarty->assign('mobile_custom_logo', '../img/'.$user->group_id.'.png'); + if (file_exists('img/'.$user->group_id.'.png')) { + $smarty->assign('custom_logo', 'img/'.$user->group_id.'.png'); + $smarty->assign('mobile_custom_logo', '../img/'.$user->group_id.'.png'); + } + else { + $user->custom_logo = 0; + } } $smarty->assign('user', $user); diff --git a/password_change.php b/password_change.php index d395b639..c527e9d5 100644 --- a/password_change.php +++ b/password_change.php @@ -29,8 +29,13 @@ $smarty->assign('i18n', $i18n->keys); } if ($user->custom_logo) { - $smarty->assign('custom_logo', 'img/'.$user->group_id.'.png'); - $smarty->assign('mobile_custom_logo', '../img/'.$user->group_id.'.png'); + if (file_exists('img/'.$user->group_id.'.png')) { + $smarty->assign('custom_logo', 'img/'.$user->group_id.'.png'); + $smarty->assign('mobile_custom_logo', '../img/'.$user->group_id.'.png'); + } + else { + $user->custom_logo = 0; + } } $smarty->assign('user', $user);