aboutsummaryrefslogtreecommitdiffstats
path: root/config/ntop2
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-06-22 16:08:49 -0400
committerjim-p <jimp@pfsense.org>2011-06-22 16:09:14 -0400
commit4f925053f4a9399bbe132900233587742a4cd163 (patch)
tree36a4bdba4311b8e32078e7410a901bb633afc6e5 /config/ntop2
parent098e698f5aee0c18c5af94650782ff4c129bbf49 (diff)
downloadpfsense-packages-4f925053f4a9399bbe132900233587742a4cd163.tar.gz
pfsense-packages-4f925053f4a9399bbe132900233587742a4cd163.tar.bz2
pfsense-packages-4f925053f4a9399bbe132900233587742a4cd163.zip
Misc lightsquid fixes
Diffstat (limited to 'config/ntop2')
-rw-r--r--config/ntop2/ntop.xml63
1 files changed, 35 insertions, 28 deletions
diff --git a/config/ntop2/ntop.xml b/config/ntop2/ntop.xml
index 8ff4d8a1..6cd71d60 100644
--- a/config/ntop2/ntop.xml
+++ b/config/ntop2/ntop.xml
@@ -123,35 +123,32 @@
system("/bin/chmod -R 755 /var/db/ntop");
system("/usr/sbin/chown -R nobody:nobody /var/db/ntop");
system("/bin/cp -Rp /usr/local/lib/X11/fonts/webfonts/ /usr/local/lib/X11/fonts/TTF/");
- if($ntop_config['password'] and $ntop_config['passwordagain']) {
- if($ntop_config['password'] == $ntop_config['passwordagain']) {
- $first = 0;
- $mergeifs = ($ntop_config['allowmerge'] == "on") ? "" : "-M";
- $alltraffic = ($ntop_config['alltraffic'] == "on") ? "" : "--ipv4";
- foreach($ntop_config['interface_array'] as $iface) {
- $if = convert_friendly_interface_to_real_interface_name($iface);
- if($if) {
- if($first == 1)
- $ifaces_final .= ",";
- $ifaces_final .= $if;
- $first = 1;
- }
- }
- exec("/usr/local/bin/ntop --set-admin-password=" . $ntop_config['password'] . " &", $ntopout);
- $start = "/usr/local/bin/ntop -i {$ifaces_final} -u root -d {$alltraffic} {$mergeifs} -x 8102 -X 8192 &";
- write_rcfile(array(
- "file" => "ntop.sh",
- "start" => $start,
- "stop" => "/usr/bin/killall ntop"
- )
- );
- restart_service("ntop");
- } else {
- $input_errors[] = "The provided passwords did not match.";
- }
- } else {
- $input_errors[] = "You must provide (and confirm) ntop's password.";
+ $first = 0;
+ $mergeifs = ($ntop_config['allowmerge'] == "on") ? "" : "-M";
+ $alltraffic = ($ntop_config['alltraffic'] == "on") ? "" : "--ipv4";
+ foreach($ntop_config['interface_array'] as $iface) {
+ $if = convert_friendly_interface_to_real_interface_name($iface);
+ if($if) {
+ if($first == 1)
+ $ifaces_final .= ",";
+ $ifaces_final .= $if;
+ $first = 1;
+ }
}
+ $start = "/usr/local/bin/ntop -i {$ifaces_final} -u root -d {$alltraffic} {$mergeifs} -x 8102 -X 8192 &";
+ write_rcfile(array(
+ "file" => "ntop.sh",
+ "start" => $start,
+ "stop" => "/usr/bin/killall ntop"
+ )
+ );
+ stop_service("ntop");
+ if (empty($ntop_config['password']))
+ $ntop_config['password'] = "admin";
+ sleep(5);
+ unlink_if_exists("/var/db/ntop/ntop_pw.db");
+ exec("/usr/local/bin/ntop --set-admin-password={$ntop_config['password']});
+ start_service("ntop");
conf_mount_ro();
config_unlock();
}
@@ -169,4 +166,14 @@
<custom_php_deinstall_command>
exec("rm /usr/local/etc/rc.d/ntop*");
</custom_php_deinstall_command>
+ <custom_php_validation_command>
+ <![CDATA[
+ if ($_POST) {
+ if (empty($_POST['password']) || empty($_POST['passwordagain']))
+ $input_errors[] = "You must provide (and confirm) ntop's password.";
+ if ($_POST['password'] != $_POST['passwordagain'])
+ $input_errors[] = "The provided passwords did not match.";
+ }
+ ]]>
+ </custom_php_validation_command>
</packagegui> \ No newline at end of file