X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fedit%2Fprocess%2Fmsgcat.cgi;h=7175fa2b3851a5f711bcaa9acbf825946777f1e5;hb=b7c723f64f35ad8049fc6605437a17b262b0d17c;hp=9711143d68c6426e28b23410f529da3837e6c220;hpb=c8cccb4a92adceb943c635fe62dad0d034462ce0;p=freeside.git diff --git a/httemplate/edit/process/msgcat.cgi b/httemplate/edit/process/msgcat.cgi index 9711143d6..7175fa2b3 100644 --- a/httemplate/edit/process/msgcat.cgi +++ b/httemplate/edit/process/msgcat.cgi @@ -1,21 +1,22 @@ -% -% -%my $error; -%foreach my $param ( grep { /^\d+$/ } $cgi->param ) { -% my $old = qsearchs('msgcat', { msgnum=>$param } ); -% next if $old->msg eq $cgi->param($param); #no need to update identical records -% my $new = new FS::msgcat { $old->hash }; -% $new->msg($cgi->param($param)); -% $error = $new->replace($old); -% last if $error; -%} -% %if ( $error ) { % $cgi->param('error',$error); -% print $cgi->redirect($p. "msgcat.cgi?". $cgi->query_string ); +<% $cgi->redirect($p. "msgcat.cgi?". $cgi->query_string ) %> %} else { -% print $cgi->redirect(popurl(3). "browse/msgcat.cgi"); +<% $cgi->redirect(popurl(3). "browse/msgcat.cgi") %> %} -% -% +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $error; +foreach my $param ( grep { /^\d+$/ } $cgi->param ) { + my $old = qsearchs('msgcat', { msgnum=>$param } ); + next if $old->msg eq $cgi->param($param); #no need to update identical records + my $new = new FS::msgcat { $old->hash }; + $new->msg($cgi->param($param)); + $error = $new->replace($old); + last if $error; +} +