[pve-devel] [PATCH pve-manager 2/3] Allow email adresses with a top level domain of up to 63 characters
Emmanuel Kasper
e.kasper at proxmox.com
Tue Nov 17 16:34:18 CET 2015
Reapply fix for https://bugzilla.proxmox.com/show_bug.cgi?id=716
which was missing in manager6/ directory
---
www/manager6/Toolkit.js | 8 +++++++-
www/manager6/dc/OptionView.js | 2 +-
www/manager6/dc/UserEdit.js | 2 +-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/www/manager6/Toolkit.js b/www/manager6/Toolkit.js
index 201d131..351cd8b 100644
--- a/www/manager6/Toolkit.js
+++ b/www/manager6/Toolkit.js
@@ -88,7 +88,13 @@ Ext.apply(Ext.form.field.VTypes, {
DnsName: function(v) {
return (/^(([a-zA-Z0-9]([a-zA-Z0-9\-]*[a-zA-Z0-9])?)\.)*([A-Za-z0-9]([A-Za-z0-9\-]*[A-Za-z0-9])?)$/).test(v);
},
- DnsNameText: gettext('This is not a valid DNS name')
+ DnsNameText: gettext('This is not a valid DNS name'),
+
+ // workaround for https://www.sencha.com/forum/showthread.php?302150
+ pveMail: function(v) {
+ return (/^(\w+)([\-+.][\w]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,63}$/).test(v);
+ },
+ pveMailText: gettext('This field should be an e-mail address in the format "user at example.com"'),
});
// we dont want that a displayfield set the form dirty flag!
diff --git a/www/manager6/dc/OptionView.js b/www/manager6/dc/OptionView.js
index 3a98bce..4de75a1 100644
--- a/www/manager6/dc/OptionView.js
+++ b/www/manager6/dc/OptionView.js
@@ -85,7 +85,7 @@ Ext.define('PVE.dc.EmailFromEdit', {
items: {
xtype: 'pvetextfield',
name: 'email_from',
- vtype: 'email',
+ vtype: 'pveMail',
emptyText: gettext('Send emails from root@$hostname'),
deleteEmpty: true,
value: '',
diff --git a/www/manager6/dc/UserEdit.js b/www/manager6/dc/UserEdit.js
index bb110b5..2ef8bce 100644
--- a/www/manager6/dc/UserEdit.js
+++ b/www/manager6/dc/UserEdit.js
@@ -117,7 +117,7 @@ Ext.define('PVE.dc.UserEdit', {
xtype: 'textfield',
name: 'email',
fieldLabel: gettext('E-Mail'),
- vtype: 'email'
+ vtype: 'pveMail'
}
];
--
2.1.4
More information about the pve-devel
mailing list