-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearchTreeId.php
34 lines (28 loc) · 1.53 KB
/
searchTreeId.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
<?php
/*
ex: set tabstop=2 shiftwidth=2 autoindent:
+-------------------------------------------------------------------------+
| Copyright (C) 2014 Nerijus Bendziunas <[email protected]> |
| |
| This program is free software; you can redistribute it and/or |
| modify it under the terms of the GNU General Public License |
| as published by the Free Software Foundation; either version 2 |
| of the License, or (at your option) any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
+-------------------------------------------------------------------------+
*/
include("../../include/global.php");
$url = $config['url_path'];
if (!empty($_REQUEST['host'])) {
$host = sql_sanitize(trim($_REQUEST['host']));
$query = "SELECT g.graph_tree_id, g.id FROM graph_tree_items g, host h WHERE g.host_id = h.id AND h.hostname = '$host' LIMIT 1";
$host_info = db_fetch_row($query);
if ($host_info) {
$url = $config['url_path'].'/graph_view.php?action=tree&tree_id=' . $host_info['graph_tree_id'] . '&leaf_id=' . $host_info['id'];
}
}
header("Location: $url");