From 131a123f09b7a2e58f810745be67bf6c4f6bb06f Mon Sep 17 00:00:00 2001 From: Preexo <tim.niklas@web.de> Date: Mon, 18 Apr 2016 16:08:22 +0800 Subject: [PATCH] improved logging, fixes issue #174 --- includes/main/WebUI.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/includes/main/WebUI.php b/includes/main/WebUI.php index 16d55b722..6f3a8dce4 100644 --- a/includes/main/WebUI.php +++ b/includes/main/WebUI.php @@ -22,15 +22,15 @@ class Vtiger_WebUI extends Vtiger_EntryPoint { * @throws AppException */ protected function checkLogin (Vtiger_Request $request) { - if (!$this->hasLogin()) { - $return_params = $_SERVER['QUERY_STRING']; - if($return_params && !$_SESSION['return_params']) { - //Take the url that user would like to redirect after they have successfully logged in. - $return_params = urlencode($return_params); - Vtiger_Session::set('return_params', $return_params); - } - header ('Location: index.php'); - throw new AppException('Login is required'); + if (!$this->hasLogin()) { + $return_params = $_SERVER['QUERY_STRING']; + if($return_params && !$_SESSION['return_params']) { + //Take the url that user would like to redirect after they have successfully logged in. + $return_params = urlencode($return_params); + Vtiger_Session::set('return_params', $return_params); + } + header ('Location: index.php'); + throw new AppException('Login is required'); } } @@ -208,8 +208,9 @@ class Vtiger_WebUI extends Vtiger_EntryPoint { } } catch(Exception $e) { if ($view) { - // Log for developement. - error_log($e->getTraceAsString(), E_NOTICE); + // log for development + global $log; + $log->debug($e->getMessage().":".$e->getTraceAsString()); $viewer = new Vtiger_Viewer(); $viewer->assign('MESSAGE', $e->getMessage()); -- GitLab