From 65380ecd0ab8f86d6603e9a98d8b0a6023151caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Fri, 31 May 2013 21:25:27 +0200 Subject: [PATCH] MDL-39503 tell robots to not index login and signup page This should partially prevent people from googling moodle sites that allow signup. Please note you can not use login block if because it would still disclose the signup link. --- login/index.php | 6 ++++++ login/signup.php | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/login/index.php b/login/index.php index a98af012c7a..e4293dc5ded 100644 --- a/login/index.php +++ b/login/index.php @@ -26,6 +26,12 @@ require('../config.php'); +// Try to prevent searching for sites that allow sign-up. +if (!isset($CFG->additionalhtmlhead)) { + $CFG->additionalhtmlhead = ''; +} +$CFG->additionalhtmlhead .= ''; + redirect_if_major_upgrade_required(); $testsession = optional_param('testsession', 0, PARAM_INT); // test session works properly diff --git a/login/signup.php b/login/signup.php index 331f9ef4691..a35641ff4f3 100644 --- a/login/signup.php +++ b/login/signup.php @@ -26,6 +26,12 @@ require('../config.php'); +// Try to prevent searching for sites that allow sign-up. +if (!isset($CFG->additionalhtmlhead)) { + $CFG->additionalhtmlhead = ''; +} +$CFG->additionalhtmlhead .= ''; + if (empty($CFG->registerauth)) { print_error('notlocalisederrormessage', 'error', '', 'Sorry, you may not use this page.'); }