mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
web service MDL-12886 minor optimization
This commit is contained in:
parent
194985dcc0
commit
40e1ba894d
@ -97,9 +97,8 @@ final class user_external extends moodle_external {
|
||||
*/
|
||||
static function tmp_delete_user($params) {
|
||||
global $DB,$USER;
|
||||
|
||||
$user = $DB->get_record('user', array('username'=>$params['username'], 'mnethostid'=>$params['mnethostid']));
|
||||
if (has_capability('moodle/user:delete', get_context_instance(CONTEXT_SYSTEM))) {
|
||||
$user = $DB->get_record('user', array('username'=>$params['username'], 'mnethostid'=>$params['mnethostid']));
|
||||
return delete_user($user); //this function is in moodlelib.php
|
||||
}
|
||||
else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user