00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 package org.openmobileis.services.security;
00030
00031 import javax.servlet.ServletException;
00032 import javax.servlet.http.HttpServlet;
00033 import javax.servlet.http.HttpServletRequest;
00034 import javax.servlet.http.HttpServletResponse;
00035
00036 import org.openmobileis.common.intl.IntlResourceManager;
00037 import org.openmobileis.common.util.log.LogManager;
00038 import org.openmobileis.common.util.log.LogServices;
00039 import org.openmobileis.embedded.webserver.WebServerConnection;
00040 import org.openmobileis.services.Service;
00041
00049 public class ValidatePasswordServlet extends HttpServlet {
00050 static final long serialVersionUID = 5521257935120563452L;
00051
00052 public void service( HttpServletRequest req, HttpServletResponse res ) throws ServletException, java.io.IOException {
00053 try {
00054 String pass = req.getParameter("password");
00055 if ((pass==null)||(pass.length() ==0) || (!SessionLoginManager.getManager().validateSessionPass(pass))) {
00056 req.getSession(true).setAttribute("security.pass.form", IntlResourceManager.getManager().getLocalizedProperty("org.openmobileis.module.login.validatepassword.error.login"));
00057 } else {
00058 SessionLoginManager.getManager().setServiceCall();
00059 }
00060 } catch (Throwable ex) {
00061 LogManager.traceError(LogServices.WEBSERVICE, ex);
00062 req.getSession(true).setAttribute("security.pass.form", IntlResourceManager.getManager().getLocalizedProperty("org.openmobileis.module.login.validatepassword.error.login"));
00063 }
00064 Service service = (Service)req.getSession(true).getAttribute("passservletreturnservice");
00065 String uri = (String)req.getSession(true).getAttribute("passservletreturnservicerequri");
00066 java.util.Map oldparam = (java.util.Map)req.getSession(true).getAttribute("passservletreturnservicereqparam");
00067 ((WebServerConnection)res).setRequestURI(uri);
00068 java.util.Map newparam = req.getParameterMap();
00069 newparam.clear();
00070 newparam.putAll(oldparam);
00071 service.runService(req, res);
00072 }
00073
00074 }