diff --git a/seahub/forms.py b/seahub/forms.py
index 50cf273da8..89775acf92 100644
--- a/seahub/forms.py
+++ b/seahub/forms.py
@@ -16,6 +16,9 @@ class AddUserForm(forms.Form):
Form for adding a user.
"""
email = forms.EmailField()
+ name = forms.CharField(max_length=64, required=False)
+ department = forms.CharField(max_length=512, required=False)
+
role = forms.ChoiceField(choices=[(DEFAULT_USER, DEFAULT_USER),
(GUEST_USER, GUEST_USER)])
password1 = forms.CharField(widget=forms.PasswordInput())
@@ -32,6 +35,16 @@ class AddUserForm(forms.Form):
except User.DoesNotExist:
return self.cleaned_data['email']
+ def clean_name(self):
+ """
+ should not include '/'
+ """
+ if "/" in self.cleaned_data["name"]:
+ raise forms.ValidationError(_(u"Name should not include ' / '"))
+
+ return self.cleaned_data["name"]
+
+
def clean(self):
"""
Verifiy that the values entered into the two password fields
diff --git a/seahub/templates/sysadmin/sys_useradmin.html b/seahub/templates/sysadmin/sys_useradmin.html
index 7c7b8567fa..c65d025a38 100644
--- a/seahub/templates/sysadmin/sys_useradmin.html
+++ b/seahub/templates/sysadmin/sys_useradmin.html
@@ -32,6 +32,12 @@
{% trans "Add user" %}
+
+
+
+
+
+
{% if is_pro %}