[ticket/539] Do not show portal on all pages if board is disabled

B3P-539
This commit is contained in:
Marc Alexander
2015-05-05 20:43:38 +02:00
parent 3e0ec62751
commit 85337f9a09

View File

@@ -121,7 +121,7 @@ class listener implements EventSubscriberInterface
if (strpos($this->controller_helper->get_current_url(), '/portal') === false) if (strpos($this->controller_helper->get_current_url(), '/portal') === false)
{ {
$portal_link = $this->controller_helper->route('board3_portal_controller'); $portal_link = $this->controller_helper->route('board3_portal_controller');
$this->display_portal(); $this->check_portal_all();
} }
else else
{ {
@@ -144,17 +144,35 @@ class listener implements EventSubscriberInterface
} }
/** /**
* Display portal columns on all pages if specified in portal settings * Check if portal on all pages should be shown and display it accordignly
*/ */
protected function display_portal() protected function check_portal_all()
{ {
// Check if we should show the portal // Check if we should show the portal
if (isset($this->config['board3_show_all_pages']) && $this->config['board3_show_all_pages']) if (isset($this->config['board3_show_all_pages']) && $this->config['board3_show_all_pages'] && !$this->board_disabled())
{
$this->display_portal();
}
}
/**
* Display portal on all pages
*/
protected function display_portal()
{ {
$this->board3_controller->handle(array( $this->board3_controller->handle(array(
'left' => $this->config['board3_show_all_side'] == false, 'left' => $this->config['board3_show_all_side'] == false,
'right' => $this->config['board3_show_all_side'] == true, 'right' => $this->config['board3_show_all_side'] == true,
)); ));
} }
/**
* Check whether the board has been disabled and should not be shown
*
* @return bool True if board has been disabled, false if not
*/
protected function board_disabled()
{
return $this->config['board_disable'] && !defined('IN_LOGIN') && !defined('SKIP_CHECK_DISABLED') && !$this->auth->acl_gets('a_', 'm_') && !$this->auth->acl_getf_global('m_');
} }
} }