diff options
author | Vincent Chan <plus.vincchan@gmail.com> | 2016-02-02 14:56:19 +0100 |
---|---|---|
committer | Vincent Chan <plus.vincchan@gmail.com> | 2016-02-02 14:56:19 +0100 |
commit | 879917f5f1e1a02e34d89172de24f1d2ae0a1fab (patch) | |
tree | 69cebca6e942f940324ef203af8690e9a5209203 | |
parent | 4777f78187cb758413db1b11f11ccb9304f12482 (diff) | |
download | nextcloud-server-879917f5f1e1a02e34d89172de24f1d2ae0a1fab.tar.gz nextcloud-server-879917f5f1e1a02e34d89172de24f1d2ae0a1fab.zip |
Do not allow username to have space at the beginning or at the end
fixes #22035
-rw-r--r-- | settings/js/users/users.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js index 151ab6cdecc..16faaf667ec 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -776,6 +776,12 @@ $(document).ready(function () { t('settings', 'Error creating user')); return false; } + if ($.trim(username).length !== username.length) { + OC.dialogs.alert( + t('settings', 'Username contains whitespace at the beginning or at the end'), + t('settings', 'Error creating user')); + return false; + } if ($.trim(password) === '') { OC.dialogs.alert( t('settings', 'A valid password must be provided'), |