src/index.jsp
changeset 35310 0c885bc2fcec
parent 34507 4ace8ed532f5
child 35503 2d10c9fb9cd4
equal deleted inserted replaced
35309:9a417375877c 35310:0c885bc2fcec
    30  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
    30  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
    31  * License for the specific  language  governing  rights  and  limitations
    31  * License for the specific  language  governing  rights  and  limitations
    32  * under the License. 
    32  * under the License. 
    33  * The Original Code is Openbravo ERP. 
    33  * The Original Code is Openbravo ERP. 
    34  * The Initial Developer of the Original Code is Openbravo SLU 
    34  * The Initial Developer of the Original Code is Openbravo SLU 
    35  * All portions are Copyright (C) 2011-2018 Openbravo SLU
    35  * All portions are Copyright (C) 2011-2019 Openbravo SLU
    36  * All Rights Reserved. 
    36  * All Rights Reserved. 
    37  * Contributor(s):  ______________________________________.
    37  * Contributor(s):  ______________________________________.
    38  ************************************************************************
    38  ************************************************************************
    39  */
    39  */
    40 
    40 
    43 HttpSession currentSession = request.getSession(false);
    43 HttpSession currentSession = request.getSession(false);
    44 boolean adSessionPresent = currentSession != null && currentSession.getAttribute("#AD_SESSION_ID") != null;
    44 boolean adSessionPresent = currentSession != null && currentSession.getAttribute("#AD_SESSION_ID") != null;
    45 
    45 
    46 AuthenticationManager authManager = AuthenticationManager.getAuthenticationManager(this);
    46 AuthenticationManager authManager = AuthenticationManager.getAuthenticationManager(this);
    47 if (!adSessionPresent && !authManager.useExternalLoginPage()) {
    47 if (!adSessionPresent && !authManager.useExternalLoginPage()) {
    48   response.sendRedirect(authManager.getLoginURL(request));
    48   if (request.getQueryString() != null) {
       
    49     response.sendRedirect(authManager.getLoginURL(request) + "?" + request.getQueryString());
       
    50   } else {
       
    51     response.sendRedirect(authManager.getLoginURL(request));
       
    52   }
    49   return;
    53   return;
    50 }
    54 }
    51 
    55 
    52 String userId = authManager.authenticate(request, response);
    56 String userId = authManager.authenticate(request, response);
    53 
    57