From 5268895d4d0effb998af8e86cf79f8a2d7d53272 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 12 Mar 2018 00:10:52 +0000 Subject: [PATCH] Another try to migrate legacy role on system entry. --- WEB-INF/templates/footer.tpl | 2 +- initialize.php | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index d04ee534..56dcb6b0 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.17.38.4055 | Copyright © Anuko | +  Anuko Time Tracker 1.17.38.4056 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/initialize.php b/initialize.php index 53342b68..5dcd6fff 100644 --- a/initialize.php +++ b/initialize.php @@ -169,13 +169,6 @@ $msg = new ActionErrors(); // Notification messages (not errrors) for user. // Create an instance of ttUser class. This gets us most of user details. import('ttUser'); $user = new ttUser(null, $auth->getUserId()); -// Temporary code to assign role_id to users who don't yet have it. -/* -if ($user->login && !$user->role_id) { - $user->migrateLegacyRole(); - // Recycle User object, now with proper role_id. - $user = new ttUser(null, $auth->getUserId()); -}*/ if ($user->custom_logo) { $smarty->assign('custom_logo', 'images/'.$user->team_id.'.png'); $smarty->assign('mobile_custom_logo', '../images/'.$user->team_id.'.png'); @@ -206,6 +199,13 @@ if (!$lang) { // Load i18n file. $i18n->load($lang); +// Temporary code to assign role_id to users who don't yet have it. +if ($user->login && !$user->role_id) { + $user->migrateLegacyRole(); // Note: this requires initialized $i18n. + // Recycle User object, now with proper role_id. + $user = new ttUser(null, $auth->getUserId()); +} + // Assign things for smarty to use in template files. $smarty->assign('i18n', $i18n->keys); $smarty->assign('err', $err); -- 2.20.1