diff --git a/addons/website_auth_signup/__init__.py b/addons/website_auth_signup/__init__.py new file mode 100644 index 00000000000..a593a9f2682 --- /dev/null +++ b/addons/website_auth_signup/__init__.py @@ -0,0 +1,22 @@ +# -*- 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 diff --git a/addons/website_auth_signup/__openerp__.py b/addons/website_auth_signup/__openerp__.py new file mode 100644 index 00000000000..346008ba06c --- /dev/null +++ b/addons/website_auth_signup/__openerp__.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2010-2012 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': 'Website integration for Signup', + 'version': '1.0', + 'category': 'Hidden', + 'description': """ +Allow users to sign up on the Website +===================================== +""", + 'author': 'OpenERP SA', + 'website': 'http://www.openerp.com', + 'depends': ['auth_signup', 'website'], + 'data': [], + 'js': [], + 'css': [], + 'qweb': [], + 'installable': True, + 'auto_install': True, +} diff --git a/addons/website_auth_signup/controllers/__init__.py b/addons/website_auth_signup/controllers/__init__.py new file mode 100644 index 00000000000..e11f9ba81bb --- /dev/null +++ b/addons/website_auth_signup/controllers/__init__.py @@ -0,0 +1,3 @@ +import main + +# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/website_auth_signup/controllers/main.py b/addons/website_auth_signup/controllers/main.py new file mode 100644 index 00000000000..8b5f8d00d48 --- /dev/null +++ b/addons/website_auth_signup/controllers/main.py @@ -0,0 +1,20 @@ +import openerp +from openerp import http +from openerp.http import request, LazyResponse + +class AuthSignupWebsiteLogin(openerp.addons.web.controllers.main.Home): + @http.route(website=True, auth="public", multilang=True) + def web_auth_signup(self, *args, **kw): + response = super(AuthSignupWebsiteLogin, self).web_auth_signup(*args, **kw) + if isinstance(response, LazyResponse): + response = request.website.render(response.params['template'], response.params['values']) + return response + + @http.route(website=True, auth="public", multilang=True) + def web_auth_reset_password(self, *args, **kw): + response = super(AuthSignupWebsiteLogin, self).web_auth_reset_password(*args, **kw) + if isinstance(response, LazyResponse): + response = request.website.render(response.params['template'], response.params['values']) + return response + +# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4: