[freeside-commits] freeside/fs_selfservice/FS-SelfService/cgi selfservice.cgi, 1.37, 1.38 myaccount_menu.html, 1.12, 1.13 myaccount.html, 1.14, 1.15 make_thirdparty_payment.html, 1.2, 1.3 login.html, 1.6, 1.7 logout.html, 1.2, 1.3

Ivan,,, ivan at wavetail.420.am
Mon Aug 10 04:50:06 PDT 2009


Update of /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi
In directory wavetail.420.am:/tmp/cvs-serv745/fs_selfservice/FS-SelfService/cgi

Modified Files:
	selfservice.cgi myaccount_menu.html myaccount.html 
	make_thirdparty_payment.html login.html logout.html 
Log Message:
when using pkg-balances, limit self-service access when a customer with multiple packages logs on, RT#4189

Index: selfservice.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/selfservice.cgi,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- selfservice.cgi	31 Jul 2009 13:20:54 -0000	1.37
+++ selfservice.cgi	10 Aug 2009 11:50:03 -0000	1.38
@@ -10,7 +10,7 @@
 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 @@
 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 @@
   $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";

Index: myaccount.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/myaccount.html,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- myaccount.html	31 Jul 2009 13:20:54 -0000	1.14
+++ myaccount.html	10 Aug 2009 11:50:03 -0000	1.15
@@ -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>!;
   }
 } %>
 <%=

Index: myaccount_menu.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- myaccount_menu.html	31 Jul 2009 13:20:54 -0000	1.12
+++ myaccount_menu.html	10 Aug 2009 11:50:03 -0000	1.13
@@ -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 @@
   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 @@
 
 }
 
-push @menu, (
-
-{ title=>' ' },
-
-{ title=>'View my usage', url=>'view_usage', size=>'+1', },
-{ title=>'Setup my services', url=>'provision', size=>'+1', },
+push @menu,
+  { title=>' ' },
+  { title=>'View my usage', url=>'view_usage', 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 @@
   }
   $OUT.='>';
 
-  $OUT .= '<FONT SIZE="'. $item->{'size'}. '">'
-    if exists $item->{'size'};
-
   $OUT .= '&nbsp;' 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/ /&nbsp;/g;
   $OUT .= $item->{'title'};
 

Index: login.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/login.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- login.html	31 Jul 2009 13:20:54 -0000	1.6
+++ login.html	10 Aug 2009 11:50:04 -0000	1.7
@@ -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>

Index: logout.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/logout.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- logout.html	31 Jul 2009 13:20:54 -0000	1.2
+++ logout.html	10 Aug 2009 11:50:04 -0000	1.3
@@ -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>

Index: make_thirdparty_payment.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/make_thirdparty_payment.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- make_thirdparty_payment.html	10 Mar 2009 16:14:06 -0000	1.2
+++ make_thirdparty_payment.html	10 Aug 2009 11:50:04 -0000	1.3
@@ -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 @@
   $OUT .= qq!</FORM>!;
 }
 %>
-</TD></TR></TABLE>
-</BODY></HTML>
+
+<%= include('footer') %>



More information about the freeside-commits mailing list