-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
39 lines (25 loc) · 911 Bytes
/
index.php
File metadata and controls
39 lines (25 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* Mizzaro Peer Assesment (MPA) Plugin.
*
* @package local
* @subpackage mpa
* @copyright 2015, Michael Soprano, miccighel@gmail.com
*/
require(dirname(__FILE__) . '/../../config.php');
require_once($CFG->dirroot . '/local/mpa/locallib.php');
if (isloggedin()) {
$userid = $USER->id;
$usercontext = context_user::instance($userid);
print_page_attributes('pluginname', 'pluginname', $usercontext, 'local');
$renderer = $PAGE->get_renderer('local_mpa');
if (has_capability('local/mpa:localoverview', $usercontext, $userid)) {
echo $renderer->render_local_overview();
} else {
echo $renderer->render_capability_error();
}
} else {
print_page_attributes('pluginname', 'pluginname', null, 'local');
$renderer = $PAGE->get_renderer('local_mpa');
echo $renderer->render_login_required();
}