fixup! remove deprecated role model

This commit is contained in:
Milan
2023-03-23 21:40:58 +01:00
parent 1709694d8e
commit 3b79d20142

View File

@@ -44,6 +44,19 @@ sub process($$$$) {
$params->{user} = $ENV{REMOTE_USER} unless defined $params->{user};
if ( ( $filename =~ /json\-p/ ) || (params::isJson) ) {
my $header = "Content-type:application/json; charset=utf-8\n\n";
my $json = JSON->new->pretty(1)->canonical()->encode($params);
$json = $header . $params->{json_callback} . $json;
if ( ( defined $_[1] ) && ( $_[1] eq 'print' ) ) {
print $json. "\n";
} else {
$_[1] = $json . "\n";
}
return;
}
unless ( -r $filename ) {
log::error( $config, qq{template "$filename" does not exist} ) unless -e $filename;
log::error( $config, qq{missing permissions to read "$filename"} );