mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
ldap: Minor styling fixes
This commit is contained in:
1 parent
bc8523d9a3
commit
82090af423
5 files changed
+15
-6
No files matched your search
@@ -26,9 +26,9 @@ from plinth.errors import ActionError
|
||||
|
||||
|
||||
class CreateUserForm(UserCreationForm):
|
||||
"""Custom user create form
|
||||
"""Custom user create form.
|
||||
|
||||
Includes options to also create POSIX and LDAP user.
|
||||
Include options to also create POSIX and LDAP user.
|
||||
"""
|
||||
|
||||
add_posix_user = forms.BooleanField(
|
||||
@@ -62,6 +62,7 @@ class CreateUserForm(UserCreationForm):
|
||||
except ActionError:
|
||||
messages.error(self.request,
|
||||
_('Creating POSIX system user failed.'))
|
||||
|
||||
if self.cleaned_data['add_ldap_user']:
|
||||
try:
|
||||
actions.superuser_run(
|
||||
@@ -114,12 +115,14 @@ class UserUpdateForm(forms.ModelForm):
|
||||
except ActionError:
|
||||
messages.error(self.request,
|
||||
_('Renaming POSIX system user failed.'))
|
||||
|
||||
try:
|
||||
actions.superuser_run('rename-ldap-user',
|
||||
[self.username, user.get_username()])
|
||||
except ActionError:
|
||||
messages.error(self.request,
|
||||
_('Renaming LDAP user failed.'))
|
||||
|
||||
return user
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% if is_ldap_user %}
|
||||
<p>This user is also an LDAP user. LDAP user will also be deleted.</p>
|
||||
<p>This user is also an LDAP user. LDAP user will also be deleted.</p>
|
||||
{% endif %}
|
||||
|
||||
<p>Delete user permanently?</p>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% if is_ldap_user %}
|
||||
<p>This user is also an LDAP user.</p>
|
||||
<p>This user is also an LDAP user.</p>
|
||||
{% endif %}
|
||||
|
||||
<input type="submit" class="btn btn-primary" value="Save Changes"/>
|
||||
|
||||
@@ -146,7 +146,6 @@ def _apply_changes(request, old_status, new_status):
|
||||
output)
|
||||
else:
|
||||
messages.success(request, _('LDAP authentication enabled'))
|
||||
|
||||
elif old_status['ldap_enabled'] and not new_status['ldap_enabled']:
|
||||
setting_changed = True
|
||||
output = actions.superuser_run('xmpp', ['disable-ldap'])
|
||||
@@ -166,7 +165,6 @@ def _apply_changes(request, old_status, new_status):
|
||||
output)
|
||||
else:
|
||||
messages.success(request, _('Inband registration enabled'))
|
||||
|
||||
elif old_status['inband_enabled'] and not new_status['inband_enabled']:
|
||||
setting_changed = True
|
||||
output = actions.superuser_run('xmpp', ['disable-inband'])
|
||||
|
||||
Reference in new issue
Block a user