Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
Improved AdminSupportDataCollector.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgruner committed Sep 3, 2018
1 parent 906463d commit d8cae00
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions Kernel/Modules/AdminServiceCenter.pm
Expand Up @@ -277,6 +277,8 @@ sub _SupportDataCollectorView {
sub _GenerateSupportBundle {
my ( $Self, %Param ) = @_;

$Self->{LayoutObject}->ChallengeTokenCheck();

my $RandomID = $Self->{MainObject}->GenerateRandomString(
Length => 8,
Dictionary => [ 0 .. 9, 'a' .. 'f' ],
Expand Down Expand Up @@ -343,12 +345,22 @@ sub _GenerateSupportBundle {
sub _DownloadSupportBundle {
my ( $Self, %Param ) = @_;

$Self->{LayoutObject}->ChallengeTokenCheck();

my $Filename = $Self->{ParamObject}->GetParam( Param => 'Filename' ) || '';
my $RandomID = $Self->{ParamObject}->GetParam( Param => 'RandomID' ) || '';

if ( !$Filename ) {
# Validate simple file name.
if ( !$Filename || $Filename !~ m{^[a-z0-9._-]+$}smxi ) {
return $Self->{LayoutObject}->ErrorScreen(
Message => "Need Filename or Filename invalid!",
);
}

# Validate simple RandomID.
if ( !$RandomID || $RandomID !~ m{^[a-f0-9]+$}smx ) {
return $Self->{LayoutObject}->ErrorScreen(
Message => "Need Filename!",
Message => "Need RandomID or RandomID invalid!",
);
}

Expand Down
Expand Up @@ -195,7 +195,7 @@
}

$('#DownloadSupportBundle').bind('click', function (Event) {
window.location.href = '[% Env("Baselink") %]Action=[% Env("Action") %];Subaction=DownloadSupportBundle;Filename=' + Response.Filename + ';RandomID=' + Response.RandomID;
window.location.href = '[% Env("Baselink") %]Action=[% Env("Action") %];Subaction=DownloadSupportBundle;Filename=' + Response.Filename + ';RandomID=' + Response.RandomID + ';ChallengeToken=' + Core.Config.Get('ChallengeToken');
Core.UI.Dialog.CloseDialog($('#SupportBundleOptionsDialog'));
});
}
Expand Down

0 comments on commit d8cae00

Please sign in to comment.