diff options
author | Renato Botelho <renato.botelho@bluepex.com> | 2010-04-27 08:41:15 -0300 |
---|---|---|
committer | Renato Botelho <renato.botelho@bluepex.com> | 2010-04-27 08:41:15 -0300 |
commit | be28a8c001ea693d491a98190445fdf6890d49f8 (patch) | |
tree | 646672ebaf8cf7426e05cc973d7a34409181a1c5 | |
parent | fac4562ee206e6e442b2107fc153e4eae6a4b3a2 (diff) | |
parent | 0648c9688a4f3324c6e90039b5179eb64bde4653 (diff) | |
download | pfsense-be28a8c001ea693d491a98190445fdf6890d49f8.zip pfsense-be28a8c001ea693d491a98190445fdf6890d49f8.tar.gz |
Merge remote branch 'mainline/master'
-rw-r--r-- | etc/inc/pkg-utils.inc | 12 | ||||
-rw-r--r-- | etc/inc/shaper.inc | 3 | ||||
-rwxr-xr-x | usr/local/www/firewall_virtual_ip_edit.php | 2 | ||||
-rwxr-xr-x | usr/local/www/javascript/row_helper.js | 2 | ||||
-rwxr-xr-x | usr/local/www/javascript/row_helper_dynamic.js | 2 | ||||
-rwxr-xr-x | usr/local/www/pkg_edit.php | 58 |
6 files changed, 70 insertions, 9 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index a443c28..f8c187c 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -276,11 +276,13 @@ function get_pkg_depends($pkg_name, $filetype = ".xml", $format = "files", $retu function uninstall_package_from_name($pkg_name) { global $config; $id = get_pkg_id($pkg_name); - $pkg_depends =& $config['installedpackages']['package'][$id]['depends_on_package']; - delete_package($pkg_depends[0], $pkg_name); - if (is_array($pkg_depends)) { - foreach ($pkg_depends as $pkg_depend) - remove_freebsd_package($pkg_depend); + if ($id >= 0) { + $pkg_depends =& $config['installedpackages']['package'][$id]['depends_on_package']; + delete_package($pkg_depends[0], $pkg_name); + if (is_array($pkg_depends)) { + foreach ($pkg_depends as $pkg_depend) + remove_freebsd_package($pkg_depend); + } } delete_package_xml($pkg_name); } diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc index d366180..9a023eb 100644 --- a/etc/inc/shaper.inc +++ b/etc/inc/shaper.inc @@ -3443,8 +3443,7 @@ class layer7 { } function delete_l7c() { - $l7pid = `"/bin/pgrep -f 'ipfw-classifyd .* -p ". $l7rules->GetRPort() . "'"`; - mwexec("/bin/kill {$l7pid}"); + mwexec("/bin/pkill -f 'ipfw-classifyd .* -p ". $l7rules->GetRPort() . "'", true); unset_l7_object_by_reference($this->GetRName()); cleanup_l7_from_rules($this->GetRName()); } diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php index 89e473a..80d40d8 100755 --- a/usr/local/www/firewall_virtual_ip_edit.php +++ b/usr/local/www/firewall_virtual_ip_edit.php @@ -216,7 +216,7 @@ if ($_POST) { mark_subsystem_dirty('vip'); write_config(); - if (!$id) + if (!$id && $id != 0) $id = count($a_vip) - 1; header("Location: firewall_virtual_ip.php?changes=mods&id={$id}"); exit; diff --git a/usr/local/www/javascript/row_helper.js b/usr/local/www/javascript/row_helper.js index 8193043..476602b 100755 --- a/usr/local/www/javascript/row_helper.js +++ b/usr/local/www/javascript/row_helper.js @@ -28,6 +28,8 @@ var addRowTo = (function() { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input size='" + rowsize[i] + "' class='formfld unknown' name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> "; } else if(rowtype[i] == 'select') { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><select size='1' name='" + rowname[i] + totalrows + "'><option value=\"32\" selected>32</option><option value=\"31\" >31</option><option value=\"30\" >30</option><option value=\"29\" >29</option><option value=\"28\" >28</option><option value=\"27\" >27</option><option value=\"26\" >26</option><option value=\"25\" >25</option><option value=\"24\" >24</option><option value=\"23\" >23</option><option value=\"22\" >22</option><option value=\"21\" >21</option><option value=\"20\" >20</option><option value=\"19\" >19</option><option value=\"18\" >18</option><option value=\"17\" >17</option><option value=\"16\" >16</option><option value=\"15\" >15</option><option value=\"14\" >14</option><option value=\"13\" >13</option><option value=\"12\" >12</option><option value=\"11\" >11</option><option value=\"10\" >10</option><option value=\"9\" >9</option><option value=\"8\" >8</option><option value=\"7\" >7</option><option value=\"6\" >6</option><option value=\"5\" >5</option><option value=\"4\" >4</option><option value=\"3\" >3</option><option value=\"2\" >2</option><option value=\"1\" >1</option></select> "; + } else if(rowtype[i] == 'select_source') { + td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><select size='1' name='" + rowname[i] + totalrows + "'><option value=\"32\" selected>32</option><option value=\"31\" >31</option><option value=\"30\" >30</option><option value=\"29\" >29</option><option value=\"28\" >28</option><option value=\"27\" >27</option><option value=\"26\" >26</option><option value=\"25\" >25</option><option value=\"24\" >24</option><option value=\"23\" >23</option><option value=\"22\" >22</option><option value=\"21\" >21</option><option value=\"20\" >20</option><option value=\"19\" >19</option><option value=\"18\" >18</option><option value=\"17\" >17</option><option value=\"16\" >16</option><option value=\"15\" >15</option><option value=\"14\" >14</option><option value=\"13\" >13</option><option value=\"12\" >12</option><option value=\"11\" >11</option><option value=\"10\" >10</option><option value=\"9\" >9</option><option value=\"8\" >8</option><option value=\"7\" >7</option><option value=\"6\" >6</option><option value=\"5\" >5</option><option value=\"4\" >4</option><option value=\"3\" >3</option><option value=\"2\" >2</option><option value=\"1\" >1</option></select> "; } else { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input type='checkbox' name='" + rowname[i] + totalrows + "'></input> "; } diff --git a/usr/local/www/javascript/row_helper_dynamic.js b/usr/local/www/javascript/row_helper_dynamic.js index 778f182..032874c 100755 --- a/usr/local/www/javascript/row_helper_dynamic.js +++ b/usr/local/www/javascript/row_helper_dynamic.js @@ -31,6 +31,8 @@ var addRowTo = (function() { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input size='" + objectSize + "' name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> "; } else if(rowtype[i] == 'select') { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><select name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'>" + newrow[i] + "</select> "; + } else if(rowtype[i] == 'select_source') { + td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><select name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'>" + newrow[i] + "</select> "; } else if(rowtype[i] == 'checkbox') { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input type='checkbox'name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> "; } else if(rowtype[i] == 'input') { diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php index 6c2fbde..5ac3776 100755 --- a/usr/local/www/pkg_edit.php +++ b/usr/local/www/pkg_edit.php @@ -440,6 +440,40 @@ if ($pkg['tabs'] <> "") { } print("</select>\n<br />\n" . fixup_string($pkga['description']) . "\n"); + } else if($pkga['type'] == "select_source") { + $fieldname = $pkga['fieldname']; + if (isset($pkga['multiple'])) { + $multiple = 'multiple="multiple"'; + $items = explode(',', $value); + $fieldname .= "[]"; + } + else { + $multiple = ''; + $items = array($value); + } + $size = (isset($pkga['size']) ? "size=\"{$pkga['size']}\"" : ''); + $onchange = (isset($pkga['onchange']) ? "onchange=\"{$pkga['onchange']}\"" : ''); + + print("<select id='" . $pkga['fieldname'] . "' $multiple $size $onchange id=\"$fieldname\" name=\"$fieldname\">\n"); + $source_url = $pkga['source']; + eval("\$pkg_source_txt = &$source_url;"); + foreach ($pkg_source_txt as $opt) { + $selected = ''; + if($pkga['source_name']) { + $source_name = $opt[$pkga['source_name']]; + } else { + $source_name = $opt[$pkga['name']]; + } + if($pkga['source_value']) { + $source_value = $opt[$pkga['source_value']]; + } else { + $source_value = $opt[$pkga['value']]; + } + if (in_array($opt['value'], $items)) $selected = 'selected="selected"'; + print("\t<option name=\"{$source_name}\" value=\"{$source_value}\" $selected>{$source_name}</option>\n"); + } + + print("</select>\n<br />\n" . fixup_string($pkga['description']) . "\n"); } else if($pkga['type'] == "vpn_selection") { echo "<select id='" . $pkga['fieldname'] . "' name='" . $vpn['name'] . "'>\n"; foreach ($config['ipsec']['phase1'] as $vpn) { @@ -656,7 +690,7 @@ if($pkg['note'] != "") * ROW Helpers function */ function display_row($trc, $value, $fieldname, $type, $rowhelper, $size) { - global $text; + global $text, $config; echo "<td>\n"; if($type == "input") { echo "<input size='" . $size . "' name='" . $fieldname . $trc . "' id='" . $fieldname . $trc . "' value='" . $value . "'>\n"; @@ -678,6 +712,28 @@ function display_row($trc, $value, $fieldname, $type, $rowhelper, $size) { echo "<option value='" . $rowopt['value'] . "'" . $selected . ">" . $rowopt['name'] . "</option>\n"; } echo "</select>\n"; + } else if($type == "select_source") { + echo "<select id='" . $fieldname . $trc . "' name='" . $fieldname . $trc . "'>\n"; + $source_url = $rowhelper['source']; + eval("\$pkg_source_txt = &$source_url;"); + foreach($pkg_source_txt as $opt) { + $selected = ""; + if($rowhelper['source_name']) { + $source_name = $opt[$rowhelper['source_name']]; + } else { + $source_name = $opt[$rowhelper['name']]; + } + if($rowhelper['source_value']) { + $source_value = $opt[$rowhelper['source_value']]; + } else { + $source_value = $opt[$rowhelper['value']]; + } + if($opt['value'] == $value) + $selected = " SELECTED"; + $text .= "<option value='" . $source_value . "'" . $selected . ">" . $source_name . "</option>"; + echo "<option value='" . $source_value . "'" . $selected . ">" . $source_name . "</option>\n"; + } + echo "</select>\n"; } } |