[freeside-commits] freeside/fs_selfservice/FS-SelfService/cgi
change_password.html, NONE, 1.1 myaccount_menu.html, 1.2,
1.3 process_change_password.html, NONE,
1.1 provision_list.html, 1.3, 1.4 selfservice.cgi, 1.11, 1.12
Ivan,,,
ivan at wavetail.420.am
Wed Aug 9 03:47:20 PDT 2006
Update of /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi
In directory wavetail:/tmp/cvs-serv13115/fs_selfservice/FS-SelfService/cgi
Modified Files:
myaccount_menu.html provision_list.html selfservice.cgi
Added Files:
change_password.html process_change_password.html
Log Message:
self-service interface: add proper password changer and prevent "Setup my services" provisioner from showing broken links for services not handled yet
Index: selfservice.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/selfservice.cgi,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- selfservice.cgi 8 Jun 2005 09:03:06 -0000 1.11
+++ selfservice.cgi 9 Aug 2006 10:47:18 -0000 1.12
@@ -13,6 +13,7 @@
list_pkgs
part_svc_info provision_acct provision_external
unprovision_svc
+ list_svcs myaccount_passwd
);
$template_dir = '.';
@@ -62,7 +63,7 @@
#order|pw_list XXX ???
$cgi->param('action') =~
- /^(myaccount|view_invoice|make_payment|payment_results|recharge_prepay|recharge_results|logout|change_bill|change_ship|provision|provision_svc|process_svc_acct|process_svc_external|delete_svc)$/
+ /^(myaccount|view_invoice|make_payment|payment_results|recharge_prepay|recharge_results|logout|change_bill|change_ship|provision|provision_svc|process_svc_acct|process_svc_external|delete_svc|change_password|process_change_password)$/
or die "unknown action ". $cgi->param('action');
my $action = $1;
@@ -257,6 +258,41 @@
);
}
+sub change_password {
+ list_svcs(
+ 'session_id' => $session_id,
+ 'svcdb' => 'svc_acct',
+ );
+};
+
+sub process_change_password {
+
+ my $result = myaccount_passwd(
+ 'session_id' => $session_id,
+ map { $_ => $cgi->param($_) } qw( svcnum new_password new_password2 )
+ );
+
+ if ( exists $result->{'error'} && $result->{'error'} ) {
+
+ $action = 'change_password';
+ return {
+ $cgi->Vars,
+ %{ list_svcs( 'session_id' => $session_id,
+ 'svcdb' => 'svc_acct',
+ )
+ },
+ #'svcnum' => $cgi->param('svcnum'),
+ 'error' => $result->{'error'}
+ };
+
+ } else {
+
+ return $result;
+
+ }
+
+}
+
#--
sub do_template {
--- NEW FILE: process_change_password.html ---
<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
<%= include('myaccount_menu') %>
<TD VALIGN="top">
<FONT SIZE=4>Password changed for <%= $value %> <%= $label %>.</FONT>
</TD></TR></TABLE>
<HR>
<FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT>
</BODY></HTML>
Index: myaccount_menu.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- myaccount_menu.html 8 Jun 2005 09:03:06 -0000 1.2
+++ myaccount_menu.html 9 Aug 2006 10:47:18 -0000 1.3
@@ -35,9 +35,9 @@
{ title=>' ' },
{ title=>'Change my information', size=>'+1', },
- { title=>'Change payment information*', url=>'change_bill', indent=>2 },
- { title=>'Change service address*', url=>'change_ship', indent=>2 },
- { title=>'Change password(s)*', url=>'hmmmFIXME', indent=>2 },
+ { title=>'Change payment information*', url=>'change_bill', indent=>2 },
+ { title=>'Change service address*', url=>'change_ship', indent=>2 },
+ { title=>'Change password(s)', url=>'change_password', indent=>2 },
{ title=>' ' },
@@ -82,8 +82,8 @@
%>
+<TR><TD STYLE="border-right: 1px solid black"><BR><BR>* coming soon</TD></TR>
+
</TABLE>
-<A HREF="passwd.html">(tempFIXME) Change password(s)</A><BR><BR>
-* coming soon
</TD>
Index: provision_list.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/provision_list.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- provision_list.html 30 Dec 2005 02:41:22 -0000 1.3
+++ provision_list.html 9 Aug 2006 10:47:18 -0000 1.4
@@ -75,7 +75,10 @@
$OUT .= "<TR>$td COLSPAN=3 ALIGN=center>".
qq!<A HREF="$link">!. 'Setup '. $part_svc->{'svc'}. '</A> '.
'('. $part_svc->{'num_avail'}. ' available)'.
- '</TD></TR>';
+ '</TD></TR>'
+ #self-service only supports these services so far
+ if grep { $part_svc->{'svcdb'} eq $_ } qw( svc_acct svc_external );
+
$col = $col eq $col1 ? $col2 : $col1;
}
--- NEW FILE: change_password.html ---
<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
<%= include('myaccount_menu') %>
<TD VALIGN="top">
<FONT SIZE=4>Change password</FONT><BR><BR>
<%= if ( $error ) {
$OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">$error</FONT><BR><BR>!;
} ''; %>
<FORM ACTION="<%= $selfurl %>" METHOD="POST">
<INPUT TYPE="hidden" NAME="session" VALUE="<%= $session_id %>">
<INPUT TYPE="hidden" NAME="action" VALUE="process_change_password">
<TABLE BGCOLOR="#cccccc">
<TR>
<TH ALIGN="right">Change password for account: </TH>
<TD>
<SELECT NAME="svcnum">
<%= foreach my $svc ( @svcs ) {
$OUT .= '<OPTION VALUE="'. $svc->{'svcnum'}. '"'.
( $svc->{'svcnum'} eq $svcnum ? ' SELECTED' : '' ). '>'.
$svc->{'label'}. ': '. $svc->{'value'}. "\n";
}
%>
</SELECT>
</TD>
</TR>
<TR>
<TH ALIGN="right">New password: </TH>
<TD><INPUT TYPE="password" NAME="new_password" SIZE="18"></TD>
</TR>
<TR>
<TH ALIGN="right">Re-enter new password: </TH>
<TD><INPUT TYPE="password" NAME="new_password2" SIZE="18"></TD>
</TR>
</TABLE>
<BR>
<INPUT TYPE="submit" VALUE="Change password">
</FORM>
</TD></TR></TABLE>
<HR>
<FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT>
</BODY></HTML>
More information about the freeside-commits
mailing list