]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/PasswordCredentialImpl.js
a7b648b230e5d9f7623ac67c9543ce769ca1c8a4
1 qx
.Class
.define("org.argeo.security.ria.components.PasswordCredentialImpl", {
2 extend
: qx
.ui
.container
.Composite
,
3 implement
: [org
.argeo
.security
.ria
.components
.ICredentialPane
],
5 "modified" : "qx.event.type.Event"
12 init : function(string
){
13 var encoderShort
= org
.argeo
.ria
.util
.Encoder
;
14 return "{SHA}"+encoderShort
.base64Encode(encoderShort
.hexDecode(encoderShort
.hash(string
, "sha1")));
20 construct : function(){
22 this.setLayout(new qx
.ui
.layout
.HBox(5, "center"));
23 this.add(new qx
.ui
.basic
.Label("Password"), {flex
:1});
24 this.pass1
= new qx
.ui
.form
.PasswordField();
25 this.add(this.pass1
, {flex
:2});
26 this.add(new qx
.ui
.basic
.Label("Confirm Password"), {flex
:1});
27 this.pass2
= new qx
.ui
.form
.PasswordField();
28 this.add(this.pass2
, {flex
:2});
29 this.pass1
.addListener("changeValue", function(){this.fireEvent("modified");}, this);
30 this.pass2
.addListener("changeValue", function(){this.fireEvent("modified");}, this);
31 this.pass2
.addListener("changeValue", this.validate
, this);
35 getContainer : function(){
38 getData : function(format
){
40 if(this.pass1
.getValue() != null && this.pass1
.getValue() != ""){
41 var encoder
= this.getEncoderCallback();
42 encoded
= encoder(this.pass1
.getValue());
47 this.pass1
.setValue("");
48 this.pass2
.setValue("");
50 validate : function(){
51 if(this.pass1
.getValue() != this.pass2
.getValue()){
52 this.pass1
.setValid(false);
53 this.pass2
.setValid(false);
56 this.pass1
.setValid(true);
57 this.pass2
.setValid(true);
60 return this.getValid();
62 setEditMode : function(editMode
){return true;}