Commit 22747e6b authored by Dietmar Maurer's avatar Dietmar Maurer

fix bug #368: use vtype 'DnsName' to verify host names

parent cb71474e
...@@ -84,17 +84,11 @@ Ext.define('PVE.openvz.CreateWizard', { ...@@ -84,17 +84,11 @@ Ext.define('PVE.openvz.CreateWizard', {
{ {
xtype: 'pvetextfield', xtype: 'pvetextfield',
name: 'hostname', name: 'hostname',
vtype: 'DnsName',
value: '', value: '',
fieldLabel: 'Hostname', fieldLabel: 'Hostname',
skipEmptyText: true, skipEmptyText: true,
allowBlank: true, allowBlank: true
validator: function(value) {
var hostnamere = /^[a-zA-Z0-9\-.]+$/;
if (value && !hostnamere.test(value)) {
return "Hostname contains invalid characters !";
}
return true;
}
} }
], ],
column2: [ column2: [
......
...@@ -30,6 +30,7 @@ Ext.define('PVE.openvz.DNS', { ...@@ -30,6 +30,7 @@ Ext.define('PVE.openvz.DNS', {
items: { items: {
xtype: 'textfield', xtype: 'textfield',
name: 'hostname', name: 'hostname',
vtype: 'DnsName',
value: '', value: '',
fieldLabel: 'Hostname', fieldLabel: 'Hostname',
allowBlank: true, allowBlank: true,
......
...@@ -68,6 +68,7 @@ Ext.define('PVE.qemu.CreateWizard', { ...@@ -68,6 +68,7 @@ Ext.define('PVE.qemu.CreateWizard', {
{ {
xtype: 'textfield', xtype: 'textfield',
name: 'name', name: 'name',
vtype: 'DnsName',
value: '', value: '',
fieldLabel: gettext('Name'), fieldLabel: gettext('Name'),
allowBlank: true allowBlank: true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment