Various fixes to "start" operation in Invite Web Script

- Fixed bug where "start invite" web script operation was always generating a new disabled invitee account, even if an account for a user with the given invitee email address already existed.
- Make sure that invitee ONLY receives account details in invitation email if a disabled invitee account has just been created for invitee prior to sending out the email (i.e. if there was no pre-existing account for the invitee and thus a disabled invitee account had to be created)
- Breaking out the long "start invite" web script method into various helper methods
- Throw web script exception if "start invite" web script operation hasn't been able to generate a unique user name for the given invitee email address after 10 attempts.
- If "start invite" web script operation detects that a person already exists in the repository with the given invitee email address, then use that existing person as the invitee (instead of always creating a new person node for the given invitee email address)  
- Throw Web Script exception if "start invite" web script operation detects that given invitee is already a member of the given site
- Added more comments to the code

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10405 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Glen Johnson
2008-08-18 16:38:38 +00:00
parent db52f6c045
commit da322f33ca
4 changed files with 340 additions and 96 deletions

View File

@@ -19,6 +19,20 @@
mail.parameters.subject = "Invitation to Alfresco Share Site "
+ "'" + wf_siteShortName +"'";
mail.parameters.from = inviterPerson.properties["cm:email"];
var mail_text_invitee_account_section = "";
if (wf_inviteeGenPassword != null)
{
mail_text_invitee_account_section = "An account has been "
+ "created for you with user name: " + wf_inviteeUserName
+ ".\n"
+ "This account is initially disabled. However it will be "
+ "enabled if you accept the invitation, but only after your "
+ "response has been received and processed.\n\n"
+ "An initial password has been generated for you: "
+ wf_inviteeGenPassword + ".\n"
+ "You are strongly advised to change it to a password of "
+ "your choice once you have logged into Alfresco Share.\n\n";
}
mail.parameters.text = "Dear " + wf_inviteeFirstName + ",\n\n"
+ "You have been invited to join a site on Alfresco Share: "
+ wf_siteShortName + "\n\n"
@@ -26,22 +40,17 @@
+ "'" + wf_siteShortName + "', "
+ "please follow this link:\n"
+ wf_serverPath
+ "/alfresco/service/api/inviteresponse/accept?format=html&"
+ "inviteId=" + workflowId
+ "/alfresco/service/api/inviteresponse/accept?format=html"
+ "&inviteId=" + workflowId
+ "&inviteeUserName=" + wf_inviteeUserName
+ "&siteShortName=" + wf_siteShortName + "\n\n"
+ "An account has been created for you with user name: "
+ wf_inviteeUserName + ".\n\n"
+ "An initial password has been generated for you: "
+ wf_inviteeGenPassword + ".\n"
+ "You are strongly advised to change it to a password of your choice once you "
+ "have logged into Alfresco Share.\n\n"
+ mail_text_invitee_account_section
+ "To reject the invitation to join the site "
+ "'" + wf_siteShortName + "', "
+ "please follow this link:\n"
+ wf_serverPath
+ "/alfresco/service/api/inviteresponse/reject?format=html&"
+ "inviteId=" + workflowId
+ "/alfresco/service/api/inviteresponse/reject?format=html"
+ "&inviteId=" + workflowId
+ "&inviteeUserName=" + wf_inviteeUserName
+ "&siteShortName=" + wf_siteShortName;
mail.execute(bpm_package);