general-functions.pl: Fix for bug#12937 - The check for validwildcarddomainname did not allow wildcards of the form *.ipfire.org* which is the example given on the proxy.cgi page for excluded url's for the wpad file. - A forum user sufferred from this problem and the bug was raised for it. https://community.ipfire.org/t/proxy-cgi-error-message-when-use-wildcard-in-wpad-excluded-url-s/8597 forum user has tested the patch change and confirmed it solves the problem. Fixes: Bug#12937 Suggested-by: Bernhard Bitsch <bbitsch@ipfire.org> Signed-off-by: Adolf Belka <adolf.belka@ipfire.org> Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
general-functions.pl: Fix for bug #12865 - Static IP address pools - Add network - Name wit> - The fix for bug #12428 removed spaces from the validhostname subroutine as hostnames are not supposed to have spaces - This resulted in spaces no longer being allowed for the Static IP Address Pools names - New subroutine created called validccdname. This allows letters, upper and lower case, numbers, spaces and dashes Fixes: Bug #12865 Tested-by: Adolf Belka <adolf.belka@ipfire.org> Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Fix translations and clean general-functions.pl This patch fixes two wrong translations now used by the new user manual links feature and removes an abandoned constant. Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de> Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org> Tested-by: Bernhard Bitsch <bbitsch@ipfire.org>
speed.cgi: reduce system load by copying two general-functions. include general-functions.pl load and initialize many subfunctions that are not needed by speed.cgi which was executed very often. So this reduce the system load significant if webif was open in browser and ajax-speed display enabled. Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org> Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
index.cgi: Remove left-over DNSSEC status warning An error message is still shown although there is no option to disable DNSSEC at the moment. The old marker file could still be present on older machines. Signed-off-by: Michael Tremer <michael.tremer@ipfire.org> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
firewalllog.dat: Proper display protocol names. In some cases iptables logs the protocol number instead of the name. When accessing the logs via the WUI, this number has been displayed as used protocol, which is very hard to read and understand. This commit adds a new function to the general-functions.pl, which generates a hash to translate the protocol number into the protocol name. Fixes #11282. Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> Reviewed-by: Michael Tremer <michael.tremer@ipfire.org> Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
general-functions.pl: Explicitely call new system function Perl seems to just "guess" that someone no longer wants to use the builtin "system" command when there is a function with the same name. I have no idea what kind of liquid they are drinking, but because of the side effects of that stuff, we explicitely call our system() function. Not that that would be necessary, but why not waste a couple more CPU cycles? Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
general-functions.pl: Update to fix bug #12428 - Patch of general-functions.pl for implementation of fix provided by Bernhard Bitsch in bug #12428. Had to be modified as that fix gave a failure for single character hostnames. Updated version prevents spaces being put into hostnames and works for single character hostnames - Updated subroutine validfqdn to apply consistent rules for hostname & domain name portions of fqdn - Minor updates for consistency across validhostname, validdomainname & validfqdn - Patch implemented into testbed system and confirmed working for hostnames, domain names and FQDN's. Signed-off-by: Adolf Belka <ahb.ipfire@gmail.com> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
aws-functions.pl: Drop file and move functions to general-functions.pl There is not enough stuff that it is justified to have an own file. This patch therefore merges everything into general-functions.pl. There are no functional changes. Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
general-functions.pl: Add formatBytes() function. This function can be used to convert an amount of bytes to a humand-readable format. For example "3221225472" will become "3MB". Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>