Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lbplanner/classes/model/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ public function prepare_for_api_short(): array {
'firstname' => $mdluser->firstname,
'lastname' => $mdluser->lastname,
'profileimageurl' => $this->get_pfp(),
'capabilities' => $capabilitybm,
];

if ($capabilitybm & CAPABILITY_FLAG::STUDENT && strlen($mdluser->address) > 0) {
Expand All @@ -306,6 +307,7 @@ public static function api_structure_short(): external_single_structure {
'lastname' => new external_value(PARAM_TEXT, 'The lastname of the user'),
'profileimageurl' => new external_value(PARAM_URL, 'The url of the profile image'),
'vintage' => new external_value(PARAM_TEXT, 'The vintage of the user', VALUE_DEFAULT),
'capabilities' => new external_value(PARAM_INT, 'The capabilities of the user represented as a bitmask value'),
]
);
}
Expand All @@ -324,7 +326,6 @@ public function prepare_for_api(): array {
'planid' => $this->get_planid(),
'colorblindness' => $this->colorblindness,
'displaytaskcount' => $this->displaytaskcount,
'capabilities' => $this->get_capabilitybitmask(),
'email' => $mdluser->email,
]
);
Expand Down
2 changes: 1 addition & 1 deletion lbplanner/services/user/get_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static function get_user(): array {
// Checks if the user is enrolled in LB Planner.
if (!user_helper::check_user_exists($USER->id)) {
// Register user if not found.
$lbplanneruser = new user(0, $USER->id, 'default', 'en', 'none', 1);
$lbplanneruser = new user(0, $USER->id, 'default', 'none', 1);
$lbpid = $DB->insert_record(user_helper::LB_PLANNER_USER_TABLE, $lbplanneruser->prepare_for_db());
$lbplanneruser->set_fresh($lbpid);

Expand Down
Loading