Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Massimiliano
ISPConfig 3
Commits
fb6c56e0
Commit
fb6c56e0
authored
Aug 21, 2014
by
Till Brehm
Browse files
Added code to installer to apply updates to the security_settings.ini
parent
e23c47d0
Changes
4
Hide whitespace changes
Inline
Side-by-side
install/dist/lib/fedora.lib.php
View file @
fb6c56e0
...
...
@@ -833,9 +833,30 @@ class installer_dist extends installer_base {
$command
=
"cp -rf ../server
$install_dir
"
;
caselog
(
$command
.
' &> /dev/null'
,
__FILE__
,
__LINE__
,
"EXECUTED:
$command
"
,
"Failed to execute the command
$command
"
);
//* Make a backup of the security settings
if
(
is_file
(
'/usr/local/ispconfig/security/security_settings.ini'
))
copy
(
'/usr/local/ispconfig/security/security_settings.ini'
,
'/usr/local/ispconfig/security/security_settings.ini~'
);
//* copy the ISPConfig security part
$command
=
'cp -rf ../security '
.
$install_dir
;
caselog
(
$command
.
' &> /dev/null'
,
__FILE__
,
__LINE__
,
"EXECUTED:
$command
"
,
"Failed to execute the command
$command
"
);
//* Apply changed security_settings.ini values to new security_settings.ini file
if
(
is_file
(
'/usr/local/ispconfig/security/security_settings.ini~'
))
{
$security_settings_old
=
ini_to_array
(
file_get_contents
(
'/usr/local/ispconfig/security/security_settings.ini~'
));
$security_settings_new
=
ini_to_array
(
file_get_contents
(
'/usr/local/ispconfig/security/security_settings.ini'
));
if
(
is_array
(
$security_settings_new
)
&&
is_array
(
$security_settings_old
))
{
foreach
(
$security_settings_new
as
$section
=>
$sval
)
{
if
(
is_array
(
$sval
))
{
foreach
(
$sval
as
$key
=>
$val
)
{
if
(
isset
(
$security_settings_old
[
$section
])
&&
isset
(
$security_settings_old
[
$section
][
$key
]))
{
$security_settings_new
[
$section
][
$key
]
=
$security_settings_old
[
$section
][
$key
];
}
}
}
}
file_put_contents
(
'/usr/local/ispconfig/security/security_settings.ini'
,
array_to_ini
(
$security_settings_new
));
}
}
//* Create a symlink, so ISPConfig is accessible via web
// Replaced by a separate vhost definition for port 8080
...
...
install/dist/lib/gentoo.lib.php
View file @
fb6c56e0
...
...
@@ -749,9 +749,30 @@ class installer extends installer_base
$command
=
"cp -rf ../server
$install_dir
"
;
caselog
(
$command
.
' &> /dev/null'
,
__FILE__
,
__LINE__
,
"EXECUTED:
$command
"
,
"Failed to execute the command
$command
"
);
//* Make a backup of the security settings
if
(
is_file
(
'/usr/local/ispconfig/security/security_settings.ini'
))
copy
(
'/usr/local/ispconfig/security/security_settings.ini'
,
'/usr/local/ispconfig/security/security_settings.ini~'
);
//* copy the ISPConfig security part
$command
=
'cp -rf ../security '
.
$install_dir
;
caselog
(
$command
.
' &> /dev/null'
,
__FILE__
,
__LINE__
,
"EXECUTED:
$command
"
,
"Failed to execute the command
$command
"
);
//* Apply changed security_settings.ini values to new security_settings.ini file
if
(
is_file
(
'/usr/local/ispconfig/security/security_settings.ini~'
))
{
$security_settings_old
=
ini_to_array
(
file_get_contents
(
'/usr/local/ispconfig/security/security_settings.ini~'
));
$security_settings_new
=
ini_to_array
(
file_get_contents
(
'/usr/local/ispconfig/security/security_settings.ini'
));
if
(
is_array
(
$security_settings_new
)
&&
is_array
(
$security_settings_old
))
{
foreach
(
$security_settings_new
as
$section
=>
$sval
)
{
if
(
is_array
(
$sval
))
{
foreach
(
$sval
as
$key
=>
$val
)
{
if
(
isset
(
$security_settings_old
[
$section
])
&&
isset
(
$security_settings_old
[
$section
][
$key
]))
{
$security_settings_new
[
$section
][
$key
]
=
$security_settings_old
[
$section
][
$key
];
}
}
}
}
file_put_contents
(
'/usr/local/ispconfig/security/security_settings.ini'
,
array_to_ini
(
$security_settings_new
));
}
}
//* Create the config file for ISPConfig interface
...
...
install/dist/lib/opensuse.lib.php
View file @
fb6c56e0
...
...
@@ -905,9 +905,30 @@ class installer_dist extends installer_base {
$command
=
"cp -rf ../server
$install_dir
"
;
caselog
(
$command
.
' &> /dev/null'
,
__FILE__
,
__LINE__
,
"EXECUTED:
$command
"
,
"Failed to execute the command
$command
"
);
//* Make a backup of the security settings
if
(
is_file
(
'/usr/local/ispconfig/security/security_settings.ini'
))
copy
(
'/usr/local/ispconfig/security/security_settings.ini'
,
'/usr/local/ispconfig/security/security_settings.ini~'
);
//* copy the ISPConfig security part
$command
=
'cp -rf ../security '
.
$install_dir
;
caselog
(
$command
.
' &> /dev/null'
,
__FILE__
,
__LINE__
,
"EXECUTED:
$command
"
,
"Failed to execute the command
$command
"
);
//* Apply changed security_settings.ini values to new security_settings.ini file
if
(
is_file
(
'/usr/local/ispconfig/security/security_settings.ini~'
))
{
$security_settings_old
=
ini_to_array
(
file_get_contents
(
'/usr/local/ispconfig/security/security_settings.ini~'
));
$security_settings_new
=
ini_to_array
(
file_get_contents
(
'/usr/local/ispconfig/security/security_settings.ini'
));
if
(
is_array
(
$security_settings_new
)
&&
is_array
(
$security_settings_old
))
{
foreach
(
$security_settings_new
as
$section
=>
$sval
)
{
if
(
is_array
(
$sval
))
{
foreach
(
$sval
as
$key
=>
$val
)
{
if
(
isset
(
$security_settings_old
[
$section
])
&&
isset
(
$security_settings_old
[
$section
][
$key
]))
{
$security_settings_new
[
$section
][
$key
]
=
$security_settings_old
[
$section
][
$key
];
}
}
}
}
file_put_contents
(
'/usr/local/ispconfig/security/security_settings.ini'
,
array_to_ini
(
$security_settings_new
));
}
}
//* Create a symlink, so ISPConfig is accessible via web
// Replaced by a separate vhost definition for port 8080
...
...
install/lib/installer_base.lib.php
View file @
fb6c56e0
...
...
@@ -1745,9 +1745,30 @@ class installer_base {
$command
=
'cp -rf ../server '
.
$install_dir
;
caselog
(
$command
.
' &> /dev/null'
,
__FILE__
,
__LINE__
,
"EXECUTED:
$command
"
,
"Failed to execute the command
$command
"
);
//* Make a backup of the security settings
if
(
is_file
(
'/usr/local/ispconfig/security/security_settings.ini'
))
copy
(
'/usr/local/ispconfig/security/security_settings.ini'
,
'/usr/local/ispconfig/security/security_settings.ini~'
);
//* copy the ISPConfig security part
$command
=
'cp -rf ../security '
.
$install_dir
;
caselog
(
$command
.
' &> /dev/null'
,
__FILE__
,
__LINE__
,
"EXECUTED:
$command
"
,
"Failed to execute the command
$command
"
);
//* Apply changed security_settings.ini values to new security_settings.ini file
if
(
is_file
(
'/usr/local/ispconfig/security/security_settings.ini~'
))
{
$security_settings_old
=
ini_to_array
(
file_get_contents
(
'/usr/local/ispconfig/security/security_settings.ini~'
));
$security_settings_new
=
ini_to_array
(
file_get_contents
(
'/usr/local/ispconfig/security/security_settings.ini'
));
if
(
is_array
(
$security_settings_new
)
&&
is_array
(
$security_settings_old
))
{
foreach
(
$security_settings_new
as
$section
=>
$sval
)
{
if
(
is_array
(
$sval
))
{
foreach
(
$sval
as
$key
=>
$val
)
{
if
(
isset
(
$security_settings_old
[
$section
])
&&
isset
(
$security_settings_old
[
$section
][
$key
]))
{
$security_settings_new
[
$section
][
$key
]
=
$security_settings_old
[
$section
][
$key
];
}
}
}
}
file_put_contents
(
'/usr/local/ispconfig/security/security_settings.ini'
,
array_to_ini
(
$security_settings_new
));
}
}
//* Create a symlink, so ISPConfig is accessible via web
// Replaced by a separate vhost definition for port 8080
...
...
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