X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=fs_selfservice%2FFS-SelfService%2Fcgi%2Fselfservice.cgi;h=6aa5191a8f81a27e0ff092378fcb884348b0e418;hb=02d95b3bb4f7beb0c4c52751c25bd6d37f8f9b59;hp=1b728e2f9ef4a87f240cc88b1b30d605964afa17;hpb=7beec7068e00be5ae1b2599fdf2b494bc19e31d0;p=freeside.git diff --git a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi index 1b728e2f9..6aa5191a8 100755 --- a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi +++ b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi @@ -23,6 +23,8 @@ use FS::SelfService qw( mason_comp port_graph start_thirdparty finish_thirdparty reset_passwd check_reset_passwd process_reset_passwd + validate_passwd + billing_history ); $template_dir = '.'; @@ -82,6 +84,8 @@ my @actions = ( qw( process_change_password customer_suspend_pkg process_suspend_pkg + history + validate_password )); my @nologin_actions = (qw( @@ -90,6 +94,7 @@ my @nologin_actions = (qw( process_forgot_password do_process_forgot_password process_forgot_password_session + validate_password_nologin )); push @actions, @nologin_actions; my %nologin_actions = map { $_=>1 } @nologin_actions; @@ -106,7 +111,6 @@ if ( $cgi->param('action') =~ /^process_forgot_password_session_(\w+)$/ ) { warn "WARNING: unrecognized action '$1'\n"; } } - unless ( $nologin_actions{$action} ) { my %cookies = CGI::Cookie->fetch; @@ -339,6 +343,10 @@ sub invoices { list_invoices( 'session_id' => $session_id, ); } +sub history { + billing_history( 'session_id' => $session_id, ); +} + sub tktcreate { my $customer_info = customer_info( 'session_id' => $session_id ); return $customer_info if ( $customer_info->{'error'} ); @@ -563,10 +571,15 @@ sub make_payment { my $payment_info = payment_info( 'session_id' => $session_id ); + my $amount = + ($payment_info->{'balance'} && ($payment_info->{'balance'} > 0)) + ? $payment_info->{'balance'} + : ''; + my $tr_amount_fee = mason_comp( 'session_id' => $session_id, 'comp' => '/elements/tr-amount_fee.html', - 'args' => [ 'amount' => $payment_info->{'balance'}, + 'args' => [ 'amount' => $amount, ], ); @@ -971,7 +984,7 @@ sub delete_svc { sub view_usage { my $res = list_svcs( 'session_id' => $session_id, - 'svcdb' => [ 'svc_acct', 'svc_phone', 'svc_port', 'svc_pbx' ], + 'svcdb' => [ 'svc_acct', 'svc_broadband', 'svc_phone', 'svc_port', 'svc_pbx' ], 'ncancelled' => 1, ); if ($res->{hide_usage}) { @@ -1098,6 +1111,22 @@ sub do_process_forgot_password { ); } +sub validate_password { + validate_passwd( + 'session_id' => $session_id, + map { $_ => scalar($cgi->param($_)) } + qw( fieldid svcnum check_password ) + ) +} + +sub validate_password_nologin { + $action = 'validate_password'; #use same landing page + validate_passwd( + map { $_ => scalar($cgi->param($_)) } + qw( fieldid check_password agentnum ) + ) +} + #-- sub do_template {