mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 16:35:45 +01:00
improve validation
This commit is contained in:
@@ -78,6 +78,19 @@ Sonia.user.Grid = Ext.extend(Sonia.rest.Grid, {
|
||||
// register xtype
|
||||
Ext.reg('userGrid', Sonia.user.Grid);
|
||||
|
||||
|
||||
Ext.apply(Ext.form.VTypes, {
|
||||
password: function(val, field) {
|
||||
if (field.initialPassField) {
|
||||
var pwd = Ext.getCmp(field.initialPassField);
|
||||
return (val == pwd.getValue());
|
||||
}
|
||||
return true;
|
||||
},
|
||||
passwordText: 'The passwords entered do not match!'
|
||||
});
|
||||
|
||||
|
||||
// UserFormPanel
|
||||
Sonia.user.FormPanel = Ext.extend(Sonia.rest.FormPanel,{
|
||||
|
||||
@@ -95,14 +108,24 @@ Sonia.user.FormPanel = Ext.extend(Sonia.rest.FormPanel,{
|
||||
},{
|
||||
fieldLabel: 'Mail',
|
||||
name: 'mail',
|
||||
allowBlank: false
|
||||
allowBlank: false,
|
||||
vtype: 'email'
|
||||
},{
|
||||
fieldLabel: 'Password',
|
||||
id: 'pwd',
|
||||
name: 'password',
|
||||
inputType: 'password'
|
||||
inputType: 'password',
|
||||
minLength: 6,
|
||||
maxLength: 32,
|
||||
minLengthText: 'Password must be at least 6 characters long.'
|
||||
},{
|
||||
name: 'password',
|
||||
inputType: 'password'
|
||||
inputType: 'password',
|
||||
minLength: 6,
|
||||
maxLength: 32,
|
||||
minLengthText: 'Password must be at least 6 characters long.',
|
||||
vtype: 'password',
|
||||
initialPassField: 'pwd'
|
||||
}]
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user