Merge branch 'ent-1964-5331-error-de-ACLs-en-custom-graphs' into 'develop'

Ent 1964 5331 error de ac ls en custom graphs

See merge request artica/pandorafms!1315
This commit is contained in:
vgilc 2018-02-26 10:31:22 +01:00
commit 3f7e6f7ed3
3 changed files with 22 additions and 4 deletions

View File

@ -161,7 +161,9 @@ if (!empty ($graphs)) {
$table->size[3] = '200px';
$table->align[2] = 'left';
$table->align[3] = 'left';
$op_column = false;
if ($report_w || $report_m) {
$op_column = true;
$table->align[4] = 'left';
$table->head[4] = __('Op.') .
html_print_checkbox('all_delete', 0, false, true, false,
@ -193,6 +195,8 @@ if (!empty ($graphs)) {
.$graph['id_graph'].'" onClick="if (!confirm(\''.__('Are you sure?').'\'))
return false;">' . html_print_image("images/cross.png", true, array('alt' => __('Delete'), 'title' => __('Delete'))) . '</a>' .
html_print_checkbox_extended ('delete_multiple[]', $graph['id_graph'], false, false, '', 'class="check_delete" style="margin-left:2px;"', true);
} else {
if($op_column) $data[4] = '';
}
array_push ($table->data, $data);

View File

@ -596,10 +596,13 @@ switch ($action) {
$table->size[$next] = '15%';
$next++;
if(!defined('METACONSOLE'))
$op_column = false;
if(!defined('METACONSOLE')) {
$op_column = true;
$table->head[$next] = '<span title="Operations">' .
__('Op.') . '</span>'.html_print_checkbox('all_delete', 0, false, true, false,
'check_all_checkboxes();');
}
//$table->size = array ();
$table->size[$next] = '10%';
@ -746,6 +749,8 @@ switch ($action) {
$data[$next] .= '</form>';
}
} else {
if ($op_column) $data[$next] = '';
}
array_push ($table->data, $data);

View File

@ -981,10 +981,19 @@ function users_check_users() {
// user is admin or pandora manager and the group is all
function users_can_manage_group_all($access = "PM") {
global $config;
$access = get_acl_column($access);
$sql = sprintf ('SELECT COUNT(*) FROM tusuario_perfil
INNER JOIN tperfil
ON tperfil.id_perfil = tusuario_perfil.id_perfil
WHERE tusuario_perfil.id_grupo=0
AND tusuario_perfil.id_usuario="%s"
AND %s=1
', $config['id_user'], $access
);
$is_admin = db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']);
if (check_acl ($config['id_user'], 0, $access, true) || $is_admin) {
if (users_is_admin($config['id_user']) || (int)db_get_value_sql($sql) !== 0) {
return true;
}