summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
Diffstat (limited to 'library')
-rw-r--r--library/SSRS/Form/Adapter/AdapterInterface.php2
-rw-r--r--library/SSRS/Form/Adapter/ZendFramework2.php8
2 files changed, 10 insertions, 0 deletions
diff --git a/library/SSRS/Form/Adapter/AdapterInterface.php b/library/SSRS/Form/Adapter/AdapterInterface.php
index 07a03f8..58b6196 100644
--- a/library/SSRS/Form/Adapter/AdapterInterface.php
+++ b/library/SSRS/Form/Adapter/AdapterInterface.php
@@ -13,4 +13,6 @@ interface AdapterInterface {
public function getHTML();
public function validate($data);
+
+ public function addCSRFElement($name, $value);
}
diff --git a/library/SSRS/Form/Adapter/ZendFramework2.php b/library/SSRS/Form/Adapter/ZendFramework2.php
index fef6585..26e28a2 100644
--- a/library/SSRS/Form/Adapter/ZendFramework2.php
+++ b/library/SSRS/Form/Adapter/ZendFramework2.php
@@ -94,6 +94,14 @@ class ZendFramework2 extends AbstractAdapter {
return $this;
}
+ public function addCSRFElement($name, $value) {
+ $csrf = new \Zend\Form\Element\Hidden($name);
+ $csrf->setValue($value);
+
+ $this->form->add($csrf);
+ return $this;
+ }
+
public function getUserParameters() {
return array_filter($this->executionInfo->getReportParameters(), function(ReportParameter $parameter) {
return ($parameter->data['PromptUser'] && false === empty($parameter->data['Prompt']));