From 7d32a9a9e9b61d37e95c7e59c75d897298b68289 Mon Sep 17 00:00:00 2001 From: guanghongwei Date: Sat, 27 Sep 2014 19:44:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=87=EE=86=BD=E6=95=BClogin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webroot/AutoSa/AutoSa/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webroot/AutoSa/AutoSa/views.py b/webroot/AutoSa/AutoSa/views.py index 1af4083cc..4bbbd6135 100644 --- a/webroot/AutoSa/AutoSa/views.py +++ b/webroot/AutoSa/AutoSa/views.py @@ -219,7 +219,7 @@ def login(request): user = User.objects.filter(username=username) if user: user = user[0] - if password == user.password: + if md5_crypt(password) == user.password: request.session['username'] = username if user.is_admin: request.session['admin'] = 1 @@ -343,7 +343,7 @@ def addUser(request): user = form.cleaned_data username = user['username'] password = md5_crypt(user['password']) - key_pass = user['key_pass'] + key_pass = md5_crypt(user['key_pass']) name = user['name'] is_admin = user['is_admin'] is_superuser = user['is_superuser']