this is a crosspost to http://forums.cacti.net/viewtopic.php?t=13467
according to the reply i received from lvm (cacti-forum-mod) I've crossposted my entry in this forum...
I hope I'll receive an answer here...
Problem:
I'm implementing Cacti into Nagios (using the following htaccess file and changing the auth mechanism to External in cacti):
Code: Select all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios/htpasswd.users
AuthGroupFile /etc/nagios/htgroup.users
require group admins
<Files ~ "graph_image.php|graph.php|graph_view.php|css|gif|js">
AuthUserFile /etc/nagios/htpasswd.users
AuthGroupFile /etc/nagios/htgroup.users
require group admins guests
</Files>
But if you login as admin OR guest you see the graph_settings icon on top of the screen. The graph settings are for USER-Based Graph Customization. Right ?
So, if I set the external auth this Feature is blocked
graph_settings.php
Code: Select all
/* you cannot have per-user graph settings if cacti's user management is not turned on */
if (read_config_option("global_auth") == "") {
raise_message(6);
display_output_messages();
return;
}
/* Find out whether this user has right here */
if($current_user["graph_settings"] == "") {
print "<strong><font size='+1' color='#FF0000'>YOU DO NOT HAVE RIGHTS TO CHANGE GRAPH SETTINGS</font></strong>";
include_once("./include/bottom_footer.php");
exit;
}
Is my solution correct to include this patch ?
Code: Select all
--- top_graph_header.php.orig 2006-05-11 12:50:14.000000000 +0200
+++ top_graph_header.php 2006-05-11 12:46:47.000000000 +0200
@@ -105,10 +105,10 @@
<?php if ($show_console_tab == true) {?><a href="index.php"><img src="images/tab_console.gif" alt="Console" align="absmiddle" border="0"></a><?php }?><a href="graph_view.php"><img src="images/tab_graphs.gif" alt="Graphs" align="absmiddle" border="0"></a>
</td>
<td>
- <img src="images/cacti_backdrop2.gif" align="absmiddle">
+ <!-- <img src="images/cacti_backdrop2.gif" align="absmiddle"> -->
</td>
<td align="right" nowrap>
- <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["graph_settings"] == "on")) { print '<a href="graph_settings.php"><img src="images/tab_settings'; if (basename($_SERVER["PHP_SELF"]) == "graph_settings.php") { print "_down"; } print '.gif" border="0" alt="Settings" align="absmiddle"></a>';}?> <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_tree"] == "on")) {?><a href="graph_view.php?action=tree"><img src="images/tab_mode_tree<?php if ($_REQUEST["action"] == "tree") { print "_down"; }?>.gif" border="0" title="Tree View" alt="Tree View" align="absmiddle"></a><?php }?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_list"] == "on")) {?><a href="graph_view.php?action=list"><img src="images/tab_mode_list<?php if ($_REQUEST["action"] == "list") { print "_down"; }?>.gif" border="0" title="List View" alt="List View" align="absmiddle"></a><?php }?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_preview"] == "on")) {?><a href="graph_view.php?action=preview"><img src="images/tab_mode_preview<?php if ($_REQUEST["action"] == "preview") { print "_down"; }?>.gif" border="0" title="Preview View" alt="Preview View" align="absmiddle"></a><?php }?> <br>
+ <?php if ((read_config_option("global_auth") == "on") && (!isset($_SESSION["sess_user_id"]) || $current_user["graph_settings"] == "on")) { print '<a href="graph_settings.php"><img src="images/tab_settings'; if (basename($_SERVER["PHP_SELF"]) == "graph_settings.php") { print "_down"; } print '.gif" border="0" alt="Settings" align="absmiddle"></a>';}?> <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_tree"] == "on")) {?><a href="graph_view.php?action=tree"><img src="images/tab_mode_tree<?php if ($_REQUEST["action"] == "tree") { print "_down"; }?>.gif" border="0" title="Tree View" alt="Tree View" align="absmiddle"></a><?php }?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_list"] == "on")) {?><a href="graph_view.php?action=list"><img src="images/tab_mode_list<?php if ($_REQUEST["action"] == "list") { print "_down"; }?>.gif" border="0" title="List View" alt="List View" align="absmiddle"></a><?php }?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_preview"] == "on")) {?><a href="graph_view.php?action=preview"><img src="images/tab_mode_preview<?php if ($_REQUEST["action"] == "preview") { print "_down"; }?>.gif" border="0" title="Preview View" alt="Preview View" align="absmiddle"></a><?php }?> <br>
</td>
</tr>
</table>
Do I really need the graph_settings feature ?
greetz
zyta2002