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:30:39 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 1e025a7..e7d18e2 100644
--- a/share/frontend/nagvis-js/classes/NagVisHeaderMenu.php
+++ b/share/frontend/nagvis-js/classes/NagVisHeaderMenu.php
@@ -114,11 +114,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->AUTHORISATION->getAuthentication()->getUser();
                
diff --git a/share/userfiles/templates/default.header.html 
b/share/userfiles/templates/default.header.html
index 67b9997..eb23b64 100644
--- a/share/userfiles/templates/default.header.html
+++ b/share/userfiles/templates/default.header.html
@@ -12,9 +12,9 @@
                                <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>
@@ -24,9 +24,9 @@
                                                {if $map.permittedEdit}<a 
class="right" 
href="{$pathBase}/frontend/wui/index.php?mod=Map&amp;act=edit&amp;show={$map.mapName}{$map.urlParams}">Edit</a>
                                                {else}<a 
class="right">&nbsp;</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&amp;act=view&amp;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="&#8711;" /></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'}


------------------------------------------------------------------------------
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

Reply via email to