Skip to content

Commit

Permalink
add auth type and suspension status to user details
Browse files Browse the repository at this point in the history
  • Loading branch information
my-curiosity committed Dec 19, 2023
1 parent a582799 commit ae6e953
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
5 changes: 5 additions & 0 deletions classes/external.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@ public static function get_user_information($userid) {
'showtimecreated' => get_config('tool_supporter', 'user_details_showtimecreated'),
'showtimemodified' => get_config('tool_supporter', 'user_details_showtimemodified'),
'showlastlogin' => get_config('tool_supporter', 'user_details_showlastlogin'),
'showsuspension' => get_config('tool_supporter', 'user_details_showsuspension'),
'showauthtype' => get_config('tool_supporter', 'user_details_showauthtype'),
];

// Get level labels.
Expand Down Expand Up @@ -492,6 +494,7 @@ public static function get_user_information_returns() {
'lang' => new external_value(PARAM_TEXT, 'lang of the user'),
'auth' => new external_value(PARAM_TEXT, 'auth of the user'),
'idnumber' => new external_value(PARAM_TEXT, 'idnumber of the user'),
'suspended' => new external_value(PARAM_BOOL, 'suspension of the user'),
]),
'config' => new external_single_structure(( [
'showusername' => new external_value(PARAM_BOOL, "Show username of user in user details"),
Expand All @@ -502,6 +505,8 @@ public static function get_user_information_returns() {
'showtimecreated' => new external_value(PARAM_BOOL, "Show time created of user in user details"),
'showtimemodified' => new external_value(PARAM_BOOL, "Show time modified of user in user details"),
'showlastlogin' => new external_value(PARAM_BOOL, "Show last login of user in user details"),
'showsuspension' => new external_value(PARAM_BOOL, "Show suspension status of user in user details"),
'showauthtype' => new external_value(PARAM_BOOL, "Show auth type of user in user details"),
])),
'userscourses' => new external_multiple_structure(new external_single_structure([
'id' => new external_value(PARAM_INT, 'id of course'),
Expand Down
12 changes: 12 additions & 0 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,16 @@
"",
1
));
$settings->add(new admin_setting_configcheckbox(
'tool_supporter/user_details_showsuspension',
get_string('suspended'),
"",
1
));
$settings->add(new admin_setting_configcheckbox(
'tool_supporter/user_details_showauthtype',
get_string('authentication'),
"",
1
));
}
2 changes: 2 additions & 0 deletions templates/user_detail.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ Example context (json):
{{#showtimecreated}}<tr><th>{{#str}}eventusercreated{{/str}}</th><td>{{timecreated}}</td></tr>{{/showtimecreated}}
{{#showtimemodified}}<tr><th>{{#str}}lastmodified{{/str}}</th><td>{{timemodified}}</td></tr>{{/showtimemodified}}
{{#showlastlogin}}<tr><th>{{#str}}lastlogin{{/str}}</th><td>{{lastlogin}}</td></tr>{{/showlastlogin}}
{{#showsuspension}}<tr><th>{{#str}}suspended{{/str}}</th><td>{{suspended}}</td></tr>{{/showsuspension}}
{{#showauthtype}}<tr><th>{{#str}}authentication{{/str}}</th><td>{{auth}}</td></tr>{{/showauthtype}}
{{/config}}{{/userinformation}}
</tbody>
</table>
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2023120500; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2023121300; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022041900; // Requires Moodle version 4.0 or higher.
$plugin->component = 'tool_supporter'; // Full name of the plugin (used for diagnostics).
$plugin->release = 'v4-r2';
$plugin->release = 'v4-r3';
$plugin->maturity = MATURITY_STABLE;

0 comments on commit ae6e953

Please sign in to comment.