cancel
Showing results for 
Search instead for 
Did you mean: 

Loging in from Intranet - Language problem

agey
Champ in-the-making
Champ in-the-making
Good Morning all

We are trying to integrate Alfresco 3.0 with our Intranet. To do so we are not using LDAP, we just copied the users from our intranet and created them in Alfresco 3.0 with the same Login/password.

What we want to get is creating a link in our index page of the Intranet to alfresco 3.0 and that link should redirect the webbrowser to Alfresco not to the Alfresco Login page, but to the "My alfresco" of the user.

Basically we want to get the user to be authenticated in the Intranet Login Page, and then be able to go to all the other applications linked from there but not using LDAP.

To do so we have created a JavaBean (Code Below) that is included in a link of the index page of the Intranet, and with it we send the order to Alfresco to log in with Login and Password.

This works fine and the user once he clicks in the link of the intranet, gets logged in Alfresco, however we have a problem with the Language, as we have Spanish installed as preferred language, and with this method we get the user to get loged in with English as language.

We have configured the Web-Client-Config-Custom.xml to use Spanish as primary language using
<config evaluator="string-compare" condition="Languages" replace="true">
However we still get the users to log in English..

Any ideas of how we should do it to get the users loging in Spanish?? Is there something in the code that we should include to force Alfresco to log in "Spanish"?

Thanks a lot for your help in advance



//This function obtains calls the authentication process and once the user is aunthenticated goes to the "My Alfresco" page

public void doGet(HttpServletRequest request,
         HttpServletResponse response)
   throws IOException, ServletException {
      
      /* Get value of parameter "userName". */
      String sesionID = request.getParameter("sesionId");      
      
                //This line performs the authentication using the "autentificar" function using the login and password in the 
                //object Session Id
      User usuario = this.getConfigurationService().autentificar(sesionID);
      HttpSession session = request.getSession();
      
      session.setAttribute(AuthenticationHelper.AUTHENTICATION_USER, usuario);
      
      
      response.sendRedirect(request.getContextPath() + FACES_SERVLET + "/jsp/dashboards/container.jsp");
               

            
   }

This is the function that performs the authentication process…. Shall we include something to force the "Spanish" language here??

public User autentificar(String sesionId)   {
      Parametros user = parametrosDAO.listParametro(sesionId,ExpedienteModel.PARAMETRO_USER);
      Parametros pass = parametrosDAO.listParametro(sesionId,ExpedienteModel.PARAMETRO_PASS);

      //System.out.println(user);
      //System.out.println(pass);
      parametrosDAO.eliminarParametros(sesionId);
      try {
         this.serviceRegistry.getAuthenticationService().authenticate(user.getValor(), pass.getValor().toCharArray());
         //      this.authenticationComponent.authenticate(user.getValor(), pass.getValor().toCharArray());                  

      } catch (Exception e) {
         System.out.println("Usuario incorrecto:"+user.getValor());
         return null;
      }

      String currentUser = this.serviceRegistry.getAuthenticationService().getCurrentUserName();

      User usuario = new User(
            currentUser,
            this.serviceRegistry.getAuthenticationService().getCurrentTicket(),
            this.serviceRegistry.getPersonService().getPerson(currentUser));

      System.out.println("Curernt user:"+currentUser);

      // Get ticket
      //String ticket = this.serviceRegistry.getAuthenticationService().getCurrentTicket();
      //        String ticket = pubAuthenticationService.getCurrentTicket();
      //        assertEquals("andy", ticketComponent.getAuthorityForTicket(ticket));

      return usuario;
   }
3 REPLIES 3

jlabuelo
Champ on-the-rise
Champ on-the-rise
Good Morning AGey

We are having the same problem when we try to log in Alfresco not using the Loging page, even we have configured the language to Spanish as primary and used the option "replace = true" in the web-client-config-custom.xml file, when we log in the application not using the loging page we get the menus in English.

Did you get to change this in your application? Does anyone know how to solve this, getting loged in from another application? any quick fix… LDAP trick or something??

Cheers

mabayona
Champ on-the-rise
Champ on-the-rise
Did you try to change the default language in $TOMCAT/webapps/alfresco/WEB-INF/classes/alfresco/web-client-config.xml


  <config evaluator="string-compare" condition="Languages">
      <!– the list of available language files –>
      <languages>
         <language locale="en_US">English</language>
      </languages>
   </config>

stop tomcat, empty the caches, tomcat´s temp and work/Catalina/localhost/alfresco and restart tomcat?

jlabuelo
Champ on-the-rise
Champ on-the-rise
Found our reason…. stupid we are… there are not Spanish language files in our 3.0 Implementation, after copying them from 2.9 it works fine