Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Adding admin user to contact list after registration new user View modes: 
User avatar
Member
Member
Alex - 2/9/2011 6:48:09 AM
   
Adding admin user to contact list after registration new user
Hello!

I need to add admin user to contact list after registration a new user.

I use code in CustomDataHandler OnAfterInsert

SimpleDataClass dataItemContactList = (SimpleDataClass)dataObj;

if (dataItemContactList.ClassName.ToLower() == "cms.user")
{
UserInfo user = UserInfoProvider.GetUserInfo("administrator");
if (CMSContext.CurrentUser.IsAuthenticated())
{
ContactListInfoProvider.AddToContactList(CMSContext.CurrentUser.UserID, user.UserID);
}

But after registration through registration form CurrentUser is shown as "Public", not a new registerred user.

What is wrong?

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 2/10/2011 5:49:38 AM
   
RE:Adding admin user to contact list after registration new user
Hi,

could you please try to add the administrator to the contact list in the CustomSecurityHandler?

There is a method onAuthentication, where you can check if the user is already authenticated and execute your custom code.

Best regards,
Ivana Tomanickova


User avatar
Member
Member
Alex - 2/10/2011 6:01:41 AM
   
RE:Adding admin user to contact list after registration new user
Thanks!

But I solve problem by adding the code into webpart RegistrationForm.