Skip to Content Skip to Menu

Login as user

  • ialearn
  • ialearn
  • OFFLINE
  • Posts: 20
  • Thanks: 2
  • Karma: 0
1 year 11 months ago #331866 by ialearn
Login as user was created by ialearn
Hi

In a pre-sales post I wrote which I can't seem to find now I asked if it would be possible to create a login as function, please could you give me an explanation as to how to implement it so that an administrator can login to as a user, we need this functionality to assist students from time to time.

Thanks

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
1 year 11 months ago #331874 by krileon
Replied by krileon on topic Login as user
You can login as another user using the Login / Logout auto action type in CB Auto Actions. Login to our demosites backend below and take a look as we've already examples there since that's how we've implemented the "Sign In As" functionality.

demo.cbdemosites.com/administrator/


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • ialearn
  • ialearn
  • OFFLINE
  • Posts: 20
  • Thanks: 2
  • Karma: 0
1 year 11 months ago #331883 by ialearn
Replied by ialearn on topic Login as user
Hi

I have taken a look at your demo site and have tried to recreate it, I have also taken a look at your documentation on auto actions which sadly gave no additional clarity.
Based on your demo site it seems like you need to create an auto action for each user you want to "login as" I hope this is not the case because I do not feel like creating over 15k auto actions.

I want one auto action that allows any user with "Admin" capabilities to login to any users account who is not an admin or supper user. I want it to be accessible from the back end only, if I can get something like the attached image it would be first prize but if I can get this working any other way I will accept that as well. I can purchase other plugins that add this capability, but I am trying to keep the amount of plugins I use to the absolute minimum.
 

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
1 year 11 months ago #331884 by krileon
Replied by krileon on topic Login as user

Based on your demo site it seems like you need to create an auto action for each user you want to "login as" I hope this is not the case because I do not feel like creating over 15k auto actions.

You don't have to, but yes that's how the demosite is setup. You can have the username, email, or user id login come from a substitution. Example as follows.

Global
Triggers: None
Type: Login / Logout
User: Self
Access: Super Users
Conditions
Field: Custom > Value
Custom Value: [get_loginas]
Operator: Not Empty
Action
Mode: Login
Method: User ID
User ID: [get_loginas]
Force Login: Yes
Redirect: index.php

Now save the auto action. Next under Global you'll have a URL to directly run the auto action. Add &loginas=USER_ID_HERE to the URL and navigate to it to login as that user id. You need to already be logged in as a super user first though.

We don't have backend accessed auto actions. They're all accessed via frontend so it will need some sort of access protections. Whether you do that as an access check done above or you check against a specific token in conditions is up to you. A token check would avoid needing to be logged in on frontend already as a super user. A future CB Auto Actions release will have backend only accessible auto actions.

Additionally as for where you'd render access to this (e.g. a button somewhere) is easy enough as long as the location supports substitutions OR has a trigger with the user to be logged in and outputs its trigger results so you can inject a button via CB Auto Actions. There is no such trigger for CB > User Management though.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum