Module: nagvis Branch: master Commit: 3a66e6a367b3c2c10eb44b00995b8fd102716ec1 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=3a66e6a367b3c2c10eb44b00995b8fd102716ec1
Author: LaMi <[email protected]> Date: Wed Mar 17 23:00:32 2010 +0100 Can only overwrite existing maps when permitted to --- docs/en_US/automap.html | 5 +++-- share/server/core/classes/NagVisAutoMap.php | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/en_US/automap.html b/docs/en_US/automap.html index a829ace..eb87c48 100644 --- a/docs/en_US/automap.html +++ b/docs/en_US/automap.html @@ -145,8 +145,9 @@ in your header menu.</p> <p>With the exported map you can add design elements as you want and customize your layout according to your needs.</p> - <p>A map can only be exported once. If you export a map a second time to the - same name it will overwrite the existing map configuration without confirmation.</p> + <p>A map can be exported multiple times to the same target map. But it will + overwrite all changes you made to the target map before. You can only overwrite + maps you have edit permissions on.</p> <p>A classic map can not be turned into an automap.</p> </body> </html> diff --git a/share/server/core/classes/NagVisAutoMap.php b/share/server/core/classes/NagVisAutoMap.php index 80faefc..1112bd4 100644 --- a/share/server/core/classes/NagVisAutoMap.php +++ b/share/server/core/classes/NagVisAutoMap.php @@ -515,7 +515,13 @@ class NagVisAutoMap extends GlobalMap { * @return Boolean Done? * @author Lars Michelsen <[email protected]> */ - public function toClassicMap($name) { + public function toClassicMap($name) { + if(count($this->CORE->getAvailableMaps('/^'.$name.'.cfg$/')) > 0) { + if(!$this->CORE->getAuthorization()->isPermitted('Map', 'edit', $name)) { + new GlobalMessage('ERROR', $this->CORE->getLang()->getText('Unable to export the automap. A map with this name already exists.')); + } + } + // Read position from graphviz and set it on the objects $this->setMapObjectPositions(); ------------------------------------------------------------------------------ Download Intel® 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
