Skip to content

Kirby 3.9.8

$auth->impersonate()

Become any existing user or disable the current user

$auth->impersonate(?string $who = null): Kirby\Cms\User|null

Parameters

Name Type Default Description
$who string|null null User ID or email address,
null to use the actual user again,
'kirby' for a virtual admin user or
'nobody' to disable the actual user

Return type

Kirby\Cms\User|null

Exceptions

Type Description
Kirby\Exception\NotFoundException if the given user cannot be found

Parent class

Kirby\Cms\Auth