DemoLogin
in package
Config-gated simulated Google site login (no Google account).
Table of Contents
Constants
- PERSONA_INSTRUCTORS : mixed = 5
- PERSONA_STUDENTS : mixed = 10
Methods
- isEnabled() : mixed
- True when /login/simulate may be used.
- persona() : array<string|int, mixed>|null
- personas() : array<string, array<string|int, mixed>>
- Fixed catalog of 15 personas keyed by id (instructor-01 .. student-10).
- secretMatches() : mixed
- Timing-safe check of a posted secret against $CFG->qa_demo_secret.
- sessionOptions() : array<string|int, mixed>
- Options for GoogleLoginService::establishSiteSession().
- simulateUrl() : mixed
- URL of the simulate form (same host as /login).
Constants
PERSONA_INSTRUCTORS
public
mixed
PERSONA_INSTRUCTORS
= 5
PERSONA_STUDENTS
public
mixed
PERSONA_STUDENTS
= 10
Methods
isEnabled()
True when /login/simulate may be used.
public
static isEnabled() : mixed
persona()
public
static persona(string $id) : array<string|int, mixed>|null
Parameters
- $id : string
Return values
array<string|int, mixed>|nullpersonas()
Fixed catalog of 15 personas keyed by id (instructor-01 .. student-10).
public
static personas() : array<string, array<string|int, mixed>>
Return values
array<string, array<string|int, mixed>>secretMatches()
Timing-safe check of a posted secret against $CFG->qa_demo_secret.
public
static secretMatches(mixed $posted) : mixed
Supports plaintext or sha256:... like $CFG->adminpw.
Parameters
- $posted : mixed
sessionOptions()
Options for GoogleLoginService::establishSiteSession().
public
static sessionOptions(array<string|int, mixed> $persona) : array<string|int, mixed>
Instructors get create_courses only. Site-course membership is always learner (same as a normal Google login).
Parameters
- $persona : array<string|int, mixed>
Return values
array<string|int, mixed>simulateUrl()
URL of the simulate form (same host as /login).
public
static simulateUrl() : mixed