diff --git a/actions/change-ldap-user-password b/actions/change-ldap-user-password new file mode 100755 index 000000000..1fc3b5f6e --- /dev/null +++ b/actions/change-ldap-user-password @@ -0,0 +1,34 @@ +#!/bin/bash +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# Must be run as root. + +username="$1" +password="$2" + +cat < {% endif %} + {% if is_ldap_user %} +

This user is also an LDAP user and password for LDAP user will also + be updated. +

+ {% endif %} + diff --git a/plinth/modules/users/templates/users_delete.html b/plinth/modules/users/templates/users_delete.html index 8f4d95899..746e729fb 100644 --- a/plinth/modules/users/templates/users_delete.html +++ b/plinth/modules/users/templates/users_delete.html @@ -30,6 +30,10 @@

{% endif %} + {% if is_ldap_user %} +

This user is also an LDAP user. LDAP user will also be deleted.

+ {% endif %} +

Delete user permanently?

diff --git a/plinth/modules/users/views.py b/plinth/modules/users/views.py index 4687c3c51..750d03a66 100644 --- a/plinth/modules/users/views.py +++ b/plinth/modules/users/views.py @@ -116,6 +116,8 @@ class UserDelete(ContextMixin, DeleteView): context = super(UserDelete, self).get_context_data(**kwargs) output = actions.run('check-user-exists', [self.kwargs['slug']]) context['is_posix_user'] = 'User exists' in output + output = actions.run('check-ldap-user-exists', [self.kwargs['slug']]) + context['is_ldap_user'] = 'User exists' in output return context def delete(self, *args, **kwargs): @@ -163,6 +165,8 @@ class UserChangePassword(ContextMixin, SuccessMessageMixin, FormView): context = super(UserChangePassword, self).get_context_data(**kwargs) output = actions.run('check-user-exists', [self.kwargs['slug']]) context['is_posix_user'] = 'User exists' in output + output = actions.run('check-ldap-user-exists', [self.kwargs['slug']]) + context['is_ldap_user'] = 'User exists' in output return context def get_success_url(self):