$auth->impersonate()
Become any existing user or disable the current user
$auth->impersonate(string|null $who = null): Kirby\Cms\User|null
Parameters
Name | Type | Default | Description |
---|---|---|---|
$who | string ornull |
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 types
Kirby\Cms\User
ornull
This method modifies the existing $auth
object it is applied to and returns it again.
Exceptions
Type | Description |
---|---|
Kirby\Exception\NotFoundException |
if the given user cannot be found |