include("../config.php");
require_login();
+ optional_variable($enrol, $CFG->enrol);
if (!$site = get_site()) {
redirect("index.php");
error("Only the admin can use this page");
}
- if (isset($_GET['enrolment'])) {
- $enrolname = $_GET['enrol'];
- } else {
- $enrolname = $CFG->enrol;
- }
-
- require_once("$CFG->dirroot/enrol/$enrolname/enrol.php"); /// Open the class
+ require_once("$CFG->dirroot/enrol/$enrol/enrol.php"); /// Open the class
$enrolment = new enrolment_plugin();
/// If data submitted, then process and store.
- if ($config = data_submitted()) {
- if ($enrolment->process_config($config)) {
+ if ($frm = data_submitted()) {
+ if ($enrolment->process_config($frm)) {
+ set_config('enrol', $frm->enrol);
redirect("enrol.php", get_string("changessaved"), 1);
}
- }
+ } else {
+ $frm = $CFG;
+ }
/// Otherwise fill and print the form.
- $str = get_strings(array('enrolments', 'users', 'administration'));
+ /// get language strings
+ $str = get_strings(array('enrolments', 'users', 'administration', 'settings'));
- if (empty($config)) {
- $page->config = $CFG;
- } else {
- $page->config = $config;
- }
$modules = get_list_of_plugins("enrol");
foreach ($modules as $module) {
- $page->options[$module] = get_string("enrolname", "enrol_$module");
+ $options[$module] = get_string("enrolname", "enrol_$module");
}
- asort($page->options);
-
- $form = $enrolment->config_form($page);
+ asort($options);
print_header("$site->shortname: $str->enrolments", "$site->fullname",
"<a href=\"index.php\">$str->administration</a> ->
<a href=\"users.php\">$str->users</a> -> $str->enrolments");
- print_heading($page->options[$CFG->enrol]);
+ echo "<form target=\"{$CFG->framename}\" name=\"enrolmenu\" method=\"post\" action=\"enrol.php\">";
+ echo "<div align=\"center\"><p><b>";
+
- echo "<CENTER><P><B>";
- echo "NOT COMPLETE";
- echo "<P><B>";
- echo "<form TARGET=\"{$CFG->framename}\" NAME=\"authmenu\" method=\"post\" action=\"auth.php\">";
- print_string("chooseauthmethod","auth");
+/// Choose an enrolment method
+ echo get_string('chooseenrolmethod').': ';
+ choose_from_menu ($options, "enrol", $enrol, "",
+ "document.location='enrol.php?enrol='+document.enrolmenu.enrol.options[document.enrolmenu.enrol.selectedIndex].value", "");
- choose_from_menu ($options, "auth", $auth, "","document.location='auth.php?auth='+document.authmenu.auth.options[document.authmenu.auth.selectedIndex].value", "");
+ echo "</b></p></div>";
+
+/// Print current enrolment type description
+ print_simple_box_start("center", "80%", "$THEME->cellheading");
+ print_heading($options[$enrol]);
- echo "</B></P></CENTER>";
-
+ print_simple_box_start("center", "60%", "$THEME->cellcontent");
+ print_string("description", "enrol_$enrol");
+ print_simple_box_end();
+ echo "<hr>";
+ // print_heading($str->settings);
+ $enrolment->config_form($frm);
+
+ echo "<center><p><input type=\"submit\" value=\"".get_string("savechanges")."\"></p></center>\n";
+ echo "</form>";
+
+ print_simple_box_end();
print_footer();
$table->data[] = array("<b><a href=\"$CFG->wwwroot/$CFG->admin/uploaduser.php\">".get_string("uploadusers")."</a></b>",
get_string("adminhelpuploadusers"));
}
- $table->data[] = array('', '');
+ $table->data[] = array('', '<hr />');
$table->data[] = array("<b><a href=\"enrol.php\">".get_string("enrolments")."</a></b>",
get_string("adminhelpenrolments"));
$table->data[] = array("<b><a href=\"../course/index.php?edit=off\">".get_string("assignstudents")."</a></b>",
--- /dev/null
+<table cellspacing="0" cellpadding="5" border="0" align="center">
+<tr valign="top">
+ <td align="right"><p>enrol_dbtype:</p></td>
+ <td>
+ <?php $dbtypes = array("access","ado_access", "ado", "ado_mssql", "borland_ibase", "csv", "db2", "fbsql", "firebird", "ibase", "informix72", "informix", "mssql", "mysql", "mysqlt", "oci805", "oci8", "oci8po", "odbc", "odbc_mssql", "odbc_oracle", "oracle", "postgres64", "postgres7", "postgres", "proxy", "sqlanywhere", "sybase", "vfp");
+ foreach ($dbtypes as $dbtype) {
+ $dboptions[$dbtype] = $dbtype;
+ }
+ choose_from_menu($dboptions, "enrol_dbtype", $frm->enrol_dbtype, '', '', '');
+ ?>
+
+ </td>
+ <td>
+ <?php print_string("dbtype","enrol_database") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_dbhost:</p></td>
+ <td>
+ <input size="15" type="text" name="enrol_dbhost" value="<?php echo $frm->enrol_dbhost ?>" />
+ </td>
+ <td>
+ <?php print_string("dbhost","enrol_database") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_dbuser:</p></td>
+ <td>
+ <input size="15" type="text" name="enrol_dbuser" value="<?php echo $frm->enrol_dbuser ?>" />
+ </td>
+ <td>
+ <?php print_string("dbuser","enrol_database") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_dbpass:</p></td>
+ <td>
+ <input size="15" type="text" name="enrol_dbpass" value="<?php echo $frm->enrol_dbpass ?>" />
+ </td>
+ <td>
+ <?php print_string("dbpass","enrol_database") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_dbname:</p></td>
+ <td>
+ <input size="15" type="text" name="enrol_dbname" value="<?php echo $frm->enrol_dbname ?>" />
+ </td>
+ <td>
+ <?php print_string("dbname","enrol_database") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_dbtable:</p></td>
+ <td>
+ <input size="15" type="text" name="enrol_dbtable" value="<?php echo $frm->enrol_dbtable ?>" />
+ </td>
+ <td>
+ <?php print_string("dbtable","enrol_database") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_localcoursefield:</p></td>
+ <td>
+ <input size="15" type="text" name="enrol_localcoursefield" value="<?php echo $frm->enrol_localcoursefield ?>" />
+ </td>
+ <td>
+ <?php print_string("localcoursefield","enrol_database") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_localuserfield:</p></td>
+ <td>
+ <input size="15" type="text" name="enrol_localuserfield" value="<?php echo $frm->enrol_localuserfield ?>" />
+ </td>
+ <td>
+ <?php print_string("localuserfield","enrol_database") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_remotecoursefield:</p></td>
+ <td>
+ <input size="15" type="text" name="enrol_remotecoursefield" value="<?php echo $frm->enrol_remotecoursefield ?>" />
+ </td>
+ <td>
+ <?php print_string("remotecoursefield","enrol_database") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_remoteuserfield:</p></td>
+ <td>
+ <input size="15" type="text" name="enrol_remoteuserfield" value="<?php echo $frm->enrol_remoteuserfield ?>" />
+ </td>
+ <td>
+ <?php print_string("remoteuserfield","enrol_database") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_allowinternal:</p></td>
+ <td>
+ <input type="checkbox" name="enrol_allowinternal" <?php if ($frm->enrol_allowinternal) echo "checked=\"true\"" ?> />
+ </td>
+ <td>
+ <?php print_string('allowinternal') ?>
+ </td>
+</tr>
+
+</table>
-<?php
-require_once("$CFG->dirroot/enrol/enrol.class.php");
-
-/**
- *
- * $CFG->enrol_dbtype
- * $CFG->enrol_dbhost
- * $CFG->enrol_dbname
- * $CFG->enrol_dbuser
- * $CFG->enrol_dbpass
- * $CFG->enrol_dbtable
- * $CFG->enrol_localcoursefield
- * $CFG->enrol_localuserfield
- * $CFG->enrol_remotecoursefield
- * $CFG->enrol_remoteuserfield
- */
-
-
-
+<?php // $Id$
+require_once("$CFG->dirroot/enrol/enrol.class.php");
class enrolment_plugin extends enrolment_base {
/// to the respective remote fields
$rs = $enroldb->Execute("SELECT * FROM $CFG->enrol_dbtable
WHERE $CFG->enrol_remotecoursefield = '$localcoursevalue'
- AND $CFG->enrol_remoteuserfield = '$user->{$CFG->enrol_localuserfield}' ");
+ AND $CFG->enrol_remoteuserfield = '{$user->$CFG->enrol_localuserfield}' ");
/// If no records existed then student has been unenrolled externally.
/// Unenrol locally and remove entry from the $user->student array
function print_entry($course) {
global $CFG;
- if (! empty($CFG->enrol_flatfileallowinternal) ) {
+ if (! empty($CFG->enrol_allowinternal) ) {
parent::print_entry($course);
} else {
print_header();
function check_entry($form, $course) {
global $CFG;
- if (! empty($CFG->enrol_flatfileallowinternal) ) {
+ if (! empty($CFG->enrol_allowinternal) ) {
parent::check_entry($form, $course);
}
}
}
+/// Overrise the base config_form() function
+function config_form($frm) {
+ global $CFG;
+ include("$CFG->dirroot/enrol/database/config.html");
+}
+
+/// Override the base process_config() function
+function process_config($config) {
+
+ if (!isset($config->enrol_dbtype)) {
+ $config->enrol_dbtype = 'mysql';
+ }
+ set_config('enrol_dbtype', $config->enrol_dbtype);
+
+ if (!isset($config->enrol_dbhost)) {
+ $config->enrol_dbhost = '';
+ }
+ set_config('enrol_dbhost', $config->enrol_dbhost);
+
+ if (!isset($config->enrol_dbuser)) {
+ $config->enrol_dbuser = '';
+ }
+ set_config('enrol_dbuser', $config->enrol_dbuser);
+ if (!isset($config->enrol_dbpass)) {
+ $config->enrol_dbpass = '';
+ }
+ set_config('enrol_dbpass', $config->enrol_dbpass);
+ if (!isset($config->enrol_dbname)) {
+ $config->enrol_dbname = '';
+ }
+ set_config('enrol_dbname', $config->enrol_dbname);
+
+ if (!isset($config->enrol_dbtable)) {
+ $config->enrol_dbtable = '';
+ }
+ set_config('enrol_dbtable', $config->enrol_dbtable);
+
+ if (!isset($config->enrol_localcoursefield)) {
+ $config->enrol_localcoursefield = '';
+ }
+ set_config('enrol_localcoursefield', $config->enrol_localcoursefield);
+
+ if (!isset($config->enrol_localuserfield)) {
+ $config->enrol_localuserfield = '';
+ }
+ set_config('enrol_localuserfield', $config->enrol_localuserfield);
+
+ if (!isset($config->enrol_remotecoursefield)) {
+ $config->enrol_remotecoursefield = '';
+ }
+ set_config('enrol_remotecoursefield', $config->enrol_remotecoursefield);
+
+ if (!isset($config->enrol_remoteuserfield)) {
+ $config->enrol_remoteuserfield = '';
+ }
+ set_config('enrol_remoteuserfield', $config->enrol_remoteuserfield);
+
+ if (!isset($config->enrol_allowinternal)) {
+ $config->enrol_allowinternal = '';
+ }
+ set_config('enrol_allowinternal', $config->enrol_allowinternal);
+
+ return true;
+
+}
} // end of class
* @param page an object containing all the data for this page
*/
function config_form($page) {
-
- return "";
-
+
}
*/
function process_config($config) {
- return true;
+ $return = true;
+
+ print_object($config);
+
+ foreach ($config as $name => $value) {
+ if (!set_config($name, $value)) {
+ $return = false;
+ }
+ }
+ return $return;
}
--- /dev/null
+<table cellspacing="0" cellpadding="5" border="0" align="center">
+
+<tr valign="top">
+ <td align="right"><p>enrol_flatfilelocation:</p></td>
+ <td>
+ <input type="text" size="20" name="enrol_flatfilelocation" value="<?php echo $frm->enrol_flatfilelocation ?>" />
+ </td>
+ <td>
+ <?php print_string("location", "enrol_flatfile") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_mailstudents:</p></td>
+ <td>
+ <input type="checkbox" value=1 name="enrol_mailstudents" <?php if ($frm->enrol_mailstudents) echo "checked=\"true\"" ?> />
+ </td>
+ <td>
+ <?php print_string("mailstudents") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_mailteachers:</p></td>
+ <td>
+ <input type="checkbox" value=1 name="enrol_mailteachers" <?php if ($frm->enrol_mailteachers) echo "checked=\"true\"" ?> />
+ </td>
+ <td>
+ <?php print_string("mailteachers") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_mailadmins:</p></td>
+ <td>
+ <input type="checkbox" value=1 name="enrol_mailadmins" <?php if ($frm->enrol_mailadmins) echo "checked=\"true\"" ?> />
+ </td>
+ <td>
+ <?php print_string("mailadmins") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_allowinternal:</p></td>
+ <td>
+ <input type="checkbox" value=1 name="enrol_allowinternal" <?php if ($frm->enrol_allowinternal) echo "checked=\"true\"" ?> />
+ </td>
+ <td>
+ <?php print_string('allowinternal') ?>
+ </td>
+</tr>
+
+</table>
// The following flags are set in the configuration
// $CFG->enrol_flatfilelocation: where is the file we are looking for?
-// $CFG->enrol_flatfilemailusers: send email to users when they are enrolled in a course
-// $CFG->enrol_flatfilemailadmin: email the log from the cron job to the admin
-// $CFG->enrol_flatfileallowinternal: allow internal enrolment in courses
-
+// $CFG->enrol_allowinternal: allow internal enrolment in courses
+// $CFG->enrol_emailstudents: send email to students when they are enrolled in a course
+// $CFG->enrol_emailteachers: send email to teachers when they are enrolled in a course
+// $CFG->enrol_emailadmins: email the log from the cron job to the admin
function print_entry($course) {
global $CFG;
- if (! empty($CFG->enrol_flatfileallowinternal) ) {
+ if (! empty($CFG->enrol_allowinternal) ) {
parent::print_entry($course);
} else {
print_header();
function check_entry($form, $course) {
global $CFG;
- if (! empty($CFG->enrol_flatfileallowinternal) ) {
+ if (! empty($CFG->enrol_allowinternal) ) {
parent::check_entry($form, $course);
}
}
+/// Override the base config_form() function
+function config_form($frm) {
+ global $CFG;
+ include ("$CFG->dirroot/enrol/flatfile/config.html");
+}
+
+
+/// Override the base process_config() function
+function process_config($config) {
+
+ if (!isset($config->enrol_flatfilelocation)) {
+ $config->enrol_flatfilelocation = '';
+ }
+ set_config('enrol_flatfilelocation', $config->enrol_flatfilelocation);
+
+ if (!isset($config->enrol_mailstudents)) {
+ $config->enrol_mailstudents = '';
+ }
+ set_config('enrol_mailstudents', $config->enrol_mailstudents);
+
+ if (!isset($config->enrol_mailteachers)) {
+ $config->enrol_mailteachers = '';
+ }
+ set_config('enrol_mailteachers', $config->enrol_mailteachers);
+
+ if (!isset($config->enrol_mailadmins)) {
+ $config->enrol_mailadmins = '';
+ }
+ set_config('enrol_mailadmins', $config->enrol_mailadmins);
+
+ if (!isset($config->enrol_allowinternal)) {
+ $config->enrol_allowinternal = '';
+ }
+ set_config('enrol_allowinternal', $config->enrol_allowinternal);
+
+ return true;
+
+}
/**
* Override the base cron() function to read in a file
- if ( (! empty($CFG->enrol_flatfilemailusers)) and empty($elog) and ($fields[0] == "add") ) {
- $subject = get_string("welcometocourse", "", $course->fullname);
- $a->coursename = $course->fullname;
- $a->profileurl = "$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id";
- $message = get_string("welcometocoursetext", "", $a);
-
+ if ( empty($elog) and ($fields[0] == "add") ) {
+
if ($fields[1] == "student") {
if (! $teacher = get_teacher($course->id)) {
$teacher = get_admin();
$teacher = get_admin();
}
- email_to_user($user, $teacher, $subject, $message);
- }
+ if (!empty($CFG->enrol_mailstudents)) {
+ $a->coursename = "$course->fullname";
+ $a->profileurl = "$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id";
+ email_to_user($user, $teacher, get_string("enrolmentnew", '', $course->shortname),
+ get_string('welcometocoursetext', '', $a));
+ }
+ if (!empty($CFG->enrol_mailteachers)) {
+ $a->course = "$course->fullname";
+ $a->user = fullname($user);
+ email_to_user($teacher, $user, get_string("enrolmentnew", '', $course->shortname),
+ get_string('enrolmentnewuser', '', $a));
+ }
+ }
if (empty($elog)) {
$this->log .= "Error unlinking file $filename\n";
}
- if (! empty($CFG->enrol_flatfilemailadmin)) {
+ if (!empty($CFG->enrol_mailadmins)) {
email_to_user(get_admin(), get_admin(), "Flatfile Enrolment Log", $this->log);
}
--- /dev/null
+<table cellspacing="0" cellpadding="5" border="0" align="center">
+
+<tr valign="top">
+ <td align="right"><p>enrol_cost:</p></td>
+ <td>
+ <input type="text" size="5" name="enrol_cost" value="<?php echo $frm->enrol_cost ?>" />
+ </td>
+ <td>
+ <?php print_string("costdefault") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_currency:</p></td>
+ <td>
+ <?php choose_from_menu ($paypalcurrencies, "enrol_currency", $frm->enrol_currency, "","", "") ?>
+ </td>
+ <td>
+ <?php print_string("currency") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_paypalbusiness:</p></td>
+ <td>
+ <input type="text" name="enrol_paypalbusiness" value="<?php echo $frm->enrol_paypalbusiness ?>" />
+ </td>
+ <td>
+ <?php print_string("business", "enrol_paypal") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_mailstudents:</p></td>
+ <td>
+ <input type="checkbox" value=1 name="enrol_mailstudents" <?php if ($frm->enrol_mailstudents) echo "checked=\"true\"" ?> />
+ </td>
+ <td>
+ <?php print_string("mailstudents") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_mailteachers:</p></td>
+ <td>
+ <input type="checkbox" value=1 name="enrol_mailteachers" <?php if ($frm->enrol_mailteachers) echo "checked=\"true\"" ?> />
+ </td>
+ <td>
+ <?php print_string("mailteachers") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right"><p>enrol_mailadmins:</p></td>
+ <td>
+ <input type="checkbox" value=1 name="enrol_mailadmins" <?php if ($frm->enrol_mailadmins) echo "checked=\"true\"" ?> />
+ </td>
+ <td>
+ <?php print_string("mailadmins") ?>
+ </td>
+</tr>
+
+</table>
<div align="center">
<p><?php print_string("paymentrequired") ?></p>
-<p><b><?php echo get_string("cost").": $CFG->enrol_paypalcurrency $cost"; ?></b></p>
+<p><b><?php echo get_string("cost").": $CFG->enrol_currency $cost"; ?></b></p>
<p><?php print_string("paymentinstant") ?></p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="os0" value="<?php echo fullname($USER) ?>">
<input type="hidden" name="custom" value="<?php echo "$USER->id-$course->id" ?>">
-<input type="hidden" name="currency_code" value="<?php p($CFG->enrol_paypalcurrency) ?>">
+<input type="hidden" name="currency_code" value="<?php p($CFG->enrol_currency) ?>">
<input type="hidden" name="amount" value="<?php p($cost) ?>">
<input type="hidden" name="for_auction" value="false">
-<?php
+<?php // $Id$
+ // Implements all the main code for the Paypal plugin
require_once("$CFG->dirroot/enrol/enrol.class.php");
include("$CFG->dirroot/enrol/paypal/enrol.html");
- echo "</div>";
print_simple_box_end();
print_footer();
$strrequirespayment = get_string("requirespayment");
$strcost = get_string("cost");
- if (empty($CFG->enrol_paypalcurrency)) {
- $CFG->enrol_paypalcurrency = 'USD';
+ if (empty($CFG->enrol_currency)) {
+ set_config('enrol_currency', 'USD');
}
- switch ($CFG->enrol_paypalcurrency) {
+ switch ($CFG->enrol_currency) {
case 'EUR': $currency = '€'; break;
case 'CAD': $currency = '$'; break;
case 'GBP': $currency = '£'; break;
default: $currency = '$'; break;
}
- $str .= "<p>$strcost: <a title=\"$strrequirespayment\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
+ $str .= "<p class=\"coursecost\"><font size=-1>$strcost: ".
+ "<a title=\"$strrequirespayment\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\"></a>";
$str .= "$currency".format_float($cost,2).'</a></p>';
}
}
+/// Override the base class config_form() function
+function config_form($frm) {
+ global $CFG;
+
+ $paypalcurrencies = array( 'USD' => 'US Dollars',
+ 'EUR' => 'Euros',
+ 'JPY' => 'Japanese Yen',
+ 'GBP' => 'British Pounds',
+ 'CAD' => 'Canadian Dollars'
+ );
+
+ include("$CFG->dirroot/enrol/paypal/config.html");
+}
+
+function process_config($config) {
+
+ if (!isset($config->enrol_cost)) {
+ $config->enrol_cost = 0;
+ }
+ set_config('enrol_cost', $config->enrol_cost);
+
+ if (!isset($config->enrol_currency)) {
+ $config->enrol_currency = 'USD';
+ }
+ set_config('enrol_currency', $config->enrol_currency);
+
+ if (!isset($config->enrol_paypalbusiness)) {
+ $config->enrol_paypalbusiness = '';
+ }
+ set_config('enrol_paypalbusiness', $config->enrol_paypalbusiness);
+
+ if (!isset($config->enrol_mailstudents)) {
+ $config->enrol_mailstudents = '';
+ }
+ set_config('enrol_mailstudents', $config->enrol_mailstudents);
+
+ if (!isset($config->enrol_mailteachers)) {
+ $config->enrol_mailteachers = '';
+ }
+ set_config('enrol_mailteachers', $config->enrol_mailteachers);
+
+ if (!isset($config->enrol_mailadmins)) {
+ $config->enrol_mailadmins = '';
+ }
+ set_config('enrol_mailadmins', $config->enrol_mailadmins);
+
+ return true;
+
+}
+
} // end of class definition
} else {
$teacher = get_teacher($course->id);
- if (!empty($CFG->enrol_paypalmailstudents)) {
+ if (!empty($CFG->enrol_mailstudents)) {
$a->coursename = "$course->fullname";
$a->profileurl = "$CFG->wwwroot/user/view.php?id=$user->id";
- email_to_user($user, $teacher, get_string("enrolmentnew", '', $course->shortname), get_string('welcometocoursetext', '', $a));
+ email_to_user($user, $teacher, get_string("enrolmentnew", '', $course->shortname),
+ get_string('welcometocoursetext', '', $a));
}
- if (!empty($CFG->enrol_paypalmailteachers)) {
- email_to_user($teacher, $user, get_string("enrolmentnew", '', $course->shortname), "I have enrolled in your class via Paypal");
+ if (!empty($CFG->enrol_mailteachers)) {
+ $a->course = "$course->fullname";
+ $a->user = fullname($user);
+ email_to_user($teacher, $user, get_string("enrolmentnew", '', $course->shortname),
+ get_string('enrolmentnewuser', '', $a));
}
+
+ if (!empty($CFG->enrol_mailadmins)) {
+ $a->course = "$course->fullname";
+ $a->user = fullname($user);
+ $admins = get_admins();
+ foreach ($admins as $admin) {
+ email_to_user($admin, $user, get_string("enrolmentnew", '', $course->shortname),
+ get_string('enrolmentnewuser', '', $a));
+ }
+ }
+
}
--- /dev/null
+<?PHP // $Id$
+
+$string['enrolname'] = 'External Database';
+
+$string['description'] = 'You can use a external database (of nearly any kind) to control your enrolments. It is assumed your external database contains a field containing a course ID, and a field containing a user ID. These are compared against fields that you choose in the local course and user tables.';
+$string['dbtype'] = 'Database server type';
+$string['dbhost'] = 'Database server hostname ';
+$string['dbuser'] = 'Username to access the server';
+$string['dbpass'] = 'Password to access the server';
+$string['dbname'] = 'The specific database to use';
+$string['dbtable'] = 'The table in that database';
+$string['localcoursefield'] = 'The name of the field in the course table that we are using to match entries in the remote database (eg idnumber)';
+$string['localuserfield'] = 'The name of the field in the local user table that we use to match the user to a remote record (eg idnumber)';
+$string['remotecoursefield'] = 'The field in the remote database we expect to find the course ID in';
+$string['remoteuserfield'] = 'The field in the remote database we expect to find the user ID in';
+
+?>
<?PHP // $Id$
$string['enrolname'] = 'Flat file';
+
+$string['description'] = 'This method will repeatedly check for and process a specially-formatted text file in the location that you specify. The file can look something like this:
+<pre>
+ add, student, 5, CF101
+ add, teacher, 6, CF101
+ add, teacheredit, 7, CF101
+ del, student, 8, CF101
+ del, student, 17, CF101
+ add, student, 21, CF101, 1091115000, 1091215000
+</pre>
+';
+
$string['filelockedmailsubject'] = 'Important error: Enrolment file';
$string['filelockedmail'] = 'The text file you are using for file-based enrolments ($a) can not be deleted by the cron process. This usually means the permissions are wrong on it. Please fix the permissions so that Moodle can delete the file, otherwise it might be processed repeatedly.';
+$string['location'] = 'File location';
+$string['mailusers'] = 'Notify users by email';
+$string['mailadmin'] = 'Notify admin by email';
?>
$string['enrolname'] = 'Internal Enrolment';
+$string['description'] = 'This is the default form of enrolment. There are two main ways a student can be enrolled in a particular course.
+<ul>
+<li>A teacher or admin can enrol them manually using the link in the Course Administration menu
+ within the course.</li>
+<li>A course can have a password defined, known as an \"enrolment key\". Anyone who knows this key is
+ able to add themselves to a course.</li>
+</ul>';
+
?>
<?PHP // $Id$
$string['enrolname'] = 'Paypal';
+$string['description'] = 'The Paypal module allows you to set up paid courses. If the cost for any course is zero, then students are not asked to pay for entry. There is a site-wide cost that you set here as a default for the whole site and then a course setting that you can set for each course individually. The course cost overrides the site cost.';
+$string['business'] = 'The email address of your business Paypal account';
$string['sendpaymentbutton'] = 'Send payment via Paypal';
+
+
?>
$string['caution'] = 'Caution';\r
$string['chooselanguage'] = 'Choose a language';\r
$string['compatibilitysettings'] = 'Checking your PHP settings ...';\r
-$string['configfilenotwritten'] = "The installer script was not able to automatically create a config.php file containing your chosen settings. Please copy the following code into a file named config.php within the root directory of Moodle.";\r
+$string['configfilenotwritten'] = "The installer script was not able to automatically create a config.php file containing your chosen settings, probably because the Moodle directory is not writeable. You can manually copy the following code into a file named config.php within the root directory of Moodle.";\r
$string['configfilewritten'] = "config.php has been successfully created";\r
$string['configurationcomplete'] = 'Configuration completed';\r
\r
$string['alllogs'] = 'All logs';
$string['allow'] = 'Allow';
$string['allowguests'] = 'This course allows guest users to enter';
+$string['allowinternal'] = 'Allow internal methods as well';
$string['allownot'] = 'Do not allow';
$string['allparticipants'] = 'All participants';
$string['alphabet'] = 'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z';
$string['checklanguage'] = 'Check language';
$string['choose'] = 'Choose';
$string['choosecourse'] = 'Choose a course';
+$string['chooseenrolmethod'] = 'Primary method of enrolment';
$string['chooselivelogs'] = 'Or watch current activity';
$string['chooselogs'] = 'Choose which logs you want to see';
$string['choosereportfilter'] = 'Choose a filter for the report';
$string['copyingzipfile'] = 'Copying zip file';
$string['copyrightnotice'] = 'Copyright notice';
$string['cost'] = 'Cost';
+$string['costdefault'] = 'Default cost';
$string['country'] = 'Country';
$string['course'] = 'Course';
$string['courseavailable'] = 'This course is available to students';
$string['creatingtemporarystructures'] = 'Creating temporary structures';
$string['creatingusers'] = 'Creating users';
$string['creatingxmlfile'] = 'Creating XML file';
+$string['currency'] = 'Currency';
$string['currentcourseadding'] = 'Current course, adding data to it';
$string['currentcoursedeleting'] = 'Current course, deleting it first';
$string['currentlanguage'] = 'Current language';
$string['enrolmentkeyhint'] = 'That enrolment key was incorrect, please try again<BR>
(Here\'s a hint - it starts with \'$a\')';
$string['enrolmentnew'] = 'New enrolment in $a';
+$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 <br /> $a';
$string['enrolments'] = 'Enrolments';
$string['loginusing'] = 'Login here using your username and password';
$string['logout'] = 'Logout';
$string['logs'] = 'Logs';
+$string['mailstudents'] = 'Inform students';
+$string['mailteachers'] = 'Inform teachers';
+$string['mailadmins'] = 'Inform admins';
$string['mainmenu'] = 'Main menu';
$string['makeafolder'] = 'Make a folder';
$string['makeeditable'] = 'If you make \'$a\' editable by the web server process (eg apache) then you could edit this file directly from this page';