From 610b9c8154ea57b71c3f599e6a63f9fd16b1bc04 Mon Sep 17 00:00:00 2001
From: Prasad <prasad@vtiger.com>
Date: Sat, 2 Oct 2021 10:15:37 +0530
Subject: [PATCH] PHP warning eliminated for Login

---
 modules/Users/models/Record.php |  2 +-
 modules/Users/views/Login.php   | 15 ++++++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/modules/Users/models/Record.php b/modules/Users/models/Record.php
index b6a0c43c6..04330f22b 100644
--- a/modules/Users/models/Record.php
+++ b/modules/Users/models/Record.php
@@ -653,7 +653,7 @@ class Users_Record_Model extends Vtiger_Record_Model {
 	 * @return string
 	 */
 	function getCurrentUserActivityReminderInSeconds() {
-		$activityReminder = $this->reminder_interval;
+		$activityReminder = isset($this->reminder_interval) ? $this->reminder_interval : 0;
 		$activityReminderInSeconds = '';
 		if($activityReminder != 'None') {
 			preg_match('/([0-9]+)[\s]([a-zA-Z]+)/', $activityReminder, $matches);
diff --git a/modules/Users/views/Login.php b/modules/Users/views/Login.php
index 9a022777d..c9e17e87d 100644
--- a/modules/Users/views/Login.php
+++ b/modules/Users/views/Login.php
@@ -20,6 +20,8 @@ class Users_Login_View extends Vtiger_View_Controller {
 	}
 	
 	function preProcess(Vtiger_Request $request, $display = true) {
+		global $current_user;
+
 		$viewer = $this->getViewer($request);
 		$viewer->assign('PAGETITLE', $this->getPageTitle($request));
 		$viewer->assign('SCRIPTS', $this->getHeaderScripts($request));
@@ -27,6 +29,16 @@ class Users_Login_View extends Vtiger_View_Controller {
 		$viewer->assign('MODULE', $request->getModule());
 		$viewer->assign('VIEW', $request->get('view'));
 		$viewer->assign('LANGUAGE_STRINGS', array());
+
+		$viewer->assign('INVENTORY_MODULES', array());
+		$viewer->assign('SELECTED_MENU_CATEGORY', '');
+		$viewer->assign('QUALIFIED_MODULE', '');
+		$viewer->assign('PARENT_MODULE', '');
+		$viewer->assign('NOTIFIER_URL', '');
+		$viewer->assign('EXTENSION_MODULE', '');
+		$viewer->assign('CURRENT_USER_MODEL', $current_user);
+		$viewer->assign('LANGUAGE', '');
+
 		if ($display) {
 			$this->preProcessDisplay($request);
 		}
@@ -37,8 +49,9 @@ class Users_Login_View extends Vtiger_View_Controller {
 
 		$modelInstance = Settings_ExtensionStore_Extension_Model::getInstance();
 		$news = $modelInstance->getNews();
+		$jsonData = array();
 
-		if ($news && $news['result']) {
+		if ($news && isset($news['result'])) {
 			$jsonData = $news['result'];
 			$oldTextLength = vglobal('listview_max_textlength');
 			foreach ($jsonData as $blockData) {
-- 
GitLab