From 0448818b49caf5174ae28422777d21290a5547d3 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.'); }