From 0688503f7092a87d31b961eb43e2ff6282bc8930 Mon Sep 17 00:00:00 2001 From: Daniel Stefan Haischt Date: Mon, 22 Jan 2007 00:24:04 +0000 Subject: * allow NFS options per export * split NFS daemon options and export options into two different tabs * allow NFS related daemons to bind to a particular IP address --- packages/freenas/www/services_nfs.php | 703 ++------------------- packages/freenas/www/services_samba.php | 2 - packages/freenas/www/services_samba_share.php | 8 +- packages/freenas/www/services_samba_share_edit.php | 5 +- 4 files changed, 72 insertions(+), 646 deletions(-) (limited to 'packages/freenas/www') diff --git a/packages/freenas/www/services_nfs.php b/packages/freenas/www/services_nfs.php index ea5bbf92..7b4b9a18 100644 --- a/packages/freenas/www/services_nfs.php +++ b/packages/freenas/www/services_nfs.php @@ -54,8 +54,9 @@ if (!is_array($freenas_config['nfs'])) } $pconfig['enable'] = isset($freenas_config['nfs']['enable']); -$pconfig['mapall'] = $freenas_config['nfs']['mapall']; $pconfig['bindto'] = $freenas_config['nfs']['bindto']; +$pconfig['serveudp'] = isset($freenas_config['nfs']['serveudp']); +$pconfig['servetcp'] = isset($freenas_config['nfs']['servetcp']); if (! empty($_POST)) { @@ -66,29 +67,11 @@ if (! empty($_POST)) $pconfig = $_POST; /* input validation */ - $reqdfields = explode(" ", "authnetworks bindto"); - $reqdfieldsn = explode(",", "Destination network, IP address to bind to"); + $reqdfields = explode(" ", "bindto"); + $reqdfieldsn = explode(",", "IP address to bind to"); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); - if (isset($_POST['authnetworks']) && is_array($_POST['authnetworks'])) { - foreach ($_POST['authnetworks'] as $netel) { - list($_POST['network'], $_POST['network_subnet']) = explode('/', $netel); - - if (($_POST['network'] && !is_ipaddr($_POST['network']))) { - $error_bucket[] = array("error" => gettext("A valid network must be specified."), - "field" => "network"); - } - - if (($_POST['network_subnet'] && !is_numeric($_POST['network_subnet']))) { - $error_bucket[] = array("error" => gettext("A valid network bit count must be specified."), - "field" => "network_subnet"); - } - - $osn['nfsnetwork'][] = gen_subnet($_POST['network'], $_POST['network_subnet']) . "/" . $_POST['network_subnet']; - } - } - if (is_array($error_bucket)) foreach($error_bucket as $elem) $input_errors[] =& $elem["error"]; @@ -101,10 +84,19 @@ if (! empty($_POST)) if (!$input_errors) { - $freenas_config['nfs'] = $osn; $freenas_config['nfs']['enable'] = $_POST['enable'] ? true : false; - $freenas_config['nfs']['mapall'] = $_POST['mapall']; $freenas_config['nfs']['bindto'] = $_POST['bindto']; + if (isset($_POST['servetcp'])) { + $freenas_config['nfs']['servetcp'] = $_POST['servetcp']; + } else { + unset($freenas_config['nfs']['servetcp']); + } + if (isset($_POST['serveudp'])) { + $freenas_config['nfs']['serveudp'] = $_POST['serveudp']; + } else { + unset($freenas_config['nfs']['serveudp']); + } + write_config(); $retval = 0; @@ -127,548 +119,22 @@ include("head.inc"); /* put your custom HTML head content here */ /* using some of the $pfSenseHead function calls */ -$addressTransString = gettext("Address"); -$plusimgDescTransString = gettext("add to network list"); -$minusimgDescTransString = gettext("remove from network list"); -$currentnetTransString = gettext("Current networks"); -$networksTypehintTransString = gettext("Network that is authorised to access NFS shares"); - -$networkCount = count($freenas_config['nfs']['nfsnetwork']); -$generatedWANSubnet = gen_subnet($config['interfaces']['wan']['ipaddr'], - $config['interfaces']['wan']['subnet']); -$generatedLANSubnet = gen_subnet($config['interfaces']['lan']['ipaddr'], - $config['interfaces']['lan']['subnet']); - $jscriptstr = << @@ -683,11 +149,25 @@ echo $pfSenseHead->getHTML(); "> +
-
- - +
+
+ + + + + + +
+ +
+
+ - - - - - + - - - -
@@ -700,16 +180,19 @@ echo $pfSenseHead->getHTML();
- -
- -
- - - - - -
: - -
+

+ /> + +

+

+ /> + +

+

+ : + + + +

  - - " onmousedown="selectnetel();" onkeydown="selectnetel();" /> -
  - - : - -
-
    -
  • - - - -
  • -
  • - - - -
  • -
  • - - - -
  • -
+ " />
- +
+
+ diff --git a/packages/freenas/www/services_samba.php b/packages/freenas/www/services_samba.php index 06a0291d..afd90a08 100644 --- a/packages/freenas/www/services_samba.php +++ b/packages/freenas/www/services_samba.php @@ -234,8 +234,6 @@ echo $pfSenseHead->getHTML();
- - - - - + + + diff --git a/packages/freenas/www/services_samba_share_edit.php b/packages/freenas/www/services_samba_share_edit.php index 02efc98d..d417fa4c 100644 --- a/packages/freenas/www/services_samba_share_edit.php +++ b/packages/freenas/www/services_samba_share_edit.php @@ -81,7 +81,8 @@ if (! empty($_POST)) if (!$input_errors) { - if(!$_POST['browseable']) { + /* TODO: This logic needs to be tested! */ + if($_POST['browseable'] == gettext("No")) { $freenas_config['samba']['hidemount'] = array_merge($freenas_config['samba']['hidemount'],array($freenas_config['mounts']['mount'][$id]['sharename'])); } else { if(is_array($freenas_config['samba']['hidemount']) && in_array($freenas_config['mounts']['mount'][$id]['sharename'],$freenas_config['samba']['hidemount'])) { @@ -109,7 +110,7 @@ echo $pfSenseHead->getHTML();
- +
diff --git a/packages/freenas/www/services_samba_share.php b/packages/freenas/www/services_samba_share.php index 95f1fe0b..1545df97 100644 --- a/packages/freenas/www/services_samba_share.php +++ b/packages/freenas/www/services_samba_share.php @@ -143,11 +143,11 @@ echo $pfSenseHead->getHTML();
   - "); ?>
-- cgit v1.2.3