-
Notifications
You must be signed in to change notification settings - Fork 3
/
report_getInfo.php
90 lines (70 loc) · 1.81 KB
/
report_getInfo.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
<?php
include 'checkinstance.php';
// Are we authorized to view this page?
if ( !isset($_SESSION['id']) )
{
do_notauthorized();
exit();
}
if ( !isset($_GET['type']) )
{
display_error( "Unauthorized request." );
exit();
}
$infoType = $_GET['type'];
include 'db.php';
include 'lib/reports.php';
if ( $infoType == 'p' )
{
// Return some dynamic text about people
// who have granted user permission to view reports
$personID = ( isset( $_GET['pID'] ) ) ? $_GET['pID'] : $_SESSION['id'];
$text = people_select( $link, 'people_select', $personID );
echo $text;
exit();
}
else if ( $infoType == 'r' )
{
// Return some dynamic text about available runs
$personID = ( isset( $_GET['pID'] ) ) ? $_GET['pID'] : $_SESSION['id'];
$currentID = ( isset( $_GET['rID'] ) ) ? $_GET['rID'] : -1;
$text = run_select( $link, 'run_select', $currentID, $personID );
echo $text;
exit();
}
else if ( $infoType == 't' )
{
// Return a dynamic list of associated triples
$currentID = ( isset( $_GET['rID'] ) ) ? $_GET['rID'] : -1;
$text = tripleList( $link, $currentID );
echo $text;
exit();
}
else if ( $infoType == 'c' )
{
// Return a dynamic list of associated combinations
$currentID = ( isset( $_GET['rID'] ) ) ? $_GET['rID'] : -1;
$text = combo_info( $link, $currentID );
echo $text;
exit();
}
else
display_error( "Unsupported info type." );
exit();
// Display not authorized text
function do_notauthorized()
{
echo <<<HTML
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
<meta name="verify-v1" content="+TIfXSnY08mlIGLtDJVkQxTV4kDYMoWu2GLfWLI7VBE=" />
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<hr>
<address>Apache/2.2.3 (CentOS) Server at uslims3.uthscsa.edu Port 80</address>
</body></html>
HTML;
}
?>