Created
May 16, 2012 16:30
-
-
Save allanharris/2711927 to your computer and use it in GitHub Desktop.
webui\src\main\java\com\taskadapter\webui\Exporter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (destinationDataHolder.getData() instanceof MSPConfig) { | |
// implementation of http://www.hostedredmine.com/issues/68820 | |
// quite ugly | |
// TODO check for XSS attack with wrong paths... | |
MSPConfig config = (MSPConfig) destinationDataHolder.getData(); | |
if (config.getOutputAbsoluteFilePath().isEmpty()) { | |
String userName = navigator.getServices().getAuthenticator().getUserName(); | |
FileManager fm = new FileManager(); | |
File f = fm.getUserFolder(userName); | |
String newPath = String.format("%s/%s-%s.xml", f.getAbsolutePath(), sourceDataHolder.getType(), destinationDataHolder.getType()); | |
config.setOutputAbsoluteFilePath(newPath); | |
config.setInputAbsoluteFilePath(newPath); | |
} | |
} else { | |
destinationDataHolder.getData().validateForSave(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment