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

Author: LaMi <[email protected]>
Date:   Sun Feb 28 23:21:33 2010 +0100

Removed old auth controll with allowed_user and allowed_for_config options

---

 share/frontend/wui/classes/WuiCore.php |   14 --------------
 share/frontend/wui/classes/WuiPage.php |   22 ----------------------
 share/frontend/wui/js/MapManagement.js |   25 -------------------------
 share/frontend/wui/js/wui.js           |   31 -------------------------------
 4 files changed, 0 insertions(+), 92 deletions(-)

diff --git a/share/frontend/wui/classes/WuiCore.php 
b/share/frontend/wui/classes/WuiCore.php
index 87cf66a..4cdcaac 100644
--- a/share/frontend/wui/classes/WuiCore.php
+++ b/share/frontend/wui/classes/WuiCore.php
@@ -90,20 +90,6 @@ class WuiCore extends GlobalCore {
                        // used image
                        $aOpts['mapImage'] = $MAPCFG1->getValue('global', '0', 
'map_image');
                        
-                       // permited users for writing
-                       $aOpts['allowedForConfig'] = Array();
-                       $arr = $MAPCFG1->getValue('global', '0', 
'allowed_for_config');
-                       for($i = 0; count($arr) > $i; $i++) {
-                               $aOpts['allowedForConfig'][] = $arr[$i];
-                       }
-                       
-                       // permited users for viewing the map
-                       $aOpts['allowedUsers'] = Array();
-                       $arr = $MAPCFG1->getValue('global', '0', 
'allowed_user');
-                       for($i = 0; count($arr) > $i; $i++) {
-                               $aOpts['allowedUsers'][] = $arr[$i];
-                       }
-                       
                        // linked maps
                        $aOpts['linkedMaps'] = Array();
                        foreach($MAPCFG1->getDefinitions('map') AS $key => 
$obj) {
diff --git a/share/frontend/wui/classes/WuiPage.php 
b/share/frontend/wui/classes/WuiPage.php
index 7c67f7a..bd4ed9c 100644
--- a/share/frontend/wui/classes/WuiPage.php
+++ b/share/frontend/wui/classes/WuiPage.php
@@ -62,7 +62,6 @@ class WuiPage {
                $this->title = $prop['title'];
                $this->cssIncludes = $prop['cssIncludes'];
                $this->jsIncludes = $prop['jsIncludes'];
-               $this->allowedUsers = $prop['allowedUsers'];
                $this->extHeader = $prop['extHeader'];
                
                // Append additional header information
@@ -116,26 +115,6 @@ class WuiPage {
        }
        
        /**
-        * Checks for valid Permissions
-        *
-        * @param       String  $allowed        
-        * @param       Boolean $printErr
-        * @return      Boolean Is Check Successful?
-        * @author      Lars Michelsen <[email protected]>
-        */
-       private function checkPermissions(&$allowed,$printErr) {
-               if(isset($allowed) && !in_array('EVERYONE', $allowed) && 
!in_array($this->CORE->getMainCfg()->getRuntimeValue('user'), $allowed)) {
-                       if($printErr) {
-                               new GlobalMessage('ERROR', 
$this->CORE->getLang()->getText('permissionDenied','USER~'.$this->CORE->getMainCfg()->getRuntimeValue('user')));
-                       }
-                       return FALSE;
-               } else {
-                       return TRUE;
-               }
-               return TRUE;
-       }
-       
-       /**
         * Does the Prflight checks before building the page
         *
         * @return      Boolean Is Check Successful?
@@ -145,7 +124,6 @@ class WuiPage {
                $ret = TRUE;
                $ret = $ret & $this->checkUser(TRUE);
                $ret = $ret & $this->checkPHPVersion(TRUE);
-               $ret = $ret & $this->checkPermissions($this->allowedUsers,TRUE);
                
                return $ret;
        }
diff --git a/share/frontend/wui/js/MapManagement.js 
b/share/frontend/wui/js/MapManagement.js
index 72a15be..6e4ca2e 100644
--- a/share/frontend/wui/js/MapManagement.js
+++ b/share/frontend/wui/js/MapManagement.js
@@ -71,15 +71,6 @@ function check_create_map() {
                alert(printLang(lang['noSpaceAllowed'],''));
                return false;
        }
-       if (document.map_create.allowed_users.value=='') {
-               alert(printLang(lang['minOneUserAccess'],''));
-               return false;
-       }
-       if (document.map_create.allowed_for_config.value=='') {
-               alert(printLang(lang['minOneUserWriteAccess'],''));
-               return false;
-       }
-       
        for(var i=0;i<document.map_rename.map_name.length;i++) {
                if(document.map_rename.map_name.options[i].value == 
document.map_create.map_name.value) {
                        alert(printLang(lang['mapAlreadyExists'],''));
@@ -113,11 +104,6 @@ function check_map_rename() {
                }
        }
        
-       
if(!checkUserAllowed(getMapPermissions(document.map_rename.map_name.value, 
mapOptions,"allowedForConfig"), username)) {
-               alert(printLang(lang['noPermissions'],''));
-               return false;
-       }
-       
        if (confirm(printLang(lang['confirmMapRename'],'')) === false) {
                return false;
        }
@@ -131,12 +117,6 @@ function check_map_export() {
                return false;
        }
        
-       // read and write users are allowed to export the map
-       
if(!checkUserAllowed(getMapPermissions(document.map_export.map_name.value, 
mapOptions,"allowedUsersOrAllowedForConfig"), username)) {
-               alert(printLang(lang['noPermissions'],''));
-               return false;
-       }
-       
        return true;
 }
 
@@ -168,11 +148,6 @@ function check_map_delete() {
                return false;
        }
        
-       
if(!checkUserAllowed(getMapPermissions(document.map_delete.map_name.value,mapOptions,"allowedForConfig"),
 username)) {
-               alert(printLang(lang['noPermissions'],''));
-               return false;
-       }
-       
        var mapWithLink = checkMapLinked(document.map_delete.map_name.value, 
mapOptions)
        if(mapWithLink != "") {
                
alert(printLang(lang['unableToDeleteMap'],'PARENTMAP~'+mapWithLink+',MAP~'+document.map_delete.map_name.value));
diff --git a/share/frontend/wui/js/wui.js b/share/frontend/wui/js/wui.js
index 67ae065..899905f 100644
--- a/share/frontend/wui/js/wui.js
+++ b/share/frontend/wui/js/wui.js
@@ -142,37 +142,6 @@ function getHeaderHeight() {
        return ret;
 }
 
-// function that says if the current user is allowed to have access to the map
-function checkUserAllowed(allowedUsers,username) {
-       for(var i=0;i<allowedUsers.length;i++) {
-               if((allowedUsers[i] == username) || (allowedUsers[i] == 
"EVERYONE") ) {
-                       return true;
-               }
-       }
-       return false;
-}
-
-function getMapPermissions(mapName, mapOptions, permissionLevel) {
-       if(permissionLevel == "") {
-               permissionLevel = "allowedUsers";
-       }
-       
-       for(var i=0;i<mapOptions.length;i++) {
-               if(mapOptions[i].mapName == mapName) {
-                       if(permissionLevel == "allowedForConfig") {
-                               return mapOptions[i].allowedForConfig;
-                       } else if(permissionLevel == "allowedUsers") {
-                               return mapOptions[i].allowedUsers;
-                       } else if(permissionLevel == 
"allowedUsersOrAllowedForConfig") {
-                               return 
mapOptions[i].allowedForConfig.concat(mapOptions[i].allowedUsers);
-                       } else {
-                               return false;   
-                       }
-               }
-       }
-       return false;
-}
-
 /**
  * validateValue(oField)
  *


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to