-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathteamviewer_controller.php
48 lines (41 loc) · 1.35 KB
/
teamviewer_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
<?php
/**
* Teamviewer module class
*
* @package munkireport
* @author tuxudo
**/
class Teamviewer_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 teamviewer 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;
}
$queryobj = new Teamviewer_model();
$sql = "SELECT clientid, clientic, always_online, autoupdatemode, version, update_available, lastmacused, security_adminrights, security_passwordstrength, meeting_username, ipc_port_service, licensetype, is_not_first_run_without_connection, is_not_running_test_connection, had_a_commercial_connection, prefpath, updateversion FROM teamviewer WHERE serial_number = '$serial_number'";
$teamviewer_tab = $queryobj->query($sql);
$obj->view('json', array('msg' => current(array('msg' => $teamviewer_tab))));
}
} // END class Teamviewer_controller