diff options
author | ivan <ivan> | 2009-05-02 00:02:07 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-05-02 00:02:07 +0000 |
commit | b19bf30f0d745d20e5e4f0a8e47ce16a04b02dd9 (patch) | |
tree | 5c277c7bb3fb4a3d9a55d42335696d6649989d67 /httemplate/config/config-delete.cgi | |
parent | 0609e18c044c8cf749b58dbae951fdacdb87f159 (diff) |
finish up useful agent stuff on the config editor: adding, deleting overrides too. also add a confirmation to override deletion from the agent browse page. RT#5218
Diffstat (limited to 'httemplate/config/config-delete.cgi')
-rw-r--r-- | httemplate/config/config-delete.cgi | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/httemplate/config/config-delete.cgi b/httemplate/config/config-delete.cgi index cdac434fa..ffeae7877 100644 --- a/httemplate/config/config-delete.cgi +++ b/httemplate/config/config-delete.cgi @@ -2,14 +2,19 @@ die "access denied\n" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); -die "No configuration item specified (bad URL)!" unless $cgi->keywords; -my ($query) = $cgi->keywords; -$query =~ /^(\d+)$/; +$cgi->param('confnum') =~ /^(\d+)$/ or die "illegal or missing confnum"; my $confnum = $1; my $conf = qsearchs('conf', {'confnum' => $confnum}); die "Configuration not found!" unless $conf; $conf->delete; +my $redirect = popurl(2); +if ( $cgi->param('redirect') eq 'config_view' ) { + $redirect .= 'config/config-view.cgi?showagent=1#'. $conf->name; +} else { + $redirect .= 'browse/agent.cgi'; +} + </%init> -<% $cgi->redirect(popurl(2) . "browse/agent.cgi") %> +<% $cgi->redirect($redirect) %> |