X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fmsgcat.cgi;h=937fc7c24bcfcd48f2353437a865e567debd81cb;hp=ab30f06b576c745ce0ceccc31348523f99e45a7c;hb=HEAD;hpb=44e3eff0aa6e7bdb7f4ecd9ee1ddf141e1b68af3 diff --git a/httemplate/edit/process/msgcat.cgi b/httemplate/edit/process/msgcat.cgi index ab30f06b5..937fc7c24 100644 --- a/httemplate/edit/process/msgcat.cgi +++ b/httemplate/edit/process/msgcat.cgi @@ -1,19 +1,23 @@ -<% +%if ( $error ) { +% $cgi->param('error',$error); +<% $cgi->redirect($p. "msgcat.cgi?". $cgi->query_string ) %> +%} else { +<% $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 + die "editing en_US locale is currently disabled" if $old->locale eq 'en_US'; 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 ); -} else { - print $cgi->redirect(popurl(3). "browse/msgcat.cgi"); -} - -%> +