Admin Can Login as Any User
Author Message
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
(This post was last modified: 06-05-2018 09:30 AM by ZiNgA BuRgA.)
Find all posts by this user
Quote this message in a reply
Download: admhijack.php (3.68 KB)
Plugin Version: 1.2
Last Updated: 11-02-2011, 10:09 PM

Downloads: 4,416
MyBB Compatibility: 1.2.x, 1.4.x, 1.6.x, 1.8.x
Uploader: ZiNgA BuRgA
Imran Offline
Member
***
Posts: 204
Joined: Apr 2010
Post: #2
RE: Admin Can Login as Any User
Fantastic Plug-in Smile

[Image: logo.png]

[Image: twitter.png]
04-26-2010 05:52 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Goggalor Offline
Junior Member
**
Posts: 4
Joined: Feb 2008
Post: #3
RE: Admin Can Login as Any User
Thanks for this!
07-22-2010 07:07 AM
Find all posts by this user Quote this message in a reply
Technoman Offline
Forum Idiot
Posts: 108
Joined: Jun 2010
Post: #4
RE: Admin Can Login as Any User
I always liked this Plug-In specifically when it came to logging into my very own personal user account.

Thanks
(This post was last modified: 07-22-2010 08:54 AM by Technoman.)
07-22-2010 08:51 AM
Find all posts by this user Quote this message in a reply
patrese Offline
Junior Member
**
Posts: 11
Joined: Aug 2010
Post: #5
RE: Admin Can Login as Any User
Awesome plugin. Is there anyway to exclude a user (myself or other admins?)

Thanks, great work!
08-23-2010 06:34 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: Admin Can Login as Any User
(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.

My Blog
08-23-2010 08:00 PM
Find all posts by this user Quote this message in a reply
patrese Offline
Junior Member
**
Posts: 11
Joined: Aug 2010
Post: #7
RE: Admin Can Login as Any User
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
08-23-2010 09:15 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #8
RE: Admin Can Login as Any User
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.


My Blog
08-23-2010 09:20 PM
Find all posts by this user Quote this message in a reply
patrese Offline
Junior Member
**
Posts: 11
Joined: Aug 2010
Post: #9
RE: Admin Can Login as Any User
That was fast!
Thanks, am gonna try it, will let you know, thanks again!
08-23-2010 09:28 PM
Find all posts by this user Quote this message in a reply
patrese Offline
Junior Member
**
Posts: 11
Joined: Aug 2010
Post: #10
RE: Admin Can Login as Any User
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!
(This post was last modified: 08-23-2010 10:33 PM by patrese.)
08-23-2010 10:03 PM
Find all posts by this user Quote this message in a reply


Forum Jump: