summaryrefslogtreecommitdiffstats
path: root/Kernel
diff options
context:
space:
mode:
authorAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2016-05-25 01:15:54 +0200
committerotrs <otrs@vm-tickets.spline.inf.fu-berlin.de>2016-05-25 01:17:06 +0200
commit6b45d2ab7344e0022ac4d33494b470364d681be6 (patch)
tree816a05e60ca69b927539a7b4ecd70fc0a711fcb2 /Kernel
parent4d081a0103b17e7221abe8b4218fed031c1e4c50 (diff)
downloadFakePackageVerification-6b45d2ab7344e0022ac4d33494b470364d681be6.tar.gz
FakePackageVerification-6b45d2ab7344e0022ac4d33494b470364d681be6.tar.bz2
FakePackageVerification-6b45d2ab7344e0022ac4d33494b470364d681be6.zip
First version of the pluginHEADv1.0.0master
The plugin wrapps the Get method of the default Cache::Module and returns a "custom" value for all PackageVerification cache queries. This hides the notification about failed verification, but does not show a verified badge.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Config/Files/FakePackageVerification.xml12
-rw-r--r--Kernel/System/Cache/FakeVerifyFileStorable.pm28
2 files changed, 40 insertions, 0 deletions
diff --git a/Kernel/Config/Files/FakePackageVerification.xml b/Kernel/Config/Files/FakePackageVerification.xml
new file mode 100644
index 0000000..7f4e50d
--- /dev/null
+++ b/Kernel/Config/Files/FakePackageVerification.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<otrs_config version="1.0" init="Config">
+ <ConfigItem Name="Cache::Module" Required="1" Valid="1" ConfigLevel="200">
+ <Description Translatable="1">Selects the cache backend to use.</Description>
+ <Group>Framework</Group>
+ <SubGroup>Core::Cache</SubGroup>
+ <Setting>
+ <Option Location="Kernel/System/Cache/*.pm" SelectedID="Kernel::System::Cache::FakeVerifyFileStorable">
+ </Option>
+ </Setting>
+ </ConfigItem>
+</otrs_config>
diff --git a/Kernel/System/Cache/FakeVerifyFileStorable.pm b/Kernel/System/Cache/FakeVerifyFileStorable.pm
new file mode 100644
index 0000000..183c1af
--- /dev/null
+++ b/Kernel/System/Cache/FakeVerifyFileStorable.pm
@@ -0,0 +1,28 @@
+package Kernel::System::Cache::FakeVerifyFileStorable;
+
+use strict;
+use warnings;
+
+our @ObjectDependencies = (
+ 'Kernel::System::Cache::FileStorable',
+);
+
+use parent 'Kernel::System::Cache::FileStorable';
+
+sub Get {
+ my ( $Self, %Param ) = @_;
+
+ # check needed stuff
+ if ( !defined $Param{Type} ) {
+ $Kernel::OM->Get('Kernel::System::Log')->Log(
+ Priority => 'error',
+ Message => "Need Type!"
+ );
+ return;
+ }
+
+ return 'custom' if $Param{Type} eq 'PackageVerification';
+ return Kernel::System::Cache::FileStorable::Get(@_);
+}
+
+1;