mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-14 17:34:28 +02:00
parent
5c13a19b1a
commit
7c53e6f7be
@ -224,7 +224,7 @@ class Wizard
|
|||||||
if ($isValid) {
|
if ($isValid) {
|
||||||
$pageData = & $this->getPageData();
|
$pageData = & $this->getPageData();
|
||||||
$pageData[$page->getName()] = $page->getValues();
|
$pageData[$page->getName()] = $page->getValues();
|
||||||
$this->setCurrentPage($this->getNewPage($requestedPage));
|
$this->setCurrentPage($this->getNewPage($requestedPage, $page));
|
||||||
$page->getResponse()->redirectAndExit($page->getRedirectUrl());
|
$page->getResponse()->redirectAndExit($page->getRedirectUrl());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -281,20 +281,30 @@ class Wizard
|
|||||||
/**
|
/**
|
||||||
* Return the new page to set as current page
|
* Return the new page to set as current page
|
||||||
*
|
*
|
||||||
|
* Permission is checked by verifying that the requested page's previous page has page data available.
|
||||||
|
* The requested page is automatically permitted without any checks if the origin page is its previous
|
||||||
|
* page or one that occurs later in order.
|
||||||
|
*
|
||||||
* @param string $requestedPage The name of the requested page
|
* @param string $requestedPage The name of the requested page
|
||||||
|
* @param Form $originPage The origin page
|
||||||
*
|
*
|
||||||
* @return Form The new page
|
* @return Form The new page
|
||||||
*
|
*
|
||||||
* @throws InvalidArgumentException In case the requested page does not exist or is not permitted yet
|
* @throws InvalidArgumentException In case the requested page does not exist or is not permitted yet
|
||||||
*/
|
*/
|
||||||
protected function getNewPage($requestedPage)
|
protected function getNewPage($requestedPage, Form $originPage)
|
||||||
{
|
{
|
||||||
if (($page = $this->getPage($requestedPage)) !== null) {
|
if (($page = $this->getPage($requestedPage)) !== null) {
|
||||||
$permitted = true;
|
$permitted = true;
|
||||||
|
|
||||||
$pages = $this->getPages();
|
$pages = $this->getPages();
|
||||||
if (($index = array_search($page, $pages, true)) > 0) {
|
if (($index = array_search($page, $pages, true)) > 0) {
|
||||||
$permitted = $this->hasPageData($pages[$index - 1]->getName());
|
$previousPage = $pages[$index - 1];
|
||||||
|
if ($originPage === null || ($previousPage->getName() !== $originPage->getName()
|
||||||
|
&& array_search($originPage, $pages, true) < $index))
|
||||||
|
{
|
||||||
|
$permitted = $this->hasPageData($previousPage->getName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($permitted) {
|
if ($permitted) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user