Commit 10b13ad2 authored by Richard Mansfield's avatar Richard Mansfield Committed by Gerrit Code Review
Browse files

Merge "Make 'Student ID' specific for the institution when using LDAP (bug #918442)"

parents 5711c83e fce5c16c
......@@ -144,9 +144,24 @@ class AuthLdap extends Auth {
if (!empty($ldapdetails[$field]) && ($user->$field != $ldapdetails[$field])) {
$user->$field = $ldapdetails[$field];
set_profile_field($user->id, $field, $ldapdetails[$field]);
if (('studentid' == $field) && ('mahara' != $this->institution)) {
// studentid is specific for the institution, so store it there too.
$dataobject = array(
'usr' => $user->id,
'institution' => $this->institution,
'ctime' => db_format_timestamp(time()),
'studentid' => $user->studentid,
);
$whereobject = $dataobject;
unset($whereobject['ctime']);
unset($whereobject['studentid']);
ensure_record_exists('usr_institution', $whereobject, $dataobject);
unset($dataobject);
unset($whereobject);
}
}
}
}
}
return true;
}
}
......
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