Upload users
(Redirected from admin/uploaduser)
Location: Administration > Users > Accounts > Upload users
Firstly, note that it is usually not necessary to import users in bulk - to keep maintenance work down you should first explore forms of authentication that do not require manual maintenance, such as connecting to existing external databasesor letting the users create their own accounts. See Manage authentication for more information.
If you are sure you want to import multiple user accounts from a text file, then you need to format your text file as follows:
Contents[hide] |
Upload users file format
- Each line contains fields separated by commas (or other delimiters) without quotes (") and no trailing delimiter
- The first line is special, and contains fieldnames defining the format for the rest of the file.
- Required fields: In any order
username, password, firstname, lastname, email
- Validity checks are performed for:
username
can only contain alphabetical lowercase letters , numbers, hypen '-', underscore '_', period '.', or at-sign '@'Password
should meet the requirements for the site's Password policy. .To force password change, set the password field tochangeme
.email
is in the form: name@example.com .
- Optional fields: To provide values other than the default include one or more of these
institution, department, city, country, lang, auth, ajax, timezone, idnumber, icq, phone1, phone2, address, url, description, mailformat, maildisplay, htmleditor, autosubscribe, emailstop
- Custom profile field names: (Optional). xxxxx is the real custom user profile field name (i.e. the unique shortname)
profile_field_xxxxx
- Create the custom fields BEFORE importing. Use the standard header. The "shortname" for your custom field is xxxxx. The first record must include "profile_field_xxxxx".
- Example: To create a custom field "genre", you must write a shortname "genre" in the new field, and write "profile_field_genre" in the header of the .csv file.
- Special fields: Used for changing of usernames or deleting of users
oldusername
,deleted
- Enrolment fields: (Optional):
course1, type1, role1, group1, enrolperiod1, course2, type2, role2, group2, enrolperiod2
etc.
course
is the "shortname" if present the user will be enrolled in those courses.type
refers to the role to be used for associated course enrolment. Value 1 is default course role, 2 is legacy Teacher role and 3 is legacy Non-editing Teacher.- You can use role field instead to specify roles directly - use either role short name or id (numeric names of roles are not supported).
- Users may be also assigned to groups in course (group1 in course1, group2 in course2, etc.).
- A group is identified by name or id (numeric group names are not supported).
- From Moodle 2.0, you can set the enrolment duration, in days, for each course (
enrolperiod1
forcourse1
,enrolperiod2
forcourse2
, etc.).
Commas within a field must be encoded as , - the script will decode these back to commas.
For Boolean fields, use
0
for false and 1
for true.Turn email off:
emailstop
set to 1
if the email address should be disabled (default: email is enabled):To prevent users from receiving a large number of emails from courses or forced subscription forums use the maildigest. The options for this field are 0 = No digest, 1 = Complete digest and 2 = Digest with just subjects.
Here is an example of a valid upload file:
username, password, firstname, lastname, email, course1, group1
jonest, verysecret, Tom, Jones, jonest@someplace.edu, math102, Section 1
reznort, somesecret, Trent, Reznor, reznort@someplace.edu,math102, Section 3
댓글 없음:
댓글 쓰기