Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
.
/**
* Manual user enrolment UI.
*
* @package enrol_manual
* @copyright 2010 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require('../../config.php');
require_once($CFG->dirroot.'/enrol/manual/locallib.php');
$enrolid = required_param('enrolid', PARAM_INT);
$roleid = optional_param('roleid', -1, PARAM_INT);
$extendperiod = optional_param('extendperiod', 0, PARAM_INT);
$extendbase = optional_param('extendbase', 0, PARAM_INT);
$timeend = optional_param_array('timeend', [], PARAM_INT);
$instance = $DB->get_record('enrol', array('id'=>$enrolid, 'enrol'=>'manual'), '*', MUST_EXIST);
$course = $DB->get_record('course', array('id'=>$instance->courseid), '*', MUST_EXIST);
$context = context_course::instance($course->id, MUST_EXIST);
require_login($course);
$canenrol = has_capability('enrol/manual:enrol', $context);
$canunenrol = has_capability('enrol/manual:unenrol', $context);
// Note: manage capability not used here because it is used for editing
// of existing enrolments which is not possible here.
if (!$canenrol and !$canunenrol) {
// No need to invent new error strings here...
require_capability('enrol/manual:enrol', $context);
require_capability('enrol/manual:unenrol', $context);
}
if ($roleid < 0) {
$roleid = $instance->roleid;
}
$roles = get_assignable_roles($context);
$roles = array('0'=>get_string('none')) + $roles;
if (!isset($roles[$roleid])) {
// Weird - security always first!
$roleid = 0;
}
if (!$enrol_manual = enrol_get_plugin('manual')) {
throw new coding_exception('Can not instantiate enrol_manual');
}
$url = new moodle_url('/enrol/manual/manage.php', ['enrolid' => $instance->id]);
$title = get_string('managemanualenrolements', 'enrol_manual');
$PAGE->set_url($url);
$PAGE->set_pagelayout('admin');
$PAGE->set_title($title);
$PAGE->set_heading($course->fullname);
navigation_node::override_active_url(new moodle_url('/enrol/instances.php', ['id' => $course->id]));
$PAGE->navbar->add($title, $url);
// Create the user selector objects.
$options = array('enrolid' => $enrolid, 'accesscontext' => $context);
$potentialuserselector = new enrol_manual_potential_participant('addselect', $options);
$currentuserselector = new enrol_manual_current_participant('removeselect', $options);
// Build the list of options for the enrolment period dropdown.
$unlimitedperiod = get_string('unlimited');
$periodmenu = array();
for ($i=1; $i<=365; $i++) {
$seconds = $i * 86400;
$periodmenu[$seconds] = get_string('numdays', '', $i);
}
// Work out the apropriate default settings.
if ($extendperiod) {
$defaultperiod = $extendperiod;
} else {
$defaultperiod = $instance->enrolperiod;
}
if ($instance->enrolperiod > 0 && !isset($periodmenu[$instance->enrolperiod])) {
$periodmenu[$instance->enrolperiod] = format_time($instance->enrolperiod);
}
if (empty($extendbase)) {
if (!$extendbase = get_config('enrol_manual', 'enrolstart')) {
// Default to now if there is no system setting.
$extendbase = 4;
}
}
// Build the list of options for the starting from dropdown.
$now = time();
$today = make_timestamp(date('Y', $now), date('m', $now), date('d', $now), 0, 0, 0);
$dateformat = get_string('strftimedatefullshort');
// Enrolment start.
$basemenu = array();
if ($course->startdate > 0) {
$basemenu[2] = get_string('coursestart') . ' (' . userdate($course->startdate, $dateformat) . ')';
}
$basemenu[3] = get_string('today') . ' (' . userdate($today, $dateformat) . ')';
$basemenu[4] = get_string('now', 'enrol_manual') . ' (' . userdate($now, get_string('strftimedatetimeshort')) . ')';
// Process add and removes.
if ($canenrol && optional_param('add', false, PARAM_BOOL) && confirm_sesskey()) {
$userstoassign = $potentialuserselector->get_selected_users();
if (!empty($userstoassign)) {
foreach($userstoassign as $adduser) {
switch($extendbase) {
case 2:
$timestart = $course->startdate;
break;
case 4:
// We mimic get_enrolled_sql round(time(), -2) but always floor as we want users to always access their
// courses once they are enrolled.
$timestart = intval(substr($now, 0, 8) . '00') - 1;
break;
case 3:
default:
$timestart = $today;
break;
}
if ($timeend) {
$timeend = make_timestamp($timeend['year'], $timeend['month'], $timeend['day'], $timeend['hour'],
$timeend['minute']);
} else if ($extendperiod <= 0) {
$timeend = 0;
} else {
$timeend = $timestart + $extendperiod;
}
$enrol_manual->enrol_user($instance, $adduser->id, $roleid, $timestart, $timeend);
}
$potentialuserselector->invalidate_selected_users();
$currentuserselector->invalidate_selected_users();
//TODO: log
}
}
// Process incoming role unassignments.
if ($canunenrol && optional_param('remove', false, PARAM_BOOL) && confirm_sesskey()) {
$userstounassign = $currentuserselector->get_selected_users();
if (!empty($userstounassign)) {
foreach($userstounassign as $removeuser) {
$enrol_manual->unenrol_user($instance, $removeuser->id);
}
$potentialuserselector->invalidate_selected_users();
$currentuserselector->invalidate_selected_users();
//TODO: log
}
}
echo $OUTPUT->header();
echo $OUTPUT->heading($title);
$addenabled = $canenrol ? '' : 'disabled="disabled"';
$removeenabled = $canunenrol ? '' : 'disabled="disabled"';
?>
footer();