Revision e1135f7b
Added by Jim Pingle over 15 years ago
usr/local/www/widgets/widgets/services_status.widget.php | ||
---|---|---|
54 | 54 |
* |
55 | 55 |
*/ |
56 | 56 |
if(isset($config['dnsmasq']['enable'])) { |
57 |
$pconfig['name'] = "dnsmasq";
|
|
58 |
$pconfig['description'] = "DNS Forwarder";
|
|
59 |
$services[] = $pconfig;
|
|
60 |
unset($pconfig);
|
|
57 |
$sconfig['name'] = "dnsmasq";
|
|
58 |
$sconfig['description'] = "DNS Forwarder";
|
|
59 |
$services[] = $sconfig;
|
|
60 |
unset($sconfig);
|
|
61 | 61 |
} |
62 | 62 |
|
63 |
$pconfig['name'] = "ntpd";
|
|
64 |
$pconfig['description'] = "NTP clock sync";
|
|
65 |
$services[] = $pconfig;
|
|
66 |
unset($pconfig);
|
|
63 |
$sconfig['name'] = "ntpd";
|
|
64 |
$sconfig['description'] = "NTP clock sync";
|
|
65 |
$services[] = $sconfig;
|
|
66 |
unset($sconfig);
|
|
67 | 67 |
|
68 | 68 |
if(isset($config['captiveportal']['enable'])) { |
69 |
$pconfig['name'] = "lighttpd";
|
|
70 |
$pconfig['description'] = "Captive Portal";
|
|
71 |
$services[] = $pconfig;
|
|
72 |
$pconfig = "";
|
|
73 |
unset($pconfig);
|
|
69 |
$sconfig['name'] = "lighttpd";
|
|
70 |
$sconfig['description'] = "Captive Portal";
|
|
71 |
$services[] = $sconfig;
|
|
72 |
$sconfig = "";
|
|
73 |
unset($sconfig);
|
|
74 | 74 |
} |
75 | 75 |
|
76 | 76 |
$iflist = array(); |
... | ... | |
87 | 87 |
} |
88 | 88 |
|
89 | 89 |
if($show_dhcprelay == true) { |
90 |
$pconfig['name'] = "dhcrelay";
|
|
91 |
$pconfig['description'] = "DHCP Relay";
|
|
92 |
$services[] = $pconfig;
|
|
93 |
unset($pconfig);
|
|
90 |
$sconfig['name'] = "dhcrelay";
|
|
91 |
$sconfig['description'] = "DHCP Relay";
|
|
92 |
$services[] = $sconfig;
|
|
93 |
unset($sconfig);
|
|
94 | 94 |
} |
95 | 95 |
|
96 | 96 |
if(is_dhcp_server_enabled()) { |
97 |
$pconfig['name'] = "dhcpd";
|
|
98 |
$pconfig['description'] = "DHCP Service";
|
|
99 |
$services[] = $pconfig;
|
|
100 |
unset($pconfig);
|
|
97 |
$sconfig['name'] = "dhcpd";
|
|
98 |
$sconfig['description'] = "DHCP Service";
|
|
99 |
$services[] = $sconfig;
|
|
100 |
unset($sconfig);
|
|
101 | 101 |
} |
102 | 102 |
|
103 | 103 |
if(isset($config['snmpd']['enable'])) { |
104 |
$pconfig['name'] = "bsnmpd";
|
|
105 |
$pconfig['description'] = "SNMP Service";
|
|
106 |
$services[] = $pconfig;
|
|
107 |
unset($pconfig);
|
|
104 |
$sconfig['name'] = "bsnmpd";
|
|
105 |
$sconfig['description'] = "SNMP Service";
|
|
106 |
$services[] = $sconfig;
|
|
107 |
unset($sconfig);
|
|
108 | 108 |
} |
109 | 109 |
|
110 | 110 |
if (count($config['igmpproxy']['igmpentry']) > 0) { |
111 |
$pconfig['name'] = "igmpproxy";
|
|
112 |
$pconfig['descritption'] = "IGMP proxy";
|
|
113 |
$services[] = $pconfig;
|
|
114 |
unset($pconfig);
|
|
111 |
$sconfig['name'] = "igmpproxy";
|
|
112 |
$sconfig['descritption'] = "IGMP proxy";
|
|
113 |
$services[] = $sconfig;
|
|
114 |
unset($sconfig);
|
|
115 | 115 |
} |
116 | 116 |
|
117 | 117 |
if($config['installedpackages']['miniupnpd']['config'][0]['enable']) { |
118 |
$pconfig['name'] = "miniupnpd";
|
|
119 |
$pconfig['description'] = gettext("UPnP Service");
|
|
120 |
$services[] = $pconfig;
|
|
121 |
unset($pconfig);
|
|
118 |
$sconfig['name'] = "miniupnpd";
|
|
119 |
$sconfig['description'] = gettext("UPnP Service");
|
|
120 |
$services[] = $sconfig;
|
|
121 |
unset($sconfig);
|
|
122 | 122 |
} |
123 | 123 |
|
124 | 124 |
if (isset($config['ipsec']['enable'])) { |
125 |
$pconfig['name'] = "racoon";
|
|
126 |
$pconfig['description'] = gettext("IPsec VPN");
|
|
127 |
$services[] = $pconfig;
|
|
128 |
unset($pconfig);
|
|
125 |
$sconfig['name'] = "racoon";
|
|
126 |
$sconfig['description'] = gettext("IPsec VPN");
|
|
127 |
$services[] = $sconfig;
|
|
128 |
unset($sconfig);
|
|
129 | 129 |
} |
130 | 130 |
|
131 | 131 |
foreach (array('server', 'client') as $mode) { |
... | ... | |
133 | 133 |
foreach ($config['installedpackages']["openvpn$mode"]['config'] as $id => $settings) { |
134 | 134 |
$setting = $config['installedpackages']["openvpn$mode"]['config'][$id]; |
135 | 135 |
if (!$setting['disable']) { |
136 |
$pconfig['name'] = "openvpn";
|
|
137 |
$pconfig['mode'] = $mode;
|
|
138 |
$pconfig['id'] = $id;
|
|
139 |
$pconfig['description'] = "OpenVPN ".$mode.": ".htmlspecialchars($setting['description']);
|
|
140 |
$services[] = $pconfig;
|
|
141 |
unset($pconfig);
|
|
136 |
$sconfig['name'] = "openvpn";
|
|
137 |
$sconfig['mode'] = $mode;
|
|
138 |
$sconfig['id'] = $id;
|
|
139 |
$sconfig['description'] = "OpenVPN ".$mode.": ".htmlspecialchars($setting['description']);
|
|
140 |
$services[] = $sconfig;
|
|
141 |
unset($sconfig);
|
|
142 | 142 |
} |
143 | 143 |
} |
144 | 144 |
} |
Also available in: Unified diff
Change variable name to avoid clobbering one by the same name in the Dashboard. Fixes all kinds of fun Dashboard issues. Any widget directly after the Services Status one would mess up in some way.