Allow login-as for admin members, protect only super admin (member_srl=4)

Changed the restriction so admins can login as other admin accounts,
but member_srl 4 (super admin) is protected from impersonation.

Co-authored-by: Lastorder-DC <18280396+Lastorder-DC@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-03-02 04:11:36 +00:00
parent d6486a0415
commit 4b32a2fc37
2 changed files with 4 additions and 3 deletions

View file

@ -1829,13 +1829,14 @@ class MemberAdminController extends Member
throw new Rhymix\Framework\Exceptions\InvalidRequest;
}
// Do not allow login as another admin
if($member_info->is_admin === 'Y')
// Do not allow login as the super admin (member_srl = 4)
if(intval($member_info->member_srl) === 4)
{
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
// Perform login as the target member
// Session::login() sets the basic session variables, and setSessionInfo() populates Context with member details
Rhymix\Framework\Session::login($member_info->member_srl);
$oMemberController = getController('member');
$oMemberController->setSessionInfo();