jquery() 函式在 moodle 2.3 版中沒有,所以註解掉,直接在 signup_form.php 加入登入按鈕。
[root@dywang mod_tmp]# diff -uNwB elcentra/auth.php ../auth/elcentra/auth.php
--- elcentra/auth.php 2014-04-21 19:32:06.000000000 +0800
+++ ../auth/elcentra/auth.php 2019-03-06 10:36:36.185681157 +0800
@@ -226,7 +226,7 @@
global $PAGE, $OUTPUT, $CFG;
$conf = get_config("auth/elcentra", "add_code_mode");
if ($conf == "auto") {
- $PAGE->requires->jquery();
+ //$PAGE->requires->jquery();
$PAGE->requires->js_init_code("buttonsAddMethod = 'auto';");
$content = str_replace(array("\n", "\r"), array("\\\n", "\\\r",), $this->get_buttons_string());
$PAGE->requires->js_init_code("buttonsCode = '$content';");
login/index_form.html 的「忘記密碼連結」上方加上 Facebook 及 Google 認證登入按鈕。
[root@dywang login]# vim index_form.html
<center>
<div class="moreproviderlink">
<a href="<?php echo $CFG->httpswwwroot; ?>/auth/elcentra/google_request.php">
<img src="<?php echo $CFG->httpswwwroot; ?>/auth/elcentra/img/google.png"></a>
<a href="<?php echo $CFG->httpswwwroot; ?>/auth/elcentra/facebook_request.php">
<img src="<?php echo $CFG->httpswwwroot; ?>/auth/elcentra/img/facebook.png"></a> <br>
</div>
<div class="forgetpass"><a href="forgot_password.php">
<?php print_string("forgotten") ?></a></div>
@@ -243,7 +243,7 @@
list($username, $email, $firstName, $lastName, $country, $city, $timezone, $verified) = $details;
//throw an error if the email address is not verified
- if (!$verified) {
+ if (!$email) {
throw new moodle_exception('emailaddressmustbeverified', 'auth_elcentra');
}