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:
Colin Kuskie 2007-06-10 16:38:43 +00:00
parent 32f7866f3b
commit 21c4fcb75f
18 changed files with 586 additions and 28 deletions

View file

@ -0,0 +1,128 @@
package WebGUI::i18n::English::Invite;
our $I18N = {
'invite a friend title' => {
message => q|Invite A Friend|,
lastUpdated => 1181103900,
},
'default invite' => {
message => q|I'm a member of a site that I thought you would find very useful, so I'm sending this invitation hoping you'll join me here. Click on the link below to register.|,
lastUpdated => 1181106351,
},
'missing email' => {
message => q|The invitation cannot be sent because you did not enter an email address.|,
lastUpdated => 1181409056,
},
'missing message' => {
message => q|Your invitiation must have a message.|,
lastUpdated => 1181409432,
},
'missing subject' => {
message => q|Your invitation must have a subject.|,
lastUpdated => 1181409433,
},
'already a member' => {
message => q|Already a member.|,
lastUpdated => 1181410226,
},
'invitation sent' => {
message => q|Your invitation has been sent.|,
lastUpdated => 1181410226,
},
'invalid invite code' => {
message => q|Invalid invitation code|,
lastUpdated => 1181428043,
},
'invalid invite code message' => {
message => q|The invitation code in your URL is invalid.|,
lastUpdated => 1181410226,
},
'already a member message' => {
message => q|The invitation code in your URL is invalid.|,
lastUpdated => 1181410226,
context => q|This message is displayed when someone who is already signed up tries to use an invite code.|,
},
'invite form template title' => {
message => q|User Invitation Form Template|,
lastUpdated => 1181492752,
},
'invite form template body' => {
message => q|This template is used to customize and display the form that users fill out to invite friends to create an account.|,
lastUpdated => 1181492842,
},
'inviteFormError' => {
message => q|Any errors from submitting the form. Error messages are internationalized.|,
lastUpdated => 1181492842,
},
'formHeader' => {
message => q|HTML code for starting the form.|,
lastUpdated => 1181492842,
},
'formFooter' => {
message => q|HTML code for ending the form.|,
lastUpdated => 1181492842,
},
'title' => {
message => q|An internationalized title for the form.|,
lastUpdated => 1181492842,
},
'emailAddressLabel' => {
message => q|An internationalized label for the email address field.|,
lastUpdated => 1181492842,
},
'emailAddressForm' => {
message => q|HTML code for the email address field.|,
lastUpdated => 1181492842,
},
'subjectLabel' => {
message => q|An internationalized label for the subject field.|,
lastUpdated => 1181492842,
},
'subjectForm' => {
message => q|HTML code for the subject field.|,
lastUpdated => 1181492842,
},
'messageLabel' => {
message => q|An internationalized label for the message field.|,
lastUpdated => 1181492842,
},
'messageForm' => {
message => q|HTML code for the message field.|,
lastUpdated => 1181492842,
},
'submitButton' => {
message => q|HTML code for the submit button, with internationalized label.|,
lastUpdated => 1181492842,
},
'topicName' => {
message => q|User Invitations.|,
lastUpdated => 1181493546,
},
};
1;

View file

@ -3676,10 +3676,9 @@ and tracked by WebGUI.|,
lastUpdated => 1163457062,
},
'Enable passive profiling description' => {
message => q|Used in conjunction with Metadata, this keeps a record of every wobject viewed by
a user.|,
lastUpdated => 1167189802,
'Enable user invitations description' => {
message => q|Enable users to send emails to their friends, inviting them to come and create an account on this site.|,
lastUpdated => 1181017746,
},
'164 description' => {
@ -3788,6 +3787,17 @@ Select which of the configured LDAP connections to use to authenticate users.
lastUpdated => 1089039511
},
'Enable passive profiling description' => {
message => q|Used in conjunction with Metadata, this keeps a record of every wobject viewed by
a user.|,
lastUpdated => 1167189802,
},
'Enable user invitations' => {
message => q|Enable user invitations?|,
lastUpdated => 1181017730
},
'Illegal Warning' => {
message => q|Enabling this feature is illegal in some countries, like Australia. In addition, some countries require you to add a warning to your site if you use this feature. Consult your local authorities for local laws. Plain Black Corporation is not responsible for your illegal activities, regardless of ignorance or malice.|,
lastUpdated => 1089039511
@ -4077,6 +4087,21 @@ Get a copy of wget and use this: <code>wget -p -r --html-extension -k http://the
lastUpdated => 1161388472,
},
'invite a friend' => {
message => q|Invite a friend|,
lastUpdated => 1181019679,
},
'user invitations email exists' => {
message => q|Email exists message|,
lastUpdated => 1181277915
},
'user invitations email exists description' => {
message => q|This is the message displayed to users who try to invite someone whose email address already exists in the system.|,
lastUpdated => 1181277914,
},
};
1;