1
|
<?php
|
2
|
/* $Id$ */
|
3
|
/*
|
4
|
Copyright (C) 2012 Jim Pingle
|
5
|
All rights reserved.
|
6
|
|
7
|
Copyright (C) 2007, 2008 Scott Ullrich <sullrich@gmail.com>
|
8
|
All rights reserved.
|
9
|
|
10
|
Redistribution and use in source and binary forms, with or without
|
11
|
modification, are permitted provided that the following conditions are met:
|
12
|
|
13
|
1. Redistributions of source code must retain the above copyright notice,
|
14
|
this list of conditions and the following disclaimer.
|
15
|
|
16
|
2. Redistributions in binary form must reproduce the above copyright
|
17
|
notice, this list of conditions and the following disclaimer in the
|
18
|
documentation and/or other materials provided with the distribution.
|
19
|
|
20
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
21
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
22
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
23
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
24
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
25
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
26
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
27
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
28
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
29
|
POSSIBILITY OF SUCH DAMAGE.
|
30
|
|
31
|
*/
|
32
|
|
33
|
/*
|
34
|
pfSense_MODULE: system
|
35
|
*/
|
36
|
|
37
|
// On the page, add in like so:
|
38
|
// $shortcut_section = "relayd";
|
39
|
|
40
|
$shortcuts = array();
|
41
|
|
42
|
/* Load and process custom shortcuts. */
|
43
|
function get_shortcut_files($directory) {
|
44
|
$dir_array = array();
|
45
|
if(!is_dir($directory))
|
46
|
return;
|
47
|
if ($dh = opendir($directory)) {
|
48
|
while (($file = readdir($dh)) !== false) {
|
49
|
$canadd = 0;
|
50
|
if($file == ".")
|
51
|
$canadd = 1;
|
52
|
if($file == "..")
|
53
|
$canadd = 1;
|
54
|
if($canadd == 0)
|
55
|
array_push($dir_array, $file);
|
56
|
}
|
57
|
closedir($dh);
|
58
|
}
|
59
|
if(!is_array($dir_array))
|
60
|
return;
|
61
|
return $dir_array;
|
62
|
}
|
63
|
|
64
|
// Load shortcuts
|
65
|
$dir_array = get_shortcut_files("/usr/local/www/shortcuts");
|
66
|
foreach ($dir_array as $file)
|
67
|
if (!is_dir("/usr/local/www/shortcuts/{$file}") && stristr($file,".inc"))
|
68
|
include("/usr/local/www/shortcuts/{$file}");
|
69
|
if(is_dir("/usr/local/pkg/shortcuts")) {
|
70
|
$dir_array = get_shortcut_files("/usr/local/pkg/shortcuts");
|
71
|
foreach ($dir_array as $file)
|
72
|
if (!is_dir("/usr/local/pkg/shortcuts/{$file}") && stristr($file,".inc"))
|
73
|
include("/usr/local/pkg/shortcuts/{$file}");
|
74
|
}
|
75
|
|
76
|
$shortcuts['relayd'] = array();
|
77
|
$shortcuts['relayd']['main'] = "load_balancer_pool.php";
|
78
|
$shortcuts['relayd']['log'] = "diag_logs_relayd.php";
|
79
|
$shortcuts['relayd']['status'] = "status_lb_pool.php";
|
80
|
$shortcuts['relayd']['service'] = "relayd";
|
81
|
|
82
|
$shortcuts['relayd-virtualservers'] = array();
|
83
|
$shortcuts['relayd-virtualservers']['main'] = "load_balancer_virtual_server.php";
|
84
|
$shortcuts['relayd-virtualservers']['log'] = "diag_logs_relayd.php";
|
85
|
$shortcuts['relayd-virtualservers']['status'] = "status_lb_vs.php";
|
86
|
$shortcuts['relayd-virtualservers']['service'] = "relayd";
|
87
|
|
88
|
$shortcuts['captiveportal'] = array();
|
89
|
$shortcuts['captiveportal']['main'] = "services_captiveportal_zones.php";
|
90
|
$shortcuts['captiveportal']['log'] = "diag_logs_auth.php";
|
91
|
$shortcuts['captiveportal']['status'] = "status_captiveportal.php";
|
92
|
$shortcuts['captiveportal']['service'] = "captiveportal";
|
93
|
|
94
|
$shortcuts['captiveportal-vouchers'] = array();
|
95
|
$shortcuts['captiveportal-vouchers']['log'] = "diag_logs_auth.php";
|
96
|
$shortcuts['captiveportal-vouchers']['status'] = "status_captiveportal_vouchers.php";
|
97
|
$shortcuts['captiveportal-vouchers']['service'] = "captiveportal";
|
98
|
|
99
|
$shortcuts['dhcp'] = array();
|
100
|
$shortcuts['dhcp']['main'] = "services_dhcp.php";
|
101
|
$shortcuts['dhcp']['log'] = "diag_logs_dhcp.php";
|
102
|
$shortcuts['dhcp']['status'] = "status_dhcp_leases.php";
|
103
|
$shortcuts['dhcp']['service'] = "dhcpd";
|
104
|
|
105
|
$shortcuts['dhcp6'] = array();
|
106
|
$shortcuts['dhcp6']['main'] = "services_dhcpv6.php";
|
107
|
$shortcuts['dhcp6']['log'] = "diag_logs_dhcp.php";
|
108
|
$shortcuts['dhcp6']['status'] = "status_dhcpv6_leases.php";
|
109
|
|
110
|
|
111
|
$shortcuts['ipsec'] = array();
|
112
|
$shortcuts['ipsec']['main'] = "vpn_ipsec.php";
|
113
|
$shortcuts['ipsec']['log'] = "diag_logs_ipsec.php";
|
114
|
$shortcuts['ipsec']['status'] = "diag_ipsec.php";
|
115
|
$shortcuts['ipsec']['service'] = "racoon";
|
116
|
|
117
|
$shortcuts['openvpn'] = array();
|
118
|
$shortcuts['openvpn']['main'] = "vpn_openvpn_server.php";
|
119
|
$shortcuts['openvpn']['log'] = "diag_logs_openvpn.php";
|
120
|
$shortcuts['openvpn']['status'] = "status_openvpn.php";
|
121
|
$shortcuts['openvpn']['service'] = "openvpn";
|
122
|
|
123
|
$shortcuts['firewall'] = array();
|
124
|
$shortcuts['firewall']['main'] = "firewall_rules.php";
|
125
|
$shortcuts['firewall']['log'] = "diag_logs_filter.php";
|
126
|
$shortcuts['firewall']['status'] = "status_filter_reload.php";
|
127
|
|
128
|
$shortcuts['routing'] = array();
|
129
|
$shortcuts['routing']['main'] = "system_routes.php";
|
130
|
$shortcuts['routing']['log'] = "diag_logs_routing.php";
|
131
|
$shortcuts['routing']['status'] = "diag_routes.php";
|
132
|
|
133
|
$shortcuts['gateways'] = array();
|
134
|
$shortcuts['gateways']['main'] = "system_gateways.php";
|
135
|
$shortcuts['gateways']['log'] = "diag_logs_gateways.php";
|
136
|
$shortcuts['gateways']['status'] = "status_gateways.php";
|
137
|
|
138
|
$shortcuts['gateway-groups'] = array();
|
139
|
$shortcuts['gateway-groups']['main'] = "system_gateway_groups.php";
|
140
|
$shortcuts['gateway-groups']['log'] = "diag_logs_gateways.php";
|
141
|
$shortcuts['gateway-groups']['status'] = "status_gateway_groups.php";
|
142
|
|
143
|
$shortcuts['interfaces'] = array();
|
144
|
$shortcuts['interfaces']['main'] = "interfaces_assign.php";
|
145
|
$shortcuts['interfaces']['status'] = "status_interfaces.php";
|
146
|
|
147
|
$shortcuts['trafficshaper'] = array();
|
148
|
$shortcuts['trafficshaper']['main'] = "firewall_shaper.php";
|
149
|
$shortcuts['trafficshaper']['status'] = "status_queues.php";
|
150
|
|
151
|
$shortcuts['resolver'] = array();
|
152
|
$shortcuts['resolver']['main'] = "services_dnsmasq.php";
|
153
|
$shortcuts['resolver']['log'] = "diag_logs_resolver.php";
|
154
|
$shortcuts['resolver']['service'] = "dnsmasq";
|
155
|
|
156
|
$shortcuts['wireless'] = array();
|
157
|
$shortcuts['wireless']['main'] = "interfaces_wireless.php";
|
158
|
$shortcuts['wireless']['log'] = "diag_logs_wireless.php";
|
159
|
$shortcuts['wireless']['status'] = "status_wireless.php";
|
160
|
|
161
|
$shortcuts['ntp'] = array();
|
162
|
$shortcuts['ntp']['main'] = "services_ntpd.php";
|
163
|
$shortcuts['ntp']['log'] = "diag_logs_ntpd.php";
|
164
|
$shortcuts['ntp']['status'] = "status_ntpd.php";
|
165
|
$shortcuts['ntp']['service'] = "ntpd";
|
166
|
|
167
|
$shortcuts['pptps'] = array();
|
168
|
$shortcuts['pptps']['main'] = "vpn_pptp.php";
|
169
|
$shortcuts['pptps']['log'] = "diag_logs_vpn.php";
|
170
|
|
171
|
$shortcuts['pppoes'] = array();
|
172
|
$shortcuts['pppoes']['main'] = "vpn_pppoe.php";
|
173
|
$shortcuts['pppoes']['log'] = "diag_logs_vpn.php?vpntype=poes";
|
174
|
|
175
|
$shortcuts['l2tps'] = array();
|
176
|
$shortcuts['l2tps']['main'] = "vpn_l2tp.php";
|
177
|
$shortcuts['l2tps']['log'] = "diag_logs_vpn.php?vpntype=l2tp";
|
178
|
|
179
|
$shortcuts['carp'] = array();
|
180
|
$shortcuts['carp']['main'] = "system_hasync.php";
|
181
|
$shortcuts['carp']['status'] = "carp_status.php";
|
182
|
?>
|