Index: 0.12/accountldap/accountldap.py
===================================================================
--- 0.12/accountldap/accountldap.py	(revision 13376)
+++ 0.12/accountldap/accountldap.py	(working copy)
@@ -14,7 +14,7 @@
 from trac.web.chrome import INavigationContributor, ITemplateProvider
 
 class AccountLDAP(Component):
-    """Gestiona el api para la interacción con el LDAP y la gestión del trac
+    """Integrate account trac user with properties defined in LDAP.
     """
     implements(IRequestFilter, INavigationContributor, ITemplateProvider,
                IRequestHandler)
@@ -22,7 +22,7 @@
     MODULE_NAME = 'accountldap'    
     
     def __init__(self):
-        """Se realiza la conexión con el LDAP.
+        """Connects to ldap
         """
         self.basedn = self.config.get('ldap', 'basedn')
         self.userdn = self.config.get('ldap', 'user_rdn')
@@ -40,9 +40,9 @@
                                       self.config.get('ldap', 'bind_passwd'))
                 break
             except ldap.LDAPError, e:
-                self.log.error('Connection LDAP problems. Check trac.ini ldap options. Attempt', (i + 1))
+                self.log.error('Connection LDAP problems. Check trac.ini ldap options. Attempt %i', (i + 1))
                 self.enabled = False
-        self.log.info('Connection LDAP basdn %s" userdn "%s". Attempt %i' % (self.basedn, 
+        self.log.info('Connection LDAP basedn "%s" user_rdn "%s". Attempt %i' % (self.basedn, 
                                                                  self.userdn, (i + 1)))
         
     #
@@ -52,11 +52,19 @@
         return handler
     
     def post_process_request(self, req, template, data, content_type):
-        if not req.remote_user or req.session.has_key('email'):
+        self.log.debug('post_process_request(): entering function')
+        if (not req.authname) or (req.authname == 'anonymous'):
+            self.log.debug('post_process_request(): returning early as req.authname is null or anonymous.')
+            self.log.debug(repr(req.__dict__))
             return template, data, content_type 
-        uid = req.remote_user.lower()
+        if req.session.has_key('email'):
+            self.log.debug('post_process_request(): returning early. req.authname=%s, req.session[email]=%s',
+                           (req.authname or ""), (req.session['email'] or ""))
+            return template, data, content_type 
+        uid = req.authname.lower()
         name, email = self._getUserAttributes(uid)
-        req.session['name'] = name        
+        self.log.debug('post_process_request(): got name=%s, email=%s', (name or ""), (email or ""))
+        req.session['name'] = name.decode('utf-8')
         req.session['email'] = email
         return template, data, content_type        
     #
@@ -69,7 +77,7 @@
         if not req.authname or not req.session.has_key('email'):
             return
         yield ('metanav', self.MODULE_NAME,
-               tag.a(u'Contraseñas', href=req.href.accountldap()))
+               tag.a(u'LDAP Password', href=req.href.accountldap()))
     #
     #------------------------------------------------ IRequestHandler interface
     #
@@ -85,20 +93,20 @@
         p2 = req.args.get('password2')
         old = req.args.get('oldpassword')
         if p1 != p2:
-            data['accountldap_message'] = tag.center(u'Las contraseñas suministradas no coinciden.', tag.b(u' Por favor, revise las contraseñas.'), style='color:chocolate')
+            data['accountldap_message'] = tag.center(u'The passwords do not match.', tag.b(u' Please enter the same password twice.'), style='color:chocolate')
             return template, data, None
         if old == p1:
-            data['accountldap_message'] = tag.center(u'Las contraseña antigua y la nueva contraseña es la misma.', tag.b(u' Por favor, realice un cambio en la nueva contraseña.'), style='color:chocolate')
+            data['accountldap_message'] = tag.center(u'The old password is the same as the new password.', tag.b(u' Please supply a different password.'), style='color:chocolate')
             return template, data, None
         dn = '%s=%s,%s,%s' % (self.userFilter, req.authname, self.userdn, self.basedn)
         try:
             self.log.warn('Ldap change password dn. %s' % dn)
             self.ldap.passwd_s(dn, old, p1)
         except ldap.LDAPError, e:
-            data['accountldap_message'] = tag.center(u'Se produjo un error durante el cambio de contraseña.', tag.b(u' Por favor, comprueba que la contraseña antigua es la correcta.'), style='color:chocolate')
+            data['accountldap_message'] = tag.center(u'There was an error changing your password.', tag.b(u' Please make sure the old password you entered was correct.'), style='color:chocolate')
             self.log.warn('Ldap change password. %s' % e)
             return template, data, None
-        data['accountldap_message'] = tag.center(tag.b(u'La contraseña se ha cambiado correctamente.'), style='color:green')        
+        data['accountldap_message'] = tag.center(tag.b(u'Your LDAP password has been updated successfully.'), style='color:green')        
         return template, data, None
     #
     #---------------------------------------------- ITemplateProvider interface
@@ -123,5 +131,5 @@
         except ldap.LDAPError, e:
             self.log.error('Search LDAP problems. Check trac.ini ldap options')
             return ('', '')
-        self.log.info('%s - %s' % (data[0][1]['cn'][0], data[0][1]['mail'][0]))
-        return (data[0][1]['cn'][0], data[0][1]['mail'][0])
\ No newline at end of file
+        self.log.info('%s - %s' % (data[0][1]['displayName'][0], data[0][1]['mail'][0]))
+        return (data[0][1]['displayName'][0], data[0][1]['mail'][0])
Index: 0.12/accountldap/templates/accountldap.html
===================================================================
--- 0.12/accountldap/templates/accountldap.html	(revision 13376)
+++ 0.12/accountldap/templates/accountldap.html	(working copy)
@@ -6,17 +6,17 @@
       xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="layout.html" />
   <head>
-    <title>Cambio de contraseñas LDAP</title>
+    <title>Change LDAP password</title>
   </head>
 
   <body>
     <div id="content" class="accountldap">
- <h1>Contraseñas de LDAP</h1>
+ <h1>LDAP password</h1>
 
   <p>
- Esta página te permite cambiar la contraseña del LDAP. 
- Tener en cuenta que este cambio se realizará de forma <b>centralizada</b> y afectará a todos los 
- sistemas que utilizando el mismo LDAP, como por ejemplo el <b>Subversion</b>.
+ This page allows you to change your LDAP password.
+ Please keep in mind that this change will affect <b>all</b> other services that
+ use the same LDAP for authentication; for example, <b>Subversion</b>.
  </p>
  <fieldset py:if="accountldap_message != None">
  <legend>Aviso</legend>
@@ -24,24 +24,24 @@
   </fieldset>
  <form method="post" action="">
  <fieldset>
- <legend>Cambio de contraseña</legend>
+ <legend>Change password</legend>
   <div class="field">
-   <label for="oldpassword" style="float:left;text-align:right;margin-top:5px;width:15em;">Contraseña antigua:</label>
+   <label for="oldpassword" style="float:left;text-align:right;margin-top:5px;width:15em;">Current password:</label>
    <input type="password" id="oldpassword" name="oldpassword" class="textwidget" size="30" />
   </div>
   &nbsp;
   &nbsp;
   <div class="field">
-   <label for="password1" style="float:left;text-align:right;margin-top:5px;width:15em;">Nueva contraseña:</label>
+   <label for="password1" style="float:left;text-align:right;margin-top:5px;width:15em;">New password:</label>
    <input type="password" id="password1" name="password1" class="textwidget" size="30" />
   </div>
   <div class="field">
-   <label for="password2" style="float:left;text-align:right;margin-top:5px;width:15em;">Confirmar contraseña:</label>
+   <label for="password2" style="float:left;text-align:right;margin-top:5px;width:15em;">Confirm new password:</label>
    <input type="password" id="password2" name="password2" class="textwidget" size="30" />
   </div>  
   </fieldset>
   <div class="buttons">
-   <input type="submit" value="Actualizar contraseña" />
+   <input type="submit" value="Change password" />
   </div >
 </form>
 
