Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
201a26b
)
MDL-50332 enrol_self: Setting form url for guests
author
David Monllao
<davidm@moodle.com>
Wed, 23 Sep 2015 01:51:44 +0000
(09:51 +0800)
committer
David Monllao
<davidm@moodle.com>
Wed, 23 Sep 2015 01:52:04 +0000
(09:52 +0800)
Credit to Andrew Nicols.
enrol/self/lib.php
patch
|
blob
|
blame
|
history
diff --git
a/enrol/self/lib.php
b/enrol/self/lib.php
index
6dca20b
..
6c1364b
100644
(file)
--- a/
enrol/self/lib.php
+++ b/
enrol/self/lib.php
@@
-249,7
+249,11
@@
class enrol_self_plugin extends enrol_plugin {
$data = new stdClass();
$data->header = $this->get_instance_name($instance);
$data->info = $enrolstatus;
- $form = new enrol_self_empty_form(null, $data);
+
+ // The can_self_enrol call returns a button to the login page if the user is a
+ // guest, setting the login url to the form if that is the case.
+ $url = isguestuser() ? get_login_url() : null;
+ $form = new enrol_self_empty_form($url, $data);
}
ob_start();