diff -Nr -x .svn -x '*~' svn-orig/phpconf/inc/services.inc svn/phpconf/inc/services.inc
77c77,85
< 	
---
> 
> 	/* Extra Options (global) (not yet) */
> 	/* $optioncfg = "";
> 	if (isset($dhcpdcfg['options'])
> 		foreach ($dhcpdcfg['options'] as $option) 
> 			$optioncfg .= "option " . $option['name'] . " " . $option['value'];
> 
> 	$dhcpdconf .= $optioncfg . "\n"; */
> 
104a113,119
> 
> // Extra Options (if related)
> 		$optioncfg = "";
> 		if (isset($dhcpifconf['options']))
> 			foreach ($dhcpifconf['options'] as $option)
> 				$optioncfg .= "	option " . $option['name'] . " " . $option['value'];
> 
119a135
> $optioncfg
diff -Nr -x .svn -x '*~' svn-orig/webgui/services_dhcp_option_edit.php svn/webgui/services_dhcp_option_edit.php
0a1,150
> #!/usr/local/bin/php
> <?php 
> /*
> 	$Id: services_dhcp_edit.php 72 2006-02-10 11:13:01Z jdegraeve $
> 	part of m0n0wall (http://m0n0.ch/wall)
> 	
> 	Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
> 	All rights reserved.
> 	
> 	Redistribution and use in source and binary forms, with or without
> 	modification, are permitted provided that the following conditions are met:
> 	
> 	1. Redistributions of source code must retain the above copyright notice,
> 	   this list of conditions and the following disclaimer.
> 	
> 	2. Redistributions in binary form must reproduce the above copyright
> 	   notice, this list of conditions and the following disclaimer in the
> 	   documentation and/or other materials provided with the distribution.
> 	
> 	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
> 	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
> 	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> 	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
> 	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
> 	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
> 	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
> 	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> 	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
> 	POSSIBILITY OF SUCH DAMAGE.
> */
> 
> $pgtitle = array("Services", "DHCP server", "Edit DHCP options");
> require("guiconfig.inc");
> 
> $if = $_GET['if'];
> if ($_POST['if'])
> 	$if = $_POST['if'];
> 	
> if (!$if) {
> 	header("Location: services_dhcp.php");
> 	exit;
> }
> 
> if (!is_array($config['dhcpd'][$if]['options'])) {
> 	$config['dhcpd'][$if]['options'] = array();
> }
> //staticmaps_sort($if);
> $options = &$config['dhcpd'][$if]['options'];
> $ifcfg = &$config['interfaces'][$if];
> 
> $id = $_GET['id'];
> if (isset($_POST['id']))
> 	$id = $_POST['id'];
> 
> if (isset($id) && $options[$id]) {
> 	$pconfig['name']  = $options[$id]['name'];
> 	$pconfig['value'] = $options[$id]['value'];
> 	$pconfig['descr'] = $options[$id]['descr'];
> } else {
> 	$pconfig['name'] = $_GET['name'];
> }
> 
> if ($_POST) {
> 
> 	unset($input_errors);
> 	$pconfig = $_POST;
> 
> 	/* input validation */
> 	$reqdfields = explode(" ", "name value");
> 	$reqdfieldsn = explode(",", "option name,option value");
> 	
> 	do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
> 	
> 	/* check for overlaps */
> 	foreach ($options as $option) {
> 		if (isset($id) && ($options[$id]) && ($options[$id] === $option))
> 			continue;
> 
> 		if (($option['name'] == $_POST['name'])) {
> 			$input_errors[] = "This option already exists.";
> 			break;
> 		}
> 	}
> 		
> 	/* make sure it's not defined by default configuration */
> 	$badoptions = array('routers','domain-name-servers');
> 	if (in_array ($POST['name'], $badoptions))
> 		$input_errors[] = "User defined option must not be " . join (", ",$badoptions);
> 
> 
> 	if (!$input_errors) {
> 		$option = array();
> 		$option['name']  = $_POST['name'];
> 		$option['value'] = $_POST['value'];
> 		$option['descr'] = $_POST['descr'];
> 
> 		if (isset($id) && $options[$id])
> 			$options[$id] = $option;
> 		else
> 			$options[] = $option;
> 		
> 		//touch($d_staticmapsdirty_path);
> 		
> 		write_config();
> echo "<pre>";
> 		print_r ($config);
> 		
> 		header("Location: services_dhcp.php?if={$if}");
> 		exit;
> 	}
> }
> ?>
> <?php include("fbegin.inc"); ?>
> <?php if ($input_errors) print_input_errors($input_errors); ?>
>             <form action="services_dhcp_option_edit.php" method="post" name="iform" id="iform">
>               <table width="100%" border="0" cellpadding="6" cellspacing="0">
>                 <tr> 
>                   <td width="22%" valign="top" class="vncellreq">DHCP options</td>
>                   <td width="78%" class="vtable"> 
>                     <?=$mandfldhtml;?><input name="name" type="text" class="formfld" id="name" size="30" value="<?=htmlspecialchars($pconfig['name']);?>"> 
>                     <br>
>                     <span class="vexpl">Enter a option name:</span></td>
>                 </tr>
>                 <tr> 
>                   <td width="22%" valign="top" class="vncell">option value</td>
>                   <td width="78%" class="vtable"> 
>                     <input name="value" type="text" class="formfld" id="value" size="20" value="<?=htmlspecialchars($pconfig['value']);?>">
>                     <br>
>                     All options will be processed in the format: option &lt;option-name&gt; &lt;option-value&gt;</td>
>                 </tr>
>                 <tr> 
>                   <td width="22%" valign="top" class="vncell">Description</td>
>                   <td width="78%" class="vtable"> 
>                     <input name="descr" type="text" class="formfld" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>"> 
>                     <br> <span class="vexpl">You may enter a description here 
>                     for your reference (not parsed).</span></td>
>                 </tr>
>                 <tr> 
>                   <td width="22%" valign="top">&nbsp;</td>
>                   <td width="78%"> 
>                     <input name="Submit" type="submit" class="formbtn" value="Save"> 
>                     <?php if (isset($id) && $options[$id]): ?>
>                     <input name="id" type="hidden" value="<?=$id;?>">
>                     <?php endif; ?>
>                     <input name="if" type="hidden" value="<?=$if;?>"> 
>                   </td>
>                 </tr>
>               </table>
> </form>
> <?php include("fend.inc"); ?>
diff -Nr -x .svn -x '*~' svn-orig/webgui/services_dhcp.php svn/webgui/services_dhcp.php
66a67
> $options = &$config['dhcpd'][$if]['options'];
154a156,164
> 
> if ($_GET['act'] == "deloption") {
> 	if ($options[$_GET['id']]) {
> 		unset($options[$_GET['id']]);
> 		write_config();
> 		header("Location: services_dhcp.php?if={$if}");
> 		exit;
> 	}
> }
284a295,321
>                   <td width="35%" class="listhdrr">Option Name</td>
>                   <td width="20%" class="listhdrr">Option Value</td>
>                   <td width="35%" class="listhdr">Description</td>
>                   <td width="10%" class="list"></td>
> 				</tr>
> 			  <?php $i = 0; foreach ($options as $option): ?>
>                 <tr>
>                   <td class="listlr">
>                     <?=htmlspecialchars($option['name']);?>
>                   </td>
>                   <td class="listr">
>                     <?=htmlspecialchars($option['value']);?>&nbsp;
>                   </td>
>                   <td class="listbg">
>                     <?=htmlspecialchars($option['descr']);?>&nbsp;
>                   </td>
>                   <td valign="middle" nowrap class="list"> <a href="services_dhcp_option_edit.php?if=<?=$if;?>&id=<?=$i;?>"><img src="e.gif" title="edit option" width="17" height="17" border="0"></a>
>                      &nbsp;<a href="services_dhcp.php?if=<?=$if;?>&act=deloption&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this option?')"><img src="x.gif" title="delete option" width="17" height="17" border="0"></a></td>
> 				</tr>
> 			  <?php $i++; endforeach; ?>
>                 <tr> 
>                   <td class="list" colspan="3"></td>
>                   <td class="list"> <a href="services_dhcp_option_edit.php?if=<?=$if;?>"><img src="plus.gif" title="add mapping" width="17" height="17" border="0"></a></td>
> 				</tr>
>               </table>
>               <table width="100%" border="0" cellpadding="0" cellspacing="0">
>                 <tr>
