Developer forum

Forum » CMS - Standard features » Full Impersonation

Full Impersonation

Adrian Ursu
Reply

Hi Guys,

I amtrying to implement full impersonation on a project.

I am using the sample template from the manual page.

After choosing the impersonee, I could not find a way to determine if the user is impersonating another user or it's just a regular login.

In the old impersonation model, this difference was based on the SecondaryUser information. In the new one it looks like the SecondaryUser is no longer available after impersonation.

On short, I need to know how to determine an impersonation from a regular login and also I want to determine the User that is using the impersonation.

Template tags or API guidance would be fine.

Thanks,

Adrian


Replies

 
Nuno Aguiar
Reply

Hi Adrian,

 

Are you sure it's not a version issue? We use that all the time (with both the full/new and the old impersonation features).

 

We do stuff like this

  • bool isImpersonate = Pageview.User.SecondaryUserUserID != 0;
    OR
  • if(Pageview.User.SecondaryUserID != null) {
                User secondaryUser = User.GetUserByID(Int32.Parse(Pageview.User.SecondaryUserID.ToString()));
    }

 

Does this help?

 

Best Regards,

Nuno

 
Adrian Ursu
Reply

Hi Nuno,

I am using 8.8.1.4.

The problem is that Pageview.User.SecondaryUserUserID = 0

I have the standard impersonation template, I can see the list of users that can be impersonated, I am impersonating a user, the system shows "Logged in as {impersonated user}" but I cannot find any distinction between this case and the case where the ImpersonatedUser logs in regularly.

Adrian

 
Mario Santos
Reply

Hi Adrian,

 

Do you have Group frontend start page set up? I got an issue using it and impersonation a few weeks ago.

http://developer.dynamicweb.com/forum.aspx?PID=48&ThreadID=47399

Hope that could help.

 

BR, Mário

 
Adrian Ursu
Reply

Hi Mario,

Yes I have. From your link it looks like a known bug. I will disable the Front-end page start and try again.

Thank you very much for this. It saves me a lot of headaches.

Adrian

 
Adrian Ursu
Reply

Hi Mario,

I confirm it solved the issue.

Thank you again.

Adrian

 

You must be logged in to post in the forum