Class LoginUtils


  • public class LoginUtils
    extends Object
    • Field Detail

      • log4j

        public static org.apache.logging.log4j.Logger log4j
    • Method Detail

      • getValidUserId

        public static String getValidUserId​(ConnectionProvider connectionProvider,
                                            String login,
                                            String unHashedPassword)
        Returns a userId which matches the login and password. If no user is found then null is returned. The combination of login and password is used to find the user. Blocking users is taking into account Note that only active users are returned.
        Parameters:
        connectionProvider - , see the DalConnectionProvider for an instance of a ConnectionProvider for the DAL.
        login - the login
        unHashedPassword - the password, the unhashed password as it is entered by the user.
        Returns:
        the user id or null if no user could be found or the user is locked.
        See Also:
        PasswordHash
      • readNumberFormat

        public static void readNumberFormat​(VariablesSecureApp vars,
                                            String strFormatFile)
        Reads the number format from the format file and sets it in VariablesSecureApp
      • saveLoginBD

        public static void saveLoginBD​(javax.servlet.http.HttpServletRequest request,
                                       VariablesSecureApp vars,
                                       String strCliente,
                                       String strOrganizacion)
                                throws javax.servlet.ServletException
        It saves session in the DB when logging in
        Throws:
        javax.servlet.ServletException
      • getDefaultLanguage

        public static String getDefaultLanguage​(ConnectionProvider connectionProvider,
                                                String aduserid)
                                         throws javax.servlet.ServletException
        Returns default language
        Throws:
        javax.servlet.ServletException
      • isDefaultRtl

        public static String isDefaultRtl​(ConnectionProvider connectionProvider,
                                          String aduserid)
                                   throws javax.servlet.ServletException
        Returns default value for Rtl
        Throws:
        javax.servlet.ServletException
      • getDefaultWarehouse

        public static String getDefaultWarehouse​(ConnectionProvider connectionProvider,
                                                 String strClient,
                                                 String strOrg,
                                                 String strRole)
                                          throws javax.servlet.ServletException
        Returns default warehouse for a given organization
        Throws:
        javax.servlet.ServletException