From 69342690023b5b9f225de99f4b2abbad0df43394 Mon Sep 17 00:00:00 2001 From: souliane Date: Fri, 27 Nov 2015 11:21:51 +0100 Subject: [PATCH] plugin misc_account: fixed password verification --- src/plugins/plugin_misc_account.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/plugins/plugin_misc_account.py b/src/plugins/plugin_misc_account.py index 19a17380..be3ff34e 100755 --- a/src/plugins/plugin_misc_account.py +++ b/src/plugins/plugin_misc_account.py @@ -332,7 +332,7 @@ http://www.salut-a-toi.org def error_ui(message=None): if not message: - D_("The provided profile password doesn't match.") + message = D_("The provided profile password doesn't match.") error_ui = xml_tools.XMLUI("popup", title=D_("Attempt failure")) error_ui.addText(message) return {'xmlui': error_ui.toXml()} @@ -341,7 +341,9 @@ http://www.salut-a-toi.org delete_passwd = data[xml_tools.SAT_FORM_PREFIX + 'delete_passwd'] delete_checkbox = data[xml_tools.SAT_FORM_PREFIX + 'delete_checkbox'] if delete_checkbox == 'true': - if verify(delete_passwd): + verified = yield verify(delete_passwd) + assert isinstance(verified, bool) + if verified: defer.returnValue(self.__deleteAccount(profile)) defer.returnValue(error_ui()) @@ -353,7 +355,9 @@ http://www.salut-a-toi.org posts = delete_posts_checkbox == 'true' comments = delete_comments_checkbox == 'true' if posts or comments: - if verify(delete_posts_passwd): + verified = yield verify(delete_posts_passwd) + assert isinstance(verified, bool) + if verified: defer.returnValue(self.__deleteBlogPosts(posts, comments, profile)) defer.returnValue(error_ui()) @@ -362,7 +366,9 @@ http://www.salut-a-toi.org new_passwd1 = data[xml_tools.SAT_FORM_PREFIX + 'new_passwd1'] new_passwd2 = data[xml_tools.SAT_FORM_PREFIX + 'new_passwd2'] if new_passwd1 or new_passwd2: - if verify(current_passwd): + verified = yield verify(current_passwd) + assert isinstance(verified, bool) + if verified: if new_passwd1 == new_passwd2: data = yield self.__changePassword(new_passwd1, profile=profile) defer.returnValue(data)