proxy.cgi: Some cosmetics for the absolutely lazy ones... ; -)

Message ID 20170917131812.2865-1-matthias.fischer@ipfire.org
State Superseded
Headers
Series proxy.cgi: Some cosmetics for the absolutely lazy ones... ; -) |

Commit Message

Matthias Fischer Sept. 17, 2017, 11:18 p.m. UTC
  Added clickable links for 'URL filter' and 'Update accelerator' for faster access.

Best,
Matthias

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
---
 html/cgi-bin/proxy.cgi | 4 ++--
 langs/de/cgi-bin/de.pl | 2 ++
 langs/en/cgi-bin/en.pl | 2 ++
 3 files changed, 6 insertions(+), 2 deletions(-)
  

Comments

Michael Tremer Sept. 21, 2017, 7:22 a.m. UTC | #1
Hi,

it would be way better to have the link in the CGI and not in the
translation file. That way translators wouldn't have to deal with any
of the markup and what is even worse: being able to inject any kind of
HTML into the generated output. But that is a different issue.

Would you be up for sending a corrected patch?

I like the idea to get a reference so people find the correct
configuration page easily.

Best,
-Michael

On Sun, 2017-09-17 at 15:18 +0200, Matthias Fischer wrote:
> Added clickable links for 'URL filter' and 'Update accelerator' for faster access.
> 
> Best,
> Matthias
> 
> Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
> ---
>  html/cgi-bin/proxy.cgi | 4 ++--
>  langs/de/cgi-bin/de.pl | 2 ++
>  langs/en/cgi-bin/en.pl | 2 ++
>  3 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/html/cgi-bin/proxy.cgi b/html/cgi-bin/proxy.cgi
> index 0b7d36c3c..1a5985d17 100644
> --- a/html/cgi-bin/proxy.cgi
> +++ b/html/cgi-bin/proxy.cgi
> @@ -1054,11 +1054,11 @@ if ( -e "/usr/bin/squidclamav" ) {
>  } else {
>  	print "<td></td>";
>  }
> -print "<td class='base'><b>".$Lang::tr{'advproxy url filter'}."</b><br />";
> +print "<td class='base'><b>".$Lang::tr{'advproxy url filter link'}."</b><br />";
>  print $Lang::tr{'advproxy enabled'}."<input type='checkbox' name='ENABLE_FILTER' ".$checked{'ENABLE_FILTER'}{'on'}." /><br />";
>  print "+ ".int(($count**(1/3)) * 6);
>  print "</td>";
> -print "<td class='base'><b>".$Lang::tr{'advproxy update accelerator'}."</b><br />";
> +print "<td class='base'><b>".$Lang::tr{'advproxy update accelerator link'}."</b><br />";
>  print $Lang::tr{'advproxy enabled'}."<input type='checkbox' name='ENABLE_UPDXLRATOR' ".$checked{'ENABLE_UPDXLRATOR'}{'on'}." /><br />";
>  print "+ ".int(($count**(1/3)) * 5);
>  print "</td></tr>";
> diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl
> index 7bc1c495d..45e45aa2e 100644
> --- a/langs/de/cgi-bin/de.pl
> +++ b/langs/de/cgi-bin/de.pl
> @@ -327,12 +327,14 @@
>  'advproxy unrestricted ip clients' => 'Uneingeschränkte IP-Adressen (eine pro Zeile)',
>  'advproxy unrestricted mac clients' => 'Uneingeschränkte MAC-Adressen (eine pro Zeile)',
>  'advproxy update accelerator' => 'Update-Accelerator',
> +'advproxy update accelerator link' => '<a href="/cgi-bin/updatexlrator.cgi">Update-Accelerator</a>',
>  'advproxy update notification' => 'Update-Benachrichtigung!',
>  'advproxy upstream password' => 'Proxy-Passwort',
>  'advproxy upstream proxy' => 'Vorgelagerter Proxy',
>  'advproxy upstream proxy host:port' => 'Vorgelagerter Proxy (Host:Port)',
>  'advproxy upstream username' => 'Proxy-Benutzername',
>  'advproxy url filter' => 'URL-Filter',
> +'advproxy url filter link' => '<a href="/cgi-bin/urlfilter.cgi">URL-Filter</a>',
>  'advproxy username forwarding' => ' Benutzernamen weiterleiten',
>  'advproxy via forwarding' => 'Proxy-Adresse weiterleiten',
>  'advproxy visible hostname' => 'Sichtbarer Hostname',
> diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl
> index 9732a6e9d..adebbf4b4 100644
> --- a/langs/en/cgi-bin/en.pl
> +++ b/langs/en/cgi-bin/en.pl
> @@ -327,6 +327,7 @@
>  'advproxy unrestricted ip clients' => 'Unrestricted IP addresses (one per line)',
>  'advproxy unrestricted mac clients' => 'Unrestricted MAC addresses (one per line)',
>  'advproxy update accelerator' => 'Update accelerator',
> +'advproxy update accelerator link' => '<a href="/cgi-bin/updatexlrator.cgi">Update accelerator</a>',
>  'advproxy update information' => 'There is an updated version available for download. Visit <a href="http://www.advproxy.net" target="_blank">http://www.advproxy.net</a>; for more information.',
>  'advproxy update notification' => 'Update notification!',
>  'advproxy upstream password' => 'Upstream password',
> @@ -334,6 +335,7 @@
>  'advproxy upstream proxy host:port' => 'Upstream proxy (host:port)',
>  'advproxy upstream username' => 'Upstream username',
>  'advproxy url filter' => 'URL filter',
> +'advproxy url filter link' => '<a href="/cgi-bin/urlfilter.cgi">URL filter</a>',
>  'advproxy username forwarding' => 'Username forwarding',
>  'advproxy via forwarding' => 'Proxy address forwarding',
>  'advproxy visible hostname' => 'Visible hostname',
  
Matthias Fischer Sept. 21, 2017, 8:40 a.m. UTC | #2
Hi,

On 20.09.2017 23:22, Michael Tremer wrote:

> it would be way better to have the link in the CGI and not in the
> translation file. That way translators wouldn't have to deal with any
> of the markup and what is even worse: being able to inject any kind of
> HTML into the generated output. But that is a different issue.

Yep. Why did I know that you would answer that...? ;-))

> Would you be up for sending a corrected patch?

No problem - I'll try, but the first attempts ended in a blank page.

I tried to add these links like in 'wlanap.cgi' (lines 536ff) but hadn't
so far no luck, only a white "server error" page. I'll try again.

> I like the idea to get a reference so people find the correct
> configuration page easily.

Me, too - and the easiest way I remembered was the way we did this in
Copfilter. However not the best way.

Best,
Matthias
  

Patch

diff --git a/html/cgi-bin/proxy.cgi b/html/cgi-bin/proxy.cgi
index 0b7d36c3c..1a5985d17 100644
--- a/html/cgi-bin/proxy.cgi
+++ b/html/cgi-bin/proxy.cgi
@@ -1054,11 +1054,11 @@  if ( -e "/usr/bin/squidclamav" ) {
 } else {
 	print "<td></td>";
 }
-print "<td class='base'><b>".$Lang::tr{'advproxy url filter'}."</b><br />";
+print "<td class='base'><b>".$Lang::tr{'advproxy url filter link'}."</b><br />";
 print $Lang::tr{'advproxy enabled'}."<input type='checkbox' name='ENABLE_FILTER' ".$checked{'ENABLE_FILTER'}{'on'}." /><br />";
 print "+ ".int(($count**(1/3)) * 6);
 print "</td>";
-print "<td class='base'><b>".$Lang::tr{'advproxy update accelerator'}."</b><br />";
+print "<td class='base'><b>".$Lang::tr{'advproxy update accelerator link'}."</b><br />";
 print $Lang::tr{'advproxy enabled'}."<input type='checkbox' name='ENABLE_UPDXLRATOR' ".$checked{'ENABLE_UPDXLRATOR'}{'on'}." /><br />";
 print "+ ".int(($count**(1/3)) * 5);
 print "</td></tr>";
diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl
index 7bc1c495d..45e45aa2e 100644
--- a/langs/de/cgi-bin/de.pl
+++ b/langs/de/cgi-bin/de.pl
@@ -327,12 +327,14 @@ 
 'advproxy unrestricted ip clients' => 'Uneingeschränkte IP-Adressen (eine pro Zeile)',
 'advproxy unrestricted mac clients' => 'Uneingeschränkte MAC-Adressen (eine pro Zeile)',
 'advproxy update accelerator' => 'Update-Accelerator',
+'advproxy update accelerator link' => '<a href="/cgi-bin/updatexlrator.cgi">Update-Accelerator</a>',
 'advproxy update notification' => 'Update-Benachrichtigung!',
 'advproxy upstream password' => 'Proxy-Passwort',
 'advproxy upstream proxy' => 'Vorgelagerter Proxy',
 'advproxy upstream proxy host:port' => 'Vorgelagerter Proxy (Host:Port)',
 'advproxy upstream username' => 'Proxy-Benutzername',
 'advproxy url filter' => 'URL-Filter',
+'advproxy url filter link' => '<a href="/cgi-bin/urlfilter.cgi">URL-Filter</a>',
 'advproxy username forwarding' => ' Benutzernamen weiterleiten',
 'advproxy via forwarding' => 'Proxy-Adresse weiterleiten',
 'advproxy visible hostname' => 'Sichtbarer Hostname',
diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl
index 9732a6e9d..adebbf4b4 100644
--- a/langs/en/cgi-bin/en.pl
+++ b/langs/en/cgi-bin/en.pl
@@ -327,6 +327,7 @@ 
 'advproxy unrestricted ip clients' => 'Unrestricted IP addresses (one per line)',
 'advproxy unrestricted mac clients' => 'Unrestricted MAC addresses (one per line)',
 'advproxy update accelerator' => 'Update accelerator',
+'advproxy update accelerator link' => '<a href="/cgi-bin/updatexlrator.cgi">Update accelerator</a>',
 'advproxy update information' => 'There is an updated version available for download. Visit <a href="http://www.advproxy.net" target="_blank">http://www.advproxy.net</a> for more information.',
 'advproxy update notification' => 'Update notification!',
 'advproxy upstream password' => 'Upstream password',
@@ -334,6 +335,7 @@ 
 'advproxy upstream proxy host:port' => 'Upstream proxy (host:port)',
 'advproxy upstream username' => 'Upstream username',
 'advproxy url filter' => 'URL filter',
+'advproxy url filter link' => '<a href="/cgi-bin/urlfilter.cgi">URL filter</a>',
 'advproxy username forwarding' => 'Username forwarding',
 'advproxy via forwarding' => 'Proxy address forwarding',
 'advproxy visible hostname' => 'Visible hostname',