Commit cd24c03466289b190ab5f2b639904a985d6673e7

Authored by Conrad Vermeulen
1 parent e9b49a20

KTS-2360

"Remove cache logging."
Updated.

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7203 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/session/Session.inc
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 * License Version 1.1.2 ("License"); You may not use this file except in 8 * License Version 1.1.2 ("License"); You may not use this file except in
9 * compliance with the License. You may obtain a copy of the License at 9 * compliance with the License. You may obtain a copy of the License at
10 * http://www.knowledgetree.com/KPL 10 * http://www.knowledgetree.com/KPL
11 - * 11 + *
12 * Software distributed under the License is distributed on an "AS IS" 12 * Software distributed under the License is distributed on an "AS IS"
13 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. 13 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
14 * See the License for the specific language governing rights and 14 * See the License for the specific language governing rights and
@@ -19,16 +19,16 @@ @@ -19,16 +19,16 @@
19 * (ii) the KnowledgeTree copyright notice 19 * (ii) the KnowledgeTree copyright notice
20 * in the same form as they appear in the distribution. See the License for 20 * in the same form as they appear in the distribution. See the License for
21 * requirements. 21 * requirements.
22 - * 22 + *
23 * The Original Code is: KnowledgeTree Open Source 23 * The Original Code is: KnowledgeTree Open Source
24 - * 24 + *
25 * The Initial Developer of the Original Code is The Jam Warehouse Software 25 * The Initial Developer of the Original Code is The Jam Warehouse Software
26 * (Pty) Ltd, trading as KnowledgeTree. 26 * (Pty) Ltd, trading as KnowledgeTree.
27 * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright 27 * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright
28 * (C) 2007 The Jam Warehouse Software (Pty) Ltd; 28 * (C) 2007 The Jam Warehouse Software (Pty) Ltd;
29 * All Rights Reserved. 29 * All Rights Reserved.
30 * Contributor( s): ______________________________________ 30 * Contributor( s): ______________________________________
31 - */ 31 + */
32 32
33 class Session { 33 class Session {
34 var $_bNotEmpty = true; 34 var $_bNotEmpty = true;
@@ -42,7 +42,7 @@ class Session { @@ -42,7 +42,7 @@ class Session {
42 function create(&$oUser) { 42 function create(&$oUser) {
43 $iUserId = $oUser->getId(); 43 $iUserId = $oUser->getId();
44 global $default; 44 global $default;
45 - 45 +
46 session_start(); 46 session_start();
47 47
48 if (KTPluginUtil::pluginIsActive('ktdms.wintools')) { 48 if (KTPluginUtil::pluginIsActive('ktdms.wintools')) {
@@ -54,23 +54,23 @@ class Session { @@ -54,23 +54,23 @@ class Session {
54 } 54 }
55 } 55 }
56 } 56 }
57 - 57 +
58 if ($oUser->getDisabled()) { 58 if ($oUser->getDisabled()) {
59 return PEAR::raiseError(_kt("Your account has been disabled. Please contact the system administrator for assistance.")); 59 return PEAR::raiseError(_kt("Your account has been disabled. Please contact the system administrator for assistance."));
60 } 60 }
61 - 61 +
62 // bind user id to session 62 // bind user id to session
63 $_SESSION["userID"] = $iUserId; 63 $_SESSION["userID"] = $iUserId;
64 $_SESSION["KTErrorMessage"] = array(); 64 $_SESSION["KTErrorMessage"] = array();
65 - 65 +
66 // use the PHP generated session id 66 // use the PHP generated session id
67 $sessionID = session_id(); 67 $sessionID = session_id();
68 68
69 // retrieve client ip 69 // retrieve client ip
70 $ip = $this->getClientIP(); 70 $ip = $this->getClientIP();
71 71
72 - $default->log->debug("Session::create() new session for $iUserId, from $ip, sessionID=$sessionID");  
73 - 72 + if (KTLOG_CACHE) $default->log->debug("Session::create() new session for $iUserId, from $ip, sessionID=$sessionID");
  73 +
74 // insert session information into db 74 // insert session information into db
75 $aParams = array( 75 $aParams = array(
76 'session_id' => $sessionID, 76 'session_id' => $sessionID,
@@ -100,10 +100,10 @@ class Session { @@ -100,10 +100,10 @@ class Session {
100 100
101 $oProvider =& KTAuthenticationUtil::getAuthenticationProviderForUser($oUser); 101 $oProvider =& KTAuthenticationUtil::getAuthenticationProviderForUser($oUser);
102 $oProvider->login($oUser); 102 $oProvider->login($oUser);
103 - 103 +
104 return $sessionID; 104 return $sessionID;
105 } 105 }
106 - 106 +
107 /** 107 /**
108 * Destroys the current session. 108 * Destroys the current session.
109 */ 109 */
@@ -113,7 +113,7 @@ class Session { @@ -113,7 +113,7 @@ class Session {
113 session_start(); 113 session_start();
114 $sSessionID = session_id(); 114 $sSessionID = session_id();
115 $iUserId = $_SESSION["userID"]; 115 $iUserId = $_SESSION["userID"];
116 - 116 +
117 // remove the session information from the database 117 // remove the session information from the database
118 118
119 $sTable = KTUtil::getTableName('sessions'); 119 $sTable = KTUtil::getTableName('sessions');
@@ -132,9 +132,9 @@ class Session { @@ -132,9 +132,9 @@ class Session {
132 unset($_SESSION['userID']); 132 unset($_SESSION['userID']);
133 unset($_SESSION['sessionStatus']); 133 unset($_SESSION['sessionStatus']);
134 session_unset(); 134 session_unset();
135 - session_destroy(); 135 + session_destroy();
136 } 136 }
137 - 137 +
138 /** 138 /**
139 * Removes any stale sessions for the specified userID 139 * Removes any stale sessions for the specified userID
140 * 140 *
@@ -198,7 +198,7 @@ class Session { @@ -198,7 +198,7 @@ class Session {
198 198
199 // this should be an existing session, so check the db 199 // this should be an existing session, so check the db
200 $aRows = DBUtil::getResultArray(array("SELECT * FROM $default->sessions_table WHERE session_id = ?", $sessionID)); 200 $aRows = DBUtil::getResultArray(array("SELECT * FROM $default->sessions_table WHERE session_id = ?", $sessionID));
201 - 201 +
202 $numrows = count($aRows); 202 $numrows = count($aRows);
203 203
204 // FIXME: if there aren't more rows that the max sessions for this user 204 // FIXME: if there aren't more rows that the max sessions for this user
@@ -209,16 +209,16 @@ class Session { @@ -209,16 +209,16 @@ class Session {
209 return false; 209 return false;
210 } 210 }
211 211
212 - $default->log->debug("Session::verify found session in db"); 212 + if (KTLOG_CACHE) $default->log->debug("Session::verify found session in db");
213 $aRow = $aRows[0]; 213 $aRow = $aRows[0];
214 214
215 $iUserID = $aRow["user_id"]; 215 $iUserID = $aRow["user_id"];
216 -  
217 - $oKTConfig = KTConfig::getSingleton(); 216 +
  217 + $oKTConfig = KTConfig::getSingleton();
218 $allowAnon = $oKTConfig->get('session/allowAnonymousLogin', false); 218 $allowAnon = $oKTConfig->get('session/allowAnonymousLogin', false);
219 - 219 +
220 $ANON = -2; 220 $ANON = -2;
221 - if ((!$allowAnon) && ($iUserID == $ANON)) { 221 + if ((!$allowAnon) && ($iUserID == $ANON)) {
222 Session::destroy(); // delete the anonymous session - config.ini has changed under this session. 222 Session::destroy(); // delete the anonymous session - config.ini has changed under this session.
223 return PEAR::raiseError(_kt("Anonymous logins are no longer allowed by the system administrator. Please login.")); 223 return PEAR::raiseError(_kt("Anonymous logins are no longer allowed by the system administrator. Please login."));
224 } 224 }
@@ -229,7 +229,7 @@ class Session { @@ -229,7 +229,7 @@ class Session {
229 if ($ipTracking && ($ip != trim($aRow["ip"]))) { 229 if ($ipTracking && ($ip != trim($aRow["ip"]))) {
230 return PEAR::raiseError(_kt("You are coming from a different IP address than the session requires")); 230 return PEAR::raiseError(_kt("You are coming from a different IP address than the session requires"));
231 } 231 }
232 - 232 +
233 if (empty($_SESSION['userID'])) { 233 if (empty($_SESSION['userID'])) {
234 Session::removeStaleSessions(); 234 Session::removeStaleSessions();
235 235
@@ -263,10 +263,10 @@ class Session { @@ -263,10 +263,10 @@ class Session {
263 } 263 }
264 264
265 Session::removeStaleSessions(); 265 Session::removeStaleSessions();
266 - 266 +
267 return false; 267 return false;
268 } 268 }
269 - 269 +
270 /** 270 /**
271 * Retrieves and returns the IP address of the current user 271 * Retrieves and returns the IP address of the current user
272 */ 272 */
lib/session/SiteMap.inc
@@ -358,13 +358,13 @@ class SiteMap { @@ -358,13 +358,13 @@ class SiteMap {
358 358
359 // for each section 359 // for each section
360 foreach ($this->aSiteMap as $section => $valArr) { 360 foreach ($this->aSiteMap as $section => $valArr) {
361 - //$default->log->debug("Sitemap::getPage section=$section"); 361 + if (KTLOG_CACHE) $default->log->debug("Sitemap::getPage section=$section");
362 // for each group, page array combination 362 // for each group, page array combination
363 foreach ($valArr as $requiredAccess => $pageArr) { 363 foreach ($valArr as $requiredAccess => $pageArr) {
364 // now loop through pages until we find the right one 364 // now loop through pages until we find the right one
365 foreach ($pageArr as $ackshin => $page) { 365 foreach ($pageArr as $ackshin => $page) {
366 if ($ackshin == $action) { 366 if ($ackshin == $action) {
367 - $default->log->debug("Sitemap::getPageArray calling hasPermission current requiredAccess=$requiredAccess, action=$ackshin"); 367 + if (KTLOG_CACHE) $default->log->debug("Sitemap::getPageArray calling hasPermission current requiredAccess=$requiredAccess, action=$ackshin");
368 if ($this->hasPermission($requiredAccess)) { 368 if ($this->hasPermission($requiredAccess)) {
369 if (KTUtil::arrayGet($_SERVER, 'kt_no_extensions')) { 369 if (KTUtil::arrayGet($_SERVER, 'kt_no_extensions')) {
370 return str_replace('.php', '', $page["page"]); 370 return str_replace('.php', '', $page["page"]);
@@ -503,7 +503,7 @@ class SiteMap { @@ -503,7 +503,7 @@ class SiteMap {
503 $results = array(); 503 $results = array();
504 // need to loop through all (groupName, page) arrays in this section 504 // need to loop through all (groupName, page) arrays in this section
505 foreach ($this->aSiteMap[$sSectionName] as $requiredAccess => $pages) { 505 foreach ($this->aSiteMap[$sSectionName] as $requiredAccess => $pages) {
506 - $default->log->debug("Sitemap::getDefaultActionArray calling hasPermission current requiredAccess=$requiredAccess"); 506 + if (KTLOG_CACHE) $default->log->debug("Sitemap::getDefaultActionArray calling hasPermission current requiredAccess=$requiredAccess");
507 if ($this->hasPermission($requiredAccess)) { 507 if ($this->hasPermission($requiredAccess)) {
508 foreach ($pages as $action => $pageArray) { 508 foreach ($pages as $action => $pageArray) {
509 if ($pageArray["default"] && $pageArray["enabled"]) { 509 if ($pageArray["default"] && $pageArray["enabled"]) {
@@ -570,21 +570,21 @@ class SiteMap { @@ -570,21 +570,21 @@ class SiteMap {
570 */ 570 */
571 function getActionFromPageArray($sPage) { 571 function getActionFromPageArray($sPage) {
572 global $default; 572 global $default;
573 - // $default->log->debug("Sitemap::getActionFromPage: page=$sPage"); 573 + if (KTLOG_CACHE) $default->log->debug("Sitemap::getActionFromPage: page=$sPage");
574 // for each section 574 // for each section
575 if (!strpos($sPage, '.php')) { 575 if (!strpos($sPage, '.php')) {
576 $sPage .= '.php'; 576 $sPage .= '.php';
577 } 577 }
578 foreach ($this->aSiteMap as $section => $valArr) { 578 foreach ($this->aSiteMap as $section => $valArr) {
579 - //$default->log->debug("Sitemap::getActionFromPage section=$section"); 579 + if (KTLOG_CACHE) $default->log->debug("Sitemap::getActionFromPage section=$section");
580 // for each group, page array combination 580 // for each group, page array combination
581 foreach ($valArr as $requiredAccess => $pageArr) { 581 foreach ($valArr as $requiredAccess => $pageArr) {
582 - //$default->log->debug("Sitemap::getActionFromPage access=$requiredAccess"); 582 + if (KTLOG_CACHE) $default->log->debug("Sitemap::getActionFromPage access=$requiredAccess");
583 // now loop through pages until we find the right one 583 // now loop through pages until we find the right one
584 foreach ($pageArr as $action => $page) { 584 foreach ($pageArr as $action => $page) {
585 - //$default->log->debug("Sitemap::getActionFromPage action=$action, reqPage=$sPage; page=" . $page["page"]); 585 + if (KTLOG_CACHE) $default->log->debug("Sitemap::getActionFromPage action=$action, reqPage=$sPage; page=" . $page["page"]);
586 if ($sPage == $page["page"]) { 586 if ($sPage == $page["page"]) {
587 - //$default->log->debug("Sitemap::getActionFromPage found action=$action for page=$sPage"); 587 + if (KTLOG_CACHE) $default->log->debug("Sitemap::getActionFromPage found action=$action for page=$sPage");
588 return $action; 588 return $action;
589 } 589 }
590 } 590 }
@@ -613,13 +613,13 @@ class SiteMap { @@ -613,13 +613,13 @@ class SiteMap {
613 if (!$this->bUseDB) { 613 if (!$this->bUseDB) {
614 // clear section table 614 // clear section table
615 if ($sql->query("DELETE from $default->site_sections_table")) { 615 if ($sql->query("DELETE from $default->site_sections_table")) {
616 - $default->log->debug("Sitemap::syncWithDB removed sections"); 616 + if (KTLOG_CACHE) $default->log->debug("Sitemap::syncWithDB removed sections");
617 } else { 617 } else {
618 $default->log->error("Sitemap::syncWithDB remove sections failed"); 618 $default->log->error("Sitemap::syncWithDB remove sections failed");
619 } 619 }
620 // clear sitemap table 620 // clear sitemap table
621 if ($sql->query("DELETE from $default->sitemap_table")) { 621 if ($sql->query("DELETE from $default->sitemap_table")) {
622 - $default->log->debug("Sitemap::syncWithDB removed sitemap"); 622 + if (KTLOG_CACHE) $default->log->debug("Sitemap::syncWithDB removed sitemap");
623 } else { 623 } else {
624 $default->log->error("Sitemap::syncWithDB remove sitemap failed"); 624 $default->log->error("Sitemap::syncWithDB remove sitemap failed");
625 } 625 }
@@ -631,13 +631,13 @@ class SiteMap { @@ -631,13 +631,13 @@ class SiteMap {
631 ); 631 );
632 $id = DBUtil::autoInsert($default->site_sections_table, $aFieldValues); 632 $id = DBUtil::autoInsert($default->site_sections_table, $aFieldValues);
633 633
634 - // $default->log->debug("Sitemap::syncWithDB insert=$sSectionSql"); 634 + if (KTLOG_CACHE) $default->log->debug("Sitemap::syncWithDB insert=$sSectionSql");
635 635
636 if (PEAR::isError($id)) { 636 if (PEAR::isError($id)) {
637 $default->log->error("Sitemap::syncWithDB add section $section failed"); 637 $default->log->error("Sitemap::syncWithDB add section $section failed");
638 } else { 638 } else {
639 $sectionID = $id; 639 $sectionID = $id;
640 - $default->log->debug("Sitemap::syncWithDB added section $section; $sectionID"); 640 + if (KTLOG_CACHE) $default->log->debug("Sitemap::syncWithDB added section $section; $sectionID");
641 } 641 }
642 642
643 // for each group, page array combination 643 // for each group, page array combination
@@ -655,9 +655,9 @@ class SiteMap { @@ -655,9 +655,9 @@ class SiteMap {
655 ); 655 );
656 $id = DBUtil::autoInsert($default->sitemap_table, $aFieldValues); 656 $id = DBUtil::autoInsert($default->sitemap_table, $aFieldValues);
657 if (PEAR::isError($id)) { 657 if (PEAR::isError($id)) {
658 - $default->log->debug("Sitemap::syncWithDB sitemap insert failed ($sSiteMapSql)"); 658 + $default->log->error("Sitemap::syncWithDB sitemap insert failed ($sSiteMapSql)");
659 } else { 659 } else {
660 - $default->log->debug("Sitemap::syncWithDb sitemap insert worked for ($action, " . $page["page"] . ")"); 660 + if (KTLOG_CACHE) $default->log->debug("Sitemap::syncWithDb sitemap insert worked for ($action, " . $page["page"] . ")");
661 } 661 }
662 } 662 }
663 } 663 }
lib/session/control.inc
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 * License Version 1.1.2 ("License"); You may not use this file except in 8 * License Version 1.1.2 ("License"); You may not use this file except in
9 * compliance with the License. You may obtain a copy of the License at 9 * compliance with the License. You may obtain a copy of the License at
10 * http://www.knowledgetree.com/KPL 10 * http://www.knowledgetree.com/KPL
11 - * 11 + *
12 * Software distributed under the License is distributed on an "AS IS" 12 * Software distributed under the License is distributed on an "AS IS"
13 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. 13 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
14 * See the License for the specific language governing rights and 14 * See the License for the specific language governing rights and
@@ -19,9 +19,9 @@ @@ -19,9 +19,9 @@
19 * (ii) the KnowledgeTree copyright notice 19 * (ii) the KnowledgeTree copyright notice
20 * in the same form as they appear in the distribution. See the License for 20 * in the same form as they appear in the distribution. See the License for
21 * requirements. 21 * requirements.
22 - * 22 + *
23 * The Original Code is: KnowledgeTree Open Source 23 * The Original Code is: KnowledgeTree Open Source
24 - * 24 + *
25 * The Initial Developer of the Original Code is The Jam Warehouse Software 25 * The Initial Developer of the Original Code is The Jam Warehouse Software
26 * (Pty) Ltd, trading as KnowledgeTree. 26 * (Pty) Ltd, trading as KnowledgeTree.
27 * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright 27 * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright
@@ -51,7 +51,7 @@ function controllerRedirect($sAction, $sQueryString = "") { @@ -51,7 +51,7 @@ function controllerRedirect($sAction, $sQueryString = "") {
51 // generate url 51 // generate url
52 $url = generateControllerUrl($sAction, $sQueryString); 52 $url = generateControllerUrl($sAction, $sQueryString);
53 // now redirect 53 // now redirect
54 - $default->log->debug("controllerRedirect: redirect to $url"); 54 + if (KTLOG_CACHE) $default->log->debug("controllerRedirect: redirect to $url");
55 redirect($url); 55 redirect($url);
56 exit(0); 56 exit(0);
57 } 57 }
@@ -67,11 +67,11 @@ function controllerRedirect($sAction, $sQueryString = "") { @@ -67,11 +67,11 @@ function controllerRedirect($sAction, $sQueryString = "") {
67 function generateLink($sTargetPage, $sQueryString = "", $sLinkText = "", $bLinkUrl = false) { 67 function generateLink($sTargetPage, $sQueryString = "", $sLinkText = "", $bLinkUrl = false) {
68 global $default; 68 global $default;
69 69
70 - $sLink = "http" . ($default->sslEnabled ? "s" : "") . "://" . $default->serverName . 70 + $sLink = "http" . ($default->sslEnabled ? "s" : "") . "://" . $default->serverName .
71 ((substr($sTargetPage, 0, strlen($default->rootUrl)) != $default->rootUrl) ? $default->rootUrl : "") . 71 ((substr($sTargetPage, 0, strlen($default->rootUrl)) != $default->rootUrl) ? $default->rootUrl : "") .
72 - (substr($sTargetPage, 0, 1) == "/" ? "" : "/") . 72 + (substr($sTargetPage, 0, 1) == "/" ? "" : "/") .
73 $sTargetPage; 73 $sTargetPage;
74 - 74 +
75 $sLink = KTUtil::addQueryString($sLink, $sQueryString); 75 $sLink = KTUtil::addQueryString($sLink, $sQueryString);
76 if($bLinkUrl == true){ 76 if($bLinkUrl == true){
77 $sLinkText = $sLink; 77 $sLinkText = $sLink;
@@ -137,12 +137,12 @@ function checkSessionAndRedirect($bRedirect, $bDownload = false) { @@ -137,12 +137,12 @@ function checkSessionAndRedirect($bRedirect, $bDownload = false) {
137 $sessionStatus = $session->verify(); 137 $sessionStatus = $session->verify();
138 138
139 if ($sessionStatus === true) { 139 if ($sessionStatus === true) {
140 - $default->log->debug("checkSession:: returning true"); 140 + if (KTLOG_CACHE) $default->log->debug("checkSession:: returning true");
141 return true; 141 return true;
142 } 142 }
143 143
144 // verification failed 144 // verification failed
145 - $default->log->debug("checkSession:: session check failed"); 145 + if (KTLOG_CACHE) $default->log->debug("checkSession:: session check failed");
146 if (empty($bRedirect)) { 146 if (empty($bRedirect)) {
147 return $sessionStatus; 147 return $sessionStatus;
148 } 148 }
@@ -151,11 +151,11 @@ function checkSessionAndRedirect($bRedirect, $bDownload = false) { @@ -151,11 +151,11 @@ function checkSessionAndRedirect($bRedirect, $bDownload = false) {
151 if (PEAR::isError($sessionStatus)) { 151 if (PEAR::isError($sessionStatus)) {
152 $sErrorMessage = $sessionStatus->getMessage(); 152 $sErrorMessage = $sessionStatus->getMessage();
153 } 153 }
154 - 154 +
155 $oKTConfig = KTConfig::getSingleton(); 155 $oKTConfig = KTConfig::getSingleton();
156 $dest = 'login'; 156 $dest = 'login';
157 if ($oKTConfig->get('allowAnonymousLogin', false)) { $dest = 'dashboard'; } 157 if ($oKTConfig->get('allowAnonymousLogin', false)) { $dest = 'dashboard'; }
158 - 158 +
159 // redirect to login with error message 159 // redirect to login with error message
160 if ($sErrorMessage) { 160 if ($sErrorMessage) {
161 // session timed out 161 // session timed out
@@ -166,13 +166,13 @@ function checkSessionAndRedirect($bRedirect, $bDownload = false) { @@ -166,13 +166,13 @@ function checkSessionAndRedirect($bRedirect, $bDownload = false) {
166 166
167 $redirect = urlencode(KTUtil::addQueryStringSelf($_SERVER["QUERY_STRING"])); 167 $redirect = urlencode(KTUtil::addQueryStringSelf($_SERVER["QUERY_STRING"]));
168 if ((strlen($redirect) > 1)) { 168 if ((strlen($redirect) > 1)) {
169 - $default->log->debug("checkSession:: redirect url=$redirect"); 169 + if (KTLOG_CACHE) $default->log->debug("checkSession:: redirect url=$redirect");
170 // this session verification failure represents either the first visit to 170 // this session verification failure represents either the first visit to
171 // the site OR a session timeout etc. (in which case we still want to bounce 171 // the site OR a session timeout etc. (in which case we still want to bounce
172 // the user to the login page, and then back to whatever page they're on now) 172 // the user to the login page, and then back to whatever page they're on now)
173 $url = $url . "&redirect=" . $redirect; 173 $url = $url . "&redirect=" . $redirect;
174 } 174 }
175 - $default->log->debug("checkSession:: about to redirect to $url"); 175 + if (KTLOG_CACHE) $default->log->debug("checkSession:: about to redirect to $url");
176 redirect($url); 176 redirect($url);
177 exit; 177 exit;
178 } 178 }
@@ -180,15 +180,15 @@ function checkSessionAndRedirect($bRedirect, $bDownload = false) { @@ -180,15 +180,15 @@ function checkSessionAndRedirect($bRedirect, $bDownload = false) {
180 /** 180 /**
181 * Verifies the current session 181 * Verifies the current session
182 * Automatically redirects to the login page on session verification failure 182 * Automatically redirects to the login page on session verification failure
183 - * @param boolean optional parameter set if we're downloading a file 183 + * @param boolean optional parameter set if we're downloading a file
184 */ 184 */
185 function checkSession($bDownload = false, $bHandleNoAccess = true) { 185 function checkSession($bDownload = false, $bHandleNoAccess = true) {
186 global $default; 186 global $default;
187 if (checkSessionAndRedirect(true, $bDownload)) { 187 if (checkSessionAndRedirect(true, $bDownload)) {
188 - $default->log->debug("control.inc: print the session variables: " . arrayToString($_SESSION)); 188 + if (KTLOG_CACHE) $default->log->debug("control.inc: print the session variables: " . arrayToString($_SESSION));
189 // the session is cool, now check if we access to this page 189 // the session is cool, now check if we access to this page
190 $pageName = KTUtil::getRequestScriptName($_SERVER); 190 $pageName = KTUtil::getRequestScriptName($_SERVER);
191 - $default->log->debug("control.inc: page=" . $pageName . " ? " . $_SESSION["pageAccess"][$pageName]); 191 + if (KTLOG_CACHE) $default->log->debug("control.inc: page=" . $pageName . " ? " . $_SESSION["pageAccess"][$pageName]);
192 if ($_SESSION["pageAccess"][$pageName]) { 192 if ($_SESSION["pageAccess"][$pageName]) {
193 return true; 193 return true;
194 } else { 194 } else {