From 497b9108559e8eac8daba6e8e9e8ff83d5040c69 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 1 May 2017 12:35:45 +0100 Subject: [PATCH] captive: Verify that the user actually accepted the terms and conditions Signed-off-by: Michael Tremer --- doc/language_issues.de | 1 + doc/language_issues.es | 1 + doc/language_issues.fr | 1 + doc/language_issues.it | 1 + doc/language_issues.nl | 1 + doc/language_issues.pl | 1 + doc/language_issues.ru | 1 + doc/language_issues.tr | 1 + html/cgi-bin/captive/index.cgi | 19 +++++++++++++------ html/html/captive/template.html | 2 +- langs/en/cgi-bin/en.pl | 1 + 11 files changed, 23 insertions(+), 7 deletions(-) diff --git a/doc/language_issues.de b/doc/language_issues.de index 83b2f3606c..f8cf0da595 100644 --- a/doc/language_issues.de +++ b/doc/language_issues.de @@ -694,6 +694,7 @@ WARNING: untranslated string: Captive clients WARNING: untranslated string: Captive expiry time WARNING: untranslated string: Captive issued coupons WARNING: untranslated string: Captive logo uploaded +WARNING: untranslated string: Captive please accept the terms and conditions WARNING: untranslated string: Captive terms WARNING: untranslated string: Captive terms short WARNING: untranslated string: Captive upload logo diff --git a/doc/language_issues.es b/doc/language_issues.es index c1e91d838c..290dbc0053 100644 --- a/doc/language_issues.es +++ b/doc/language_issues.es @@ -639,6 +639,7 @@ WARNING: untranslated string: Captive mac WARNING: untranslated string: Captive menu WARNING: untranslated string: Captive noexpiretime WARNING: untranslated string: Captive nolimit +WARNING: untranslated string: Captive please accept the terms and conditions WARNING: untranslated string: Captive terms WARNING: untranslated string: Captive terms short WARNING: untranslated string: Captive title diff --git a/doc/language_issues.fr b/doc/language_issues.fr index 7384da5496..75424f85ab 100644 --- a/doc/language_issues.fr +++ b/doc/language_issues.fr @@ -649,6 +649,7 @@ WARNING: untranslated string: Captive mac WARNING: untranslated string: Captive menu WARNING: untranslated string: Captive noexpiretime WARNING: untranslated string: Captive nolimit +WARNING: untranslated string: Captive please accept the terms and conditions WARNING: untranslated string: Captive terms WARNING: untranslated string: Captive terms short WARNING: untranslated string: Captive title diff --git a/doc/language_issues.it b/doc/language_issues.it index cec9cc4754..dc64186227 100644 --- a/doc/language_issues.it +++ b/doc/language_issues.it @@ -716,6 +716,7 @@ WARNING: untranslated string: Captive mac WARNING: untranslated string: Captive menu WARNING: untranslated string: Captive noexpiretime WARNING: untranslated string: Captive nolimit +WARNING: untranslated string: Captive please accept the terms and conditions WARNING: untranslated string: Captive terms WARNING: untranslated string: Captive terms short WARNING: untranslated string: Captive title diff --git a/doc/language_issues.nl b/doc/language_issues.nl index aa4d72d8ba..3284639c19 100644 --- a/doc/language_issues.nl +++ b/doc/language_issues.nl @@ -712,6 +712,7 @@ WARNING: untranslated string: Captive mac WARNING: untranslated string: Captive menu WARNING: untranslated string: Captive noexpiretime WARNING: untranslated string: Captive nolimit +WARNING: untranslated string: Captive please accept the terms and conditions WARNING: untranslated string: Captive terms WARNING: untranslated string: Captive terms short WARNING: untranslated string: Captive title diff --git a/doc/language_issues.pl b/doc/language_issues.pl index c1e91d838c..290dbc0053 100644 --- a/doc/language_issues.pl +++ b/doc/language_issues.pl @@ -639,6 +639,7 @@ WARNING: untranslated string: Captive mac WARNING: untranslated string: Captive menu WARNING: untranslated string: Captive noexpiretime WARNING: untranslated string: Captive nolimit +WARNING: untranslated string: Captive please accept the terms and conditions WARNING: untranslated string: Captive terms WARNING: untranslated string: Captive terms short WARNING: untranslated string: Captive title diff --git a/doc/language_issues.ru b/doc/language_issues.ru index d335c7c1cd..f88653702a 100644 --- a/doc/language_issues.ru +++ b/doc/language_issues.ru @@ -641,6 +641,7 @@ WARNING: untranslated string: Captive mac WARNING: untranslated string: Captive menu WARNING: untranslated string: Captive noexpiretime WARNING: untranslated string: Captive nolimit +WARNING: untranslated string: Captive please accept the terms and conditions WARNING: untranslated string: Captive terms WARNING: untranslated string: Captive terms short WARNING: untranslated string: Captive title diff --git a/doc/language_issues.tr b/doc/language_issues.tr index 1309727ac7..19fd6718c7 100644 --- a/doc/language_issues.tr +++ b/doc/language_issues.tr @@ -724,6 +724,7 @@ WARNING: untranslated string: Captive mac WARNING: untranslated string: Captive menu WARNING: untranslated string: Captive noexpiretime WARNING: untranslated string: Captive nolimit +WARNING: untranslated string: Captive please accept the terms and conditions WARNING: untranslated string: Captive terms WARNING: untranslated string: Captive terms short WARNING: untranslated string: Captive title diff --git a/html/cgi-bin/captive/index.cgi b/html/cgi-bin/captive/index.cgi index 482ea9016b..b891255744 100755 --- a/html/cgi-bin/captive/index.cgi +++ b/html/cgi-bin/captive/index.cgi @@ -116,15 +116,22 @@ if ($cgiparams{'ACTION'} eq "SUBMIT") { $errormessage = $Lang::tr{"Captive please enter a coupon code"}; } - # License + # Terms } else { - # Copy session expiry time - $clientshash{$key}[3] = $settings{'SESSION_TIME'} || "0"; + # Make sure that they have been accepted + if ($cgiparams{'TERMS'} eq "on") { + # Copy session expiry time + $clientshash{$key}[3] = $settings{'SESSION_TIME'} || "0"; - # No coupon code - $clientshash{$key}[4] = "TERMS"; + # No coupon code + $clientshash{$key}[4] = "TERMS"; - &General::log("Captive", "Internet access granted via license agreement for $ip_address until $clientshash{$key}[3]"); + &General::log("Captive", "Internet access granted via license agreement for $ip_address until $clientshash{$key}[3]"); + + # The terms have not been accepted + } else { + $errormessage = $Lang::tr{'Captive please accept the terms and conditions'}; + } } # If no errors were found, save configruation and reload diff --git a/html/html/captive/template.html b/html/html/captive/template.html index ad1c6ce2be..6e39d87dbf 100644 --- a/html/html/captive/template.html +++ b/html/html/captive/template.html @@ -55,7 +55,7 @@
diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index f569f53b02..c0fff16071 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -42,6 +42,7 @@ 'Captive noexpiretime' => 'No valid connection time range given', 'Captive nolimit' => 'unlimited', 'Captive nr' => 'Number', +'Captive please accept the terms and conditions' => 'Please accept the terms & conditions', 'Captive please enter a coupon code' => 'Please enter a coupon code', 'Captive terms' => 'Terms & Conditions', 'Captive terms short' => 'T&Cs', -- 2.39.2