Commit 0481f9d3 authored by Tino Goratsch's avatar Tino Goratsch

made it much more easier to use the form token helper

parent 333e5073
......@@ -18,43 +18,43 @@ class DB
/**
* @var string
*/
protected $name = '';
protected $database = '';
/**
* @var string
*/
protected $prefix = '';
/**
* @param $dbHost
* @param $dbName
* @param $dbUser
* @param $dbPassword
* @param string $dbTablePrefix
* @param string $dbDriver
* @param string $dbCharset
* @param string $host
* @param string $database
* @param string $userName
* @param string $password
* @param string $tablePrefix
* @param string $driver
* @param string $charset
* @param string $cacheDriverName
*
* @throws \Doctrine\DBAL\DBALException
*/
public function __construct(
$dbHost,
$dbName,
$dbUser,
$dbPassword,
$dbTablePrefix = '',
$dbDriver = 'pdo_mysql',
$dbCharset = 'utf8',
$host,
$database,
$userName,
$password,
$tablePrefix = '',
$driver = 'pdo_mysql',
$charset = 'utf8',
$cacheDriverName = 'Array'
)
{
$config = new DBAL\Configuration();
$connectionParams = [
'dbname' => $dbName,
'user' => $dbUser,
'password' => $dbPassword,
'host' => $dbHost,
'driver' => $dbDriver,
'charset' => $dbCharset
'dbname' => $database,
'user' => $userName,
'password' => $password,
'host' => $host,
'driver' => $driver,
'charset' => $charset
];
if (defined('DEBUG_SQL') === true && DEBUG_SQL === true) {
$config->setSQLLogger(new SQLLogger());
......@@ -74,8 +74,8 @@ class DB
$this->connection = DBAL\DriverManager::getConnection($connectionParams, $config);
$this->prefix = $dbTablePrefix;
$this->name = $dbName;
$this->prefix = $tablePrefix;
$this->database = $database;
}
/**
......@@ -89,9 +89,9 @@ class DB
/**
* @return string
*/
public function getName()
public function getDatabase()
{
return $this->name;
return $this->database;
}
/**
......
......@@ -44,11 +44,12 @@ class FormToken
* @param string $path
* Optionaler ACP3 interner URI Pfad, für welchen das Token gelten soll
*/
public function generateFormToken($path)
public function generateFormToken($path = '')
{
$tokenName = Core\SessionHandler::XSRF_TOKEN_NAME;
$sessionTokens = $this->sessionHandler->get($tokenName, []);
$path = empty($path) ? $this->request->getQuery() : $path;
$path = $path . (!preg_match('/\/$/', $path) ? '/' : '');
if (!isset($sessionTokens[$path])) {
......@@ -65,8 +66,9 @@ class FormToken
* @param string $path
* @param string $token
*/
public function unsetFormToken($path, $token = '')
public function unsetFormToken($path = '', $token = '')
{
$path = empty($path) ? $this->request->getQuery() : $path;
$tokenName = Core\SessionHandler::XSRF_TOKEN_NAME;
if (empty($token) && $this->request->getPost()->has($tokenName)) {
$token = $this->request->getPost()->get($tokenName, '');
......
......@@ -132,7 +132,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('form', array_merge($defaults, $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
/**
......@@ -163,7 +163,7 @@ class Index extends Core\Modules\AdminController
$this->createOrUpdateMenuItem($formData, $lastId);
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $lastId;
});
......@@ -246,7 +246,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('form', array_merge($article, $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
} else {
throw new Core\Exceptions\ResultNotExists();
}
......@@ -286,7 +286,7 @@ class Index extends Core\Modules\AdminController
$this->createOrUpdateMenuItem($formData, $id);
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $bool;
});
......
......@@ -68,7 +68,7 @@ class Index extends Core\Modules\AdminController
}
$this->view->assign('mod_list', $modules);
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
/**
......@@ -98,7 +98,7 @@ class Index extends Core\Modules\AdminController
$this->categoriesCache->saveCache(strtolower($formData['module']));
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $bool;
});
......@@ -168,7 +168,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('form', array_merge($category, $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
} else {
throw new Core\Exceptions\ResultNotExists();
}
......@@ -202,7 +202,7 @@ class Index extends Core\Modules\AdminController
$this->categoriesCache->saveCache($this->categoriesModel->getModuleNameFromCategoryId($id));
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $bool;
});
......@@ -241,7 +241,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('form', array_merge($settings, $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
/**
......@@ -258,7 +258,7 @@ class Index extends Core\Modules\AdminController
'filesize' => (int)$formData['filesize'],
];
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $this->config->setSettings($data, 'categories');
});
......
......@@ -132,7 +132,7 @@ class Details extends Core\Modules\AdminController
$this->view->assign('form', array_merge($comment, $this->request->getPost()->getAll()));
$this->view->assign('module_id', (int)$comment['module_id']);
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
} else {
throw new Core\Exceptions\ResultNotExists();
}
......@@ -201,7 +201,7 @@ class Details extends Core\Modules\AdminController
$bool = $this->commentsModel->update($updateValues, $id);
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $bool;
});
......
......@@ -110,7 +110,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('allow_emoticons', $this->get('core.helpers.forms')->selectGenerator('emoticons', [1, 0], $lang_allowEmoticons, $settings['emoticons'], 'checked'));
}
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
/**
......@@ -126,7 +126,7 @@ class Index extends Core\Modules\AdminController
'emoticons' => $formData['emoticons'],
];
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $this->config->setSettings($data, 'comments');
});
......
......@@ -204,7 +204,7 @@ class Index extends Core\Modules\FrontendController
$this->view->assign('captcha', $this->captchaHelpers->captcha());
}
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
return $this->view->fetchTemplate('Comments/Frontend/index.create.tpl');
}
......@@ -233,7 +233,7 @@ class Index extends Core\Modules\FrontendController
$bool = $this->commentsModel->insert($insertValues);
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
$this->redirectMessages()->setMessage($bool, $this->lang->t('system', $bool !== false ? 'create_success' : 'create_error'), $this->request->getQuery());
}
......
......@@ -46,7 +46,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('form', array_merge($settings, $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
/**
......@@ -67,7 +67,7 @@ class Index extends Core\Modules\AdminController
'vat_id' => Core\Functions::strEncode($formData['vat_id'], true),
];
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $this->config->setSettings($data, 'contact');
});
......
......@@ -93,7 +93,7 @@ class Index extends Core\Modules\FrontendController
$this->view->assign('captcha', $this->captchaHelpers->captcha());
}
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
/**
......@@ -125,7 +125,7 @@ class Index extends Core\Modules\FrontendController
$this->sendEmailHelper->execute($formData['name'], $formData['mail'], $settings['mail'], $subjectCopy, $bodyCopy);
}
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
$this->setTemplate($this->get('core.helpers.alerts')->confirmBox(
$bool === true ? $this->lang->t('contact', 'send_mail_success') : $this->lang->t('contact', 'send_mail_error'),
......
......@@ -58,7 +58,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('form', array_merge(['code' => '', 'description' => ''], $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
/**
......@@ -85,7 +85,7 @@ class Index extends Core\Modules\AdminController
$this->emoticonsCache->saveCache();
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $bool;
});
......@@ -136,7 +136,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('form', array_merge($emoticon, $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
} else {
throw new Core\Exceptions\ResultNotExists();
}
......@@ -170,7 +170,7 @@ class Index extends Core\Modules\AdminController
$this->emoticonsCache->saveCache();
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $bool;
});
......@@ -203,7 +203,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('form', array_merge($this->config->getSettings('emoticons'), $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
/**
......@@ -220,7 +220,7 @@ class Index extends Core\Modules\AdminController
'filesize' => (int)$formData['filesize'],
];
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $this->config->setSettings($data, 'emoticons');
});
......
......@@ -53,7 +53,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('form', array_merge($settings, $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
/**
......@@ -69,7 +69,7 @@ class Index extends Core\Modules\AdminController
'feed_type' => $formData['feed_type']
];
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $this->config->setSettings($data, 'feeds');
});
......
......@@ -121,7 +121,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('form', array_merge($defaults, $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
/**
......@@ -198,7 +198,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('SEO_FORM_FIELDS', $this->seo->formFields(sprintf(Files\Helpers::URL_KEY_PATTERN, $id)));
$this->view->assign('form', array_merge($file, $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
} else {
throw new Core\Exceptions\ResultNotExists();
}
......@@ -240,7 +240,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('sidebar_entries', $this->get('core.helpers.forms')->recordsPerPage((int)$settings['sidebar'], 1, 10));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
/**
......@@ -293,7 +293,7 @@ class Index extends Core\Modules\AdminController
(int)$formData['seo_robots']
);
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $lastId;
});
......@@ -363,7 +363,7 @@ class Index extends Core\Modules\AdminController
$this->filesCache->saveCache($id);
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $bool;
});
......@@ -386,7 +386,7 @@ class Index extends Core\Modules\AdminController
$data['comments'] = $formData['comments'];
}
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $this->config->setSettings($data, 'files');
});
......
......@@ -80,7 +80,7 @@ class Index extends Core\Modules\AdminController
];
$this->view->assign('form', array_merge($defaults, $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
public function actionDelete($action = '')
......@@ -138,7 +138,7 @@ class Index extends Core\Modules\AdminController
$this->_actionEditPictures();
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
} else {
throw new Core\Exceptions\ResultNotExists();
}
......@@ -204,7 +204,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('form', array_merge($settings, $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
/**
......@@ -233,7 +233,7 @@ class Index extends Core\Modules\AdminController
(int)$formData['seo_robots']
);
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $lastId;
});
......@@ -269,7 +269,7 @@ class Index extends Core\Modules\AdminController
);
$this->galleryHelpers->generatePictureAliases($id);
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $bool;
});
......@@ -300,7 +300,7 @@ class Index extends Core\Modules\AdminController
$data['comments'] = (int)$formData['comments'];
}
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
$bool = $this->config->setSettings($data, 'gallery');
......
......@@ -102,7 +102,7 @@ class Pictures extends Core\Modules\AdminController
$this->view->assign('form', array_merge(['description' => ''], $this->request->getPost()->getAll()));
$this->view->assign('gallery_id', $id);
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
} else {
throw new Core\Exceptions\ResultNotExists();
}
......@@ -173,7 +173,7 @@ class Pictures extends Core\Modules\AdminController
$this->view->assign('form', array_merge($picture, $this->request->getPost()->getAll()));
$this->view->assign('gallery_id', $id);
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
} else {
throw new Core\Exceptions\ResultNotExists();
}
......@@ -231,7 +231,7 @@ class Pictures extends Core\Modules\AdminController
$this->galleryCache->saveCache($id);
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $lastId && $bool2;
},
......@@ -272,7 +272,7 @@ class Pictures extends Core\Modules\AdminController
$this->galleryCache->saveCache($picture['gallery_id']);
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $bool;
},
......
......@@ -116,7 +116,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('form', array_merge($guestbook, $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
} else {
throw new Core\Exceptions\ResultNotExists();
}
......@@ -187,7 +187,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('form', array_merge(['notify_email' => $settings['notify_email']], $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
/**
......@@ -208,7 +208,7 @@ class Index extends Core\Modules\AdminController
$bool = $this->guestbookModel->update($updateValues, $id);
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $bool;
});
......@@ -231,7 +231,7 @@ class Index extends Core\Modules\AdminController
'newsletter_integration' => $formData['newsletter_integration'],
];
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $this->config->setSettings($data, 'guestbook');
});
......
......@@ -175,7 +175,7 @@ class Index extends Core\Modules\FrontendController
$this->view->assign('captcha', $this->captchaHelpers->captcha());
}
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
public function actionIndex()
......@@ -251,7 +251,7 @@ class Index extends Core\Modules\FrontendController
$this->newsletterHelpers->subscribeToNewsletter($formData['mail']);
}
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
$this->redirectMessages()->setMessage($lastId, $this->lang->t('system', $lastId !== false ? 'create_success' : 'create_error'));
}
......
......@@ -72,7 +72,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('form', array_merge(['index_name' => '', 'title' => ''], $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
public function actionDelete($action = '')
......@@ -125,7 +125,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('form', array_merge($menu, $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
} else {
throw new Core\Exceptions\ResultNotExists();
}
......@@ -173,7 +173,7 @@ class Index extends Core\Modules\AdminController
$lastId = $this->menusModel->insert($insertValues);
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $lastId;
});
......@@ -197,7 +197,7 @@ class Index extends Core\Modules\AdminController
$this->menusCache->saveMenusCache();
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $bool;
});
......
......@@ -117,7 +117,7 @@ class Items extends Core\Modules\AdminController
$this->view->assign('SEO_FORM_FIELDS', $this->seo->formFields());
$this->view->assign('form', array_merge($defaults, $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
/**
......@@ -199,7 +199,7 @@ class Items extends Core\Modules\AdminController
$this->view->assign('SEO_FORM_FIELDS', $this->seo->formFields($menuItem['uri']));
$this->view->assign('form', array_merge($menuItem, $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
} else {
throw new Core\Exceptions\ResultNotExists();
}
......@@ -275,7 +275,7 @@ class Items extends Core\Modules\AdminController
$this->menusCache->saveMenusCache();
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
$this->redirectMessages()->setMessage($bool, $this->lang->t('system', $bool !== false ? 'create_success' : 'create_error'), 'acp/menus');
},
......@@ -330,7 +330,7 @@ class Items extends Core\Modules\AdminController
$this->menusCache->saveMenusCache();
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
$this->redirectMessages()->setMessage($bool, $this->lang->t('system', $bool !== false ? 'edit_success' : 'edit_error'), 'acp/menus');
},
......
......@@ -130,7 +130,7 @@ class Index extends Core\Modules\AdminController
];
$this->view->assign('form', array_merge($defaults, $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
/**
......@@ -212,7 +212,7 @@ class Index extends Core\Modules\AdminController
$this->view->assign('form', array_merge($news, $this->request->getPost()->getAll()));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
} else {
throw new Core\Exceptions\ResultNotExists();
}
......@@ -262,7 +262,7 @@ class Index extends Core\Modules\AdminController
$lang_category_in_breadcrumb = [$this->lang->t('system', 'yes'), $this->lang->t('system', 'no')];
$this->view->assign('category_in_breadcrumb', $this->get('core.helpers.forms')->selectGenerator('category_in_breadcrumb', [1, 0], $lang_category_in_breadcrumb, $settings['category_in_breadcrumb'], 'checked'));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
/**
......@@ -299,7 +299,7 @@ class Index extends Core\Modules\AdminController
(int)$formData['seo_robots']
);
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $lastId;
});
......@@ -344,7 +344,7 @@ class Index extends Core\Modules\AdminController
$this->newsCache->saveCache($id);
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $bool;
});
......@@ -370,7 +370,7 @@ class Index extends Core\Modules\AdminController
$data['comments'] = $formData['comments'];
}
$this->formTokenHelper->unsetFormToken($this->request->getQuery());
$this->formTokenHelper->unsetFormToken();
return $this->config->setSettings($data, 'news');
});
......
......@@ -75,7 +75,7 @@ class Index extends Core\Modules\AdminController
$lang_action = [$this->lang->t('newsletter', 'send_and_save'), $this->lang->t('newsletter', 'only_save')];
$this->view->assign('action', $this->get('core.helpers.forms')->selectGenerator('action', [1, 0], $lang_action, 1, 'checked'));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();
}
/**
......@@ -126,7 +126,7 @@ class Index extends Core\Modules\AdminController
$lang_action = [$this->lang->t('newsletter', 'send_and_save'), $this->lang->t('newsletter', 'only_save')];
$this->view->assign('action', $this->get('core.helpers.forms')->selectGenerator('action', [1, 0], $lang_action, 1, 'checked'));
$this->formTokenHelper->generateFormToken($this->request->getQuery());
$this->formTokenHelper->generateFormToken();