mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
+1
-1
@@ -302,7 +302,7 @@ class Mailbox(DatesAware):
|
||||
:param value: the new password's value
|
||||
"""
|
||||
if parameters.get_admin("AUTHENTICATION_TYPE") == "local":
|
||||
self.password = crypt_password(value)
|
||||
self.password = crypt_password(newvalue)
|
||||
self.save()
|
||||
return
|
||||
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ class MailboxTestCase(TestCase):
|
||||
|
||||
Two cases:
|
||||
* The default admin changes his password (no associated Mailbox)
|
||||
* A normal user changes hist password
|
||||
* A normal user changes his password
|
||||
"""
|
||||
clt = Client()
|
||||
self.assertEqual(clt.login(username="admin", password="toto"), True)
|
||||
|
||||
@@ -40,6 +40,7 @@ def changepassword(request, tplname="userprefs/chpassword.html"):
|
||||
request.session["password"] = encrypt(request.POST["confirmation"])
|
||||
else:
|
||||
target.set_password(request.POST["confirmation"])
|
||||
target.save()
|
||||
|
||||
if error is None:
|
||||
return ajax_response(request, respmsg=_("Password changed"))
|
||||
|
||||
Reference in New Issue
Block a user