10,6 → 10,7 |
import org.apache.struts.action.ActionForm; |
import org.apache.struts.action.ActionForward; |
import org.apache.struts.action.ActionMapping; |
import pt.estgp.estgweb.domain.UserSession; |
import pt.estgp.estgweb.utils.ConfigProperties; |
import pt.estgp.estgweb.web.controllers.ApplicationDispatchController; |
import pt.estgp.estgweb.web.exceptions.NotAuthorizedException; |
107,6 → 108,8 |
} |
catch (Throwable e) |
{ |
if(e instanceof NotAuthorizedException) |
throw (NotAuthorizedException)e; |
logger.error(e, e); |
throw new IOException(e.toString()); |
} |
124,7 → 127,9 |
//Check if user wants to create folders or upload files |
FtpManager.checkOperations(this,request,response); |
|
UserSession sess = UserSessionProxy.loadUserSessionFromRequest(request); |
UserSession userSession = UserSessionProxy.loadUserSessionFromRequest(request); |
String username = userSession != null ? userSession.getUsername() : "UNKNOWN"; |
|
String user = ConfigProperties.getProperty(serverStr + ".user"); |
String pass = ConfigProperties.getProperty(serverStr + ".pass"); |
|
135,6 → 140,7 |
FTPClient client = ftpServer.getClient(); |
if(!client.changeWorkingDirectory(path)) |
{ |
logger.warn(username + ": cant access this area server:" + server + " and path:" + path); |
throw new NotAuthorizedException("nao pode aceder a esta area"); |
} |
FTPFile[] files = client.listFiles(); |
160,6 → 166,8 |
} |
catch (Throwable e) |
{ |
if(e instanceof NotAuthorizedException) |
throw (NotAuthorizedException)e; |
logger.error(e, e); |
} |
} |