Skip to content

Instantly share code, notes, and snippets.

@danielneis
danielneis / gist:508f60fb0f25cbff4442f7bc46e978db
Created January 12, 2024 20:31
Bloquear acesso a arquivos do Moodle
<Directory /var/www/html/moodle>
Options -Indexes
</Directory>
<Directorymatch "(^/.*/\.git/|^/.*/\.github/|fixtures|behat)">
Order deny,allow
Deny from all
</Directorymatch>
<Filesmatch "(.stylelintrc|composer.json|composer.lock|upgrade.txt|environment.xml|install.xml|readme_moodle.txt|readme.txt|README.txt|README.md|upgrade.txt|phpunit.xml.dist|.gitattributes|.gitignore)">
Order deny,allow
Deny from all
image: moodlehq/moodle-php-apache:7.0
services:
- mysql:latest
cache:
paths:
- $HOME/.composer/cache
variables:
variables:
DB: 'pgsql'
PHP: '7.1'
BROWSER: 'chrome'
before_script:
- apt install git -y
- git clone --depth 1 https://github.com/moodlehq/moodle-docker.git $HOME/moodle-docker
- cd $HOME/moodle-docker
- export MOODLE_DOCKER_WWWROOT=$CI_PROJECT_DIR
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/search/index.php b/search/index.php
index 936dfbc7a70..088251c1c69 100644
--- a/search/index.php
+++ b/search/index.php
@@ -66,6 +66,10 @@ if (\core_search\manager::is_global_search_enabled() === false) {
$search = \core_search\manager::instance(true);
+if (strpos($q, 'admin:') === 0) {
+ redirect(new moodle_url('/admin/search.php', ['query' => trim(substr($q, 6))]));