forked from Graphite-Tattle/Tattle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresult.php
40 lines (33 loc) · 1.24 KB
/
result.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
<?php
include dirname(__FILE__) . '/inc/init.php';
fAuthorization::requireLoggedIn();
$action = fRequest::getValid('action',
array('list', 'add', 'edit', 'delete','ackAll')
);
$result_id = fRequest::get('result_id','integer');
$check_id = fRequest::get('check_id');
$manage_url = $_SERVER['SCRIPT_NAME'];
/*------------------------------------*/
if ($action == 'ackAll') {
try {
$check = new Check($check_id);
if (fRequest::isPost()) {
fRequest::validateCSRFToken(fRequest::get('token'));
//$check->acknowledgeCheck();
Check::acknowledgeCheck($check,NULL,true);
fMessaging::create('success', $manage_url,
'The alerts for ' . $check->getName() . ' were successfully acknowledged');
//fURL::redirect($manage_url);
}
} catch (fNotFoundException $e) {
fMessaging::create('error', $manage_url,
'The check requested, ' . fHTML::encode($date) . ', could not be found');
fURL::redirect($manage_url);
} catch (fExpectedException $e) {
fMessaging::create('error', fURL::get(), $e->getMessage());
}
include VIEW_PATH . '/ackAll_results.php';
} else {
$check_results = CheckResult::findAll($check_id);
include VIEW_PATH . '/list_check_results.php';
}