2012-08-17 Miguel de Dios <miguel.dedios@artica.es>

* godmode/users/configure_user.php: fixed when the metaconsole is
	not set.
	
	* godmode/reporting/reporting_builder.php: cleaned source code
	style.
	
	* include/functions_reports.php: fixed into the function
	"reports_get_reports" to get reports in All group for users of
	others groups.
	
	* include/functions_api.php: fixed the confused error messages when
	there is data events.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6878 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-08-17 15:28:55 +00:00
parent b2b23c7cb0
commit 39c0cf9f84
5 changed files with 136 additions and 105 deletions

View File

@ -1,3 +1,18 @@
2012-08-17 Miguel de Dios <miguel.dedios@artica.es>
* godmode/users/configure_user.php: fixed when the metaconsole is
not set.
* godmode/reporting/reporting_builder.php: cleaned source code
style.
* include/functions_reports.php: fixed into the function
"reports_get_reports" to get reports in All group for users of
others groups.
* include/functions_api.php: fixed the confused error messages when
there is data events.
2012-08-17 Sergio Martin <sergio.martin@artica.es>
* include/javascript/pandora_modules.js

View File

@ -141,7 +141,8 @@ switch ($action) {
if (!empty($ids_serialize)) {
$sql = "DELETE FROM treport_content WHERE id_rc IN ($ids_serialize)";
$resultOperationDB = db_process_sql($sql);
} else {
}
else {
$resultOperationDB = false;
}
@ -156,7 +157,8 @@ switch ($action) {
if (($countItems < $position_to_delete) || ($position_to_delete < 1)) {
$resultOperationDB = false;
} else {
}
else {
$sql = "SELECT id_rc FROM treport_content WHERE id_report=$idReport ORDER BY '`order`'";
$items = db_get_all_rows_sql($sql);
switch ($pos_delete) {
@ -203,11 +205,12 @@ switch ($action) {
$subsection = '';
switch ($activeTab) {
case 'main': $buttons['list_reports']['active'] = true;
case 'main':
$buttons['list_reports']['active'] = true;
$subsection = ' &raquo; '.__('Custom reporting');
break;
default: $subsection = reporting_enterprise_add_subsection_main($activeTab, $buttons);
default:
$subsection = reporting_enterprise_add_subsection_main($activeTab, $buttons);
break;
}
@ -259,7 +262,8 @@ switch ($action) {
// Show only selected groups
if ($id_group > 0) {
$group = array("$id_group" => $id_group);
} else {
}
else {
$group = false;
}
@ -273,14 +277,16 @@ switch ($action) {
'name' => $search_name,
'order' => 'name'
);
} else {
}
else {
$filter = array (
'order' => 'name'
);
}
$reports = reports_get_reports ($filter,
array ('name', 'id_report', 'description', 'private', 'id_user', 'id_group'), $return_all_group, 'IR', $group);
array ('name', 'id_report', 'description', 'private',
'id_user', 'id_group'), $return_all_group, 'IR', $group);
$table->width = '0px';
if (sizeof ($reports)) {
$table->id = 'report_list';
@ -997,11 +1003,12 @@ switch ($action) {
$subsection = '';
switch ($activeTab) {
case 'main': $buttons['list_reports']['active'] = true;
case 'main':
$buttons['list_reports']['active'] = true;
$subsection = ' &raquo; '.__('Custom reporting');
break;
default: $subsection = reporting_enterprise_add_subsection_main($activeTab, $buttons);
default:
$subsection = reporting_enterprise_add_subsection_main($activeTab, $buttons);
break;
}
@ -1010,7 +1017,6 @@ switch ($action) {
reporting_enterprise_select_main_tab($action);
}
return;
break;
}
@ -1075,5 +1081,4 @@ switch ($activeTab) {
reporting_enterprise_select_tab($activeTab);
break;
}
?>

View File

@ -84,7 +84,8 @@ $update_user = (bool) get_parameter ('update_user');
$status = get_parameter ('status', -1);
// Reset status var if current action is not update_user
if ($new_user || $create_user || $add_profile || $delete_profile || $update_user){
if ($new_user || $create_user || $add_profile ||
$delete_profile || $update_user) {
$status = -1;
}
@ -427,13 +428,19 @@ if($id == $config['id_user']) {
}
if (enterprise_installed()) {
$user_info_metaconsole_access = 'only_console';
if (isset($user_info["metaconsole_access"])) {
$user_info_metaconsole_access = $user_info["metaconsole_access"];
}
$table->data[12][0] = __('Metaconsole access');
$metaconsole_accesses = array('only_console' => __('No access'),
'basic' => __('Basic (Only Metaconsole)'),
'advanced' => __('Advanced (Only Metaconsole)'),
//'custom' => __('Custom access (Only Metaconsole)'),
'all' => __('Full (Metaconsole and normal console)'));
$table->data[12][1] = html_print_select($metaconsole_accesses,'metaconsole_access',$user_info["metaconsole_access"],'','',-1,true, false, false);
$table->data[12][1] = html_print_select($metaconsole_accesses,
'metaconsole_access', $user_info_metaconsole_access,
'','',-1,true, false, false);
}
echo '<form method="post" autocomplete="off">';
@ -532,8 +539,5 @@ foreach ($result as $profile) {
array_push ($table->data, $data);
html_print_table ($table);
unset ($table);
?>

View File

@ -4987,8 +4987,9 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
$data['data'] = $result;
returnData($returnType, $data, $separator);
return;
if (empty($result))
return false;
return true;
}
/**
@ -5001,9 +5002,10 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
*/
function api_get_events($trash1, $trash2, $other, $returnType, $user_in_db = null) {
if ($user_in_db !== null) {
get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db);
$correct = get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db);
$last_error = error_get_last();
if (!empty($last_error)) {
if (!$correct && !empty($last_error)) {
$errors = array(E_ERROR, E_WARNING, E_USER_ERROR,
E_USER_WARNING);
if (in_array($last_error['type'], $errors)) {

View File

@ -83,22 +83,27 @@ function reports_get_reports ($filter = false, $fields = false, $returnAllGroup
$reports = array ();
$all_reports = @db_get_all_rows_filter ('treport', $filter, $fields);
if (empty($all_reports))
$all_reports = array();
if ($group) {
$groups = $group;
} else {
}
else {
//Recheck in all reports if the user have permissions to see each report.
$groups = users_get_groups ($config['id_user'], $privileges, $returnAllGroup);
}
foreach ($all_reports as $report) {
//If the report is not in all group.
if ($report['id_group'] != 0) {
if (!in_array($report['id_group'], array_keys($groups)))
continue;
if ($config['id_user'] != $report['id_user']
&& ! check_acl ($config['id_user'], $report['id_group'], 'AR'))
continue;
}
array_push ($reports, $report);
}