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
integration
prechecker
Commits
9a2b5e0b
Commit
9a2b5e0b
authored
Mar 28, 2013
by
Hugh Davenport
Committed by
Dan Marsden
May 07, 2013
Browse files
MDL-35852 Add config option to prevent changes to configexecutable settings
parent
95190fda
Changes
3
Hide whitespace changes
Inline
Side-by-side
config-dist.php
View file @
9a2b5e0b
...
...
@@ -456,6 +456,12 @@ $CFG->admin = 'admin';
// To ensure they are never used even when available:
// $CFG->svgicons = false;
//
// Some administration options allow setting the path to executable files. This can
// potentially cause a security risk. Set this option to true to disable editing
// those config settings via the web. They will need to be set explicitly in the
// config.php file
// $CFG->preventexecpath = true;
//
//=========================================================================
// 7. SETTINGS FOR DEVELOPMENT SERVERS - not intended for production use!!!
//=========================================================================
...
...
lang/en/admin.php
View file @
9a2b5e0b
...
...
@@ -513,6 +513,7 @@ $string['errorsetting'] = 'Could not save setting:';
$string
[
'errorwithsettings'
]
=
'Some settings were not changed due to an error.'
;
$string
[
'everyonewhocan'
]
=
'Everyone who can \'{$a}\''
;
$string
[
'exceptions'
]
=
'exceptions'
;
$string
[
'execpathnotallowed'
]
=
'Setting executable paths disabled in config.php'
;
$string
[
'experimental'
]
=
'Experimental'
;
$string
[
'experimentalsettings'
]
=
'Experimental settings'
;
$string
[
'extendedusernamechars'
]
=
'Allow extended characters in usernames'
;
...
...
lib/adminlib.php
View file @
9a2b5e0b
...
...
@@ -2107,6 +2107,16 @@ class admin_setting_configfile extends admin_setting_configtext {
'<div class="form-file defaultsnext"><input type="text" size="'
.
$this
->
size
.
'" id="'
.
$this
->
get_id
()
.
'" name="'
.
$this
->
get_full_name
()
.
'" value="'
.
s
(
$data
)
.
'" />'
.
$executable
.
'</div>'
,
$this
->
description
,
true
,
''
,
$default
,
$query
);
}
/**
* checks if execpatch has been disabled in config.php
*/
public
function
write_setting
(
$data
)
{
global
$CFG
;
if
(
!
empty
(
$CFG
->
preventexecpath
))
{
return
''
;
}
return
parent
::
write_setting
(
$data
);
}
}
...
...
@@ -2125,6 +2135,7 @@ class admin_setting_configexecutable extends admin_setting_configfile {
* @return string XHTML field
*/
public
function
output_html
(
$data
,
$query
=
''
)
{
global
$CFG
;
$default
=
$this
->
get_defaultsetting
();
if
(
$data
)
{
...
...
@@ -2136,6 +2147,9 @@ class admin_setting_configexecutable extends admin_setting_configfile {
}
else
{
$executable
=
''
;
}
if
(
!
empty
(
$CFG
->
preventexecpath
))
{
$this
->
visiblename
.
=
'<div class="form-overridden">'
.
get_string
(
'execpathnotallowed'
,
'admin'
)
.
'</div>'
;
}
return
format_admin_setting
(
$this
,
$this
->
visiblename
,
'<div class="form-file defaultsnext"><input type="text" size="'
.
$this
->
size
.
'" id="'
.
$this
->
get_id
()
.
'" name="'
.
$this
->
get_full_name
()
.
'" value="'
.
s
(
$data
)
.
'" />'
.
$executable
.
'</div>'
,
...
...
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