Merge branch 'wip-MDL-57007-master' of git://github.com/marinaglancy/moodle

This commit is contained in:
Andrew Nicols 2016-11-17 14:36:02 +08:00
commit 79f15159da
2 changed files with 5 additions and 2 deletions

View File

@ -26,7 +26,6 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
die(); // No access from web!
}
define('BEHAT_UTIL', true);
define('CLI_SCRIPT', true);
define('ABORT_AFTER_CONFIG', true);
define('CACHE_DISABLE_ALL', true);

View File

@ -366,7 +366,11 @@ function has_capability($capability, context $context, $user = null, $doanything
global $USER, $CFG, $SCRIPT, $ACCESSLIB_PRIVATE;
if (during_initial_install()) {
if ($SCRIPT === "/$CFG->admin/index.php" or $SCRIPT === "/$CFG->admin/cli/install.php" or $SCRIPT === "/$CFG->admin/cli/install_database.php") {
if ($SCRIPT === "/$CFG->admin/index.php"
or $SCRIPT === "/$CFG->admin/cli/install.php"
or $SCRIPT === "/$CFG->admin/cli/install_database.php"
or (defined('BEHAT_UTIL') and BEHAT_UTIL)
or (defined('PHPUNIT_UTIL') and PHPUNIT_UTIL)) {
// we are in an installer - roles can not work yet
return true;
} else {