Release Notes

First release.  This plugin has not been well tested.

  • This is definitely very cool, Brett. I still have a Classic Elgg site, where I am able to fix user's icons and things like that, to keep the site looking more presentable. For instance, maybe make a special icon for them, out of the same photo they chose, just cropped and resized, etc. Would this allow to do even that, with Elgg 1.7.3? If so, that would be amazing; it's a feature of the administration that I have been hoping for.

  • @Yakiv This plugin only logs you in as the selected user.  Admins have been able to edit users' profile icons for a quite a while.

  • I don't have a live 1.x site right now (I had one with 1.2 and I don't think I was able to edit user's icons) and didn't have a user base to run into this issue, with a more recent version Elgg site yet. I have been waiting for the 1.7 series to totally stabilize here (hopefully that will be here in 1.7.4) before diving into development on Elgg again. I guess I have a lot to learn still, about what 1.7 can do! ...Just out of curiousity, what version allowed admins to edit user icons?

    ...Since the default Elgg can do things like allow admins to edit user icons, do you have a list of reasons why and how to use your login-as plugin?

    ...Are you sure this is a good reason or use for your plugin: "For example, if a user flags a message in his internal mailbox, there is no easy way for the admin user to view that message." ???

    If a user flags a message, why not have the system send a copy of the message to the Admin? This means that the admin really has no reason to go into someone's inbox. And you could have a popup (for the user) that says, "A carbon copy of this message will be sent to the Admin for review. Are you sure that you want a copy of the message sent?" ...Just an idea.

  • @Yakiv - You can follow the commit history on Trac to find exactly which versions, but there could have been a bug preventing it on earlier versions.  

    Yes, what you recommend would be a better way but isn't implemented.  It's one of the gaps I mentioned in the description.

  • That's great Brett. It's one essential thing I wished to implement; 'impersonation'.

    Still using the 1.5 base so haven't tried it. Does it use a global flag, so admin can click on a link to return from impersonation and log back as the original user? My plan is to simply keep a global 'main user', so when it exists a link will be shown. I think the global structure at least can be added to the base, leaving the implementation to plugins, for a better security and compatibility. Just an idea, as I find the feature very useful on any community based application.

  • A great plugin, should be in core. Good luck developing.

  • @DW - The original user is stored in the session as a guid, but I'm thinking about changing it to the ElggUser object.  If you check out the screen shots you'll see the "Logout as..." link in the topbar.

  • Anyway to make it work with 1.61????

  • This is working on 1.7 but some bug when you try to log back out from the user you are out from you admin account too and another think is that if the plugin is activate you can't get in admin area

  • @Chambo67 - I think it might be as simple as changing the forward() call in the action. REFERER wasn't defined until 1.7.2.

    @Roy - I don't understand what you're reporting.

  • here is the error

    if i change all instances of elgg_extend_view to extend_view, i get no errors, but it does not show at all in menu!!

     

  • @chambo67 - Try upgrade.php?

  • yep, nothing, just aint there??

  • i got curious and re-coded for 1.6.1
    but there seems to be some other 17.x related calls that breaks the topbar after login-as completes ;-(

  • This worked -->

                    //echo "SHUD BE HERE! ";
                    echo elgg_view
                        (
                        //'output/url'
                        'output/confirmlink'
                        ,array    (
                                    'text'     => 'login_as:login_as'
                                    ,'href' => "{$vars['url']}action/login_as?user_guid={$vars['entity']->guid}&__elgg_token=$token&__elgg_ts=$ts"
                                    //,'is_action' => TRUE
                                )
                        );
                    //echo $link;
                    //echo "<br>SHUD BE HERE! ";

    topbar_return.php -->

    seems to causing a problem ;-(

  • I disabled/reenabled and seems to work ok now ;-)

  • spoke too soon.. cannot log back as original user ;- ( moare debugging ;-)

  • found the culprit ;-O
    elgg_add_action_tokens_to_url(
    not exist in 1.6.1

  • REFERER is causing some headache, but overall this more or less works with 1.6.1 ;-)
    I'l be checking into the REFERER situation later.

  • I don't know what I was thinking when I said making it run on 1.6 would be easy--I'm using all new features of 1.7.

    REFERER would be as simple as changing the forward(REFERER) to forward($_SERVER['HTTP_REFERER']);

  •         logout();
            if (login($user)) {
                unset($_SESSION['login_as_original_user_guid']);
                system_message(sprintf(elgg_echo('login_as:logged_in_as_user'), $user->username));

    actually executes in correct sequence;
    did code
    forward($_SERVER['HTTP_REFERER'])
    but "somehow..." browser goes to logged out page ;-(
    I might leave it at this - because the actual Login-As does happen.

  • got it ;-P
    commented out the logout()

  • Brett!! how dare you lead us blindly into the unknown.... nahhh, this is what an open source community is all about right!!, ....  ;-)

  • Great plugin Brett, I saw this functionality in Moodle and I was wondering why in elgg wasn't present.

    Thanks!

Brett

Elgg Core Developer

Project Info

Stats

  • Category: User admin
  • License: GNU General Public License (GPL) version 2
  • Updated: 2015-9-3
  • Downloads: 5941
  • Recommendations: 49

Other Projects

View Brett's plugins