Fix empty password sending updateUserPassword query, set fields in valid/invalid...
authorCharles du Jeu <charles.dujeu@gmail.com>
Sun, 22 Nov 2009 13:02:48 +0000 (13:02 +0000)
committerCharles du Jeu <charles.dujeu@gmail.com>
Sun, 22 Nov 2009 13:02:48 +0000 (13:02 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@3142 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/PasswordCredentialImpl.js

index 238cc7ef106d6e1be77eaa5ebfd90a1f52535a1a..a7b648b230e5d9f7623ac67c9543ce769ca1c8a4 100644 (file)
@@ -37,7 +37,7 @@ qx.Class.define("org.argeo.security.ria.components.PasswordCredentialImpl", {
                },\r
                getData : function(format){\r
                        var encoded = null;\r
-                       if(this.pass1.getValue() != ""){\r
+                       if(this.pass1.getValue() != null && this.pass1.getValue() != ""){\r
                                var encoder = this.getEncoderCallback();\r
                                encoded = encoder(this.pass1.getValue()); \r
                        }\r
@@ -48,12 +48,13 @@ qx.Class.define("org.argeo.security.ria.components.PasswordCredentialImpl", {
                        this.pass2.setValue("");                        \r
                },\r
                validate : function(){\r
-                       if(this.pass1.getValue() != this.pass2.getValue() || this.pass1.getValue() == ""){\r
-                               // TODO WHEN TESTING 0.8.3\r
-                               //this.pass1.setValid(false);\r
-                               //this.pass2.setValid(false); \r
+                       if(this.pass1.getValue() != this.pass2.getValue()){\r
+                               this.pass1.setValid(false);\r
+                               this.pass2.setValid(false); \r
                                this.setValid(false);\r
                        }else{\r
+                               this.pass1.setValid(true);\r
+                               this.pass2.setValid(true); \r
                                this.setValid(true);\r
                        }\r
                        return this.getValid();\r