mirror of
https://github.com/moodle/moodle.git
synced 2025-03-13 20:26:32 +01:00
Error message isn't shown when user clicked without key. Multienrol is enabled (course enrol key with authorize) This patch allows showing error message when user clicked button without key.
61 lines
1.9 KiB
HTML
61 lines
1.9 KiB
HTML
<?php print_simple_box_start('center'); ?>
|
|
<p align="center">
|
|
<?php
|
|
if ($teacher) {
|
|
$teachername = "<a href=\"../user/view.php?id=$teacher->id&course=".SITEID."\">".fullname($teacher)."</a>.";
|
|
} else {
|
|
$teachername = get_string('yourteacher', '', strtolower($course->teacher));
|
|
}
|
|
print_string('enrolmentkeyfrom', '', $teachername);
|
|
?>
|
|
</p>
|
|
|
|
<p align="center"><?php if (! empty($this->errormsg)) {formerr($this->errormsg);} ?></p>
|
|
|
|
|
|
<form name="form" method="post" action="enrol.php">
|
|
<table align="center" width="100%">
|
|
<tr>
|
|
<td align="right"><?php print_string("enrolmentkey") ?>:</td>
|
|
<td>
|
|
<input type="password" name="password" size="20" value="<?php p($password) ?>" />
|
|
<input type="hidden" name="id" value="<?php p($course->id) ?>" />
|
|
<input type="hidden" name="enrol" value="manual" />
|
|
<input type="submit" value="<?php print_string("enrolme") ?>" />
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
<br />
|
|
|
|
<div align="center">
|
|
<form action="<?php p($CFG->wwwroot)?>/index.php" method="post">
|
|
<input type="submit" value="<?php print_string("cancel") ?>" />
|
|
</form>
|
|
</div>
|
|
|
|
<?php
|
|
print_simple_box_end();
|
|
|
|
|
|
if ($course->guest and !isguest()) {
|
|
print_simple_box_start('center');
|
|
?>
|
|
<form name="form" method="post" action="enrol.php">
|
|
<table align="center" cellpadding="20">
|
|
<tr>
|
|
<td><?php print_string('allowguests') ?>: </td>
|
|
<td>
|
|
<input name="id" value="<?php p($course->id) ?>" type="hidden">
|
|
<input name="loginasguest" value="yes" type="hidden">
|
|
<input value="<?php print_string('loginguest') ?>" type="submit">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
|
|
<?php
|
|
print_simple_box_end();
|
|
}
|
|
?>
|