]> git.proxmox.com Git - pve-manager.git/commitdiff
Allow email adresses with a top level domain of up to 63 characters
authorEmmanuel Kasper <e.kasper@proxmox.com>
Tue, 17 Nov 2015 15:34:18 +0000 (16:34 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 22 Jan 2016 10:24:14 +0000 (11:24 +0100)
Reapply fix for  https://bugzilla.proxmox.com/show_bug.cgi?id=716
which was missing in manager6/ directory

www/manager6/Toolkit.js
www/manager6/dc/OptionView.js
www/manager6/dc/UserEdit.js

index 201d1318155475b6469ee61ed284f68686154974..351cd8bef1c94534e8c2bc2606c817fb6e3cad89 100644 (file)
@@ -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@example.com"'),
 });
 
 // we dont want that a displayfield set the form dirty flag! 
index 3a98bce38ee208269953500989ef090c5a4c5bb1..4de75a1ab8ba5641c1777af0676903cf108ab12f 100644 (file)
@@ -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: '',
index bb110b5305997fe7861097eec2a74602f5297df6..2ef8bceab59f158507d0010edddb893300cf44a3 100644 (file)
@@ -117,7 +117,7 @@ Ext.define('PVE.dc.UserEdit', {
                xtype: 'textfield',
                name: 'email',
                fieldLabel: gettext('E-Mail'),
-               vtype: 'email'
+               vtype: 'pveMail'
            }
        ];