Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)

100986: Merged 5.0.N (5.0.2) to HEAD-BUG-FIX (5.1/Cloud)
      100829: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.2)
         100693: Merged DEV to V4.2-BUG-FIX (4.2.5)
            89520 : MNT-12597: Share: Accepting site invitation via email does not show on the 'Completed Task' task.
               - Using asignee from request parameter


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@101001 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-04-01 01:25:45 +00:00
parent d65016321b
commit 415f7fee2c

View File

@@ -79,10 +79,10 @@ public class InviteResponse extends DeclarativeWebScript
protected Map<String, Object> executeImpl(final WebScriptRequest req, final Status status)
{
String tenantDomain = TenantService.DEFAULT_DOMAIN;
final String inviteeUserName = req.getParameter(PARAM_INVITEE_USER_NAME);
if (tenantService.isEnabled())
{
String inviteeUserName = req.getParameter(PARAM_INVITEE_USER_NAME);
if (inviteeUserName != null)
{
tenantDomain = tenantService.getUserDomain(inviteeUserName);
@@ -94,7 +94,23 @@ public class InviteResponse extends DeclarativeWebScript
{
public Map<String, Object> doWork() throws Exception
{
return execute(req, status);
String oldUser = null;
try
{
if (inviteeUserName != null && !inviteeUserName.equals(oldUser))
{
oldUser = AuthenticationUtil.getFullyAuthenticatedUser();
AuthenticationUtil.setFullyAuthenticatedUser(inviteeUserName);
}
return execute(req, status);
}
finally
{
if (oldUser != null && !oldUser.equals(inviteeUserName))
{
AuthenticationUtil.setFullyAuthenticatedUser(oldUser);
}
}
}
}, tenantDomain);
}