diff options
| author | Nimesh (Open ERP) <nco@tinyerp.com> | 2012-12-10 12:38:25 +0530 |
|---|---|---|
| committer | Nimesh (Open ERP) <nco@tinyerp.com> | 2012-12-10 12:38:25 +0530 |
| commit | 504f10c220cffa9d19caa4846b261ae7c8dbc1ce (patch) | |
| tree | 7d391f9f23543c827ba97e41a1297a5ebc3969d2 /addons/auth_reset_password/controllers/main.py | |
| parent | 3defbc23a130b411997dea30f52d0c78e9cfff07 (diff) | |
| parent | 7f1d5daf2f7a137a470a4a72779408edf7995910 (diff) | |
[MERGE] with trunk
bzr revid: nco@tinyerp.com-20121210070825-5rgigvkb1nb3hu30
Diffstat (limited to 'addons/auth_reset_password/controllers/main.py')
| -rw-r--r-- | addons/auth_reset_password/controllers/main.py | 52 |
1 files changed, 0 insertions, 52 deletions
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 (<http://www.openerp.com>) -# -# 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 <http://www.gnu.org/licenses/> -# -############################################################################## -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: |
