1 //<script type="text/javascript">
5 Pman.PasswordChange = {
19 this.dialog = new Ext.LayoutDialog(Ext.get(document.body).createChild({tag:'div'}), {
21 title: "Change Password",
32 // tabPosition: 'top',
40 var dgcloser = function(data) {
41 Pman.Preview.tmpEnable();
45 _this.callback.call(this, data ? data : false);
49 this.dialog.addKeyListener(27, dgcloser,this);
50 this.dialog.addButton("Cancel",dgcloser,this);
51 this.dialog.addButton("Save", this.save, this);
54 this.layout = this.dialog.getLayout();
55 this.layout.beginUpdate();
58 this.form = new Ext.form.Form({
62 actionfailed : function(f, act) {
64 _this.dialog.el.unmask();
67 if (act.failureType == 'client') {
68 Ext.MessageBox.alert("Error", "Please Correct all the errors");
73 if (act.type == 'submit') {
75 Ext.MessageBox.alert("Error", typeof(act.result.errorMsg) == 'string' ?
77 "Saving failed = fix errors and try again");
81 // what about load failing..
82 Ext.MessageBox.alert("Error", "Error loading details");
85 actioncomplete: function(f, act) {
86 _this.dialog.el.unmask();
88 if (act.type == 'submit') { // only submitted here if we are
100 //?? will this work...
101 this.form.addxtype.apply(this.form,[
104 fieldLabel : "New Password ",
106 allowBlank : false, // must be filled in as we rely on it for login details..
107 inputType: 'password',
108 xtype : 'SecurePass',
110 imageRoot : rootURL + '/Pman/templates/images'
115 fieldLabel : "New Password (type again to confirm)",
117 allowBlank : false, // must be filled in as we rely on it for login details..
118 inputType: 'password',
124 name : 'passwordReset',
134 var ef = this.dialog.getLayout().getEl().createChild({tag: 'div'});
135 ef.dom.style.margin = 10;
137 this.form.render(ef.dom);
139 var vp = this.dialog.getLayout().add('center', new Ext.ContentPanel(ef, {
141 //title: 'Org Details',
150 this.layout.endUpdate();
153 show : function(data, callback)
155 this.callback= callback;
161 this.form.setValues(data);
163 Pman.Preview.tmpDisable();
166 this.form.findField('passwd1').focus();
171 var p1 = this.form.findField('passwd1').getValue();
172 var p2 = this.form.findField('passwd2').getValue();
173 if (!p1.length || !p2.length) {
174 Ext.MessageBox.alert("Error", "Enter Passwords in both boxes");
177 Ext.MessageBox.alert("Error", "Passwords do not match");
180 this.form.doAction('submit', {
181 url: baseURL + '/Login.html',
184 changePassword: true,