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:
mdtrooper 2014-08-04 16:00:58 +00:00
parent c5c338a0c2
commit 706eef436f
3 changed files with 50 additions and 16 deletions

View File

@ -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

View File

@ -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,7 +1045,7 @@ 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');
@ -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', "&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&lt;img&#x20;src=&quot;" . ui_get_full_url(false, false, false, false) . "/images/pandora_report_logo.png&quot;&#x20;alt=&quot;&quot;&#x20;width=&quot;800&quot;&#x20;/&gt;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&lt;span&#x20;style=&quot;font-size:&#x20;xx-large;&quot;&gt;&#40;_REPORT_NAME_&#41;&lt;/span&gt;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&lt;span&#x20;style=&quot;font-size:&#x20;large;&quot;&gt;&#40;_DATETIME_&#41;&lt;/span&gt;&lt;/p&gt;");
config_update_value ('custom_report_front_firstpage',
"&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&lt;img&#x20;src=&quot;" . ui_get_full_url(false, false, false, false) . "/images/pandora_report_logo.png&quot;&#x20;alt=&quot;&quot;&#x20;width=&quot;800&quot;&#x20;/&gt;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&lt;span&#x20;style=&quot;font-size:&#x20;xx-large;&quot;&gt;&#40;_REPORT_NAME_&#41;&lt;/span&gt;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&lt;span&#x20;style=&quot;font-size:&#x20;large;&quot;&gt;&#40;_DATETIME_&#41;&lt;/span&gt;&lt;/p&gt;");
}
if (!isset($config['custom_report_front_footer'])) {

View File

@ -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'];