diff --git a/lang/en/moodle.php b/lang/en/moodle.php
index 0d99bd93577..f5bc7a8d5fa 100644
--- a/lang/en/moodle.php
+++ b/lang/en/moodle.php
@@ -432,6 +432,7 @@ $string['enrolledincoursenot'] = 'Not enrolled in course \"$a\"';
$string['enrollfirst'] = 'You have to enrol in one of the courses before you can use the site activities';
$string['enrolme'] = 'Enrol me in this course';
$string['enrolmentconfirmation'] = 'You are about to enrol yourself as a member of this course.
Are you sure you wish to do this?';
+$string['enrolmentend'] = 'Enrolment Ends';
$string['enrolmentkey'] = 'Enrolment key';
$string['enrolmentkeyfrom'] = 'This course requires an \'enrolment key\' - a one-time
password that you should have received from $a';
@@ -442,6 +443,7 @@ $string['enrolmentnewuser'] = '$a->user has enrolled in course \"$a->course\"';
$string['enrolmentnointernal'] = 'Manual enrolments are currently not enabled';
$string['enrolmentnotyet'] = 'Sorry, you can not access this course until
$a';
$string['enrolments'] = 'Enrolments';
+$string['enrolmentstart'] = 'Enrolment Started';
$string['enrolperiod'] = 'Enrolment duration';
$string['entercourse'] = 'Click to enter this course';
$string['enteremailaddress'] = 'Enter in your email address to reset your
@@ -461,6 +463,8 @@ $string['existingcreators'] = 'Existing course creators';
$string['existingstudents'] = 'Enrolled students';
$string['existingteachers'] = 'Existing teachers';
$string['explanation'] = 'Explanation';
+$string['extendenrol'] = 'Extend enrolment';
+$string['extendperiod'] = 'Extended period';
$string['failedloginattempts'] = '$a->attempts failed logins since your last login';
$string['failedloginattemptsall'] = '$a->attempts failed logins for $a->accounts accounts';
$string['feedback'] = 'Feedback';
@@ -803,6 +807,7 @@ $string['newusers'] = 'New users';
$string['next'] = 'Next';
$string['no'] = 'No';
$string['nobody'] = 'Nobody';
+$string['nochange'] = 'No change';
$string['nocoursesfound'] = 'No courses were found with the words \'$a\'';
$string['nocoursesyet'] = 'No courses in this category';
$string['nodstpresets'] = 'The administrator has not enabled Daylight Savings Time support.';
diff --git a/user/action_redir.php b/user/action_redir.php
new file mode 100644
index 00000000000..1d76b8a56d6
--- /dev/null
+++ b/user/action_redir.php
@@ -0,0 +1,34 @@
+ $v) {
+ $pass = $pass || preg_match('/^user(\d+)$/',$k);
+}
+if (!$pass) {
+ die();
+}
+
+header("Location: $CFG->wwwroot/user/" . $_GET['formaction'] . '?' . $_SERVER['QUERY_STRING']);
+?>
\ No newline at end of file
diff --git a/user/extendenrol.php b/user/extendenrol.php
new file mode 100644
index 00000000000..faa44e38f18
--- /dev/null
+++ b/user/extendenrol.php
@@ -0,0 +1,73 @@
+id);
+
+if (!isteacheredit($course->id)) {
+ error("You must be an editing teacher in this course, or an admin");
+}
+
+if ($users && ($form = data_submitted() and confirm_sesskey())) {
+ if (count($form->userid) != count($form->extendperiod)) {
+ error('Parameters malformation', $CFG->wwwroot.'/user/index.php?id='.$id);
+ }
+
+ foreach ($form->userid as $k => $v) {
+ if ($student = get_record('user_students', 'userid', $v, 'course', $id)) {
+ enrol_student($v, $id, $student->timestart, $student->timeend + $form->extendperiod[$k]);
+ }
+ }
+
+ redirect("$CFG->wwwroot/user/index.php?id=$id", get_string('changessaved'));
+}
+
+/// Print headers
+
+if ($course->category) {
+ print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname,
+ "id\">$course->shortname -> ".
+ get_string('extendenrol'), "", "", true, " ", navmenu($course));
+} else {
+ print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname,
+ get_string('extendenrol'), "", "", true, " ", navmenu($course));
+}
+
+for ($i=1; $i<=365; $i++) {
+ $seconds = $i * 86400;
+ $periodmenu[$seconds] = get_string('numdays', '', $i);
+}
+
+print_heading(get_string('extendenrol'));
+echo "