diff --git a/addons/auth_reset_password/__init__.py b/addons/auth_reset_password/__init__.py deleted file mode 100644 index 8341ccd60c7..00000000000 --- a/addons/auth_reset_password/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2012-today OpenERP SA () -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see -# -############################################################################## - -import controllers -import res_users diff --git a/addons/auth_reset_password/__openerp__.py b/addons/auth_reset_password/__openerp__.py deleted file mode 100644 index 2c5b61bf378..00000000000 --- a/addons/auth_reset_password/__openerp__.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2012-today OpenERP SA () -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see -# -############################################################################## - -{ - 'name': 'Reset Password', - 'description': """ -Reset Password -============== - -Allow users to reset their password from the login page. -Allow administrator to click a button to send a "Reset Password" request to a user. -""", - 'author': 'OpenERP SA', - 'version': '1.0', - 'category': 'Authentication', - 'website': 'http://www.openerp.com', - 'installable': True, - 'depends': ['auth_signup', 'email_template'], - 'data': [ - 'auth_reset_password.xml', - 'res_users_view.xml', - ], - 'js': ['static/src/js/reset_password.js'], - 'qweb': ['static/src/xml/reset_password.xml'], -} diff --git a/addons/auth_reset_password/auth_reset_password.xml b/addons/auth_reset_password/auth_reset_password.xml deleted file mode 100644 index 90f08a25899..00000000000 --- a/addons/auth_reset_password/auth_reset_password.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - Reset Password - - ]]> - ${object.email} - Password reset - A password reset was requested for the OpenERP account linked to this email.

- -

You may change your password following this link.

- -

Note: If you did not ask for a password reset, you can safely ignore this email.

]]>
-
- -
-
diff --git a/addons/auth_reset_password/controllers/__init__.py b/addons/auth_reset_password/controllers/__init__.py deleted file mode 100644 index f40f0ee976e..00000000000 --- a/addons/auth_reset_password/controllers/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2012-today OpenERP SA () -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see -# -############################################################################## - -import main - -# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/auth_reset_password/controllers/main.py b/addons/auth_reset_password/controllers/main.py deleted file mode 100644 index 639945cfc09..00000000000 --- a/addons/auth_reset_password/controllers/main.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2012-today OpenERP SA () -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see -# -############################################################################## -import logging - -import werkzeug - -import openerp -from openerp import SUPERUSER_ID -from openerp.modules.registry import RegistryManager - -_logger = logging.getLogger(__name__) - -class Controller(openerp.addons.web.http.Controller): - _cp_path = '/auth_reset_password' - - @openerp.addons.web.http.httprequest - def reset_password(self, req, dbname, login): - """ retrieve user, and perform reset password """ - url = '/' - registry = RegistryManager.get(dbname) - with registry.cursor() as cr: - try: - res_users = registry.get('res.users') - res_users.reset_password(cr, SUPERUSER_ID, login) - cr.commit() - message = 'An email has been sent with credentials to reset your password' - except Exception as e: - # signup error - _logger.exception('error when resetting password') - message = e.message - url = "/#action=login&error_message=%s" % werkzeug.urls.url_quote(message) - return werkzeug.utils.redirect(url) - -# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/auth_reset_password/i18n/ar.po b/addons/auth_reset_password/i18n/ar.po deleted file mode 100644 index 7d39cee63e4..00000000000 --- a/addons/auth_reset_password/i18n/ar.po +++ /dev/null @@ -1,70 +0,0 @@ -# Arabic translation for openobject-addons -# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 -# This file is distributed under the same license as the openobject-addons package. -# FIRST AUTHOR , 2012. -# -msgid "" -msgstr "" -"Project-Id-Version: openobject-addons\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2012-12-03 16:03+0000\n" -"PO-Revision-Date: 2012-12-01 10:40+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Arabic \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-12-04 05:55+0000\n" -"X-Generator: Launchpad (build 16335)\n" - -#. module: auth_reset_password -#: model:email.template,body_html:auth_reset_password.reset_password_email -msgid "" -"\n" -"

A password reset was requested for the OpenERP account linked to this " -"email.

\n" -"\n" -"

You may change your password following this link.

\n" -"\n" -"

Note: If you did not ask for a password reset, you can safely ignore this " -"email.

" -msgstr "" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "Send a special url by email to make the user (re)set their password." -msgstr "" - -#. module: auth_reset_password -#: code:addons/auth_reset_password/res_users.py:59 -#, python-format -msgid "Cannot send email: user has no email address." -msgstr "" - -#. module: auth_reset_password -#: model:ir.model,name:auth_reset_password.model_res_users -msgid "Users" -msgstr "" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "{}" -msgstr "" - -#. module: auth_reset_password -#. openerp-web -#: code:addons/auth_reset_password/static/src/xml/reset_password.xml:7 -#, python-format -msgid "Reset password" -msgstr "" - -#. module: auth_reset_password -#: model:email.template,subject:auth_reset_password.reset_password_email -msgid "Password reset" -msgstr "" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "Reset Password" -msgstr "" diff --git a/addons/auth_reset_password/i18n/auth_reset_password.pot b/addons/auth_reset_password/i18n/auth_reset_password.pot deleted file mode 100644 index aa1c2b2eaf0..00000000000 --- a/addons/auth_reset_password/i18n/auth_reset_password.pot +++ /dev/null @@ -1,65 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * auth_reset_password -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0alpha\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-12-03 16:03+0000\n" -"PO-Revision-Date: 2012-12-03 16:03+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: auth_reset_password -#: model:email.template,body_html:auth_reset_password.reset_password_email -msgid "\n" -"

A password reset was requested for the OpenERP account linked to this email.

\n" -"\n" -"

You may change your password following this link.

\n" -"\n" -"

Note: If you did not ask for a password reset, you can safely ignore this email.

" -msgstr "" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "Send a special url by email to make the user (re)set their password." -msgstr "" - -#. module: auth_reset_password -#: code:addons/auth_reset_password/res_users.py:59 -#, python-format -msgid "Cannot send email: user has no email address." -msgstr "" - -#. module: auth_reset_password -#: model:ir.model,name:auth_reset_password.model_res_users -msgid "Users" -msgstr "" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "{}" -msgstr "" - -#. module: auth_reset_password -#. openerp-web -#: code:addons/auth_reset_password/static/src/xml/reset_password.xml:7 -#, python-format -msgid "Reset password" -msgstr "" - -#. module: auth_reset_password -#: model:email.template,subject:auth_reset_password.reset_password_email -msgid "Password reset" -msgstr "" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "Reset Password" -msgstr "" - diff --git a/addons/auth_reset_password/i18n/it.po b/addons/auth_reset_password/i18n/it.po deleted file mode 100644 index 571e6af83cc..00000000000 --- a/addons/auth_reset_password/i18n/it.po +++ /dev/null @@ -1,70 +0,0 @@ -# Italian translation for openobject-addons -# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 -# This file is distributed under the same license as the openobject-addons package. -# FIRST AUTHOR , 2012. -# -msgid "" -msgstr "" -"Project-Id-Version: openobject-addons\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2012-12-03 16:03+0000\n" -"PO-Revision-Date: 2012-11-28 19:58+0000\n" -"Last-Translator: Davide Corio - agilebg.com \n" -"Language-Team: Italian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-12-04 05:55+0000\n" -"X-Generator: Launchpad (build 16335)\n" - -#. module: auth_reset_password -#: model:email.template,body_html:auth_reset_password.reset_password_email -msgid "" -"\n" -"

A password reset was requested for the OpenERP account linked to this " -"email.

\n" -"\n" -"

You may change your password following this link.

\n" -"\n" -"

Note: If you did not ask for a password reset, you can safely ignore this " -"email.

" -msgstr "" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "Send a special url by email to make the user (re)set their password." -msgstr "" - -#. module: auth_reset_password -#: code:addons/auth_reset_password/res_users.py:59 -#, python-format -msgid "Cannot send email: user has no email address." -msgstr "" - -#. module: auth_reset_password -#: model:ir.model,name:auth_reset_password.model_res_users -msgid "Users" -msgstr "Utenti" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "{}" -msgstr "" - -#. module: auth_reset_password -#. openerp-web -#: code:addons/auth_reset_password/static/src/xml/reset_password.xml:7 -#, python-format -msgid "Reset password" -msgstr "Reimposta password" - -#. module: auth_reset_password -#: model:email.template,subject:auth_reset_password.reset_password_email -msgid "Password reset" -msgstr "Ripristino password" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "Reset Password" -msgstr "Reimposta Password" diff --git a/addons/auth_reset_password/i18n/nl.po b/addons/auth_reset_password/i18n/nl.po deleted file mode 100644 index 3b88d2fcd64..00000000000 --- a/addons/auth_reset_password/i18n/nl.po +++ /dev/null @@ -1,70 +0,0 @@ -# Dutch translation for openobject-addons -# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 -# This file is distributed under the same license as the openobject-addons package. -# FIRST AUTHOR , 2012. -# -msgid "" -msgstr "" -"Project-Id-Version: openobject-addons\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2012-12-03 16:03+0000\n" -"PO-Revision-Date: 2012-11-29 15:12+0000\n" -"Last-Translator: Erwin van der Ploeg (Endian Solutions) \n" -"Language-Team: Dutch \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-12-04 05:55+0000\n" -"X-Generator: Launchpad (build 16335)\n" - -#. module: auth_reset_password -#: model:email.template,body_html:auth_reset_password.reset_password_email -msgid "" -"\n" -"

A password reset was requested for the OpenERP account linked to this " -"email.

\n" -"\n" -"

You may change your password following this link.

\n" -"\n" -"

Note: If you did not ask for a password reset, you can safely ignore this " -"email.

" -msgstr "" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "Send a special url by email to make the user (re)set their password." -msgstr "" - -#. module: auth_reset_password -#: code:addons/auth_reset_password/res_users.py:59 -#, python-format -msgid "Cannot send email: user has no email address." -msgstr "" - -#. module: auth_reset_password -#: model:ir.model,name:auth_reset_password.model_res_users -msgid "Users" -msgstr "Gebruikers" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "{}" -msgstr "" - -#. module: auth_reset_password -#. openerp-web -#: code:addons/auth_reset_password/static/src/xml/reset_password.xml:7 -#, python-format -msgid "Reset password" -msgstr "Reset wachtwoord" - -#. module: auth_reset_password -#: model:email.template,subject:auth_reset_password.reset_password_email -msgid "Password reset" -msgstr "Reset wachtwoord" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "Reset Password" -msgstr "Stel wachtwoord opnieuw in" diff --git a/addons/auth_reset_password/i18n/ru.po b/addons/auth_reset_password/i18n/ru.po deleted file mode 100644 index e5134f2e89b..00000000000 --- a/addons/auth_reset_password/i18n/ru.po +++ /dev/null @@ -1,70 +0,0 @@ -# Russian translation for openobject-addons -# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 -# This file is distributed under the same license as the openobject-addons package. -# FIRST AUTHOR , 2012. -# -msgid "" -msgstr "" -"Project-Id-Version: openobject-addons\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2012-12-03 16:03+0000\n" -"PO-Revision-Date: 2012-11-30 19:40+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Russian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-12-04 05:55+0000\n" -"X-Generator: Launchpad (build 16335)\n" - -#. module: auth_reset_password -#: model:email.template,body_html:auth_reset_password.reset_password_email -msgid "" -"\n" -"

A password reset was requested for the OpenERP account linked to this " -"email.

\n" -"\n" -"

You may change your password following this link.

\n" -"\n" -"

Note: If you did not ask for a password reset, you can safely ignore this " -"email.

" -msgstr "" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "Send a special url by email to make the user (re)set their password." -msgstr "" - -#. module: auth_reset_password -#: code:addons/auth_reset_password/res_users.py:59 -#, python-format -msgid "Cannot send email: user has no email address." -msgstr "" - -#. module: auth_reset_password -#: model:ir.model,name:auth_reset_password.model_res_users -msgid "Users" -msgstr "" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "{}" -msgstr "" - -#. module: auth_reset_password -#. openerp-web -#: code:addons/auth_reset_password/static/src/xml/reset_password.xml:7 -#, python-format -msgid "Reset password" -msgstr "" - -#. module: auth_reset_password -#: model:email.template,subject:auth_reset_password.reset_password_email -msgid "Password reset" -msgstr "" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "Reset Password" -msgstr "" diff --git a/addons/auth_reset_password/i18n/tr.po b/addons/auth_reset_password/i18n/tr.po deleted file mode 100644 index abd4d74b01f..00000000000 --- a/addons/auth_reset_password/i18n/tr.po +++ /dev/null @@ -1,79 +0,0 @@ -# Turkish translation for openobject-addons -# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 -# This file is distributed under the same license as the openobject-addons package. -# FIRST AUTHOR , 2012. -# -msgid "" -msgstr "" -"Project-Id-Version: openobject-addons\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2012-12-03 16:03+0000\n" -"PO-Revision-Date: 2012-11-27 22:15+0000\n" -"Last-Translator: Ahmet Altınışık \n" -"Language-Team: Turkish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-12-04 05:55+0000\n" -"X-Generator: Launchpad (build 16335)\n" - -#. module: auth_reset_password -#: model:email.template,body_html:auth_reset_password.reset_password_email -msgid "" -"\n" -"

A password reset was requested for the OpenERP account linked to this " -"email.

\n" -"\n" -"

You may change your password following this link.

\n" -"\n" -"

Note: If you did not ask for a password reset, you can safely ignore this " -"email.

" -msgstr "" -"\n" -"

Bu epostayla ilişkili OpenERP hesabı için bir parola sıfırlama isteği " -"istendi.

\n" -"\n" -"

Şifrenizi şu adresten değiştirebilirsiniz. this link.

\n" -"\n" -"

Not: Eğer bu parola değiştirme isteğini siz yapmadıysanız bu mesajı " -"görmezden gelebilirsiniz.

" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "Send a special url by email to make the user (re)set their password." -msgstr "" - -#. module: auth_reset_password -#: code:addons/auth_reset_password/res_users.py:59 -#, python-format -msgid "Cannot send email: user has no email address." -msgstr "" - -#. module: auth_reset_password -#: model:ir.model,name:auth_reset_password.model_res_users -msgid "Users" -msgstr "Kullanıcılar" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "{}" -msgstr "" - -#. module: auth_reset_password -#. openerp-web -#: code:addons/auth_reset_password/static/src/xml/reset_password.xml:7 -#, python-format -msgid "Reset password" -msgstr "Parolayı sıfırla" - -#. module: auth_reset_password -#: model:email.template,subject:auth_reset_password.reset_password_email -msgid "Password reset" -msgstr "Parola sıfırlandı" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "Reset Password" -msgstr "Parolayı Sıfırla" diff --git a/addons/auth_reset_password/i18n/zh_CN.po b/addons/auth_reset_password/i18n/zh_CN.po deleted file mode 100644 index f021be3af60..00000000000 --- a/addons/auth_reset_password/i18n/zh_CN.po +++ /dev/null @@ -1,74 +0,0 @@ -# Chinese (Simplified) translation for openobject-addons -# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 -# This file is distributed under the same license as the openobject-addons package. -# FIRST AUTHOR , 2012. -# -msgid "" -msgstr "" -"Project-Id-Version: openobject-addons\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2012-12-03 16:03+0000\n" -"PO-Revision-Date: 2012-11-28 07:14+0000\n" -"Last-Translator: ccdos \n" -"Language-Team: Chinese (Simplified) \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-12-04 05:55+0000\n" -"X-Generator: Launchpad (build 16335)\n" - -#. module: auth_reset_password -#: model:email.template,body_html:auth_reset_password.reset_password_email -msgid "" -"\n" -"

A password reset was requested for the OpenERP account linked to this " -"email.

\n" -"\n" -"

You may change your password following this link.

\n" -"\n" -"

Note: If you did not ask for a password reset, you can safely ignore this " -"email.

" -msgstr "" -"\n" -"一个关联到这个Email地址的Openerp帐号请求复位密码。\n" -"你可以修改你的密码通过下面这个链接 。\n" -"提醒:如果你没请求复位密码,请忽略这封邮件。" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "Send a special url by email to make the user (re)set their password." -msgstr "" - -#. module: auth_reset_password -#: code:addons/auth_reset_password/res_users.py:59 -#, python-format -msgid "Cannot send email: user has no email address." -msgstr "" - -#. module: auth_reset_password -#: model:ir.model,name:auth_reset_password.model_res_users -msgid "Users" -msgstr "用户" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "{}" -msgstr "" - -#. module: auth_reset_password -#. openerp-web -#: code:addons/auth_reset_password/static/src/xml/reset_password.xml:7 -#, python-format -msgid "Reset password" -msgstr "重设密码" - -#. module: auth_reset_password -#: model:email.template,subject:auth_reset_password.reset_password_email -msgid "Password reset" -msgstr "重置密码" - -#. module: auth_reset_password -#: view:res.users:0 -msgid "Reset Password" -msgstr "重置密码" diff --git a/addons/auth_reset_password/res_users.py b/addons/auth_reset_password/res_users.py deleted file mode 100644 index cfac20c76f9..00000000000 --- a/addons/auth_reset_password/res_users.py +++ /dev/null @@ -1,62 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2012-today OpenERP SA () -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see -# -############################################################################## - -from openerp.osv import osv, fields -from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT -from openerp.tools.translate import _ - -from datetime import datetime, timedelta - -def now(**kwargs): - dt = datetime.now() + timedelta(**kwargs) - return dt.strftime(DEFAULT_SERVER_DATETIME_FORMAT) - - -class res_users(osv.osv): - _inherit = 'res.users' - - def reset_password(self, cr, uid, login, context=None): - """ retrieve the user corresponding to login (login or email), - and reset their password - """ - user_ids = self.search(cr, uid, [('login', '=', login)], context=context) - if not user_ids: - user_ids = self.search(cr, uid, [('email', '=', login)], context=context) - if len(user_ids) != 1: - raise Exception('Reset password: invalid username or email') - return self.action_reset_password(cr, uid, user_ids, context=context) - - def action_reset_password(self, cr, uid, ids, context=None): - """ create signup token for each user, and send their signup url by email """ - # prepare reset password signup - res_partner = self.pool.get('res.partner') - partner_ids = [user.partner_id.id for user in self.browse(cr, uid, ids, context)] - res_partner.signup_prepare(cr, uid, partner_ids, expiration=now(days=+1), context=context) - - # send email to users with their signup url - template = self.pool.get('ir.model.data').get_object(cr, uid, 'auth_reset_password', 'reset_password_email') - assert template._name == 'email.template' - for user in self.browse(cr, uid, ids, context): - if not user.email: - raise osv.except_osv(_("Cannot send email: user has no email address."), user.name) - self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, context=context) - - return True diff --git a/addons/auth_reset_password/res_users_view.xml b/addons/auth_reset_password/res_users_view.xml deleted file mode 100644 index 628e95b6ff9..00000000000 --- a/addons/auth_reset_password/res_users_view.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - user.form.reset_password - res.users - - - - -
-
-
- - - {} - -
-
- -
-
diff --git a/addons/auth_reset_password/static/src/js/reset_password.js b/addons/auth_reset_password/static/src/js/reset_password.js deleted file mode 100644 index 13fe2a39ce5..00000000000 --- a/addons/auth_reset_password/static/src/js/reset_password.js +++ /dev/null @@ -1,30 +0,0 @@ -openerp.auth_reset_password = function(instance) { - var _t = instance.web._t; - - instance.web.Login.include({ - start: function() { - this.$('a.oe_reset_password').click(this.do_reset_password); - return this._super(); - }, - do_reset_password: function(ev) { - if (ev) { - ev.preventDefault(); - } - var db = this.$("form [name=db]").val(); - var login = this.$("form input[name=login]").val(); - if (!db) { - this.do_warn("Login", "No database selected !"); - return false; - } else if (!login) { - this.do_warn("Login", "Please enter a username or email address.") - return false; - } - var params = { - dbname : db, - login: login, - }; - var url = "/auth_reset_password/reset_password?" + $.param(params); - window.location = url; - } - }); -}; diff --git a/addons/auth_reset_password/static/src/xml/reset_password.xml b/addons/auth_reset_password/static/src/xml/reset_password.xml deleted file mode 100644 index 841f3906622..00000000000 --- a/addons/auth_reset_password/static/src/xml/reset_password.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - -
  • Reset password
  • - - - - diff --git a/addons/auth_signup/__openerp__.py b/addons/auth_signup/__openerp__.py index 235ac047346..5fe705a4440 100644 --- a/addons/auth_signup/__openerp__.py +++ b/addons/auth_signup/__openerp__.py @@ -22,15 +22,18 @@ { 'name': 'Signup', 'description': """ -Allow users to sign up. -======================= +Allow users to sign up and reset their password +=============================================== """, 'author': 'OpenERP SA', 'version': '1.0', 'category': 'Authentication', 'website': 'http://www.openerp.com', 'installable': True, - 'depends': ['base_setup'], + 'depends': [ + 'base_setup', + 'email_template', + ], 'data': [ 'auth_signup_data.xml', 'res_config.xml', diff --git a/addons/auth_signup/auth_signup_data.xml b/addons/auth_signup/auth_signup_data.xml index 39b62148494..32e397b1ba6 100644 --- a/addons/auth_signup/auth_signup_data.xml +++ b/addons/auth_signup/auth_signup_data.xml @@ -18,5 +18,20 @@ + + + Reset Password + + ]]> + ${object.email} + Password reset + A password reset was requested for the OpenERP account linked to this email.

    + +

    You may change your password by following this link.

    + +

    Note: If you do not expect this, you can safely ignore this email.

    ]]>
    +
    + diff --git a/addons/auth_signup/controllers/main.py b/addons/auth_signup/controllers/main.py index 888d2131f42..d2429e8dfd2 100644 --- a/addons/auth_signup/controllers/main.py +++ b/addons/auth_signup/controllers/main.py @@ -19,10 +19,12 @@ # ############################################################################## import logging +import urllib + +import werkzeug import openerp from openerp.modules.registry import RegistryManager - from ..res_users import SignupError _logger = logging.getLogger(__name__) @@ -30,6 +32,18 @@ _logger = logging.getLogger(__name__) class Controller(openerp.addons.web.http.Controller): _cp_path = '/auth_signup' + @openerp.addons.web.http.jsonrequest + def get_config(self, req, dbname): + """ retrieve the module config (which features are enabled) for the login page """ + registry = RegistryManager.get(dbname) + with registry.cursor() as cr: + icp = registry.get('ir.config_parameter') + config = { + 'signup': icp.get_param(cr, openerp.SUPERUSER_ID, 'auth_signup.allow_uninvited') == 'True', + 'reset_password': icp.get_param(cr, openerp.SUPERUSER_ID, 'auth_signup.reset_password') == 'True', + } + return config + @openerp.addons.web.http.jsonrequest def retrieve(self, req, dbname, token): """ retrieve the user info (name, login or email) corresponding to a signup token """ @@ -56,4 +70,21 @@ class Controller(openerp.addons.web.http.Controller): cr.commit() return {} + @openerp.addons.web.http.httprequest + def reset_password(self, req, dbname, login): + """ retrieve user, and perform reset password """ + registry = RegistryManager.get(dbname) + with registry.cursor() as cr: + try: + res_users = registry.get('res.users') + res_users.reset_password(cr, openerp.SUPERUSER_ID, login) + cr.commit() + message = 'An email has been sent with credentials to reset your password' + except Exception as e: + # signup error + _logger.exception('error when resetting password') + message = e.message + params = [('action', 'login'), ('error_message', message)] + return werkzeug.utils.redirect("/#" + urllib.urlencode(params)) + # vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/auth_signup/res_config.py b/addons/auth_signup/res_config.py index 21fce19745c..9cdb41568ff 100644 --- a/addons/auth_signup/res_config.py +++ b/addons/auth_signup/res_config.py @@ -26,14 +26,19 @@ class base_config_settings(osv.TransientModel): _inherit = 'base.config.settings' _columns = { - 'auth_signup_uninvited': fields.boolean('Allow external users to sign up', help="If unchecked, only invited users may sign up"), - 'auth_signup_template_user_id': fields.many2one('res.users', 'Template user for new users created through signup'), + 'auth_signup_reset_password': fields.boolean('Enable password reset from Login page', + help="This allows users to trigger a password reset from the Login page."), + 'auth_signup_uninvited': fields.boolean('Allow external users to sign up', + help="If unchecked, only invited users may sign up."), + 'auth_signup_template_user_id': fields.many2one('res.users', + string='Template user for new users created through signup'), } def get_default_auth_signup_template_user_id(self, cr, uid, fields, context=None): icp = self.pool.get('ir.config_parameter') # we use safe_eval on the result, since the value of the parameter is a nonempty string return { + 'auth_signup_reset_password': safe_eval(icp.get_param(cr, uid, 'auth_signup.reset_password', 'False')), 'auth_signup_uninvited': safe_eval(icp.get_param(cr, uid, 'auth_signup.allow_uninvited', 'False')), 'auth_signup_template_user_id': safe_eval(icp.get_param(cr, uid, 'auth_signup.template_user_id', 'False')), } @@ -42,5 +47,6 @@ class base_config_settings(osv.TransientModel): config = self.browse(cr, uid, ids[0], context=context) icp = self.pool.get('ir.config_parameter') # we store the repr of the values, since the value of the parameter is a required string + icp.set_param(cr, uid, 'auth_signup.reset_password', repr(config.auth_signup_reset_password)) icp.set_param(cr, uid, 'auth_signup.allow_uninvited', repr(config.auth_signup_uninvited)) icp.set_param(cr, uid, 'auth_signup.template_user_id', repr(config.auth_signup_template_user_id.id)) diff --git a/addons/auth_signup/res_config.xml b/addons/auth_signup/res_config.xml index 9d3eb4eaa5a..86c56a065a7 100644 --- a/addons/auth_signup/res_config.xml +++ b/addons/auth_signup/res_config.xml @@ -8,6 +8,10 @@ +
    + +