2014-08-04 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, include/functions_update_manager.php: some fixes into the update manager. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10376 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
c5c338a0c2
commit
706eef436f
|
@ -1,3 +1,9 @@
|
|||
2014-08-04 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_config.php,
|
||||
include/functions_update_manager.php: some fixes into the update
|
||||
manager.
|
||||
|
||||
2014-08-04 Alejandro Gallardo <alejandro.gallardo@artica.es>
|
||||
|
||||
* general/main_menu.php: Now the submenus opened by the
|
||||
|
|
|
@ -781,17 +781,31 @@ function config_process_config () {
|
|||
// config_update_value ('autoupdate', true);
|
||||
// }
|
||||
|
||||
require_once ($config["homedir"]."/include/auth/mysql.php");
|
||||
require_once ($config["homedir"] . "/include/auth/mysql.php");
|
||||
|
||||
// Next is the directory where "/attachment" directory is placed, to upload files stores.
|
||||
// This MUST be writtable by http server user, and should be in pandora root.
|
||||
// By default, Pandora adds /attachment to this, so by default is the pandora console home dir
|
||||
|
||||
// Next is the directory where "/attachment" directory is placed,
|
||||
// to upload files stores. This MUST be writtable by http server
|
||||
// user, and should be in pandora root. By default, Pandora adds
|
||||
// /attachment to this, so by default is the pandora console home
|
||||
// dir.
|
||||
if (!isset ($config['attachment_store'])) {
|
||||
config_update_value ( 'attachment_store', $config['homedir'].'/attachment');
|
||||
config_update_value('attachment_store',
|
||||
$config['homedir'] . '/attachment');
|
||||
}
|
||||
else {
|
||||
//Fixed when the user moves the pandora console to another dir
|
||||
//after the first uses.
|
||||
if (!is_dir($config['attachment_store'])) {
|
||||
config_update_value('attachment_store',
|
||||
$config['homedir'] . '/attachment');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!isset ($config['fontpath'])) {
|
||||
config_update_value ( 'fontpath', $config['homedir'].'/include/fonts/smallfont.ttf');
|
||||
config_update_value('fontpath',
|
||||
$config['homedir'] . '/include/fonts/smallfont.ttf');
|
||||
}
|
||||
|
||||
if (!isset ($config['style'])) {
|
||||
|
@ -919,7 +933,8 @@ function config_process_config () {
|
|||
}
|
||||
|
||||
if (!isset ($config['ldap_base_dn'])) {
|
||||
config_update_value ( 'ldap_base_dn', 'ou=People,dc=edu,dc=example,dc=org');
|
||||
config_update_value('ldap_base_dn',
|
||||
'ou=People,dc=edu,dc=example,dc=org');
|
||||
}
|
||||
|
||||
if (!isset ($config['ldap_login_attr'])) {
|
||||
|
@ -1030,11 +1045,11 @@ function config_process_config () {
|
|||
config_update_value( 'api_password', '');
|
||||
}
|
||||
|
||||
if(defined('METACONSOLE')) {
|
||||
if (defined('METACONSOLE')) {
|
||||
// Customizable sections (Metaconsole)
|
||||
enterprise_include_once ('include/functions_enterprise.php');
|
||||
$customizable_sections = enterprise_hook('enterprise_get_customizable_sections');
|
||||
|
||||
|
||||
if($customizable_sections != ENTERPRISE_NOT_HOOK) {
|
||||
foreach($customizable_sections as $k => $v) {
|
||||
if (!isset ($config[$k])) {
|
||||
|
@ -1050,7 +1065,7 @@ function config_process_config () {
|
|||
|
||||
if (!isset ($config['relative_path']) && (isset ($_POST['nick'])
|
||||
|| isset ($config['id_user'])) && isset($config['enterprise_installed'])) {
|
||||
|
||||
|
||||
$isFunctionSkins = enterprise_include_once ('include/functions_skins.php');
|
||||
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
|
||||
|
||||
|
@ -1153,7 +1168,8 @@ function config_process_config () {
|
|||
}
|
||||
|
||||
if (!isset($config['custom_report_front_logo'])) {
|
||||
config_update_value ('custom_report_front_logo', 'images/pandora_logo_white.jpg');
|
||||
config_update_value ('custom_report_front_logo',
|
||||
'images/pandora_logo_white.jpg');
|
||||
}
|
||||
|
||||
if (!isset($config['custom_report_front_header'])) {
|
||||
|
@ -1161,7 +1177,8 @@ function config_process_config () {
|
|||
}
|
||||
|
||||
if (!isset($config['custom_report_front_firstpage'])) {
|
||||
config_update_value ('custom_report_front_firstpage', "<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><img src="" . ui_get_full_url(false, false, false, false) . "/images/pandora_report_logo.png" alt="" width="800" /></p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><span style="font-size: xx-large;">(_REPORT_NAME_)</span></p>
<p style="text-align: center;"><span style="font-size: large;">(_DATETIME_)</span></p>");
|
||||
config_update_value ('custom_report_front_firstpage',
|
||||
"<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><img src="" . ui_get_full_url(false, false, false, false) . "/images/pandora_report_logo.png" alt="" width="800" /></p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><span style="font-size: xx-large;">(_REPORT_NAME_)</span></p>
<p style="text-align: center;"><span style="font-size: large;">(_DATETIME_)</span></p>");
|
||||
}
|
||||
|
||||
if (!isset($config['custom_report_front_footer'])) {
|
||||
|
|
|
@ -73,10 +73,12 @@ function update_manager_get_config_values() {
|
|||
function rrmdir($dir) {
|
||||
if (is_dir($dir)) {
|
||||
$objects = scandir($dir);
|
||||
|
||||
foreach ($objects as $object) {
|
||||
if ($object != "." && $object != "..") {
|
||||
if (filetype($dir."/".$object) == "dir")
|
||||
rrmdir($dir."/".$object); else unlink($dir."/".$object);
|
||||
if (filetype($dir . "/" . $object) == "dir")
|
||||
rrmdir($dir . "/" . $object);
|
||||
else unlink($dir . "/" . $object);
|
||||
}
|
||||
}
|
||||
reset($objects);
|
||||
|
@ -373,8 +375,10 @@ function update_manager_starting_update() {
|
|||
"/downloads/last_package.tgz";
|
||||
|
||||
try {
|
||||
rrmdir($config['attachment_store'] .
|
||||
"/downloads/temp_update/pandora_console");
|
||||
|
||||
$phar = new PharData($path_package);
|
||||
rrmdir($config['attachment_store'] . "/downloads/temp_update/pandora_console");
|
||||
$phar->extractTo($config['attachment_store'] . "/downloads/temp_update");
|
||||
}
|
||||
catch (Exception $e) {
|
||||
|
@ -395,7 +399,14 @@ function update_manager_starting_update() {
|
|||
array('value' => 50),
|
||||
array('token' => 'progress_update'));
|
||||
|
||||
$full_path = $config['attachment_store'] . "/downloads/temp_update/pandora_console";
|
||||
$path_array = array('downloads', 'temp_update', 'pandora_console');
|
||||
$full_path = $config['attachment_store'];
|
||||
foreach ($path_array as $directory) {
|
||||
$full_path = $full_path . '/' . $directory;
|
||||
if (!is_dir($full_path)) {
|
||||
mkdir($full_path);
|
||||
}
|
||||
}
|
||||
|
||||
$homedir = $config['homedir'];
|
||||
|
||||
|
|
Loading…
Reference in New Issue