-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathreport.php
126 lines (99 loc) · 3.97 KB
/
report.php
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php
/*
* As a work of the United States government, this project is in the public domain within the United States.
*/
/*
Index for everything
Date: September 11, 2007
*/
use App\Leaf\XSSHelpers;
error_reporting(E_ERROR);
require_once getenv('APP_LIBS_PATH') . '/loaders/Leaf_autoloader.php';
header('X-UA-Compatible: IE=edge');
$oc_login->loginUser();
if (!$oc_login->isLogin() || !$oc_login->isInDB())
{
echo 'Your login is not recognized.';
exit;
}
$post_name = isset($_POST['name']) ? $_POST['name'] : '';
$post_password = isset($_POST['password']) ? $_POST['password'] : '';
$main = new \Smarty;
$t_login = new \Smarty;
$t_menu = new \Smarty;
$o_login = '';
$o_menu = '';
$tabText = '';
$action = isset($_GET['a']) ? XSSHelpers::xscrub($_GET['a']) : '';
function customTemplate($tpl)
{
return file_exists("./templates/custom_override/{$tpl}") ? "custom_override/{$tpl}" : $tpl;
}
$main->assign('logo', '<img src="images/VA_icon_small.png" style="width: 80px" alt="VA seal, U.S. Department of Veterans Affairs" />');
$t_login->assign('name', $oc_login->getName());
$main->assign('useDojo', true);
$main->assign('useDojoUI', true);
$main->assign('app_js_path', APP_JS_PATH);
switch ($action) {
case 'about':
$t_form = new \Smarty;
$t_form->left_delimiter = '<!--{';
$t_form->right_delimiter = '}-->';
$rev = $oc_db->prepared_query("SELECT * FROM settings WHERE setting='dbversion'", array());
$t_form->assign('dbversion', XSSHelpers::xscrub($rev[0]['data']));
$main->assign('hideFooter', true);
$main->assign('body', $t_form->fetch('view_about.tpl'));
break;
default:
if ($action != ''
&& file_exists("templates/reports/{$action}.tpl"))
{
$main->assign('useUI', true);
// $main->assign('javascripts', array('js/form.js', 'js/workflow.js', 'js/formGrid.js', 'js/formQuery.js', 'js/formSearch.js'));
if ($oc_login->isLogin())
{
$o_login = $t_login->fetch('login.tpl');
$t_form = new \Smarty;
$t_form->left_delimiter = '<!--{';
$t_form->right_delimiter = '}-->';
$t_form->assign('app_js_path', APP_JS_PATH);
$t_form->assign('CSRFToken', $_SESSION['CSRFToken']);
$t_form->assign('empUID', $oc_login->getEmpUID());
$t_form->assign('empMembership', $oc_login->getMembership());
//url
// For Jira Ticket:LEAF-2471/remove-all-http-redirects-from-code
// $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http';
$protocol = 'https';
$qrcodeURL = "{$protocol}://" . HTTP_HOST . $_SERVER['REQUEST_URI'];
$main->assign('qrcodeURL', urlencode($qrcodeURL));
$main->assign('abs_portal_path', ABSOLUTE_PORT_PATH);
$main->assign('body', $t_form->fetch("reports/{$action}.tpl"));
$tabText = '';
}
}
else
{
$main->assign('body', 'Input error');
}
break;
}
$memberships = $oc_login->getMembership();
$t_menu->assign('isAdmin', $memberships['groupID'][1]);
$t_menu->assign('action', $action);
$main->assign('login', $t_login->fetch('login.tpl'));
$o_menu = $t_menu->fetch('menu.tpl');
$main->assign('menu', $o_menu);
$tabText = $tabText == '' ? '' : $tabText . ' ';
$main->assign('tabText', $tabText);
//$settings = $oc_db->query_kv('SELECT * FROM settings', 'setting', 'data');
$main->assign('title', XSSHelpers::sanitizeHTMLRich($settings['heading'] == '' ? $config->title : $settings['heading']));
$main->assign('city', XSSHelpers::sanitizeHTMLRich($settings['subheading'] == '' ? $config->city : $settings['subheading']));
$main->assign('revision', XSSHelpers::scrubNewLinesFromURL($settings['version']));
if (!isset($_GET['iframe']))
{
$main->display('main.tpl');
}
else
{
$main->display('main_iframe.tpl');
}