blob: 58c3f2c68c91d5050283f2f022fda0311365a015 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<% $server->process %>
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;
# make sure user can generally edit
die "access denied"
unless $curuser->access_right([ 'Edit templates', 'Edit global templates' ]);
# make sure user can edit this particular image
my %arg = $cgi->param('arg');
my $imgnum = $arg{'imgnum'};
die "bad imgnum" unless $imgnum =~ /^\d+$/;
die "access denied" unless qsearchs({
'table' => 'template_image',
'select' => 'imgnum',
'hashref' => { 'imgnum' => $imgnum },
'extra_sql' => ' AND ' .
$curuser->agentnums_sql(
'null_right' => ['Edit global templates']
),
});
my $server =
new FS::UI::Web::JSRPC 'FS::template_image::process_image_delete', $cgi;
</%init>
|