Author:   Lars Michelsen <[email protected]>
Date:     Sat Feb 26 22:03:44 2011 +0100
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Sat Feb 26 21:03:44 2011 +0000

Using configured permissions on uploaded files (backgrounds, shapes, maps) now

---

 ChangeLog                                          |    1 +
 .../core/classes/CoreModManageBackgrounds.php      |    2 +-
 share/server/core/classes/CoreModManageShapes.php  |    2 +-
 share/server/core/classes/CoreModMap.php           |    2 +-
 share/server/core/classes/GlobalCore.php           |    1 +
 5 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ab5bf1f..a5466f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,7 @@ Core
   * Added mechanism to search userfiles in independent structures. This allows
        usage of the local/ structure in OMD
   * Bugfix: Fixed section merging in main config when using more than one 
config file
+  * Using configured permissions on uploaded files (backgrounds, shapes, maps) 
now
 
 Automap
   * Made automap coord parsing regex resistent against html entities in the URL
diff --git a/share/server/core/classes/CoreModManageBackgrounds.php 
b/share/server/core/classes/CoreModManageBackgrounds.php
index fa0514f..284dfaf 100644
--- a/share/server/core/classes/CoreModManageBackgrounds.php
+++ b/share/server/core/classes/CoreModManageBackgrounds.php
@@ -90,7 +90,7 @@ class CoreModManageBackgrounds extends CoreModule {
                        new GlobalMessage('ERROR', 
$this->CORE->getLang()->getText('The uploaded file is no image (png,jpg,gif) 
file or contains unwanted chars.'));
 
                $filePath = $this->CORE->getMainCfg()->getPath('sys', 'local', 
'backgrounds').$fileName;
-               return move_uploaded_file($a['image_file']['tmp_name'], 
$filePath) && chmod($filePath, 0666);
+               return move_uploaded_file($a['image_file']['tmp_name'], 
$filePath) && $this->CORE->setPerms($filePath);
        }
        
        protected function doDelete($a) {
diff --git a/share/server/core/classes/CoreModManageShapes.php 
b/share/server/core/classes/CoreModManageShapes.php
index 0010db2..c1523f7 100644
--- a/share/server/core/classes/CoreModManageShapes.php
+++ b/share/server/core/classes/CoreModManageShapes.php
@@ -83,7 +83,7 @@ class CoreModManageShapes extends CoreModule {
                        new GlobalMessage('ERROR', 
$this->CORE->getLang()->getText('The uploaded file is no image (png,jpg,gif) 
file or contains unwanted chars.'));
 
                $filePath = $this->CORE->getMainCfg()->getValue('paths', 
'shape').$fileName;
-               return move_uploaded_file($a['image_file']['tmp_name'], 
$filePath) && chmod($filePath, 0666);
+               return move_uploaded_file($a['image_file']['tmp_name'], 
$filePath) && $this->CORE->setPerms($filePath);
        }
        
        protected function doDelete($a) {
diff --git a/share/server/core/classes/CoreModMap.php 
b/share/server/core/classes/CoreModMap.php
index 928dd0f..7fcc6b2 100644
--- a/share/server/core/classes/CoreModMap.php
+++ b/share/server/core/classes/CoreModMap.php
@@ -294,7 +294,7 @@ class CoreModMap extends CoreModule {
                        new GlobalMessage('ERROR', 
$this->CORE->getLang()->getText('The uploaded file is no map configuration 
file.'));
 
                $mapPath = $this->CORE->getMainCfg()->getValue('paths', 
'mapcfg').$mapName;
-               return move_uploaded_file($a['map_file']['tmp_name'], $mapPath) 
&& chmod($mapPath, 0666);
+               return move_uploaded_file($a['map_file']['tmp_name'], $mapPath) 
&& $this->CORE->setPerms($filePath);
        }
 
        protected function handleResponseDoExportMap() {
diff --git a/share/server/core/classes/GlobalCore.php 
b/share/server/core/classes/GlobalCore.php
index a6c2a50..e71a976 100644
--- a/share/server/core/classes/GlobalCore.php
+++ b/share/server/core/classes/GlobalCore.php
@@ -509,6 +509,7 @@ class GlobalCore {
                } catch(Exception $e) {
                        error_reporting($old);
                }
+               return true;
        }
 
        /**


------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to