Module: nagvis
Branch: master
Commit: 92f627fb89362aa90e3fe926abf19e1ad6f07607
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=92f627fb89362aa90e3fe926abf19e1ad6f07607

Author: LaMi <[email protected]>
Date:   Sat Nov 14 22:17:08 2009 +0100

Role/User Management menu entries be only displayed when user is permitted to 
perform these actions

---

 .../nagvis-js/classes/GlobalHeaderMenu.php         |    3 ++-
 .../userfiles/templates/pages/default.header.html  |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/share/frontend/nagvis-js/classes/GlobalHeaderMenu.php 
b/share/frontend/nagvis-js/classes/GlobalHeaderMenu.php
index 049cdbc..0dcede2 100644
--- a/share/frontend/nagvis-js/classes/GlobalHeaderMenu.php
+++ b/share/frontend/nagvis-js/classes/GlobalHeaderMenu.php
@@ -275,7 +275,8 @@ class GlobalHeaderMenu {
                        'lang_rotation_start' => 
$this->CORE->getLang()->getText('rotationStart'),
                        'lang_rotation_stop' => 
$this->CORE->getLang()->getText('rotationStop'),
                        'authChangePasswordSupported' => 
$this->AUTHORISATION->getAuthentication()->checkFeature('changePassword'),
-                       'authUserMgmtSupported' => 
$this->AUTHORISATION->getAuthentication()->checkFeature('createUser'));
+                       'permittedUserMgmt' => 
$this->AUTHORISATION->isPermitted('UserMgmt', 'manage'),
+                       'permittedRoleMgmt' => 
$this->AUTHORISATION->isPermitted('RoleMgmt', 'manage'));
                
                return $aReturn;
        }
diff --git a/share/userfiles/templates/pages/default.header.html 
b/share/userfiles/templates/pages/default.header.html
index ba6b4e8..4616275 100644
--- a/share/userfiles/templates/pages/default.header.html
+++ b/share/userfiles/templates/pages/default.header.html
@@ -43,8 +43,8 @@
                    <ul>
                        <li><a href="#">{$lang_logged_in}: 
{$current_user}</a></li>
                        {if $authChangePasswordSupported == true}<li><a 
href="javascript:showFrontendDialog(oGeneralProperties.path_server+'?mod=ChangePassword&act=view',
 '{$lang_change_password}');">{$lang_change_password}</a></li>{/if}
-                       {if $authUserMgmtSupported == true}<li><a 
href="javascript:showFrontendDialog(oGeneralProperties.path_server+'?mod=UserMgmt&act=view',
 '{$langUserMgmt}');">{$langUserMgmt}</a></li>{/if}
-                       <li><a 
href="javascript:showFrontendDialog(oGeneralProperties.path_server+'?mod=RoleMgmt&act=view',
 '{$langManageRoles}', 500);">{$langManageRoles}</a></li>
+                       {if $permittedUserMgmt == true}<li><a 
href="javascript:showFrontendDialog(oGeneralProperties.path_server+'?mod=UserMgmt&act=view',
 '{$langUserMgmt}');">{$langUserMgmt}</a></li>{/if}
+                       {if $permittedRoleMgmt == true}<li><a 
href="javascript:showFrontendDialog(oGeneralProperties.path_server+'?mod=RoleMgmt&act=view',
 '{$langManageRoles}', 500);">{$langManageRoles}</a></li>{/if}
                        <li><a href="#" 
onclick="getSyncRequest('{$html_base}/server/core/ajax_handler.php?mod=Auth&amp;act=logout');return
 false;" class="underline">{$lang_logout}</a></li>
                    </ul>
                  </dd>


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to