finish up useful agent stuff on the config editor: adding, deleting overrides too...
[freeside.git] / httemplate / config / config-delete.cgi
1 <%init>
2 die "access denied\n"
3   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
4
5 $cgi->param('confnum') =~ /^(\d+)$/ or die "illegal or missing confnum";
6 my $confnum = $1;
7
8 my $conf = qsearchs('conf', {'confnum' => $confnum});
9 die "Configuration not found!" unless $conf;
10 $conf->delete;
11
12 my $redirect = popurl(2);
13 if ( $cgi->param('redirect') eq 'config_view' ) {
14   $redirect .= 'config/config-view.cgi?showagent=1#'. $conf->name;
15 } else {
16   $redirect .= 'browse/agent.cgi';
17 }
18
19 </%init>
20 <% $cgi->redirect($redirect) %>