From: skodak Date: Thu, 1 May 2008 22:36:08 +0000 (+0000) Subject: MDL-14617 removed isstudent() - yay! X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=1b4923215ad3885879b6d1b694a693afc3fda000;p=moodle.git MDL-14617 removed isstudent() - yay! --- diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index d42c54ea9c..8947ba2fd2 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -170,33 +170,6 @@ function iscreator ($userid=0) { or has_capability('moodle/legacy:admin', $context, $userid, false)); } -/** - * Determines if a user is a student in the specified course - * - * If the course id specifies the site then this determines - * if the user is a confirmed and valid user of this site. - * - * @uses $CFG - * @uses SITEID - * @param int $courseid The id of the course being tested - * @param int $userid The user being tested. You can set this to 0 or leave it blank to test the currently logged in user. - * @return bool - */ -function isstudent($courseid=0, $userid=0) { - global $CFG; - - if (empty($CFG->rolesactive)) { - return false; - } - - if ($courseid == 0) { - $context = get_context_instance(CONTEXT_SYSTEM); - } else { - $context = get_context_instance(CONTEXT_COURSE, $courseid); - } - - return has_capability('moodle/legacy:student', $context, $userid, false); -} /** * Determines if the specified user is logged in as guest.