Make sure that we check HTTP_CLIENT_IP first

This commit is contained in:
Dmitrii Metelkin 2020-05-08 17:22:13 +10:00
parent 9e9df72f52
commit de5cfdab7e
2 changed files with 9 additions and 0 deletions

View file

@ -54,6 +54,10 @@ class auth_plugin_userkey_testcase extends advanced_testcase {
require_once($CFG->dirroot . '/auth/userkey/auth.php'); require_once($CFG->dirroot . '/auth/userkey/auth.php');
require_once($CFG->dirroot . '/user/lib.php'); require_once($CFG->dirroot . '/user/lib.php');
parent::setUp();
$this->resetAfterTest();
$CFG->getremoteaddrconf = GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR;
$this->auth = new auth_plugin_userkey(); $this->auth = new auth_plugin_userkey();
$this->user = self::getDataGenerator()->create_user(); $this->user = self::getDataGenerator()->create_user();
} }

View file

@ -52,7 +52,12 @@ class core_userkey_manager_testcase extends advanced_testcase {
* Initial set up. * Initial set up.
*/ */
public function setUp() { public function setUp() {
global $CFG;
parent::setUp();
$this->resetAfterTest(); $this->resetAfterTest();
$CFG->getremoteaddrconf = GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR;
$this->user = self::getDataGenerator()->create_user(); $this->user = self::getDataGenerator()->create_user();
$this->config = new stdClass(); $this->config = new stdClass();
} }