Commit bf5693e5 authored by Robert Lyon's avatar Robert Lyon Committed by Aaron Wells

Bug 1630753: Save the studentid and preferredname fields via webservices

When creating a user

behatnotneeded

Change-Id: I8e442cbda497cfc1cb39fd5395d7c07c7c148dd2
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit befa5bc8)
parent 3df7f98c
......@@ -168,13 +168,6 @@ class mahara_user_external extends external_api {
$new_user->passwordchange = (int)$user['forcepasswordchange'];
}
if (isset($user['studentid'])) {
$new_user->studentid = $user['studentid'];
}
if (isset($user['preferredname'])) {
$new_user->preferredname = $user['preferredname'];
}
// handle profile fields
$profilefields = new StdClass;
$remoteuser = null;
......@@ -187,6 +180,16 @@ class mahara_user_external extends external_api {
$profilefields->{$field} = $user[$field];
}
}
// The student id and preferredname get saved as an artefact and to usr table
if (isset($user['studentid'])) {
$new_user->studentid = $user['studentid'];
$profilefields->studentid = $user['studentid'];
}
if (isset($user['preferredname'])) {
$new_user->preferredname = $user['preferredname'];
$profilefields->preferredname = $user['preferredname'];
}
$new_user->id = create_user($new_user, $profilefields, $institution, $authinstance, $remoteuser);
$addedusers[] = $new_user;
$userids[] = array('id'=> $new_user->id, 'username'=>$user['username']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment