I'm trying to make use of IUserEventHandlers to add some custom functionality when a user logs in. I have been using the following post as a guide to try and get this working:
http://www.dnnsoftware.com/answers/how-can-i-handle-the-profile-updated-event
My code is as follows:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DotNetNuke.Framework;
using DotNetNuke.Entities.Users;
using System.Composition;
namespace BusinessLayer.Handlers
{
[Export(typeof(IUserEventHandlers))]
public class UserEventHandlers : IUserEventHandlers
{
TermsController _tc = new TermsController();
public void UserApproved(object sender, UserEventArgs args)
{
}
public void UserAuthenticated(object sender, UserEventArgs args)
{
}
public void UserCreated(object sender, UserEventArgs args)
{
UserInfo userInfo = args.User;
_tc.SignTerms(userInfo.UserID, 0);
}
public void UserDeleted(object sender, UserEventArgs args)
{
}
public void UserRemoved(object sender, UserEventArgs args)
{
}
}
}
The problem I am having is that the methods never seem to be firing. I have also tried using the
IProfileEventHandlers again the same problem. The methods are never hit.
I've seen that some others have been having similar issues with this in recent months and so just wondered if this is an issue or if I am doing something wrong.
I am using DNN version 07.04.01 (280)
Thanks
Scott