Ticket #1032 (closed defect: fixed)

Opened 14 years ago

Last modified 14 years ago

Validate error on Password Widget

Reported by: christophe.brun@… Owned by: fguillaume
Priority: P1 Milestone: CPS 3.3.7
Component: CPSSchemas Version: 3.3.6
Severity: major Keywords:
Cc:

Description

When you modify a member entry in CPSDirectory (CPS 3.3.6), CPS return error on password length.

Scenario to reproduce the problem :

  • log in manager
  • create an entry in members directory
  • modify this entry without modify password field
  • validate

Result

  • password too short

The versions 3.3.5 and 3.3.6 have this problem. But 3.3.4 not.

Below the patch to crrect this.

File BasicWidgets?.py

@@ -640,27 +637,26 @@
                 pv = str(pvalue).strip()
                 if pv and v != pv:
                     err = 'cpsschemas_err_password_mismatch'
-            else:
-                if not v and self.is_required:
+            elif not v:
+                if self.is_required:
                     datamodel = datastructure.getDataModel()
                     if not datamodel[self.fields[0]]:
                         err = 'cpsschemas_err_required'
-                else:
-                    # checking pw consistancy
-                    len_v = len(v)
-                    if not err and self.size_max and len_v > self.size_max:
-                        err = 'cpsschemas_err_string_too_long'
-                    if not err and self.size_min and len_v < self.size_min:
-                        err = 'cpsschemas_err_password_size_min'
-                    if not err and self.check_lower and not search(r'[a-z]', v):
-                        err = 'cpsschemas_err_password_lower'
-                    if not err and self.check_upper and not search(r'[A-Z]', v):
-                        err = 'cpsschemas_err_password_upper'
-                    if not err and self.check_digit and not search(r'[0-9]', v):
-                        err = 'cpsschemas_err_password_digit'
-                    if not err and self.check_extra and not search(r'[^a-zA-Z0-9]',
-                                                                   v):
-                        err = 'cpsschemas_err_password_extra'
+            else:
+                # checking pw consistancy
+                len_v = len(v)
+                if not err and self.size_max and len_v > self.size_max:
+                    err = 'cpsschemas_err_string_too_long'
+                if not err and self.size_min and len_v < self.size_min:
+                    err = 'cpsschemas_err_password_size_min'
+                if not err and self.check_lower and not search(r'[a-z]', v):
+                    err = 'cpsschemas_err_password_lower'
+                if not err and self.check_upper and not search(r'[A-Z]', v):
+                    err = 'cpsschemas_err_password_upper'
+                if not err and self.check_digit and not search(r'[0-9]', v):
+                    err = 'cpsschemas_err_password_digit'
+                if not err and self.check_extra and not search(r'[^a-zA-Z0-9]', v):
+                    err = 'cpsschemas_err_password_extra'

         if err:
             datastructure[widget_id] = ''

    

Change History

comment:1 Changed 14 years ago by rspivak

  • Milestone changed from CPS 3.2.5 to CPS 3.4.0

comment:2 Changed 14 years ago by fguillaume

  • Status changed from new to closed
  • Resolution set to fixed

Fixed by anahide in [24989].

Note: See TracTickets for help on using tickets.