diff options
author | mark <mark> | 2012-02-10 20:57:54 +0000 |
---|---|---|
committer | mark <mark> | 2012-02-10 20:57:54 +0000 |
commit | 860445eb4e5389ae310496a199d69e414d2428c9 (patch) | |
tree | db17592518427b8ebb2d7c6b073e77d84204eea1 | |
parent | c81adbf7bbaa537b650f39bb76ce0b7b8c069450 (diff) |
terms of service for signup server, #16383
-rw-r--r-- | FS/FS/ClientAPI/Signup.pm | 2 | ||||
-rw-r--r-- | FS/FS/Conf.pm | 8 | ||||
-rwxr-xr-x | fs_selfservice/FS-SelfService/cgi/signup.html | 36 |
3 files changed, 42 insertions, 4 deletions
diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm index 595f4fb..b026afd 100644 --- a/FS/FS/ClientAPI/Signup.pm +++ b/FS/FS/ClientAPI/Signup.pm @@ -403,6 +403,8 @@ sub signup_info { qw( body_bgcolor box_bgcolor menu_bgcolor ) ), ( map { $_ => join("\n", $conf->config("selfservice-$_", $agentnum ) ) } qw( head body_header body_footer ) ), + ( map { $_ => join("\n", $conf->config("signup_server-$_", $agentnum ) ) } + qw( terms_of_service ) ), }; $cache->set("signup_info_cache_agent$agentnum", $signup_info_cache_agent); diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index d5dc9c6..9d81b75 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -1997,6 +1997,14 @@ and customer address. Include units.', }, { + 'key' => 'signup_server-terms_of_service', + 'section' => 'self-service', + 'description' => 'Terms of Service for the signup server. May contain HTML.', + 'type' => 'textarea', + 'per_agent' => 1, + }, + + { 'key' => 'selfservice_server-base_url', 'section' => 'self-service', 'description' => 'Base URL for the self-service web interface - necessary for some widgets to find their way, including retrieval of non-US state information and phone number provisioning.', diff --git a/fs_selfservice/FS-SelfService/cgi/signup.html b/fs_selfservice/FS-SelfService/cgi/signup.html index 8204f55..3c71e92 100755 --- a/fs_selfservice/FS-SelfService/cgi/signup.html +++ b/fs_selfservice/FS-SelfService/cgi/signup.html @@ -5,7 +5,12 @@ <%= $head %> </HEAD> <BODY BGCOLOR="<%= $body_bgcolor || '#e8e8e8' %>" onUnload="myclose()"> - +<%= if ( $terms_of_service =~ /\S/ ) { # enable overlib + $OUT .= qq!<SCRIPT type="text/javascript" src="$_.js"></SCRIPT>\n! + foreach (qw(overlibmws overlibmws_iframe overlibmws_draggable + overlibmws_crossframe iframecontentmws )); +} +%> <script type="text/javascript"> var mywindow = -1; function myopen(filename,windowname,properties) { @@ -387,9 +392,32 @@ if ( @optional_packages ) { $OUT = '' } %> - -<BR><INPUT TYPE="submit" NAME="signup" VALUE="Signup"> -<script language="JavaScript"> +<%= + if ( $terms_of_service =~ /\S/ ) { + my $title = 'Terms of Service'; #config? + my $onclick = qq[overlib( terms_content, CAPTION, "$title", STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK, CLOSETEXT, "Close" );]; + # Container for $terms_of_service to avoid nasty escaping. + $OUT .= qq[ +<BR> +<DIV id="div_terms" style="display:none">$terms_of_service</DIV> +<SCRIPT type="text/javascript"> +function agree_to_terms (val) { + document.getElementById("signup").disabled = !val; +} +function show_terms () { + overlib( document.getElementById('div_terms').innerHTML, + CAPTION, '$title', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, + CLOSECLICK, CLOSETEXT, 'Close' ); +} +</SCRIPT> +<INPUT TYPE="checkbox" onchange="agree_to_terms(this.checked)"> +I agree to the <a href="javascript:void(0);" onclick="show_terms();">Terms of Service</a>. +]; + } +%> +<BR><INPUT TYPE="submit" ID="signup" NAME="signup" VALUE="Signup"> +<script language="javascript"> +<%= length($terms_of_service) ? 'agree_to_terms(false)' : '' %> function fixup_form() { |