X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fprocess%2Fchange-password.html;fp=httemplate%2Fmisc%2Fprocess%2Fchange-password.html;h=7005439ccc2ba00f5c283a7fac734034ee358108;hb=a5e611f5ffc045a59fee9e1b03f8ac79ef794d00;hp=0000000000000000000000000000000000000000;hpb=bb79bc808b080e3c9fb9ebe3275c75343a3385bd;p=freeside.git diff --git a/httemplate/misc/process/change-password.html b/httemplate/misc/process/change-password.html new file mode 100644 index 000000000..7005439cc --- /dev/null +++ b/httemplate/misc/process/change-password.html @@ -0,0 +1,21 @@ +<%init> +my $curuser = $FS::CurrentUser::CurrentUser; +die "access denied" unless $curuser->access_right('Edit password'); + +$cgi->param('svcnum') =~ /^(\d+)$/ or die "illegal svcnum"; +my $svcnum = $1; +my $svc_acct = FS::svc_acct->by_key($svcnum) + or die "svc_acct $svcnum not found"; +my $error = $svc_acct->set_password($cgi->param('password')) + || $svc_acct->replace; + +# annoyingly specific to view/svc_acct.cgi, for now... +$cgi->delete('password'); + +% if ( $error ) { +% $cgi->param('svcnum', $svcnum); +% $cgi->param("changepw${svcnum}_error", $error); +% } else { +% $cgi->query_string($svcnum); +% } +<% $cgi->redirect($fsurl.'view/svc_acct.cgi?'.$cgi->query_string) %>