mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
samba: private shares
- new share types - group and home shares - users: when creating, deleting or changing user password, update also Samba tdbsam backend database - users: new managed packages - samba-common-bin, tdb-tools - module page: show current samba users who are in freedombox-share group - module page: show users who should re-enter their password in the password change page - fix: use os.path.ismount() from Python standard library to validate a mount point - fix: samba share permissions, fixes #1729 - fix: delete a share - do not raise an exception if the share doesn't exist - storage: show samba share type in the directory selection form Closes #1727 Signed-off-by: Veiko Aasa <veiko17@disroot.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
851d1c7c28
commit
83cb305026
10 files changed
+360
-172
No files matched your search
@@ -34,7 +34,7 @@ is_essential = True
|
||||
|
||||
managed_packages = [
|
||||
'ldapscripts', 'ldap-utils', 'libnss-ldapd', 'libpam-ldapd', 'nscd',
|
||||
'nslcd', 'slapd'
|
||||
'nslcd', 'samba-common-bin', 'slapd', 'tdb-tools'
|
||||
]
|
||||
|
||||
first_boot_steps = [
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
import subprocess
|
||||
|
||||
import plinth.forms
|
||||
from django import forms
|
||||
from django.contrib import auth, messages
|
||||
from django.contrib.auth.forms import SetPasswordForm, UserCreationForm
|
||||
@@ -24,8 +25,6 @@ from django.contrib.auth.models import Group, User
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.translation import ugettext_lazy
|
||||
|
||||
import plinth.forms
|
||||
from plinth import actions, module_loader
|
||||
from plinth.errors import ActionError
|
||||
from plinth.modules import first_boot, users
|
||||
@@ -262,6 +261,21 @@ class UserUpdateForm(ValidNewUsernameCheckMixin,
|
||||
except ActionError:
|
||||
messages.error(self.request, _('Unable to set SSH keys.'))
|
||||
|
||||
is_active = self.cleaned_data['is_active']
|
||||
if self.initial['is_active'] != is_active:
|
||||
if is_active:
|
||||
status = 'active'
|
||||
else:
|
||||
status = 'inactive'
|
||||
try:
|
||||
actions.superuser_run(
|
||||
'users',
|
||||
['set-user-status',
|
||||
user.get_username(), status])
|
||||
except ActionError:
|
||||
messages.error(self.request,
|
||||
_('Failed to change user status.'))
|
||||
|
||||
return user
|
||||
|
||||
def validate_last_admin_user(self, groups):
|
||||
|
||||
Reference in new issue
Block a user