MoodleScript: ADD USER

MoodleScript Script Engine

Effect

Creates a user in Moodle.

Syntax

  ADD USER <username> IDENTIFIED BY "<password> HAVING
  firstname: "<firstname>"
  lastname: "<lastname>"
  email: "<email>"
  [ idnumber: "<idnumber>"
    department: "<department"
    ... ]

Examples

  ADD USER harry.potter IDENTIFIED BY "f4t3f*z5'e" HAVING
  firstname: "Harry"
  lastname; "Potter"
  email: "harry.potter@poudlard.edu"
  idnumber: "1ST"
  department: "Gryffindor"

Specific attributes

Default values

Impact on the execution stack context

The current user identifier is set to the id of the created user.

Back to the language index - Back to the component index