diff options
author | ivan <ivan> | 2009-08-10 11:50:04 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-08-10 11:50:04 +0000 |
commit | 99100d7e0d0b22a1844dde88acd529e79d096463 (patch) | |
tree | cba7b5d61fff4187490b644ba4414ac2085a6e4a /fs_selfservice/FS-SelfService | |
parent | 39000f1ad925a76a4a334271b8e9e5da6a5dcb89 (diff) |
when using pkg-balances, limit self-service access when a customer with multiple packages logs on, RT#4189
Diffstat (limited to 'fs_selfservice/FS-SelfService')
-rw-r--r-- | fs_selfservice/FS-SelfService/SelfService.pm | 1 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/login.html | 2 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/logout.html | 2 | ||||
-rwxr-xr-x | fs_selfservice/FS-SelfService/cgi/make_thirdparty_payment.html | 13 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/myaccount.html | 12 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/myaccount_menu.html | 65 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/selfservice.cgi | 10 |
7 files changed, 63 insertions, 42 deletions
diff --git a/fs_selfservice/FS-SelfService/SelfService.pm b/fs_selfservice/FS-SelfService/SelfService.pm index d275fa8..743057d 100644 --- a/fs_selfservice/FS-SelfService/SelfService.pm +++ b/fs_selfservice/FS-SelfService/SelfService.pm @@ -61,6 +61,7 @@ $socket .= '.'.$tag if defined $tag && length($tag); 'myaccount_passwd' => 'MyAccount/myaccount_passwd', 'signup_info' => 'Signup/signup_info', 'skin_info' => 'MyAccount/skin_info', + 'access_info' => 'MyAccount/access_info', 'domain_select_hash' => 'Signup/domain_select_hash', # expose? 'new_customer' => 'Signup/new_customer', 'capture_payment' => 'Signup/capture_payment', diff --git a/fs_selfservice/FS-SelfService/cgi/login.html b/fs_selfservice/FS-SelfService/cgi/login.html index 760f579..eef412d 100644 --- a/fs_selfservice/FS-SelfService/cgi/login.html +++ b/fs_selfservice/FS-SelfService/cgi/login.html @@ -3,7 +3,7 @@ <TITLE>Login</TITLE> <%= $head %> </HEAD> - <BODY BGCOLOR="<%= $body_bgcolor || '#e8e8e8' %>"> + <BODY BGCOLOR="<%= $body_bgcolor || '#eeeeee' %>"> <%= $body_header %> <FONT SIZE=5>Login</FONT><BR><BR> diff --git a/fs_selfservice/FS-SelfService/cgi/logout.html b/fs_selfservice/FS-SelfService/cgi/logout.html index e2de648..5e22ad8 100644 --- a/fs_selfservice/FS-SelfService/cgi/logout.html +++ b/fs_selfservice/FS-SelfService/cgi/logout.html @@ -3,7 +3,7 @@ <TITLE>MyAccount</TITLE> <%= $head %> </HEAD> - <BODY BGCOLOR="<%= $body_bgcolor || '#e8e8e8' %>"> + <BODY BGCOLOR="<%= $body_bgcolor || '#eeeeee' %>"> <%= $body_header %> <FONT SIZE=5>MyAccount</FONT><BR><BR> diff --git a/fs_selfservice/FS-SelfService/cgi/make_thirdparty_payment.html b/fs_selfservice/FS-SelfService/cgi/make_thirdparty_payment.html index 042b8b3..b2900b1 100755 --- a/fs_selfservice/FS-SelfService/cgi/make_thirdparty_payment.html +++ b/fs_selfservice/FS-SelfService/cgi/make_thirdparty_payment.html @@ -1,5 +1,6 @@ -<HTML><HEAD><TITLE>My Account</TITLE></HEAD> -<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR> +<%= $url = "$selfurl?session=$session_id;action="; ''; %> +<%= include('header') %> + <SCRIPT TYPE="text/javascript"> function popcollect() { overlib( OLiframeContent('<%= $popup_url %>', 336, 550, 'Secure Payment Area', 0, 'auto' ), CAPTION, 'Pay now', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK, BGCOLOR, '#333399', CGCOLOR, '#333399', CLOSETEXT, 'Close' ); @@ -11,9 +12,7 @@ <SCRIPT TYPE="text/javascript" SRC="overlibmws_draggable.js"></SCRIPT> <SCRIPT TYPE="text/javascript" SRC="overlibmws_crossframe.js"></SCRIPT> <SCRIPT TYPE="text/javascript" SRC="iframecontentmws.js"></SCRIPT> -<%= $url = "$selfurl?session=$session_id;action="; ''; %> -<%= include('myaccount_menu') %> -<TD VALIGN="top"> + <FONT SIZE=4>Pay now</FONT><BR><BR> <%= if ( $error ) { @@ -34,5 +33,5 @@ EOF $OUT .= qq!</FORM>!; } %> -</TD></TR></TABLE> -</BODY></HTML> + +<%= include('footer') %> diff --git a/fs_selfservice/FS-SelfService/cgi/myaccount.html b/fs_selfservice/FS-SelfService/cgi/myaccount.html index bcfcf95..d6527fe 100644 --- a/fs_selfservice/FS-SelfService/cgi/myaccount.html +++ b/fs_selfservice/FS-SelfService/cgi/myaccount.html @@ -4,11 +4,17 @@ Hello <%= $name %>!<BR><BR> <%= $small_custview %> <BR> +<%= if ( $pkgnum ) { + $OUT .= qq!Balance: <B>\$$balance</B><BR><BR>!; + } + ''; +%> + <%= if ( $balance > 0 ) { - if (scalar(grep $_, @hide_payment_field)) { - $OUT .= qq! <B><A HREF="${url}make_payment">Make a payment</A></B><BR><BR>!; - } else { + if (scalar(grep $_, @hide_payment_fields)) { $OUT .= qq! <B><A HREF="${url}make_thirdparty_payment&payby_method=CC">Make a payment</A></B><BR><BR>!; + } else { + $OUT .= qq! <B><A HREF="${url}make_payment">Make a payment</A></B><BR><BR>!; } } %> <%= diff --git a/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html b/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html index 5cf4fe2..617ae3e 100644 --- a/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html +++ b/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html @@ -7,15 +7,18 @@ <%= my @menu = ( -{ title=>' ' }, -{ title=>'Overview', url=>'myaccount', size=>'+1', }, -{ title=>' ' }, - -{ title=>'Purchase', size=>'+1', }, - { title=>'Purchase additional package', - url=>'customer_order_pkg', 'indent'=>2 }, + { title=>' ' }, + { title=>'Overview', url=>'myaccount', size=>'+1', }, + { title=>' ' }, + { title=>'Purchase', size=>'+1', }, ); +unless ( $pkgnum ) { + push @menu, + { title=>'Purchase additional package', + url=>'customer_order_pkg', 'indent'=>2 }; +} + if ( 1 ) { #XXXFIXME "enable selfservice prepay features" flag or something, eventually per-pkg or something really fancy #XXXFIXME still a bit sloppy for multi-gateway of differing namespace @@ -34,7 +37,7 @@ if ( 1 ) { #XXXFIXME "enable selfservice prepay features" flag or something, eve while($i < scalar(@cust_paybys)) { last if $cust_paybys[$i] =~ /^CHEK/; $i++ } if ( $cust_paybys[$i] =~ /^CHEK/ ) { push @menu, { title => 'Recharge my account with a check', - url => $hide_payment_field[$i] + url => $hide_payment_fields[$i] ? 'make_thirdparty_payment&payby_method=ECHECK' : 'make_ach_payment', indent => 2, @@ -49,26 +52,36 @@ if ( 1 ) { #XXXFIXME "enable selfservice prepay features" flag or something, eve } -push @menu, ( - -{ title=>' ' }, +push @menu, + { title=>' ' }, + { title=>'View my usage', url=>'view_usage', size=>'+1', }, +; -{ title=>'View my usage', url=>'view_usage', size=>'+1', }, -{ title=>'Setup my services', url=>'provision', size=>'+1', }, - -{ title=>' ' }, +unless ( $pkgnum ) { + push @menu, + { title=>'Setup my services', url=>'provision', size=>'+1', }, + ; +} -{ title=>'Change my information', size=>'+1', }, - { title=>'Change billing address', url=>'change_bill', indent=>2 }, - { title=>'Change service address', url=>'change_ship', indent=>2 }, - { title=>'Change payment information', url=>'change_pay', indent=>2 }, - { title=>'Change password(s)', url=>'change_password', indent=>2 }, +push @menu, + { title=>' ' }; -{ title=>' ' }, +push @menu, + { title=>'Change my information', size=>'+1', }; -{ title=>'Logout', url=>'logout', size=>'+1', }, +unless ( $pkgnum ) { + push @menu, + { title=>'Change billing address', url=>'change_bill', indent=>2 }, + { title=>'Change service address', url=>'change_ship', indent=>2 }, + { title=>'Change payment information', url=>'change_pay', indent=>2 }, + ; +} -); +push @menu, + { title=>'Change password(s)', url=>'change_password', indent=>2 }, + { title=>' ' }, + { title=>'Logout', url=>'logout', size=>'+1', }, +; foreach my $item ( @menu ) { @@ -83,15 +96,15 @@ foreach my $item ( @menu ) { } $OUT.='>'; - $OUT .= '<FONT SIZE="'. $item->{'size'}. '">' - if exists $item->{'size'}; - $OUT .= ' ' x $item->{'indent'} if exists $item->{'indent'}; $OUT .= '<A HREF="'. $url. $item->{'url'}. '">' if exists $item->{'url'} && $action ne $item->{'url'}; + $OUT .= '<FONT SIZE="'. $item->{'size'}. '">' + if exists $item->{'size'}; + $item->{'title'} =~ s/ / /g; $OUT .= $item->{'title'}; diff --git a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi index 09cfe60..a5a7d18 100644 --- a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi +++ b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi @@ -10,7 +10,7 @@ use HTML::Entities; use Date::Format; use Number::Format 1.50; use FS::SelfService qw( - skin_info login_info login customer_info edit_info invoice + access_info login_info login customer_info edit_info invoice payment_info process_payment realtime_collect process_prepay list_pkgs order_pkg signup_info order_recharge part_svc_info provision_acct provision_external @@ -98,7 +98,7 @@ warn "processing template $action\n" do_template($action, { 'session_id' => $session_id, 'action' => $action, #so the menu knows what tab we're on... - %{ payment_info( 'session_id' => $session_id ) }, # cust_paybys for the menu + #%{ payment_info( 'session_id' => $session_id ) }, # cust_paybys for the menu %{$result} }); @@ -645,8 +645,10 @@ sub do_template { $fill_in->{'selfurl'} = $cgi->self_url; $fill_in->{'cgi'} = \$cgi; - my $skin_info = skin_info(); - $fill_in->{$_} = $skin_info->{$_} foreach keys %$skin_info; + my $access_info = $session_id + ? access_info( 'session_id' => $session_id ) + : {}; + $fill_in->{$_} = $access_info->{$_} foreach keys %$access_info; my $source = "$template_dir/$name.html"; #warn "creating template for $source\n"; |