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 abb193c commit d9db0c6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions Kernel/Modules/AdminSupportDataCollector.pm
Expand Up @@ -275,6 +275,8 @@ sub _SupportDataCollectorView {
sub _GenerateSupportBundle {
my ( $Self, %Param ) = @_;

$Kernel::OM->Get('Kernel::Output::HTML::Layout')->ChallengeTokenCheck();

my $MainObject = $Kernel::OM->Get('Kernel::System::Main');
my $RandomID = $MainObject->GenerateRandomString(
Length => 8,
Expand Down Expand Up @@ -345,12 +347,23 @@ sub _DownloadSupportBundle {

my $ParamObject = $Kernel::OM->Get('Kernel::System::Web::Request');
my $LayoutObject = $Kernel::OM->Get('Kernel::Output::HTML::Layout');

$LayoutObject->ChallengeTokenCheck();

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

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

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

Expand Down
Expand Up @@ -216,7 +216,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 d9db0c6

Please sign in to comment.