2006-03-09 02:48:29 +00:00
|
|
|
<?PHP // $Id$
|
|
|
|
// enrol_config.php - allows admin to edit all enrollment variables
|
|
|
|
// Yes, enrol is correct English spelling.
|
|
|
|
|
2006-04-12 21:02:03 +00:00
|
|
|
require_once("../config.php");
|
2006-09-02 13:14:57 +00:00
|
|
|
require_once($CFG->libdir.'/adminlib.php');
|
2006-09-20 21:00:45 +00:00
|
|
|
|
2007-04-30 17:08:34 +00:00
|
|
|
admin_externalpage_setup('enrolment');
|
2006-03-09 02:48:29 +00:00
|
|
|
|
|
|
|
$enrol = required_param('enrol', PARAM_ALPHA);
|
2006-03-21 04:59:55 +00:00
|
|
|
$CFG->pagepath = 'enrol/' . $enrol;
|
2006-03-09 02:48:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
require_once("$CFG->dirroot/enrol/enrol.class.php"); /// Open the factory class
|
|
|
|
|
|
|
|
$enrolment = enrolment_factory::factory($enrol);
|
|
|
|
|
|
|
|
/// If data submitted, then process and store.
|
|
|
|
|
|
|
|
if ($frm = data_submitted()) {
|
2006-08-18 07:25:17 +00:00
|
|
|
if (!confirm_sesskey()) {
|
|
|
|
error(get_string('confirmsesskeybad', 'error'));
|
2006-09-20 21:00:45 +00:00
|
|
|
}
|
2006-03-09 02:48:29 +00:00
|
|
|
if ($enrolment->process_config($frm)) {
|
|
|
|
redirect("enrol.php?sesskey=$USER->sesskey", get_string("changessaved"), 1);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$frm = $CFG;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Otherwise fill and print the form.
|
|
|
|
|
|
|
|
/// get language strings
|
|
|
|
$str = get_strings(array('enrolmentplugins', 'configuration', 'users', 'administration'));
|
|
|
|
|
2006-08-18 07:25:17 +00:00
|
|
|
unset($options);
|
2006-03-09 02:48:29 +00:00
|
|
|
|
|
|
|
$modules = get_list_of_plugins("enrol");
|
|
|
|
foreach ($modules as $module) {
|
|
|
|
$options[$module] = get_string("enrolname", "enrol_$module");
|
|
|
|
}
|
|
|
|
asort($options);
|
|
|
|
|
2007-04-30 17:08:34 +00:00
|
|
|
admin_externalpage_print_header();
|
2006-03-09 02:48:29 +00:00
|
|
|
|
2007-01-04 21:32:36 +00:00
|
|
|
echo "<form $CFG->frametarget id=\"enrolmenu\" method=\"post\" action=\"enrol_config.php\">";
|
2007-02-09 07:47:14 +00:00
|
|
|
echo "<div>";
|
2007-01-09 01:31:53 +00:00
|
|
|
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".$USER->sesskey."\" />";
|
|
|
|
echo "<input type=\"hidden\" name=\"enrol\" value=\"".$enrol."\" />";
|
2006-09-20 21:00:45 +00:00
|
|
|
|
|
|
|
/// Print current enrolment type description
|
2006-03-09 02:48:29 +00:00
|
|
|
print_simple_box_start("center", "80%");
|
|
|
|
print_heading($options[$enrol]);
|
|
|
|
|
|
|
|
print_simple_box_start("center", "60%", '', 5, 'informationbox');
|
|
|
|
print_string("description", "enrol_$enrol");
|
|
|
|
print_simple_box_end();
|
|
|
|
|
|
|
|
echo "<hr />";
|
2006-09-20 21:00:45 +00:00
|
|
|
|
2006-03-09 02:48:29 +00:00
|
|
|
$enrolment->config_form($frm);
|
|
|
|
|
2007-02-09 07:47:14 +00:00
|
|
|
echo "<p class=\"centerpara\"><input type=\"submit\" value=\"".get_string("savechanges")."\" /></p>\n";
|
2007-01-09 01:31:53 +00:00
|
|
|
print_simple_box_end();
|
2007-02-09 07:47:14 +00:00
|
|
|
echo "</div>";
|
2006-03-09 02:48:29 +00:00
|
|
|
echo "</form>";
|
|
|
|
|
2007-04-30 17:08:34 +00:00
|
|
|
admin_externalpage_print_footer();
|
2006-03-09 02:48:29 +00:00
|
|
|
|
|
|
|
exit;
|
|
|
|
?>
|