|
static | get_context_user_can_login_as (stdClass $currentuser, stdClass $loginasuser, ?stdClass $course=null) |
| Determine which context a user can login as another user for, given the requested target user and course.
|
|
◆ get_context_user_can_login_as()
static core\session\loginas_helper::get_context_user_can_login_as |
( |
stdClass | $currentuser, |
|
|
stdClass | $loginasuser, |
|
|
?stdClass | $course = null ) |
|
static |
Determine which context a user can login as another user for, given the requested target user and course.
If the person cannot login at all, then null will be returned.
- Parameters
-
stdClass | $currentuser | The current user. Defaults to $USER. |
stdClass | $loginasuser | The user to be logged in as. |
stdClass | null | $course | The course currently being looked at. Applies to those who can only login within a course context. If null, then only system context will be considered. |
- Return values
-
context|null | Returns the context that the user is able to login as, or null if no context can be found. |
The documentation for this class was generated from the following file:
- lib/classes/session/loginas_helper.php