Commits

Zhang Huangbin committed 04d22a8

Don't prepend 'msg=' in libs/iredutils.py (getNewPassword).

Comments (0)

Files changed (3)

controllers/ldap/admin.py

         if result[0] is True:
             web.seeother('/profile/admin/general/%s?msg=CREATED_SUCCESS' % self.mail)
         else:
-            web.seeother('/create/admin?' + result[1])
+            web.seeother('/create/admin?msg=' + result[1])
 
 class profile(dbinit):
     @base.protected

libs/iredutils.py

     if newpw == confirmpw:
         passwd = newpw
     else:
-        return (False, 'msg=PW_MISMATCH')
+        return (False, 'PW_MISMATCH')
 
     if not len(passwd) > 0:
-        return (False, 'msg=PW_EMPTY')
+        return (False, 'PW_EMPTY')
 
     # Check password length.
     min_passwd_length = cfg.general.get('min_passwd_length', 1)
     max_passwd_length = cfg.general.get('max_passwd_length', 0)
 
     if not len(passwd) >= int(min_passwd_length):
-        return (False, 'msg=PW_LESS_THAN_MIN_LENGTH')
+        return (False, 'PW_LESS_THAN_MIN_LENGTH')
 
     if int(max_passwd_length) != 0:
         if not len(passwd) <= int(max_passwd_length):
-            return (False, 'msg=PW_GREATER_THAN_MAX_LENGTH')
+            return (False, 'PW_GREATER_THAN_MAX_LENGTH')
 
     return (True, passwd)
 

libs/ldaplib/user.py

             self.conn.add_s(ldap.filter.escape_filter_chars(self.dn), ldif,)
             return (True,)
         except ldap.ALREADY_EXISTS:
-            return (False, 'msg=ALREADY_EXISTS')
+            return (False, 'ALREADY_EXISTS')
         except Exception, e:
             return (False, ldaputils.getExceptionDesc(e))