partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit d3a6a6a3476e3296325d15880ad188b06ff3a787
parent a6e56f216a40204fe2c9d8c6df4ab934fc0cc873
Author: Timo A. Hummel <felicitus@felicitus.org>
Date:   Fri, 12 Feb 2016 21:22:10 +0100

Merge pull request #599 from partkeepr/PartKeepr-556

Ensure that usernames comply to the given rules, fixes #556
Diffstat:
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/User/UserEditor.js | 2++
Mweb/setup/js/Cards/AdminUserCard.js | 2++
2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/User/UserEditor.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/User/UserEditor.js @@ -11,6 +11,8 @@ Ext.define('PartKeepr.UserEditor', { { xtype: 'textfield', name: 'username', + regex: /^[a-zA-Za0-9.\-_\/\\]{3,50}$/, + regexText: i18n("The username must be 3-50 characters in length and may only contain the following characters: a-z, A-Z, 0-9, an underscore (_), a backslash (\), a slash (/), a dot (.) or a dash (-)"), fieldLabel: i18n("User") }, { xtype: 'textfield', diff --git a/web/setup/js/Cards/AdminUserCard.js b/web/setup/js/Cards/AdminUserCard.js @@ -31,6 +31,8 @@ Ext.define('PartKeeprSetup.AdminUserCard', { fieldLabel: 'Username', labelWidth: this.defaults.labelWidth, allowBlank: false, + regex: /^[a-zA-Za0-9.\-_\/\\]{3,50}$/, + regexText: "The username must be 3-50 characters in length and may only contain the following characters: a-z, A-Z, 0-9, an underscore (_), a backslash (\), a slash (/), a dot (.) or a dash (-)", value: PartKeeprSetup.getApplication().getSetupConfig().adminuser.username });