[freeside-commits] freeside/httemplate/edit/process svc_acct.cgi, 1.11, 1.12
Mark Wells
mark at wavetail.420.am
Thu Nov 12 13:45:10 PST 2009
Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail.420.am:/tmp/cvs-serv3856/httemplate/edit/process
Modified Files:
svc_acct.cgi
Log Message:
Add default password encoding option
Index: svc_acct.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/svc_acct.cgi,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- svc_acct.cgi 13 Jan 2008 21:35:53 -0000 1.11
+++ svc_acct.cgi 12 Nov 2009 21:45:07 -0000 1.12
@@ -5,7 +5,7 @@
<% $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?
@@ -23,12 +23,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,6 +39,15 @@
} (fields('svc_acct'), qw ( pkgnum svcpart usergroup ));
my $new = new FS::svc_acct ( \%hash );
+$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 {
+ $new->set_password($cgi->param('clear_password'));
+}
+
my $error;
if ( $svcnum ) {
foreach (grep { $old->$_ != $new->$_ } qw( seconds upbytes downbytes totalbytes )) {
More information about the freeside-commits
mailing list