Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
61bf4f7c
Commit
61bf4f7c
authored
Jun 16, 2020
by
Charles Fulton
Committed by
Eloy Lafuente
Jul 15, 2020
Browse files
MDL-69074 admin: ensure consistent default for getremoteaddrconf
parent
9a9ea3f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
admin/settings/server.php
View file @
61bf4f7c
...
...
@@ -99,7 +99,7 @@ $options = array(
GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR
|
GETREMOTEADDR_SKIP_HTTP_CLIENT_IP
=>
'REMOTE_ADDR'
);
$temp
->
add
(
new
admin_setting_configselect
(
'getremoteaddrconf'
,
new
lang_string
(
'getremoteaddrconf'
,
'admin'
),
new
lang_string
(
'configgetremoteaddrconf'
,
'admin'
),
GETREMOTEADDR_SKIP_
HTTP_X_FORWARDED_FOR
|
GETREMOTEADDR_SKIP_HTTP_CLIENT_IP
,
$options
));
GETREMOTEADDR_SKIP_
DEFAULT
,
$options
));
$temp
->
add
(
new
admin_setting_configtext
(
'reverseproxyignore'
,
new
lang_string
(
'reverseproxyignore'
,
'admin'
),
new
lang_string
(
'configreverseproxyignore'
,
'admin'
),
''
));
$temp
->
add
(
new
admin_setting_heading
(
'webproxy'
,
new
lang_string
(
'webproxy'
,
'admin'
),
new
lang_string
(
'webproxyinfo'
,
'admin'
)));
...
...
lib/moodlelib.php
View file @
61bf4f7c
...
...
@@ -365,6 +365,10 @@ define('PAGE_COURSE_VIEW', 'course-view');
define
(
'GETREMOTEADDR_SKIP_HTTP_CLIENT_IP'
,
'1'
);
/** Get remote addr constant */
define
(
'GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR'
,
'2'
);
/**
* GETREMOTEADDR_SKIP_DEFAULT defines the default behavior remote IP address validation.
*/
define
(
'GETREMOTEADDR_SKIP_DEFAULT'
,
GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR
|
GETREMOTEADDR_SKIP_HTTP_CLIENT_IP
);
// Blog access level constant declaration.
define
(
'BLOG_USER_LEVEL'
,
1
);
...
...
@@ -9165,7 +9169,7 @@ function getremoteaddr($default='0.0.0.0') {
if
(
empty
(
$CFG
->
getremoteaddrconf
))
{
// This will happen, for example, before just after the upgrade, as the
// user is redirected to the admin screen.
$variablestoskip
=
0
;
$variablestoskip
=
GETREMOTEADDR_SKIP_DEFAULT
;
}
else
{
$variablestoskip
=
$CFG
->
getremoteaddrconf
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment