mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
fixed define detection
This commit is contained in:
parent
1493741406
commit
894843b465
1 changed files with 2 additions and 2 deletions
|
@ -529,7 +529,7 @@ class course_enrolment_manager {
|
|||
try {
|
||||
role_unassign($roleid, $user->id, $this->context->id, '', NULL);
|
||||
} catch (Exception $e) {
|
||||
if (is_defined('AJAX_SCRIPT')) {
|
||||
if (defined('AJAX_SCRIPT')) {
|
||||
throw $e;
|
||||
}
|
||||
return false;
|
||||
|
@ -547,7 +547,7 @@ class course_enrolment_manager {
|
|||
public function assign_role_to_user($roleid, $userid) {
|
||||
require_capability('moodle/role:assign', $this->context);
|
||||
if (!array_key_exists($roleid, $this->get_assignable_roles())) {
|
||||
if (is_defined('AJAX_SCRIPT')) {
|
||||
if (defined('AJAX_SCRIPT')) {
|
||||
throw new moodle_exception('invalidrole');
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue