mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-19 11:42:15 +00:00
Compare commits
32 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
eea34e6032 | ||
|
69a366978f | ||
|
fb634dca4c | ||
|
b045a64496 | ||
|
77e471022f | ||
|
25987545db | ||
|
6720ecc6e0 | ||
|
0b3a7bb020 | ||
|
56373e362b | ||
|
02fc045370 | ||
|
e4ac73896f | ||
|
1518f792d6 | ||
|
67277dd622 | ||
|
82e7f020ea | ||
|
f20b9e01ab | ||
|
8cf8a3701b | ||
|
7ba24293d1 | ||
|
f10114c9ed | ||
|
cf31cbfb07 | ||
|
0edad24d5d | ||
|
1f1c1a9157 | ||
|
6c9d271ae1 | ||
|
6ff852e225 | ||
|
baa75dc735 | ||
|
8a9f0436b8 | ||
|
a9620a3cbe | ||
|
769e7dc8a0 | ||
|
2a70449411 | ||
|
8df720f19e | ||
|
dabbb45f6e | ||
|
ce24c1c3fd | ||
|
3c54c82ce9 |
@ -24,6 +24,7 @@ ENV LANG=en_US.UTF-8 \
|
||||
PATH=/opt/py3/bin:$PATH
|
||||
|
||||
ARG DEPENDENCIES=" \
|
||||
libldap2-dev \
|
||||
libx11-dev"
|
||||
|
||||
ARG TOOLS=" \
|
||||
|
@ -85,7 +85,7 @@
|
||||
}
|
||||
|
||||
$('#retry_button').on('click', function () {
|
||||
window.location.href = "{% url 'authentication:login-face-capture' %}";
|
||||
window.location.href = "{{ request.get_full_path }}";
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
@ -158,7 +158,10 @@ def is_uuid(seq):
|
||||
def get_request_ip(request):
|
||||
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR', '').split(',')
|
||||
if x_forwarded_for and x_forwarded_for[0]:
|
||||
login_ip = x_forwarded_for[0].split(":")[0]
|
||||
login_ip = x_forwarded_for[0]
|
||||
if login_ip.count(':') == 1:
|
||||
# format: ipv4:port (非标准格式的 X-Forwarded-For)
|
||||
login_ip = login_ip.split(":")[0]
|
||||
return login_ip
|
||||
|
||||
login_ip = request.META.get('REMOTE_ADDR', '')
|
||||
|
@ -1,5 +1,5 @@
|
||||
type: msi # exe, zip, manual, msi
|
||||
source: jms:///download/applets/dbeaver-patch.msi
|
||||
source: jms:///download/applets/dbeaver-patch-22.3.4-x86_64-setup.msi
|
||||
arguments:
|
||||
- /quiet
|
||||
destination:
|
||||
|
@ -27,24 +27,31 @@ class UserFaceCaptureView(AuthMixin, FormView):
|
||||
return super().form_valid(form)
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data()
|
||||
context = super().get_context_data(**kwargs)
|
||||
|
||||
if not self.get_form().is_bound:
|
||||
if 'form' not in kwargs:
|
||||
form = self.get_form()
|
||||
context['form'] = form
|
||||
|
||||
if not context['form'].is_bound:
|
||||
context.update({
|
||||
"active": True,
|
||||
})
|
||||
|
||||
kwargs.update(context)
|
||||
return kwargs
|
||||
return context
|
||||
|
||||
|
||||
class UserFaceEnableView(UserFaceCaptureView, MFAFaceMixin):
|
||||
class UserFaceEnableView(MFAFaceMixin, UserFaceCaptureView):
|
||||
def form_valid(self, form):
|
||||
code = self.get_face_code()
|
||||
|
||||
try:
|
||||
code = self.get_face_code()
|
||||
user = self.get_user_from_session()
|
||||
user.face_vector = code
|
||||
user.save(update_fields=['face_vector'])
|
||||
except Exception as e:
|
||||
form.add_error("code", str(e))
|
||||
return super().form_invalid(form)
|
||||
|
||||
auth_logout(self.request)
|
||||
return super().form_valid(form)
|
||||
|
Loading…
Reference in New Issue
Block a user