www in docker support
This commit is contained in:
parent
539a848e95
commit
c227fce036
2145 changed files with 399596 additions and 58 deletions
|
|
@ -0,0 +1,108 @@
|
|||
package it.acxent.pg.servlet;
|
||||
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.pg.Users;
|
||||
import java.io.File;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public class GetFileSvlt extends it.acxent.servlet.GetFileSvlt {
|
||||
protected String getFileName(HttpServletRequest req, HttpServletResponse res) {
|
||||
String fileName = getFileName(req);
|
||||
if (fileName.indexOf("tn_") <= 0) {
|
||||
if (fileName.indexOf("_X") > 0 && getLoginUser(req).getId_userProfile() != 1L)
|
||||
return getParm("NO_FOTOX").getTesto();
|
||||
if (fileName.indexOf("_Y") > 0 && getLoginUser(req).getId_userProfile() != 1L)
|
||||
return getParm("NO_FOTOY").getTesto();
|
||||
if (fileName.indexOf("_Z") > 0 && getLoginUser(req).getId_userProfile() != 1L)
|
||||
return getParm("NO_FOTOZ").getTesto();
|
||||
Users bean = (Users)getLoginUser(req);
|
||||
Users.addLogFoto(bean, fileName, getApFull(req));
|
||||
Users user = new Users(getApFull());
|
||||
user.findByPrimaryKey(getLoginUserId(req));
|
||||
if (user.getFlgMiniature() == 1L) {
|
||||
int idx = fileName.lastIndexOf(File.separator) + 1;
|
||||
String temp = fileName.substring(0, idx) + "tn_" + fileName.substring(0, idx);
|
||||
fileName = temp;
|
||||
}
|
||||
}
|
||||
return fileName;
|
||||
}
|
||||
|
||||
protected String getLoginPage(HttpServletRequest req, HttpServletResponse res) {
|
||||
return "/logonRedirect.jsp";
|
||||
}
|
||||
|
||||
protected boolean checkLoginProfile(HttpServletRequest req) {
|
||||
try {
|
||||
req.getSession().removeAttribute("msgS");
|
||||
String fileName = getFileName(req);
|
||||
if (fileName.indexOf("tn_") > 0 || fileName.indexOf("_X") > 0)
|
||||
return true;
|
||||
String msg = "";
|
||||
Users bean = (Users)getLoginUser(req);
|
||||
if (bean == null) {
|
||||
forceJspPage(getLoginPage(null, null), req);
|
||||
return false;
|
||||
}
|
||||
if (bean.getFlgValido().equals("N")) {
|
||||
forceJspPage(getLoginPage(null, null), req);
|
||||
req.getSession().removeAttribute("loginUser_id");
|
||||
req.getSession().removeAttribute("utenteLogon");
|
||||
forceMessage(req, "Utente non valido. Contattare l'amministratore del sito.");
|
||||
req.getSession().setAttribute("msgS", "Utente non valido. Contattare l'amministratore del sito.");
|
||||
return false;
|
||||
}
|
||||
if (bean.getDataScadenza() != null && DBAdapter.getDateDiff(DBAdapter.getToday(), bean.getDataScadenza()) < 0L) {
|
||||
forceMessage(req, "Utente non valido. Utente scaduto.");
|
||||
req.getSession().setAttribute("msgS", "ATTENZIONE!! Account scaduto");
|
||||
bean.sendNoMorePictureMessageScad();
|
||||
forceJspPage(getLoginPage(null, null), req);
|
||||
req.getSession().removeAttribute("loginUser_id");
|
||||
req.getSession().removeAttribute("utenteLogon");
|
||||
return false;
|
||||
}
|
||||
if (bean.getNFotoMax() > 0L && bean.getNFotoVisual() >= bean.getNFotoMax()) {
|
||||
forceMessage(req, "Utente non valido. Numero massimo di foto visualizzate raggiunto.");
|
||||
req.getSession().setAttribute("msgS", "ATTENZIONE!! Numero massimo di foto visualizzate raggiunto.");
|
||||
forceJspPage(getLoginPage(null, null), req);
|
||||
bean.sendNoMorePictureMessageNumber();
|
||||
req.getSession().removeAttribute("loginUser_id");
|
||||
req.getSession().removeAttribute("utenteLogon");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
handleDebug(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean useAlwaysSendRedirect() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected String getFileName(HttpServletRequest req) {
|
||||
String fileName;
|
||||
String temp = req.getRequestURL().toString();
|
||||
if (temp.indexOf("/mypics2") > 0) {
|
||||
fileName = getDocBase() + getDocBase();
|
||||
} else {
|
||||
fileName = getDocBase() + getDocBase();
|
||||
}
|
||||
if (fileName.startsWith("/usr"))
|
||||
fileName = fileName.substring(4);
|
||||
return fileName;
|
||||
}
|
||||
|
||||
protected boolean isSecureServlet(HttpServletRequest req) {
|
||||
String fileName = getFileName(req);
|
||||
if (fileName.indexOf("tn_") > 0)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected it.acxent.common.Users getUser() {
|
||||
return new Users(getApFull());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue