Author: Lars Michelsen <[email protected]>
Date: Mon Mar 21 22:30:39 2011 +0100
Committer: Lars Michelsen <[email protected]>
Commit-Date: Mon Mar 21 22:32:02 2011 +0100
Hiding search menu when not permitted to search
---
.../nagvis-js/classes/NagVisHeaderMenu.php | 7 ++++---
share/userfiles/templates/default.header.html | 10 +++++-----
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/share/frontend/nagvis-js/classes/NagVisHeaderMenu.php
b/share/frontend/nagvis-js/classes/NagVisHeaderMenu.php
index f5a4183..ee6d6e5 100644
--- a/share/frontend/nagvis-js/classes/NagVisHeaderMenu.php
+++ b/share/frontend/nagvis-js/classes/NagVisHeaderMenu.php
@@ -231,11 +231,12 @@ class NagVisHeaderMenu {
$this->aMacros['permittedEdit'] =
$this->CORE->getAuthorization() !== null &&
$this->CORE->getAuthorization()->isPermitted($this->aMacros['mod'], 'edit',
$this->UHANDLER->get('show'));
// Permissions for the option menu
- $this->aMacros['permittedEditMainCfg'] =
$this->AUTHORISATION->isPermitted('MainCfg', 'edit', '*');
- $this->aMacros['permittedManageShapes'] =
$this->AUTHORISATION->isPermitted('ManageShapes', 'manage', '*');
+ $this->aMacros['permittedSearch'] =
$this->AUTHORISATION->isPermitted('Search', 'view', '*');
+ $this->aMacros['permittedEditMainCfg'] =
$this->AUTHORISATION->isPermitted('MainCfg', 'edit', '*');
+ $this->aMacros['permittedManageShapes'] =
$this->AUTHORISATION->isPermitted('ManageShapes', 'manage', '*');
$this->aMacros['permittedManageBackgrounds'] =
$this->AUTHORISATION->isPermitted('ManageBackgrounds', 'manage', '*');
$this->aMacros['permittedManageBackgrounds'] =
$this->AUTHORISATION->isPermitted('ManageBackgrounds', 'manage', '*');
- $this->aMacros['permittedManageMaps'] =
$this->AUTHORISATION->isPermitted('Map', 'add', '*') &&
$this->AUTHORISATION->isPermitted('Map', 'edit', '*');
+ $this->aMacros['permittedManageMaps'] =
$this->AUTHORISATION->isPermitted('Map', 'add', '*') &&
$this->AUTHORISATION->isPermitted('Map', 'edit', '*');
$this->aMacros['currentUser'] =
$this->CORE->getAuthentication()->getUser();
diff --git a/share/userfiles/templates/default.header.html
b/share/userfiles/templates/default.header.html
index f3a845a..8b1a26e 100644
--- a/share/userfiles/templates/default.header.html
+++ b/share/userfiles/templates/default.header.html
@@ -16,17 +16,17 @@
<ul>
{if $permittedOverview}
<li><a
href="{$pathBase}/frontend/nagvis-js/index.php">{$langOverview}</a></li>
- <li class="spacer"><hr /></li>
{/if}
{if count($maps) > 0}
+ <li class="spacer"><hr /></li>
{foreach $maps map}<li>
{if $map.configError == true}<a
class="left error" href="#">{$map.mapAlias}</a>
{else}<a class="left"
href="{$pathBase}/frontend/nagvis-js/index.php?mod=Map&act=view&show={$map.mapName}{$map.urlParams}">{$map.mapAlias}</a>
{/if}
{if $map.permittedEdit}<a
class="right"
href="{$pathBase}/frontend/wui/index.php?mod=Map&act=edit&show={$map.mapName}{$map.urlParams}">Edit</a>{else}<a
class="right"> </a>{/if}
</li>{/foreach}
- <li class="spacer"><hr /></li>
{/if}
{if count($automaps) > 0}
+ <li class="spacer"><hr /></li>
{foreach $automaps map}
<li>{if isset($map) &&
$map.configError == True}
<a class="error"
href="#">{$map.mapAlias}</a>
@@ -34,9 +34,9 @@
<a
href="{$pathBase}/frontend/nagvis-js/index.php?mod=AutoMap&act=view&show={$map.mapName}{$map.urlParams}">{$map.mapAlias}</a>
{/if}</li>
{/foreach}
- <li class="spacer"><hr /></li>
{/if}
{if $permittedEditAnyMap ||
$permittedEditMainCfg || $permittedManageBackgrounds || $permittedManageMaps ||
$permittedManageShapes}
+ <li class="spacer"><hr /></li>
<li><a
href="{$pathBase}/frontend/wui/index.php" class="underline">{$langWui}</a></li>
{else}
<li class="spacer underline"></li>
@@ -45,13 +45,13 @@
</dd>
</dl>
</li>
- {if $mod == 'Map' || $mod == 'AutoMap' || $bRotation == true}
+ {if ($mod == 'Map' && ($permittedEdit == true && $act != 'edit' ||
$permittedView == true && $act != 'view')) || $mod == 'AutoMap' || $bRotation
== true || $permittedSearch}
<li>
<dl class="dropdown">
<dt id="action-ddheader"
onmouseover="ddMenu('action',1)"
onmouseout="ddMenu('action',-1)">{$langActions} <img
src="{$pathTemplateImages}default.header_down.png" alt="∇" /></dt>
<dd id="action-ddcontent"
onmouseover="cancelHide('action')" onmouseout="ddMenu('action',-1)">
<ul>
- {if $mod == 'Map' || $mod == 'AutoMap'}
+ {if ($mod == 'Map' || $mod ==
'AutoMap') && $permittedSearch}
<li><a
href="javascript:showFrontendDialog(oGeneralProperties.path_server+'?mod=Search&act=view',
'{$langSearch}')">{$langSearch}</a></li>
{/if}
{if $mod == 'AutoMap' && $permittedEdit
== true}
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins