diff --git a/addons/anonymous/static/src/xml/anonymous.xml b/addons/anonymous/static/src/xml/anonymous.xml
index 4c6d2fcbf54..7429efff458 100644
--- a/addons/anonymous/static/src/xml/anonymous.xml
+++ b/addons/anonymous/static/src/xml/anonymous.xml
@@ -4,10 +4,12 @@
+
+
diff --git a/addons/signup/__init__.py b/addons/signup/__init__.py
new file mode 100644
index 00000000000..d70c1894925
--- /dev/null
+++ b/addons/signup/__init__.py
@@ -0,0 +1,2 @@
+import res_config
+import signup
diff --git a/addons/signup/__openerp__.py b/addons/signup/__openerp__.py
new file mode 100644
index 00000000000..b899d5bc434
--- /dev/null
+++ b/addons/signup/__openerp__.py
@@ -0,0 +1,20 @@
+{
+ 'name': 'Signup',
+ 'description': 'Allow users to sign up',
+ 'author': 'OpenERP SA',
+ 'version': '1.0',
+ 'category': 'Tools',
+ 'website': 'http://www.openerp.com',
+ 'installable': True,
+ 'depends': ['anonymous', 'base_setup'],
+ 'data': [
+ 'res_config.xml',
+ 'signup.xml',
+ ],
+ 'js': [
+ 'static/src/js/signup.js',
+ ],
+ 'qweb': [
+ 'static/src/xml/signup.xml',
+ ],
+}
diff --git a/addons/signup/res_config.py b/addons/signup/res_config.py
new file mode 100644
index 00000000000..53f0513b234
--- /dev/null
+++ b/addons/signup/res_config.py
@@ -0,0 +1,20 @@
+from openerp.osv import osv, fields
+
+class base_config_settings(osv.TransientModel):
+ _inherit = 'base.config.settings'
+
+ _columns = {
+ 'signup_template_user_id': fields.many2one('res.users', 'Template user for signup')
+ }
+
+ def get_default_signup(self, cr, uid, fields, context=None):
+ icp = self.pool.get('ir.config_parameter')
+ return {
+ 'signup_template_user_id': icp.get_param(cr, uid, 'signup.template_user_id', 0) or False
+ }
+
+ def set_signup(self, cr, uid, ids, context=None):
+ config = self.browse(cr, uid, ids[0], context=context)
+ icp = self.pool.get('ir.config_parameter')
+ icp.set_param(cr, uid, 'signup.template_user_id', config.signup_user_template_id.id)
+
diff --git a/addons/signup/res_config.xml b/addons/signup/res_config.xml
new file mode 100644
index 00000000000..d13f7002d17
--- /dev/null
+++ b/addons/signup/res_config.xml
@@ -0,0 +1,16 @@
+
+
+
+ base.config.settings.signup
+ base.config.settings
+
+ form
+
+
+
+
+
+
+
+
+
diff --git a/addons/signup/signup.py b/addons/signup/signup.py
new file mode 100644
index 00000000000..3819a63da85
--- /dev/null
+++ b/addons/signup/signup.py
@@ -0,0 +1,57 @@
+from openerp.osv import osv, fields
+
+class res_users(osv.Model):
+ _inherit = 'res.users'
+
+ _sql_constraints = [
+ ('email_uniq', 'UNIQUE (user_email)', 'You can not have two users with the same email!')
+ ]
+
+class signup_signup(osv.TransientModel):
+ _name = 'signup.signup'
+ _columns = {
+ 'name': fields.char('Name', size=64),
+ 'email': fields.char('Email', size=64),
+ 'password': fields.char('Password', size=64),
+ 'password_confirmation': fields.char('Confirm Password', size=64),
+ 'state': fields.selection([(x, x) for x in 'draft done missmatch'.split()], required=True),
+ }
+ _defaults = {
+ 'state': 'draft',
+ }
+
+ def create(self, cr, uid, values, context=None):
+ # NOTE here, invalid values raises exceptions to avoid storing
+ # sensitive data into the database (which then are available to anyone)
+ if values['password'] != values['password_confirmation']:
+ raise osv.except_osv('Error', 'Passwords missmatch')
+
+ new_user = {
+ 'name': values['name'],
+ 'login': values['email'],
+ 'user_email': values['email'],
+ 'password': values['password'],
+ 'active': True,
+ }
+
+ user_template_id = self.pool.get('ir.config_parameter').get_param(cr, uid, 'signup.user_template_id', 0)
+ if user_template_id:
+ self.pool.get('res.users').copy(cr, 1, user_template_id, new_user, context=context)
+ else:
+ self.pool.get('res.users').create(cr, 1, new_user, context=context)
+
+ # Dont store the password
+ values = {'state': 'done'}
+ return super(signup_signup, self).create(cr, uid, values, context)
+
+ def signup(self, cr, uid, ids, context=None):
+ return {
+ 'type': 'ir.actions.client',
+ 'tag': 'login',
+ }
+
+ def onchange_pw(self, cr, uid, ids, pw, cpw, context=None):
+ if pw != cpw:
+ return {'value': {'state': 'missmatch'}}
+ return {'value': {'state': 'draft'}}
+
diff --git a/addons/signup/signup.xml b/addons/signup/signup.xml
new file mode 100644
index 00000000000..3dacf85feb4
--- /dev/null
+++ b/addons/signup/signup.xml
@@ -0,0 +1,41 @@
+
+
+
+
+ signup.signup.form
+ signup.signup
+ form
+
+
+
+
+
+
+ signup.signup
+ ir.actions.act_window
+ signup.signup
+ form
+ form
+ new
+
+
+
+
diff --git a/addons/signup/static/src/js/signup.js b/addons/signup/static/src/js/signup.js
new file mode 100644
index 00000000000..aa469512b5b
--- /dev/null
+++ b/addons/signup/static/src/js/signup.js
@@ -0,0 +1,21 @@
+openerp.signup = function(instance) {
+
+ instance.web.UserMenu.include({
+ start: function() {
+ var self = this;
+ this._super.apply(this, arguments);
+ this.$element.find('a.oe_topbar_signup').click(function() {
+ var p = self.getParent();
+ var am = p.action_manager;
+ am.do_action({
+ type:'ir.actions.act_window',
+ res_model: 'signup.signup',
+ views: [[false, 'form']],
+ target: 'new',
+ name: 'Sign Up'
+ });
+ });
+ }
+ });
+
+};
diff --git a/addons/signup/static/src/xml/signup.xml b/addons/signup/static/src/xml/signup.xml
new file mode 100644
index 00000000000..c6c7f555ecd
--- /dev/null
+++ b/addons/signup/static/src/xml/signup.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+