Merge branch 'MDL-49821-master-master' of git://github.com/jleyva/moodle
[moodle.git] / user / externallib.php
index dbb384c..e31f488 100644 (file)
@@ -1389,14 +1389,7 @@ class core_user_external extends external_api {
 
         $course = get_course($params['courseid']);
         $user = core_user::get_user($params['userid'], '*', MUST_EXIST);
-
-        if ($user->deleted) {
-            throw new moodle_exception('userdeleted');
-        }
-        if (isguestuser($user)) {
-            // Can not view profile of guest - thre is nothing to see there.
-            throw new moodle_exception('invaliduserid');
-        }
+        core_user::require_active_user($user);
 
         if ($course->id == SITEID) {
             $coursecontext = context_system::instance();;