From 52383f583ed7602a7822564dd497165a1b0084f7 Mon Sep 17 00:00:00 2001 From: Alexander Marx Date: Wed, 10 Feb 2016 15:05:35 +0100 Subject: [PATCH] Captive-Portal: fix some typos and missing dir Signed-off-by: Alexander Marx --- config/rootfiles/common/web-user-interface | 1 + html/cgi-bin/captive.cgi | 12 +++++++++--- langs/de/cgi-bin/de.pl | 1 + langs/en/cgi-bin/en.pl | 3 ++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/config/rootfiles/common/web-user-interface b/config/rootfiles/common/web-user-interface index 71c8756b64..3975738cdc 100644 --- a/config/rootfiles/common/web-user-interface +++ b/config/rootfiles/common/web-user-interface @@ -98,6 +98,7 @@ srv/web/ipfire/html/captive/assets/captive.css srv/web/ipfire/html/captive/assets/internet.png srv/web/ipfire/html/captive/assets/favicon.ico srv/web/ipfire/html/captive/index.cgi +srv/web/ipfire/html/captive/logo #srv/web/ipfire/html/images srv/web/ipfire/html/images/IPFire.png srv/web/ipfire/html/images/add.gif diff --git a/html/cgi-bin/captive.cgi b/html/cgi-bin/captive.cgi index c4373b57c6..2d99566323 100755 --- a/html/cgi-bin/captive.cgi +++ b/html/cgi-bin/captive.cgi @@ -58,6 +58,11 @@ unless (-e $voucherout) { system("touch $voucherout"); } #actions if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}"){ + #Check Expiretime + if($cgiparams{'EXP_HOUR'}+$cgiparams{'EXP_DAY'}+$cgiparams{'EXP_WEEK'}+$cgiparams{'EXP_MONTH'} == 0 && $cgiparams{'UNLIMITED'} == ''){ + $errormessage=$Lang::tr{'Captive noexpiretime'}; + } + my $file = $cgiparams{'uploaded_file'}; if ($file){ #Check if extension is png @@ -85,8 +90,8 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}"){ my $PNG1=; close(PNG); my ($width,$height)=&pngsize($PNG1); - if($width > 1920 || $height > 800 || $width < 1280 || $height < 4000){ - $errormessage.="$Lang::tr{'Captive invalid logosize'}
Filedimensions width: $width height: $height
"; + if($width > 1920 || $height > 800 || $width < 1280 || $height < 400){ + $errormessage.="$Lang::tr{'Captive invalid logosize'}
Filedimensions width: $width height: $height "; unlink("$logopath/logo.png"); } } @@ -600,7 +605,8 @@ sub pngsize { my $PNG = $1; ($width,$height) = unpack( "NN", $PNG ); } else { - $width=$Lang::tr{'acct invalid png'}; + $width="invalid"; + $height= "invalid"; }; return ($width,$height); } diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index d05d26fe6c..0843c10a36 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -27,6 +27,7 @@ 'Captive mac' => 'MAC-Adresse', 'Captive menu' => 'Captive-Portal', 'Captive nr' => 'Nummer', +'Captive noexpiretime' => 'Es wurde kein gültiger Verbindungszeitraum angegeben', 'Captive nolimit' => 'Unbegrenzt', 'Captive voactive' => 'Aktive Gutscheine', 'Captive vout' => 'Ausgegebene Gutscheine', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 013885480a..0166cb6c7c 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -27,6 +27,7 @@ 'Captive mac' => 'MAC-Address', 'Captive menu' => 'Captive Portal', 'Captive nr' => 'Number', +'Captive noexpiretime' => 'No valid connection timerange given', 'Captive nolimit' => 'no limit', 'Captive voactive' => 'Active Vouchers', 'Captive vout' => 'Issued vouchers', @@ -35,7 +36,7 @@ 'Captive wrong ext' => 'Uploaded file has wrong filetype', 'Captive voucher' => 'Voucher', 'Captive voucherout' => 'Ticket transfer', -'Captive vouchervalid' => 'Conenction timerange', +'Captive vouchervalid' => 'Connection timerange', 'Choose Rule' => 'Choose one of the following rules.', 'Class' => 'Class', 'Class was deleted' => 'with potential subclasses was deleted', -- 2.39.2