MyBB Hacks

Full Version: Admin Can Login as Any User
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9
After activation, this adds two option to user profiles, only visible to administrators:
  • Login as this user
  • Force logout
The first allows the administrator to effectively login to the account without the user's password.  Everything behaves normally in this login state.  The only difference is that logging out will return the administrator back to their original account.
(note, please don't use this to log into another administrator's account, and then log into some other account from there, though I haven't tried what happens if you do this)

The second option just forces the user to log out if they have logged in somewhere.

Alternative version: Login As by burnacid
Fantastic Plug-in Smile
Thanks for this!
I always liked this Plug-In specifically when it came to logging into my very own personal user account.

Thanks
Awesome plugin. Is there anyway to exclude a user (myself or other admins?)

Thanks, great work!
(08-23-2010 06:34 PM)patrese Wrote: [ -> ]Awesome plugin. Is there anyway to exclude a user (myself or other admins?)
Only through code edits.  You'll probably have to replace checks involving 'cancp' to whatever condition you want to apply.
Ok... lolz, I am not a pro like you

I found the cancp variable, but I don't know what to add there..
Basically I would like to insert an if statement, like "if user is admin and target is not uid=x or uid=y then do hijack"...

Could you maybe give me the line for that?

Thanks in advance and sorry Smile
Find:

PHP Code:
($mybb->usergroup['cancp'] == 'yes' || $mybb->usergroup['cancp'] == 1)

Replace with:

PHP Code:
(($mybb->usergroup['cancp'] == 'yes' || $mybb->usergroup['cancp'] == 1) && !in_array($mybb->user['uid'], array(1,2,3)))


And find:

PHP Code:
($mybb->usergroup['cancp'] != 'yes' && $mybb->usergroup['cancp'] != 1)

Replace with:

PHP Code:
(($mybb->usergroup['cancp'] != 'yes' && $mybb->usergroup['cancp'] != 1) || in_array($mybb->user['uid'], array(1,2,3)))


Replace "1,2,3" with a comma separated list of uids you wish to EXCLUDE.

Haven't tested, but should work.

That was fast!
Thanks, am gonna try it, will let you know, thanks again!
Ok, did that, at first I thought I did something wrong as I did not see any login options anymore myself. As I put myself in the exclude list.

But I think (..) I see what it does. Those that I now excluded are admins that will not have this option working for them when they go to a user's cp.

I thought it would work like I wanted to exclude target users, so all admins have the tool, but some users (like me) are not hi-jackable...

Is that possible at all? If not it's ok, then I will just use it by myself.  

Thanks for your help!
Pages: 1 2 3 4 5 6 7 8 9
Reference URL's