This patch adds user invitations, a way for existing users on a site
to send an email to their friends and invite them to create an account on the site. The feature is enabled or disabled in the site Settings. (Operation/Settings.pm) It is implemented as a new operation, Invite (Operation/Invite.pm, Help/Invite.pm, i18n/English/Invite.pm), and the option is displayed as an option on the user's account screen. (Operation/Shared.pm). The form is templated, and lives in the Invite namespace. Once the invitation is submitted, if the user's email address is not already in WebGUI, an email is sent and a record is stored in the userInvitations table. When the friend gets the invitation, they are taken to the account creation screen, which conveniently has their email address already filled in. This required changes in the Auth modules (Auth.pm, Auth/*.pm), and ProfileField.pm. The latter was so that profile fields can have their values manually set. The former changes handle inserting the email address, bypassing the anonymous registration check, and updating the record in ther userInvitations table. I refactored some code out of the AdminConsole for finding the url back to the site and added it to Session/Url.pm. The method is called getBackToSiteUrl.
This commit is contained in:
parent
32f7866f3b
commit
21c4fcb75f
18 changed files with 586 additions and 28 deletions
54
lib/WebGUI/Help/Invite.pm
Normal file
54
lib/WebGUI/Help/Invite.pm
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
package WebGUI::Help::Invite;
|
||||
|
||||
our $HELP = {
|
||||
|
||||
'invite form template' => {
|
||||
title => 'invite form template title',
|
||||
body => 'invite form template body',
|
||||
variables => [
|
||||
{
|
||||
name => 'inviteFormError',
|
||||
required => 1,
|
||||
},
|
||||
{
|
||||
name => 'formHeader',
|
||||
required => 1,
|
||||
},
|
||||
{
|
||||
name => 'formFooter',
|
||||
required => 1,
|
||||
},
|
||||
{
|
||||
name => 'title',
|
||||
},
|
||||
{
|
||||
name => 'emailAddressLabel',
|
||||
},
|
||||
{
|
||||
name => 'emailAddressForm',
|
||||
},
|
||||
{
|
||||
name => 'subjectLabel',
|
||||
},
|
||||
{
|
||||
name => 'subjectForm',
|
||||
},
|
||||
{
|
||||
name => 'messageLabel',
|
||||
},
|
||||
{
|
||||
name => 'messageForm',
|
||||
},
|
||||
{
|
||||
name => 'submitButton',
|
||||
},
|
||||
],
|
||||
fields => [
|
||||
],
|
||||
related => [
|
||||
]
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1; ##All perl modules must return true
|
||||
Loading…
Add table
Add a link
Reference in a new issue