meteor/meteor — pull request #606 by uniring (2013-01-15 00:53:13+00:00)
Title: Add extraSignupFields config option to Accounts.ui

Allows you to define extra fields for Accounts.ui signup form.

The fields must have a fieldName and fieldLabel attributes and can have
visible and validate functions. If you don't specify a visible function it will be visible by default, also if you don't set a validate function it will be valid by default.

The info introduced in those fields is putted into the account profile's data using fieldName's value as attribute's name.

The validate functions are called with two arguments, value and errorFn. Value contains the submitted value for that field and errorFn is a function you can call with a custom error message as a string.

An usage example:

```javascript
Accounts.ui.config({
requestPermissions: {
facebook: ['email'],
},
passwordSignupFields: 'EMAIL_ONLY',
extraSignupFields: [{
fieldName: 'name',
fieldLabel: 'Name',
validate: function(value, errorFn) {
if (value == '') {
errorFn('Name must have a value');
return false;
}
return true;
}
},{
fieldName: 'surname',
fieldLabel: 'Surname'
}]
});
```

This will add two fields to the signup form and save the entered values to profile.name and profile.surname user attributes.