Skip to content
Merged
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
8 changes: 1 addition & 7 deletions lbplanner/services/user/update_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class user_update_user extends external_api {
*/
public static function update_user_parameters(): external_function_parameters {
return new external_function_parameters([
'lang' => new external_value(PARAM_TEXT, 'The language the user has selected', VALUE_DEFAULT, null),
'theme' => new external_value(PARAM_TEXT, 'The theme the user has selected', VALUE_DEFAULT, null),
'colorblindness' => new external_value(
PARAM_TEXT,
Expand All @@ -56,7 +55,6 @@ public static function update_user_parameters(): external_function_parameters {

/**
* Updates the given user in the lbplanner DB
* @param string $lang language the user choose
* @param string $theme The theme the user has selected
* @param string $colorblindness The colorblindness the user has selected
* @param int $displaytaskcount The displaytaskcount the user has selected
Expand All @@ -65,13 +63,12 @@ public static function update_user_parameters(): external_function_parameters {
* @throws dml_exception
* @throws invalid_parameter_exception
*/
public static function update_user($lang, $theme, $colorblindness, $displaytaskcount): array {
public static function update_user($theme, $colorblindness, $displaytaskcount): array {
global $DB, $USER;

self::validate_parameters(
self::update_user_parameters(),
[
'lang' => $lang,
'theme' => $theme,
'colorblindness' => $colorblindness,
'displaytaskcount' => $displaytaskcount,
Expand All @@ -83,9 +80,6 @@ public static function update_user($lang, $theme, $colorblindness, $displaytaskc
throw new moodle_exception('User does not exist');
}
$user = user_helper::get_user($USER->id);
if ($lang !== null) {
$user->set_lang($lang);
}
if ($colorblindness !== null) {
$user->set_colorblindness($colorblindness);
}
Expand Down
Loading