[freeside-commits] freeside/httemplate/edit/process svc_acct.cgi, 1.11, 1.11.4.1
Mark Wells
mark at wavetail.420.am
Tue Dec 22 16:30:28 PST 2009
Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail.420.am:/tmp/cvs-serv10130/httemplate/edit/process
Modified Files:
Tag: FREESIDE_1_9_BRANCH
svc_acct.cgi
Log Message:
Tweak set_password per RT#6358
Index: svc_acct.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/svc_acct.cgi,v
retrieving revision 1.11
retrieving revision 1.11.4.1
diff -u -d -r1.11 -r1.11.4.1
--- svc_acct.cgi 13 Jan 2008 21:35:53 -0000 1.11
+++ svc_acct.cgi 23 Dec 2009 00:30:26 -0000 1.11.4.1
@@ -5,12 +5,13 @@
<% $cgi->redirect(popurl(3). "view/svc_acct.cgi?" . $svcnum ) %>
%}
<%init>
-
+use CGI::Carp;
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
my $svcnum = $1;
+my $error;
my $old;
if ( $svcnum ) {
@@ -23,12 +24,6 @@
#unmunge popnum
$cgi->param('popnum', (split(/:/, $cgi->param('popnum') ))[0] );
-#unmunge passwd
-if ( $cgi->param('_password') eq '*HIDDEN*' ) {
- die "fatal: no previous account to recall hidden password from!" unless $old;
- $cgi->param('_password',$old->getfield('_password'));
-}
-
#unmunge usergroup
$cgi->param('usergroup', [ $cgi->param('radius_usergroup') ] );
@@ -45,7 +40,15 @@
} (fields('svc_acct'), qw ( pkgnum svcpart usergroup ));
my $new = new FS::svc_acct ( \%hash );
-my $error;
+$new->_password($old->_password) if $old;
+if( $cgi->param('clear_password') eq '*HIDDEN*'
+ or $cgi->param('clear_password') =~ /^\(.* encrypted\)$/ ) {
+ die "fatal: no previous account to recall hidden password from!" unless $old;
+}
+else {
+ $error = $new->set_password($cgi->param('clear_password'));
+}
+
if ( $svcnum ) {
foreach (grep { $old->$_ != $new->$_ } qw( seconds upbytes downbytes totalbytes )) {
my %hash = map { $_ => $new->$_ }
More information about the freeside-commits
mailing list