Skip to content
Permalink
Browse files

Improved AdminSupportDataCollector.

  • Loading branch information...
mgruner committed Sep 3, 2018
1 parent a0b9375 commit a4a1a01f84fac7ab032570ee50b660e2ebb15c01
@@ -280,6 +280,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,
@@ -350,12 +352,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!",
);
}

@@ -160,7 +160,7 @@ Core.Agent.Admin = Core.Agent.Admin || {};
}

$('#DownloadSupportBundle').on('click', function () {
window.location.href = Core.Config.Get('Baselink') + 'Action=' + Core.Config.Get('Action') + ';Subaction=DownloadSupportBundle;Filename=' + Response.Filename + ';RandomID=' + Response.RandomID;
window.location.href = Core.Config.Get('Baselink') + 'Action=' + Core.Config.Get('Action') + ';Subaction=DownloadSupportBundle;Filename=' + Response.Filename + ';RandomID=' + Response.RandomID + ';ChallengeToken=' + Core.Config.Get('ChallengeToken');
Core.UI.Dialog.CloseDialog($('#SupportBundleOptionsDialog'));
});
}

0 comments on commit a4a1a01

Please sign in to comment.
You can’t perform that action at this time.