upgrade django

This commit is contained in:
smile 2022-09-27 20:54:21 +02:00
parent e8fa8f6d13
commit 7ed4a39b36
9 changed files with 77 additions and 39 deletions

View file

@ -5,7 +5,7 @@ import re
from django import forms
from django.contrib.auth import authenticate
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
class UsernameField(forms.CharField):

View file

@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
import base64
import os
from Crypto import Random
from Crypto.Cipher import AES
@ -19,10 +20,11 @@ def encrypt_ldap_password(cleartext_pw):
"""
# 16 bytes of key => AES-128
random = Random.new()
key = random.read(16)
key = os.urandom(16) # random.read(16)
# initialization vector
iv = random.read(16)
iv = os.urandom(16) # random.read(16)
# do the encryption
aes = AES.new(key, AES.MODE_CFB, iv)

View file

@ -156,7 +156,7 @@
{% endblock container %}
<hr />
<div class="row pull-right">
<small class="muted">Copyright &copy; 2013 by c-base e.V.</small>
<small class="muted">Copyright &copy; 2022 by c-base e.V.</small>
</div>
</div><!-- /.container -->
{% endblock body %}

View file

@ -1,21 +1,21 @@
from account.views import (admin, auth_login, auth_logout, clabpin, gastropin,
groups_list, home, memberstatus, nrf24, password,
preferred_email, rfid, sippin, wlan_presence)
from django.conf.urls import url
from django.urls import re_path
urlpatterns = [
url(r'^login/$', auth_login, name="cbase_auth_login"),
url(r'^logout/$', auth_logout, name="auth_logout"),
url(r'^gastropin/$', gastropin, name='gastropin'),
url(r'^wlan_presence/$', wlan_presence, name='wlan_presence'),
url(r'^rfid/$', rfid, name='rfid'),
url(r'^nrf24/$', nrf24, name='nrf24'),
url(r'^password/$', password, name='password'),
url(r'^sippin/$', sippin, name='sippin'),
url(r'^clabpin/$', clabpin, name='clabpin'),
url(r'^preferred_email/$', preferred_email, name='preferred_email'),
url(r'^admin/$', admin, name='admin'),
url(r'^memberstatus/$', memberstatus, name='memberstatus'),
url(r'^$', home, name="home"),
url(r'^groups/(?P<group_name>[^/]+)/', groups_list),
re_path(r'^login/$', auth_login, name="cbase_auth_login"),
re_path(r'^logout/$', auth_logout, name="auth_logout"),
re_path(r'^gastropin/$', gastropin, name='gastropin'),
re_path(r'^wlan_presence/$', wlan_presence, name='wlan_presence'),
re_path(r'^rfid/$', rfid, name='rfid'),
re_path(r'^nrf24/$', nrf24, name='nrf24'),
re_path(r'^password/$', password, name='password'),
re_path(r'^sippin/$', sippin, name='sippin'),
re_path(r'^clabpin/$', clabpin, name='clabpin'),
re_path(r'^preferred_email/$', preferred_email, name='preferred_email'),
re_path(r'^admin/$', admin, name='admin'),
re_path(r'^memberstatus/$', memberstatus, name='memberstatus'),
re_path(r'^$', home, name="home"),
re_path(r'^groups/(?P<group_name>[^/]+)/', groups_list),
]

View file

@ -15,7 +15,8 @@ from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.shortcuts import render
from django.shortcuts import render
from django.utils.translation import ugettext as _
# from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
import smbpasswd
from account.cbase_members import retrieve_member, MemberValues