[SOLVED] Tab shows even for users that don't have access?

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

[SOLVED] Tab shows even for users that don't have access?

Post by Howie »

Cacti 0.8.7a, Thold 0.3.8

When a user has no access to THold (even to view), the tab still shows up.

Looks like thold_show_tab calls this new-fangled api_user_realm_auth() function, to decide whether or not to show it, which presumably is returning the wrong thing.

monitor has the same problem, incidentally.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
chrisgapske
Cacti User
Posts: 278
Joined: Tue May 22, 2007 7:56 am
Location: Pensacola, Fl - Padacuh, Ky-Alpena, MI-Gulf Shores,AL

Post by chrisgapske »

I have noticed I have limited users with access to thold & syslog TAB.
They do not have access to thold or syslog but just the TAB.

I am also having what might be a related issue where Issues with limited access to hosts are able to see almost all hosts in the monitor plugin?
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Either of you guys have UP and DOWN notifications working with your version of THOLD ? Sorry it's a bit off topic, but I was curious.

Thanks
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

mcutting wrote:Either of you guys have UP and DOWN notifications working with your version of THOLD ? Sorry it's a bit off topic, but I was curious.

Thanks
I don't know, because it doesn't go down ;-) It's on a customer site with only 5 switches, as a test before we move our main Cacti to 0.8.7

I don't seem to have gotten any thold-breach mails either though, and I have certainly had breaches for error rate on a couple of ports.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

I've just been looking at this some more, and it seems that the api_user_realm_auth() function in plugins.php only works if a cacti setting called global_auth is set to 'on'. That setting doesn't exist at all in my 0.8.7a install.

When it doesn't exist (or isn't 'on'), then api_user_realm_auth only checks if the permission for that file has been defined, not whether the current user actually has it - it doesn't use the sess_user_id at all.

Since I don't know what global_auth does, I don't really know what the solution is, except to say that in my Cacti 0.8.7a install, nothing refers to global_auth apart from thold, monitor and plugins.php, and the database conversion scripts for upgrades. The database upgrade scripts appear to be deleting the setting during the move from 0.8.6x to 0.8.7x, so I guess it's an obsolete setting. Looks like it should really be using auth_method, if anything.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Changing line 68 of include/plugins.php to

Code: Select all

if (read_config_option('global_auth') == 'on' || read_config_option('auth_method') == 1) {
appears to resolve this for me.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
chrisgapske
Cacti User
Posts: 278
Joined: Tue May 22, 2007 7:56 am
Location: Pensacola, Fl - Padacuh, Ky-Alpena, MI-Gulf Shores,AL

Post by chrisgapske »

That fixed my TAB issue as well.
User avatar
chrisgapske
Cacti User
Posts: 278
Joined: Tue May 22, 2007 7:56 am
Location: Pensacola, Fl - Padacuh, Ky-Alpena, MI-Gulf Shores,AL

Post by chrisgapske »

Do the same thing for the monitor plugin to work in monitor.php to fix view permissions.


line 760 and 823
User avatar
lard
Cacti User
Posts: 165
Joined: Wed Jul 20, 2005 10:48 am
Location: UK - Cambridge

Post by lard »

Excellent - thanks guys that solved it for :)
---- lard007skype ----
mkeadle
Posts: 1
Joined: Thu Mar 27, 2008 2:59 pm

Still broke for LDAP auth

Post by mkeadle »

Howie wrote:Changing line 68 of include/plugins.php to

Code: Select all

if (read_config_option('global_auth') == 'on' || read_config_option('auth_method') == 1) {
appears to resolve this for me.
This still leaves it broke when using LDAP auth, which has an auth_method = 3. The easiest/dirtiest way to fix is to just continue what Howie mentioned:

Code: Select all

if (read_config_option('global_auth') == 'on' || read_config_option('auth_method') == 1) || read_config_option)'auth_method') == 3) {
Hope that helps.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest