Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
FUSS
octonet
Commits
1c268592
Commit
1c268592
authored
Mar 13, 2020
by
Mark Caglienzi
Browse files
Merge branch 't14151'
parents
7735a5a4
ac162b8b
Changes
5
Hide whitespace changes
Inline
Side-by-side
debian/changelog
View file @
1c268592
octonet
(
10.0.0
-
1
)
testing
;
urgency
=
medium
*
Version
bump
to
10.
x
.
x
*
The
'Force password change'
button
is
removed
and
the
function
is
done
via
a
boolean
field
in
the
form
.
--
Mark
Caglienzi
<
mark
@
truelite
.
it
>
Thu
,
12
Mar
2020
16
:
27
:
42
+
0100
octonet
(
0.2.62
-
1
)
testing
;
urgency
=
medium
*
Temporarily
hide
the
lock
and
unlock
desktop
buttons
in
the
cluster
...
...
setup.py
View file @
1c268592
...
...
@@ -13,7 +13,7 @@ def list_locale_files():
setup
(
name
=
'octonet'
,
description
=
'OctoNet'
,
version
=
'0.
2.62
'
,
version
=
'
1
0.
0.0
'
,
license
=
'GPL3'
,
author
=
'Truelite S.r.l.'
,
author_email
=
'info@truelite.it'
,
...
...
users/templates/users/user_actions.html
View file @
1c268592
{% load i18n %}
{% comment %}
{# refs #14151 Hide this action #}
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<form
method=
"post"
action=
"{% url 'users:user_force_password_change' uid=octofuss_user.uid %}"
>
...
...
@@ -10,6 +12,7 @@
</form>
</div>
</div>
{% endcomment %}
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<form
method=
"post"
...
...
users/urls.py
View file @
1c268592
...
...
@@ -9,7 +9,8 @@ urlpatterns = [
url
(
r
"^user/(?P<uid>[^/]+)/edit$"
,
views
.
UserEdit
.
as_view
(),
name
=
"user_edit"
),
url
(
r
"^user/(?P<uid>[^/]+)/set-enabled$"
,
views
.
UserSetEnabled
.
as_view
(),
name
=
"user_set_enabled"
),
# refs #12559
url
(
r
"^user/(?P<uid>[^/]+)/force-password-change$"
,
views
.
UserForcePasswordChange
.
as_view
(),
name
=
"user_force_password_change"
),
# refs #14151: Hide the button that made POST to this view
# url(r"^user/(?P<uid>[^/]+)/force-password-change$", views.UserForcePasswordChange.as_view(), name="user_force_password_change"),
url
(
r
"^user/(?P<uid>[^/]+)/add-group$"
,
views
.
UserAddGroup
.
as_view
(),
name
=
"user_add_group"
),
# refs #213
url
(
r
"^user/(?P<uid>[^/]+)/delete$"
,
views
.
UserDelete
.
as_view
(),
name
=
"user_delete"
),
...
...
users/views.py
View file @
1c268592
...
...
@@ -332,6 +332,8 @@ class UserForm(FormControlClassMixin, forms.Form):
)
groups
=
forms
.
MultipleChoiceField
(
label
=
_
(
"Groups"
),
required
=
False
)
netperms
=
forms
.
MultipleChoiceField
(
label
=
_
(
"Permissions"
),
required
=
False
)
# refs #14151
force_password_change
=
forms
.
BooleanField
(
label
=
_
(
"Force password change"
),
required
=
False
)
# refs #13094
def
clean_gecos
(
self
):
...
...
@@ -476,6 +478,7 @@ class UserFormMixin:
self
.
has_quota
=
self
.
root_tree
.
lhas
([
"quota"
])
self
.
all_groups
=
self
.
root_tree
.
lget
([
"users"
,
"groups"
])
self
.
all_groups
=
sorted
(
self
.
all_groups
,
key
=
lambda
x
:
x
.
get
(
"cn"
))
def
_get_custom_user_form
(
self
):
shells
=
self
.
root_tree
.
llist
([
"users"
,
"shells"
])
...
...
@@ -578,6 +581,10 @@ class UserEdit(UserFormMixin, UserMixin, FormView):
if
self
.
root_tree
.
lhas
(
path
):
self
.
root_tree
.
lset
(
path
,
f
.
cleaned_data
)
# refs #14151
if
user_form
.
cleaned_data
.
get
(
'force_password_change'
,
False
):
self
.
root_tree
.
lset
([
"users"
,
"users"
,
self
.
user
[
"uid"
],
"shadowLastChange"
],
0
)
messages
.
info
(
self
.
request
,
_
(
"Password change forced for user {}"
).
format
(
self
.
user
[
'uid'
]))
return
super
().
form_valid
(
form
)
...
...
@@ -720,13 +727,14 @@ class UserSetEnabled(OctonetMixin, FormView):
# refs #12559
class
UserForcePasswordChange
(
OctonetMixin
,
FormView
):
http_method_names
=
[
'post'
]
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
self
.
root_tree
.
lset
([
"users"
,
"users"
,
self
.
kwargs
[
"uid"
],
"shadowLastChange"
],
0
)
messages
.
info
(
request
,
_
(
"Password change forced for user {}"
).
format
(
self
.
kwargs
[
'uid'
]))
return
redirect
(
"users:detail"
,
uid
=
self
.
kwargs
[
"uid"
])
# refs #14151: Hide the button that made POST to this view
# class UserForcePasswordChange(OctonetMixin, FormView):
# http_method_names = ['post']
# def post(self, request, *args, **kwargs):
# self.root_tree.lset(["users", "users", self.kwargs["uid"], "shadowLastChange"], 0)
# messages.info(request, _("Password change forced for user {}").format(self.kwargs['uid']))
# return redirect("users:detail", uid=self.kwargs["uid"])
class
UserAddGroup
(
OctonetMixin
,
FormView
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment