Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Zvonimir
ISPConfig 3
Commits
fb6c56e0
Commit
fb6c56e0
authored
Aug 21, 2014
by
Till Brehm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added code to installer to apply updates to the security_settings.ini
parent
e23c47d0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
0 deletions
+84
-0
install/dist/lib/fedora.lib.php
install/dist/lib/fedora.lib.php
+21
-0
install/dist/lib/gentoo.lib.php
install/dist/lib/gentoo.lib.php
+21
-0
install/dist/lib/opensuse.lib.php
install/dist/lib/opensuse.lib.php
+21
-0
install/lib/installer_base.lib.php
install/lib/installer_base.lib.php
+21
-0
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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