GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 16-16 lines in 2 locations

view.php 1 location

@@ 34-49 (lines=16) @@
31
32
$context = context::instance_by_id($contextid);
33
$instanceid = $context->instanceid;
34
if ($context instanceof context_module) {
35
    $availability = $DB->get_field('course_modules', 'availability', array('id' => $instanceid), MUST_EXIST);
36
    $availability = json_decode($availability);
37
    foreach ($availability->c as $condition) {
38
        if ($condition->type == 'paypal') {
39
            // TODO: handle more than one paypal for this context.
40
            $paypal = $condition;
41
            break;
42
        } else {
43
            print_error('no paypal condition for this context.');
44
        }
45
    }
46
} else {
47
    // TODO: handle sections.
48
    print_error('support to sections not yet implemented.');
49
}
50
$coursecontext = $context->get_course_context();
51
$course = $DB->get_record('course', array('id' => $coursecontext->instanceid));
52

ipn.php 1 location

@@ 92-107 (lines=16) @@
89
}
90
91
$instanceid = $context->instanceid;
92
if ($context instanceof context_module) {
93
    $availability = $DB->get_field('course_modules', 'availability', array('id' => $instanceid), MUST_EXIST);
94
    $availability = json_decode($availability);
95
    foreach ($availability->c as $condition) {
96
        if ($condition->type == 'paypal') {
97
            // TODO: handle more than one paypal for this context.
98
            $paypal = $condition;
99
            break;
100
        } else {
101
            availability_paypal_message_error_to_admin("Not a valid context id", $data);
102
        }
103
    }
104
} else {
105
    // TODO: handle sections.
106
    print_error('support to sections not yet implemented.');
107
}
108
109
// Open a connection back to PayPal to validate the data.
110
$paypaladdr = empty($CFG->usepaypalsandbox) ? 'www.paypal.com' : 'www.sandbox.paypal.com';