Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathModule.php
More file actions
Latest commit
85 lines (68 loc) · 2.43 KB
/
Copy pathModule.php
File metadata and controls
85 lines (68 loc) · 2.43 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
/**
* @author Ted Eberhard <eberhardtm at appstate dot edu>
*/
namespacesystemsinventory;
class Module extends \Canopy\Module implements \Canopy\SettingDefaults {
publicfunction__construct() {
parent::__construct();
$this->setTitle('sysinventory');
$this->setProperName('Systems Inventory');
}
publicfunctiongetController(\Canopy\Request$request) {
$cmd = $request->shiftCommand();
if (\Current_User::allow('sysinventory')) {
switch ($cmd) {
case'system':
$system = new \systemsinventory\Controller\System($this);
return$system;
case'settings':
if (\Current_User::allow('systemsinventory', 'settings')) {
$settings = new \systemsinventory\Controller\Settings($this);
return$settings;
}
default:
$search = new \systemsinventory\Controller\Search($this);
return$search;
}
} else {
\Current_User::requireLogin();
}
}
publicfunctionrunTime(\Canopy\Request$request) {
if (\Current_User::allow('sysinventory'))
\systemsinventory\Controller\System::loadAdminBar();
if (\PHPWS_Core::atHome() && \Current_User::isLogged()) {
$path = $_SERVER['SCRIPT_NAME'] . '?module=systemsinventory';
header('HTTP/1.1 303 See Other');
header("Location: $path");
exit();
}
}
publicfunctiongetSettingDefaults() {
// ContactInfo
$settings['building'] = null;
$settings['room_number'] = null;
$settings['phone_number'] = null;
$settings['fax_number'] = null;
$settings['email'] = null;
// Physical Address
$settings['street'] = null;
$settings['post_box'] = null;
$settings['city'] = null;
$settings['state'] = 'NC';
$settings['zip'] = null;
// Offsite
$settings['links'] = null;
// Map
$settings['thumbnail_map'] = null;
$settings['latitude'] = null;
$settings['longitude'] = null;
$settings['full_map_link'] = null;
$settings['zoom'] = 17;
$settings['dimension_x'] = '300';
$settings['dimension_y'] = '300';
return$settings;
}
}
?>