pandorafms/pandora_console/operation/users/user.php

175 lines
5.5 KiB
PHP
Raw Normal View History

<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
global $config;
check_login ();
2010-02-19 Sancho Lerena <slerena@artica.es> * functions_events.php: Fixed typo (switched meaning) in two labels. * include/styles/pandora.css: Changed background color of th default style. * include/functions_reporting.php: Improved function get_group_stats(). Now supports stats from batch-mode and get realtime stats in a more efficient way. Fixed get_fired_alerts_reporting_table() to avoid problems in external reporting (PDF & XML). * include/functions_servers.php: get_server_performance() now uses batch mode stats reporting, and improved also the realtime stats generation. Same with function get_server_info(). * include/functions_config.php: Added new config tokens (not fully implemented yet) for event, trap, strings and audit automatic purge. * include/functions_ui.php: Added new print_page_header() function to set the new standard header in all pages, using the "tabbed" format to show the title, subtitle and other options like help, or custom-tabs for the page * pandoradb.sql: Added tserver.stat_utimestamp field. Added indexes to tsession table. Fixed typo in field name in tgroup_stat: agents_uknown to agents_unknown. * extensions/ext_backup: New directory to place "deleted" extensions. * extensions/dbmanager/dbmanager.css: Table names now are in it's original lowercase/uppercase format. * extensions/dbmanager.php: Updated headers, and now return "empty" when a search is empty, instead "error" as before. * extensions/users_connected.php extensions/module_groups.php extensions/plugin_registration.php extensions/pandora_logs.php operation/incidents/incident.php operation/snmpconsole/snmp_view.php operation/users/user.php operation/users/user_edit.php godmode/agentes/planned_downtime.php operation/events/events.php operation/visual_console/index.php operation/agentes/estado_generalagente.php operation/agentes/estado_agente.php operation/agentes/exportdata.php operation/agentes/ver_agente.php operation/agentes/status_monitor.php operation/agentes/alerts_status.php operation/users/user_statistics.php: Added new header format. * operation/agentes/estado_grupo.php: Removed old group view. * operation/agentes/tactical.php: Adapted to use new realtime/batch statistical system. Placed events above server info. Showing only pending events and other minor changes. * operation/agentes/group_view.php: NEW screen, replacing old one. Probably most ugly, but much more useful than before. * operation/agentes/networkmap.php: Added title. * operation/messages/message.php: Added title and adding some exists in code was missing before. * operation/reporting/reporting_viewer.php: Added title. * operation/reporting/graph_viewer.php: Added title. * operation/reporting/custom_reporting.php: Added title. * operation/servers/view_server.php: * operation/menu.php: Replaced old group view with new (this has english name). Removed autorefresh "by default" in server view. * extras/pandoradb_migrate_v3.0_to_v3.1.sql: Fixed typo. * extras/pandora_diag.php: Minor changes, removed some info and added other. * general/logon_ok.php: Minor aesthetic changes. * general/header.php: Fixed missing ";" * operation/extensions.php, godmode/extensions.php: Added support for delete extensions. * godmode/menu.php: New setup items. * godmode/setup/setup.php, godmode/setup/performance.php, godmode/setup/setup_visuals.php: Reordered setup options, new setup section "Performance", added new performance options to set "realtime" statistics or "batchmode" with it's own interval. Some setup info is now shared with the servers (but it it's any change in setup, servers should be restarted anyway). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2390 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-19 16:16:03 +01:00
// Header
print_page_header (__('Pandora users'), "images/group.png", false, "", false, "");
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->width = 700;
$table->class = "databox";
$table->head = array ();
$table->data = array ();
$table->align = array ();
$table->head[0] = __('User ID');
$table->head[1] = __('Name');
$table->head[2] = __('Last contact');
$table->head[3] = __('Profile');
$table->head[4] = __('Description');
$table->align[2] = "center";
$table->align[3] = "center";
$info = array ();
$info = get_users ();
//Only the users from the user groups are visible
$user_groups = get_user_groups ($config["id_user"]);
$user_groups_id = array_keys($user_groups);
$users_id = array();
foreach ($user_groups_id as $group) {
$user_group_users = get_group_users($group);
foreach ($user_group_users as $user_group_user)
array_push($users_id,get_user_id ($user_group_user));
}
$users_hidden = array_diff(array_keys($info),$users_id);
foreach($users_hidden as $user_hidden){
unset($info[$user_hidden]);
}
$rowPair = true;
$iterator = 0;
foreach ($info as $user_id => $user_info) {
if ($rowPair)
$table->rowclass[$iterator] = 'rowPair';
else
$table->rowclass[$iterator] = 'rowOdd';
$rowPair = !$rowPair;
$iterator++;
2009-11-27 Sancho lerena <slerena@artica.es> * operation/menu.php: User section has no ACL check, always can be seen. * index.php: Added suppor for user-defined custom language (this code was on my disk for 3 months, pending to be commited!). * include/functions_db.php, * include/functions_agents.php, * godmode/alerts/alert_list.php, * godmode/agentes/modificar_agente.php, * godmode/agentes/configurar_agente.php: Added audit calls to several management operations who don't have or have insufficient audit info. * godmode/users/configure_user.php: Fixed several annoyings bugs. Added custom language support, and added more audit info on management operations. * godmode/users/user_list.php: More audit info. * include/config_process.php: Add new debug option to render error log to /pandora_console.log. Also set timezone if not defined (this makes warnings on several PHP 5.x setups). Added user custom language support. * include/functions_events.php: More audit info. Fixed problems with HTML encoding render. * functions_io.php: Some cleaning. * include/functions_messages.php: Fixed problems with HTML encoding render. * functions_ui.php: Fixed problems with HTML encoding render in print_string_substr() function. * auth/mysql.php: is_user_admin() functions seems to be broken ¿?¿!. Fixed. * styles/pandora.css: removed green colored left border in default style. * message.php, incident*: Fixed problems with HTML encoding render. * user.php: Better ACL check before let user to view/edit another user. * user_edit: Removed some un-used form fields, some arrangements in layout, and FIXED forever problems with password change (new code written). * users/user_statistics.php: Now user can see its own audit records. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2139 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-11-27 21:02:12 +01:00
if ((check_acl ($config["id_user"], get_user_groups ($user_id), "UM")) OR ($config["id_user"] == $user_id)){
$data[0] = '<b><a href="index.php?sec=usuarios&amp;sec2=operation/users/user_edit&amp;id='.$user_id.'">'.$user_id.'</a></b>';
} else {
$data[0] = $user_id;
}
$data[1] = $user_info["fullname"].'<a href="#" class="tip"><span>';
$data[1] .= __('First name').': '.$user_info["firstname"].'<br />';
$data[1] .= __('Last name').': '.$user_info["lastname"].'<br />';
$data[1] .= __('Phone').': '.$user_info["phone"].'<br />';
$data[1] .= __('E-mail').': '.$user_info["email"].'<br />';
$data[1] .= '</span></a>';
$data[2] = print_timestamp ($user_info["last_connect"], true);
if ($user_info["is_admin"]) {
$data[3] = print_image ("images/user_suit.png", true, array ("alt" => __('Admin'), "title" => __('Administrator'))).'&nbsp;';
} else {
$data[3] = print_image ("images/user_green.png", true, array ("alt" => __('User'), "title" => __('Standard User'))).'&nbsp;';
}
$data[3] .= '<a href="#" class="tip"><span>';
$result = get_db_all_rows_field_filter ("tusuario_perfil", "id_usuario", $user_id);
if (!empty ($result)) {
foreach ($result as $row) {
$data[3] .= get_profile_name ($row["id_perfil"]);
$data[3] .= " / ";
$data[3] .= get_group_name ($row["id_grupo"]);
$data[3] .= "<br />";
}
} else {
$data[3] .= __('The user doesn\'t have any assigned profile/group');
}
$data[3] .= "</span></a>";
$data[4] = print_string_substr ($user_info["comments"], 24, true);
array_push ($table->data, $data);
}
print_table ($table);
unset ($table);
echo '<h3>'.__('Profiles defined in Pandora').'</h3>';
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->class = 'databox';
$table->width = 700;
$table->head = array ();
$table->data = array ();
$table->size = array ();
$table->head[0] = __('Profiles');
$table->head[1] = "IR".print_help_tip (__('System incidents reading'), true);
$table->head[2] = "IW".print_help_tip (__('System incidents writing'), true);
$table->head[3] = "IM".print_help_tip (__('System incidents management'), true);
$table->head[4] = "AR".print_help_tip (__('Agents reading'), true);
$table->head[5] = "AW".print_help_tip (__('Agents management'), true);
$table->head[6] = "LW".print_help_tip (__('Alerts editing'), true);
$table->head[7] = "UM".print_help_tip (__('Users management'), true);
$table->head[8] = "DM".print_help_tip (__('Database management'), true);
$table->head[9] = "LM".print_help_tip (__('Alerts management'), true);
$table->head[10] = "PM".print_help_tip (__('Systems management'), true);
$table->size[1] = 40;
$table->size[2] = 40;
$table->size[3] = 40;
$table->size[4] = 40;
$table->size[5] = 40;
$table->size[6] = 40;
$table->size[7] = 40;
$table->size[8] = 40;
$table->size[9] = 40;
$table->size[10] = 40;
$profiles = get_db_all_rows_in_table ("tperfil");
$img = print_image ("images/ok.png", true, array ("border" => 0));
foreach ($profiles as $profile) {
$data[0] = $profile["name"];
$data[1] = ($profile["incident_view"] ? $img : '');
$data[2] = ($profile["incident_edit"] ? $img : '');
$data[3] = ($profile["incident_management"] ? $img : '');
$data[4] = ($profile["agent_view"] ? $img : '');
$data[5] = ($profile["agent_edit"] ? $img : '');
$data[6] = ($profile["alert_edit"] ? $img : '');
$data[7] = ($profile["user_management"] ? $img : '');
$data[8] = ($profile["db_management"] ? $img : '');
$data[9] = ($profile["alert_management"] ? $img : '');
$data[10] = ($profile["pandora_management"] ? $img : '');
array_push ($table->data, $data);
}
print_table ($table);
unset ($table);
2009-04-13 Esteban Sanchez <estebans@artica.es> * general/footer.php: Removed Firefox icon. Style correction. * godmode/agentes/agent_manager.php: Replaced &gt; with &raquo;. Style correction when setting bold attributes. * godmode/agentes/manage_config_remote.php, godmode/agentes/modificar_agente.php, godmode/agentes/module_manager.php, godmode/alerts/alert_list.php, godmode/db/db_audit.php, godmode/db/db_event.php, godmode/db/db_info.php, godmode/db/db_main.php, godmode/db/db_purge.php, godmode/db/db_refine.php, godmode/groups/configure_group.php, godmode/groups/group_list.php, godmode/modules/manage_nc_groups.php, godmode/modules/manage_network_components.php, godmode/modules/manage_network_templates.php, godmode/modules/manage_network_templates_form.php, godmode/modules/module_list.php, godmode/profiles/profile_list.php, godmode/reporting/graph_builder.php, godmode/reporting/map_builder.php, godmode/reporting/reporting_builder.php, godmode/servers/manage_export.php, godmode/servers/manage_export_form.php, godmode/servers/manage_recontask.php, godmode/servers/manage_recontask_form.php, godmode/servers/modificar_server.php, godmode/setup/setup_visuals.php, godmode/setup/links.php, godmode/setup/news.php, godmode/snmpconsole/snmp_alert.php, godmode/users/configure_user.php, godmode/users/user_list.php, operation/agentes/alerts_status.php, operation/agentes/estado_generalagente.php, operation/agentes/estado_agente.php, operation/agentes/estado_grupo.php, operation/agentes/estado_ultimopaquete.php, operation/agentes/exportdata.php, operation/agentes/networkmap.php, operation/agentes/status_monitor.php, operation/agentes/tactical.php, operation/events/events.php, operation/incidents/incident.php, operation/incidents/incident_detail.php, operation/incidents/incident_statistics.php, operation/messages/message.php, operation/reporting/custom_reporting.php, operation/reporting/graph_viewer.php, operation/reporting/reporting_viewer.php, operation/servers/view_server.php, operation/users/user.php, operation/users/user_edit.php, operation/users/user_statistics.php, operation/visual_console/index.php, godmode/agentes/agent_template.php: Replaced &gt; with &raquo; * operation/agentes/datos_agente.php: Return instead of exit * include/javascript/jquery.pandora.controls.js: Added pandoraSelectOS control to preview the OS icon on a select. * include/functions_reports.php: Fixed a bug on delete_report() that returns error when the report has no content. * include/functions_ui.php: Removed border attribute on print_os_icon(). Some fixes to meta refresh element on process_page_head(). Fixed format_filesize() when length is zero. * godmode/menu.php: Replaced link to file manager. Added enterprise hook. * godmode/setup/file_manager.php: Renamed from obfuscated name filemgr.php * include/styles/pandora.css: Textarea width reduced to 99% * godmode/setup/setup.php: Added get_os_icon AJAX operation. * images/mimetypes/, images/mimetypes/zip.png, images/mimetypes/image.png, images/mimetypes/unknown.png, images/mimetypes/directory.png: Added to repository. Mime type icons. * extras/pandoradb_migrate_v2.x_to_v3.0.sql: Removed date comments. * include/functions_filemanager.php: Added to repository. Minimal API for file manager system. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1608 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-13 11:50:56 +02:00
?>