forked from TestLinkOpenSourceTRMS/testlink-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
84 lines (71 loc) · 2.46 KB
/
index.php
File metadata and controls
84 lines (71 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
* TestLink Open Source Project - http://testlink.sourceforge.net/
* This script is distributed under the GNU General Public License 2 or later.
*
* Main window. Include authorization of user and define frames (navBar and main).
*
* @filesource index.php
* @package TestLink
* @copyright 2006-2011, TestLink community
* @link http://www.teamst.org/index.php
*
* @internal revisions
* 20110605 - franciscom - TICKET 4565: Current Test Plan resets every time portal page is loaded
* 20110410 - franciscom - BUGID 4342
**/
require_once('lib/functions/configCheck.php');
checkConfiguration();
require_once('config.inc.php');
require_once('common.php');
doSessionStart();
unset($_SESSION['basehref']);
setPaths();
$args = init_args();
// verify the session during a work
$redir2login = true;
if( isset($_SESSION['currentUser']) )
{
// use Mantisbt approach
$securityCookie = tlUser::auth_get_current_user_cookie();
$redir2login = is_null($securityCookie);
if(!$redir2login)
{
// need to get fresh info from db,
// before asking for securityCookie
doDBConnect($db);
$user = new tlUser();
$user->dbID = $_SESSION['currentUser']->dbID;
$user->readFromDB($db);
$dbSecurityCookie = $user->getSecurityCookie();
$redir2login = ( $securityCookie != $dbSecurityCookie );
}
}
if($redir2login)
{
// destroy user in session as security measure
unset($_SESSION['currentUser']);
redirect(TL_BASE_HREF ."login.php?note=expired");
exit;
}
$titleFrameURL = "lib/general/navBar.php?tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}" .
"&updateMainPage=1";
// $smarty->assign('titleframe', "lib/general/navBar.php?tproject_id={$args->tproject_id}&updateMainPage=1");
// $smarty->assign('titleframe', "lib/general/navBar.php?tproject_id={$args->tproject_id}");
$smarty = new TLSmarty();
$smarty->assign('title', lang_get('main_page_title'));
$smarty->assign('titleframe', $titleFrameURL);
$smarty->assign('mainframe', $args->reqURI);
$smarty->display('main.tpl');
function init_args()
{
$_REQUEST=strings_stripSlashes($_REQUEST);
$args = new stdClass();
$iParams = array("reqURI" => array(tlInputParameter::STRING_N,0,4000));
$pParams = G_PARAMS($iParams);
$args->reqURI = ($pParams["reqURI"] != '') ? $pParams["reqURI"] : 'lib/general/mainPage.php';
$args->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_REQUEST['tproject_id']) : 0;
$args->tplan_id = isset($_REQUEST['tplan_id']) ? intval($_REQUEST['tplan_id']) : 0;
return $args;
}
?>