-
Notifications
You must be signed in to change notification settings - Fork 581
/
error.php
64 lines (52 loc) · 1.17 KB
/
error.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
<?php
/**
* TestLink Open Source Project - http://testlink.sourceforge.net/
* This script is distributed under the GNU General Public License 2 or later.
*
* General purpose error page.
*
* @package TestLink
* @copyright 2012,2019 TestLink community
*
* @internal revisions
* @used by: kinow - TICKET 4977 - CSRF - Advisory ID: HTB23088
*
**/
require_once('config.inc.php');
require_once('common.php');
/**
*
*/
function init_args() {
$args = new stdClass();
$args->message = 'Rocket Raccoon is watching You';
$code = isset($_REQUEST['code']) ? $_REQUEST['code'] : 0;
switch($code) {
case 1:
$args->message = 'No CSRFName found, probable invalid request.';
break;
case 2:
$args->message = 'Invalid CSRF token';
break;
default:
break;
}
return $args;
}
/**
*
*/
function init_gui($args) {
$gui = new stdClass();
$gui->message = '';
if(isset($args->message) {
$gui->message = $args->message;
}
return $gui;
}
$templateCfg = templateConfiguration();
$args = init_args();
$gui = init_gui($args);
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
$smarty->display($templateCfg->default_template);