mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
On user deletion, user's home folder is also deleted. Admins have an
option to avoid deleting user's home by inactivating the user instead.
This commit also removes user deletion buttons from the user's list
page and adds this option to the user edit page. The user's edit form
asks for a confirmation if the user deletion is requested. This change
also means that the confirmation password is now required to delete a user.
Also:
- Add a simple username validation to the privileged actions.
- Functional tests: Create a fixture to login as an admin before every test.
- Functional tests: Add a test to check that SSH passwordless login works
after user is renamed to validate correct SSH related path permissions.
- Privileged tests: Add `test_` prefix to the generated random string which
makes easier to check and cleanup created home folders.
- Minor quote fixes.
Tests performed in stable and testing containers:
- Run all the users module tests twice, no failures in tests.
- When user is the last admin, both "Active" and "Delete user"
checkboxes are disabled.
Closes #2451.
[sunil]
- Refactor the JS code:
- Ensure that DOM elements are lookup after DOM content is loaded.
- Styling changes. Reduce the number of globals, name the global names
somewhat more unique.
- Click the button instead of submitting the form to disable the button.
- Template changes:
- Add a body for the confirmation dialog to talk about disabling the user and
deleting the home directory.
- Change the label of the confirm button to make it more
explicit (recommendation from many UX guides).
- Styling.
- Functional tests:
- Fix visibility checking of an element to use the correct splinter API.
- Simplify clicking the edit user link.
- Minor update to form checkbox help text.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
32 lines
1.1 KiB
Python
32 lines
1.1 KiB
Python
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
"""
|
|
URLs for the Users module
|
|
"""
|
|
|
|
from django.urls import re_path
|
|
from stronghold.decorators import public
|
|
|
|
from plinth.modules.sso.views import CaptchaView, SSOLoginView, logout
|
|
from plinth.utils import non_admin_view
|
|
|
|
from . import views
|
|
|
|
urlpatterns = [
|
|
re_path(r'^sys/users/$', views.UserList.as_view(), name='index'),
|
|
re_path(r'^sys/users/create/$', views.UserCreate.as_view(), name='create'),
|
|
re_path(r'^sys/users/(?P<slug>[\w.@+-]+)/edit/$',
|
|
non_admin_view(views.UserUpdate.as_view()), name='edit'),
|
|
re_path(r'^sys/users/(?P<slug>[\w.@+-]+)/change_password/$',
|
|
non_admin_view(views.UserChangePassword.as_view()),
|
|
name='change_password'),
|
|
|
|
# Authnz is handled by SSO
|
|
re_path(r'^accounts/login/$', public(SSOLoginView.as_view()),
|
|
name='login'),
|
|
re_path(r'^accounts/logout/$', public(logout), name='logout'),
|
|
re_path(r'^users/firstboot/$', public(views.FirstBootView.as_view()),
|
|
name='firstboot'),
|
|
re_path(r'accounts/login/locked/$', public(CaptchaView.as_view()),
|
|
name='locked_out'),
|
|
]
|