-
Notifications
You must be signed in to change notification settings - Fork 1
/
router.php
66 lines (53 loc) · 2.87 KB
/
router.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
<?php
require_once('runtime.php');
require_once(ROOT_DIR.'/lib/core/Router.class.php');
require_once(ROOT_DIR.'/lib/core/Networkinterfacelist.class.php');
require_once(ROOT_DIR.'/lib/core/OriginatorStatusList.class.php');
require_once(ROOT_DIR.'/lib/core/Chipsetlist.class.php');
require_once(ROOT_DIR.'/lib/core/ConfigLine.class.php');
require_once(ROOT_DIR.'/lib/core/Eventlist.class.php');
require_once(ROOT_DIR.'/lib/core/crawling.class.php');
if(isset($_GET['router_id']) AND isset($_GET['embed']) AND $_GET['embed']) {
$smarty->assign('community_essid', Config::getConfigValueByName('community_essid'));
$smarty->assign('google_maps_api_key', Config::getConfigValueByName('google_maps_api_key'));
$router = new Router((int)$_GET['router_id']);
$router->fetch();
$smarty->assign('router', $router);
$smarty->display("router_embed.tpl.html");
} elseif(!isset($_GET['section']) AND isset($_GET['router_id'])) {
$smarty->assign('message', Message::getMessage());
$smarty->assign('google_maps_api_key', Config::getConfigValueByName('google_maps_api_key'));
$router = new Router((int)$_GET['router_id']);
$router->fetch();
$smarty->assign('router', $router);
$networkinterfacelist = new Networkinterfacelist(false, $router->getRouterId(),
0, -1, 'name', 'asc');
$smarty->assign('networkinterfacelist', $networkinterfacelist);
$originator_status_list = new OriginatorStatusList($router->getRouterId(), $router->getStatusdata()->getCrawlCycleId(), 0, -1);
$smarty->assign('originator_status_list', $originator_status_list);
$eventlist = new Eventlist();
$eventlist->init('router', $router->getRouterId(), false, 0, 10, 'event_id', 'desc');
$smarty->assign('eventlist', $eventlist);
$smarty->display("header.tpl.html");
$smarty->display("router.tpl.html");
$smarty->display("footer.tpl.html");
} elseif(isset($_GET['section']) AND $_GET['section'] == 'add') {
//Logged in users can add a new router
if(Permission::checkPermission(PERM_USER)) {
$smarty->assign('message', Message::getMessage());
$smarty->assign('google_maps_api_key', ConfigLine::configByName('google_maps_api_key'));
$smarty->assign('community_location_longitude', ConfigLine::configByName('community_location_longitude'));
$smarty->assign('community_location_latitude', ConfigLine::configByName('community_location_latitude'));
$smarty->assign('community_location_zoom', ConfigLine::configByName('community_location_zoom'));
$smarty->assign('twitter_token', ConfigLine::configByName('twitter_token'));
$chipsetlist = new Chipsetlist(false, false, 0, -1);
$smarty->assign('chipsetlist', $chipsetlist->getList());
$smarty->display("header.tpl.html");
$smarty->display("router_new.tpl.html");
$smarty->display("footer.tpl.html");
} else {
Permission::denyAccess(PERM_USER);
}
} elseif($_GET['section'] == "store") {
}
?>