summaryrefslogtreecommitdiffstats
path: root/usr/local/www/firewall_aliases_edit.php
Commit message (Collapse)AuthorAgeFilesLines
* Fix Firewall - Aliases GUI inconsistencies for URL Table type aliasesdoktornotor2015-07-171-4/+4
| | | The GUI should show descriptions according to what's selected from the dropdown, but currently does not for URL Table (IPs) and URL Table (Ports) type of aliases.
* Merge pull request #1743 from phil-davis/patch-4Renato Botelho2015-07-151-0/+1
|\
| * Firewall Aliases Edit ensure input_addresses array existsPhil Davis2015-07-121-0/+1
| | | | | | | | | | | | If you click "+" to add an alias, then press Save without entering anything, you get: Warning: Invalid argument supplied for foreach() in /usr/local/www/firewall_aliases_edit.php on line 402 as well as the various messages related to $input_errors. This change ensures that $input_addresses array always exists (even if it has no real entries) so that the foreach() warning does not happen.
* | Cancel button after input errorPhil Davis2015-07-131-1/+6
|/ | | | | | | | | | | If there is an input error then the edit page is redrawn showing the input errors. The HTTP_REFERER becomes the current page, rather than the true original referer. Then if you click Cancel the current page is just redrawn. This change makes the code remember the original referer, so if the user enters some invalid data, presses Save, reads the input error messages then presses Cancel they are taken back out to the original page - the same as if Cancel was used before Save.
* Code spacingPhil Davis2015-06-151-5/+5
| | | | | | | and other random stuff I noticed. I think this finishes messing with code style. The codebase should match the developer style guide closely enough that 99.9% of changes will not feel the need to also massage the formatting.
* Fix alias rename and delete bug #4701Phil Davis2015-05-141-5/+5
| | | | The old advancedoutbound key in config.xml is now called outbound.
* Code style firewall_aliasesPhil Davis2015-05-111-65/+95
|
* Fix aliases popup width when fields are hidden when page is loaded. It ↵Renato Botelho2015-02-021-1/+1
| | | | should fix #4238
* Improve URL and URL ports alias update data:Renato Botelho2015-01-081-30/+2
| | | | | | | | | | | | - Move redundant code to a function parse_aliases_file(). Before the max number of items was not being respected when URL content is updated, only when alias was saved. Same was happening with ip/subnet/port validation and user could end up with a bad pf.conf - Remove unused variables These changes were based on Pull Request #1264. It should fix #4189 Submitted by:▸ PiBa-NL
* Fix lineup of copyright linesPhil Davis2015-01-011-1/+1
| | | | | and module names and other bits of formatting and typos in header comment sections.
* Welcome 2015Renato Botelho2014-12-311-1/+1
|
* modify copyright statement to reflect realityJim Thompson2014-11-101-0/+1
|
* Merge pull request #1297 from phil-davis/patch-23Renato Botelho2014-10-281-38/+138
|\
| * Expand range or subnet for host aliasPhil Davis2014-10-241-18/+95
| | | | | | | | | | When entering a host alias, if the user put an IP range (like 192.168.0.10-192.168.0.20) or a subnet (like 192.168.1.200/29) then expand it into a list of individual IP addresses. Check that it will not make too many rows to exceed the existing 5000 row limit on the GUI. Note: expanding ranges and subnets like this is only for IPv4 for now. Entering an IPv6 range or subnet in a hosts alias will display a message telling the user that is not supported - it could be done in future but currently the routines that convert this stuff are only for IPv4. I have done as much validation as I can think of, and where there is a problem the original user-entered data is preserved for re-display, as well as the input errors being displayed. So IMO it should be self-documenting.
| * Clarify bracketingPhil Davis2014-09-271-2/+2
| | | | | | to minimize risk of a problem when adding code here in the future.
| * Allow extended alias inputs #3890Phil Davis2014-09-271-35/+58
| | | | | | | | | | | | | | | | | | | | | | Currently if you enter a space-separated list of subnets in the IP address box when entering an alias, the code reports that the data is invalid. But it does actually expand the list of subnets into multiple rows, and enters the various subnet CIDRs into the CIDR column for the user. The user can press Save a second time and the data is now valid so the code saves it happily. This is rather odd, as reported in redmine #3890. Also, if you input an IP range (e.g. 192.168.20.0-192.168.20.30) plus description and in the 2nd row put some other subnet and description, the range is correctly expanded, but the description only appears against the 1st subnet of the range. The description from the 2nd row ends up as the description against the 2nd subnet of the range, and the rest of the descriptions are blank. i.e. the descriptions do not get copied and pushed down as the IP ranges are expanded. This change fixes all that stuff by first parsing the posted data and expanding any IP ranges and/or space-separated lists, building arrays that have all their entries lined up: $input_addresses[] $input_address_subnet[] $final_address_details[] which are then validated. This is for master (2.2) branch. Actually it was not too difficult to integrate.
* | update input_error description after changes for ticket #3491Chris Buechler2014-10-131-1/+1
|/
* firewall_aliases_edit UI text changesPhil Davis2014-09-261-3/+9
| | | | | | If type URL Table then the heading "Description" on the 3rd column gets suppressed (I am not really sure why that is, since the description data entry box still appears - I guess someone intended that the data entry box itself also be suppressed, since URL Table takes just a single line entry, the overall description of the alias should be enough - no need for a per-line description.) In any case, if the user then selects some other Alias Type, the "Description" heading on the 3rd column is not re-enabled. This change fixes that. I also implemented what is suggested in Redmine #3893 - making the 1st column heading say "IP or FQDN", "Network or FQDN". IMHO that looks fine on the UI and cannot do any harm. (and yes, the longer explanatory text already tells the user that an FQDN is allowed in these cases.)
* Remove useless check for alias description matching an interface descriptionPhil Davis2014-09-261-6/+0
| | | | | | | | | | | While looking at other checks in the code I noticed this check. It was not effective anyway, because the first line inside "if ($_POST)" below does unset($input_errors); which undoes this check anyway. In any case the check is not relevant. For example I might have interface WAN with description (which is really the alternate/display name for an interface) as MYISP. I cannot also have an Alias with name MYISP - that is checked for already later in the code. But I can have an Alias with description MYISP - in the case of an Alias the description really is just helpful text for the user, it is the name that really counts for use in the pf configuration. So the code is not needed.
* Remove almost all calls to history.back() and make Cancel button back to ↵Renato Botelho2014-09-121-1/+3
| | | | HTTP_REFERER, there are a couple of places I didn't touch on this commit because it requires more work
* Change is_port() to only validate a single port, we have is_portrange() for ↵Renato Botelho2014-09-101-1/+1
| | | | specific cases. Make necessary adjustments after check all is_port() calls. It fixes #3857
* Alias name cannot have more than 31 chars, add maxlength here just as an ↵Renato Botelho2014-08-251-1/+1
| | | | extra check. Ticket #3827
* Encode the detail field of an alias entry before displaying its contents ↵jim-p2014-08-061-1/+1
| | | | back to the user.
* Change Cancel button to call history.back() as done in Firewall Rules, the ↵Renato Botelho2014-07-031-1/+1
| | | | current method has issues with IE 11, it should fix #3728
* Improve checks for params 'id', 'dup' and other similar ones to make sure ↵Renato Botelho2014-03-121-2/+3
| | | | they are numeric integer, also, pass them through htmlspecialchars() before print
* Help ticket #3449:Renato Botelho2014-02-171-2/+6
| | | | | | | Improve data validation to avoid save a host/subnet or a IPv4 with invalid mask. The reported error is on javascript and only happen on IE8,but this fix will prevent the same issue happening in the future on a different browser.
* Catch a validation issue reported on the mailing list thread: IPv6 address ↵Ermal2014-02-111-2/+2
| | | | data validation from: Brian Candler. It prevents putting a subnet in the address field since it then breaks the whole filter generation process
* Use unlink_if_exists or @unlink to avoid PHP errors when file doesn't existRenato Botelho2014-02-041-2/+2
|
* Add escapeshellarg() calls on exec parameters. While I'm here, replace some ↵Renato Botelho2014-02-041-3/+3
| | | | exec() calls by php functions like symlink, copy, unlink, mkdir
* Really fix #3376Phil Davis2014-01-271-3/+3
| | | Thanks to Grischa Zengel for spotting the semi-colon at the end of the "if" line that was the real cause. Please also back merge this to 2.1 branch.
* Check for vertical bars in alias detail descriptionsPhil Davis2014-01-071-11/+45
| | | | The descriptions of each entry in an alias are stored in config.xml as a list delimited by "||". So you cannot have "||" in the actual description (or the description effectively splits into the next entry). Also you cannot start or end the description with "|" or it will be very confusing having the config with "|||" in it. This code validates all that sort of invalid input.
* Fix display of CIDR/Update Freq in Alias EditPhil Davis2013-12-291-2/+2
| | | Fixes #3376. I have no idea what the "^" characters were meant to do, but removing them makes the CIDR/Update Freq value be displayed correctly when editing. Will there be some other side-effect from removing the "^"?
* Make it more explicit that 'update freq.' unit is daysRenato Botelho2013-10-221-1/+1
|
* Remove unused variableRenato Botelho2013-10-221-4/+0
|
* Fix #3283, use jQuery to change attributes based on idRenato Botelho2013-10-211-61/+18
|
* Actually there is no reason to set a variable just to use onceRenato Botelho2013-10-181-2/+1
|
* Fix #3242 and some code cleanup:Renato Botelho2013-10-181-21/+15
| | | | | | | | | | | | | | - Only explode '/' and set address_subnet when address is a subnet, it fixes issue reported at #3242 - While I'm here, do some cleanup on the way addresses are treated - Remove unecessary variable $tracker, we already have $counter set with the same value - Use if:endif and while:endwhile where there is html block inside the block - Use more meaning names for variables instead of item, item2, item3 and item4 - Use while($counter <= $count()) instead of using foreach referencing array using $counter inside
* Fix #3268 - avoid pf table names conflict:Renato Botelho2013-10-161-5/+9
| | | | | | . Create a list of reserved table names for the hardcoded ones . Use this list to validate aliases and load balance pool names . Check if alias names don't conflict with LB pool names and vice-versa
* Remove call-time pass by reference for do_input_validation, helps ticket #2565Renato Botelho2013-09-121-1/+1
|
* Fix #3113, fix multiple english spell errors s/seperet/separat/Renato Botelho2013-07-281-1/+1
|
* When adding Port or URL alias default the alias typePhil Davis2013-07-211-3/+3
| | | When viewing the Port or URL aliases tab, and pressing "+" (add), make the default alias type match the Port or URL tab from which the user pressed "+".
* Implement URL Table aliases for ports instead of IP addressesRenato Botelho2013-07-081-5/+29
|
* Process zipped aliases listRenato Botelho2013-07-051-0/+2
|
* Use download_file() and check ssl certificatesRenato Botelho2013-07-051-1/+3
|
* Remove useless codeRenato Botelho2013-07-051-3/+0
|
* Add a new alias type, URLs containing PortsRenato Botelho2013-07-041-9/+32
|
* "block" is also a reserved keyword that can't be an alias name, or pf tosses ↵jim-p2013-05-291-1/+1
| | | | an error.
* Permit to use aliases containing hostnames on static routesRenato Botelho2013-05-271-14/+0
|
* Prohibit adding aliases containing FQDNs in static routes. Fixes #2941Renato Botelho2013-04-101-0/+14
|
* Tidy up "firewall_aliases*.php" XHTMLColin Fleming2013-04-091-21/+17
| | | | | | | | Add CDATA sections to SCRIPT tags Close INPUT and BR tags Update HTML boolean operators Move NOWRAP to class statement Add missing closing TD tag
OpenPOWER on IntegriCloud