Commit 35b6089dbd4025193f3a333a7048fd57a44f05f1

Authored by megan_w
1 parent 164d84ff

KTS-3382

"When session expires and I do logout then I have to login twice"
Fixed. The logout now goes directly to logout without checking the session.

Committed by: Megan Watson
Reviewed by: Conrad Vermeulen



git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@8586 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/templating/kt3template.inc.php
@@ -6,31 +6,31 @@ @@ -6,31 +6,31 @@
6 * Document Management Made Simple 6 * Document Management Made Simple
7 * Copyright (C) 2008 KnowledgeTree Inc. 7 * Copyright (C) 2008 KnowledgeTree Inc.
8 * Portions copyright The Jam Warehouse Software (Pty) Limited 8 * Portions copyright The Jam Warehouse Software (Pty) Limited
9 - * 9 + *
10 * This program is free software; you can redistribute it and/or modify it under 10 * This program is free software; you can redistribute it and/or modify it under
11 * the terms of the GNU General Public License version 3 as published by the 11 * the terms of the GNU General Public License version 3 as published by the
12 * Free Software Foundation. 12 * Free Software Foundation.
13 - * 13 + *
14 * This program is distributed in the hope that it will be useful, but WITHOUT 14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 * details. 17 * details.
18 - * 18 + *
19 * You should have received a copy of the GNU General Public License 19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>. 20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 - *  
22 - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, 21 + *
  22 + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
23 * California 94120-7775, or email info@knowledgetree.com. 23 * California 94120-7775, or email info@knowledgetree.com.
24 - * 24 + *
25 * The interactive user interfaces in modified source and object code versions 25 * The interactive user interfaces in modified source and object code versions
26 * of this program must display Appropriate Legal Notices, as required under 26 * of this program must display Appropriate Legal Notices, as required under
27 * Section 5 of the GNU General Public License version 3. 27 * Section 5 of the GNU General Public License version 3.
28 - * 28 + *
29 * In accordance with Section 7(b) of the GNU General Public License version 3, 29 * In accordance with Section 7(b) of the GNU General Public License version 3,
30 * these Appropriate Legal Notices must retain the display of the "Powered by 30 * these Appropriate Legal Notices must retain the display of the "Powered by
31 - * KnowledgeTree" logo and retain the original copyright notice. If the display of the 31 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
32 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices 32 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
33 - * must display the words "Powered by KnowledgeTree" and retain the original 33 + * must display the words "Powered by KnowledgeTree" and retain the original
34 * copyright notice. 34 * copyright notice.
35 * Contributor( s): ______________________________________ 35 * Contributor( s): ______________________________________
36 * 36 *
@@ -169,22 +169,12 @@ class KTPage { @@ -169,22 +169,12 @@ class KTPage {
169 function initMenu() { 169 function initMenu() {
170 // FIXME: we lost the getDefaultAction stuff - do we care? 170 // FIXME: we lost the getDefaultAction stuff - do we care?
171 // note that key == action. this is _important_, since we crossmatch the breadcrumbs against this for "active" 171 // note that key == action. this is _important_, since we crossmatch the breadcrumbs against this for "active"
172 - global $default;  
173 - $rootUrl = $default->rootUrl;  
174 - $bSSL = $default->sslEnabled;  
175 -  
176 - $sProtocol = ($bSSL) ? 'https' : 'http';  
177 - $sBaseUrl = $sProtocol.'://'.$_SERVER['HTTP_HOST'].$rootUrl; 172 + $sBaseUrl = KTUtil::kt_url();
178 173
179 $this->menu = array(); 174 $this->menu = array();
180 $this->menu['dashboard'] = array('label' => _kt("Dashboard"), 'url' => $sBaseUrl.'/dashboard.php'); 175 $this->menu['dashboard'] = array('label' => _kt("Dashboard"), 'url' => $sBaseUrl.'/dashboard.php');
181 $this->menu['browse'] = array('label' => _kt("Browse Documents"), 'url' => $sBaseUrl.'/browse.php'); 176 $this->menu['browse'] = array('label' => _kt("Browse Documents"), 'url' => $sBaseUrl.'/browse.php');
182 $this->menu['administration'] = array('label' => _kt("DMS Administration"), 'url' => $sBaseUrl.'/admin.php'); 177 $this->menu['administration'] = array('label' => _kt("DMS Administration"), 'url' => $sBaseUrl.'/admin.php');
183 - /*  
184 - $this->menu = array("dashboard" => $this->_actionHelper(array("name" => _kt("Dashboard"), "action" => "dashboard", "active" => 0)),  
185 - "browse" => $this->_actionHelper(array("name" => _kt("Browse Documents"), "action" => "browse", "active" => 0)),  
186 - "administration" => $this->_actionHelper(array("name" => _kt("DMS Administration"), "action" => "administration", "active" => 0)),);  
187 - */  
188 } 178 }
189 179
190 180
@@ -386,21 +376,23 @@ class KTPage { @@ -386,21 +376,23 @@ class KTPage {
386 376
387 $this->userMenu = array(); 377 $this->userMenu = array();
388 if (!(PEAR::isError($this->user) || is_null($this->user) || $this->user->isAnonymous())) { 378 if (!(PEAR::isError($this->user) || is_null($this->user) || $this->user->isAnonymous())) {
  379 + $sBaseUrl = KTUtil::kt_url();
  380 +
389 if ($oConfig->get("user_prefs/restrictPreferences", false) && !Permission::userIsSystemAdministrator($this->user->getId())) { 381 if ($oConfig->get("user_prefs/restrictPreferences", false) && !Permission::userIsSystemAdministrator($this->user->getId())) {
390 - $this->userMenu = array("logout" => $this->_actionHelper(array("name" => _kt("Logout"), "action" => "logout", "active" => 0)),); 382 + $this->userMenu['logout'] = array('label' => _kt('Logout'), 'url' => $sBaseUrl.'/presentation/logout.php');
391 } else { 383 } else {
392 - $this->userMenu = array("preferences" => $this->_actionHelper(array("name" => _kt("Preferences"), "action" => "preferences", "active" => 0)),  
393 - "aboutkt" => $this->_actionhelper(array("name" => _kt("About"), "action" => "aboutkt", "active" => 0)),  
394 - "logout" => $this->_actionHelper(array("name" => _kt("Logout"), "action" => "logout", "active" => 0)),); 384 + $this->userMenu['preferences'] = array('label' => _kt('Preferences'), 'url' => $sBaseUrl.'/preferences.php');
  385 + $this->userMenu['aboutkt'] = array('label' => _kt('About'), 'url' => $sBaseUrl.'/about.php');
  386 + $this->userMenu['logout'] = array('label' => _kt('Logout'), 'url' => $sBaseUrl.'/presentation/logout.php');
395 } 387 }
396 } else { 388 } else {
397 - $this->userMenu = array("login" => $this->_actionHelper(array("name" => _kt("Login"), "action" => "login")),); 389 + $this->userMenu['login'] = array('label' => _kt('Login'), 'url' => $sBaseUrl.'/login.php');
398 } 390 }
399 391
400 // FIXME we need a more complete solution to navigation restriction 392 // FIXME we need a more complete solution to navigation restriction
401 if (!is_null($this->menu['administration']) && !is_null($this->user)) { 393 if (!is_null($this->menu['administration']) && !is_null($this->user)) {
402 if (!Permission::userIsSystemAdministrator($this->user->getId())) { 394 if (!Permission::userIsSystemAdministrator($this->user->getId())) {
403 - unset($this->menu['administration']); 395 + unset($this->menu['administration']);
404 } 396 }
405 } 397 }
406 398