Do not allow username to have space at the beginning or at the end

fixes #22035
This commit is contained in:
Vincent Chan 2016-02-02 14:56:19 +01:00
parent 4777f78187
commit 879917f5f1
1 changed files with 6 additions and 0 deletions

View File

@ -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'),