-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlocation_controller.php
55 lines (50 loc) · 1.23 KB
/
location_controller.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
<?php
/**
* location status module class
*
* @package munkireport
* @author
**/
class Location_controller extends Module_controller
{
/*** Protect methods with auth! ****/
public function __construct()
{
// Store module path
$this->module_path = dirname(__FILE__);
}
/**
* Default method
*
* @author AvB
**/
public function index()
{
echo "You've loaded the location module!";
}
/**
* Retrieve data in json format
*
**/
public function get_data($serial_number = '')
{
$obj = new View();
if (! $this->authorized()) {
$obj->view('json', array('msg' => 'Not authorized'));
return;
}
$location = new Location_model($serial_number);
$obj->view('json', array('msg' => $location->rs));
}
// return locations of all macs
public function get_map_data()
{
$obj = new View();
if (! $this->authorized()) {
$obj->view('json', array('msg' => 'Not authorized'));
return;
}
$location = new Location_model();
$obj->view('json', array('msg' => $location->get_map_data()));
}
} // END class location_controller