misuzu/public-legacy/auth/revert.php

20 lines
413 B
PHP
Raw Permalink Normal View History

2023-05-21 18:15:04 +00:00
<?php
namespace Misuzu;
use Misuzu\Users\User;
if(!isset($userInfoReal) || !$authToken->hasImpersonatedUserId() || !CSRF::validateRequest()) {
url_redirect('index');
return;
}
$authToken->removeImpersonatedUserId();
$authToken->applyCookie();
$impUserId = User::hasCurrent() ? User::getCurrent()->getId() : 0;
url_redirect(
$impUserId > 0 ? 'manage-user' : 'index',
['user' => $impUserId]
);