Nagios_auth_Model Class Reference

Model providing access to the authorization system in nagios. More...

Public Member Functions

 __construct ()
 Almost anything you can do with this model is expensive and cached.
 i_can_has_root_plx ()
 This is required for testing purposes.
 check_rootness ()
 Initializes the user authorization levels.
 is_authorized_for_host ($host)
 is_authorized_for_service ($service, $desc=false)
 Return a boolean saying if we're authorized for the service name or id provided.
 is_authorized_for_hostgroup ($hostgroup)
 is_authorized_for_servicegroup ($servicegroup)

Static Public Member Functions

static instance ()
 Return the singleton instance of the auth model.

Data Fields

 $session = false
 FIXME: Another user session variable, that the ninja model already provides, except we've decided not to use it.
 $user = ''
 The username.
 $view_hosts_root = false
 Is user authorized to see all hosts?

Detailed Description

Model providing access to the authorization system in nagios.

Warning: a lot of these function calls are expensive! Do not create loads of instances!


Constructor & Destructor Documentation

Nagios_auth_Model::__construct (  ) 

Almost anything you can do with this model is expensive and cached.

Thus, do /NOT/ call this constructor directly - use self::instance() instead.


Member Function Documentation

Nagios_auth_Model::i_can_has_root_plx (  ) 

This is required for testing purposes.

The backdoor side of it can safely be ignored, since the reports library has zero authentication anyway, and return-into-libzend or similar exploits are impossible from php

Nagios_auth_Model::is_authorized_for_host ( host  ) 
Parameters:
$host string
Returns:
boolean
Nagios_auth_Model::is_authorized_for_hostgroup ( hostgroup  ) 
Parameters:
$hostgroup string
Returns:
boolean
Nagios_auth_Model::is_authorized_for_service ( service,
desc = false 
)

Return a boolean saying if we're authorized for the service name or id provided.

This function can be called with two arguments, where the first is host name, and the second is service description, or with one argument where host and service is ';' separated.

Parameters:
$service string hostname if second arg is given, otherwize "host;service"
$desc string = false see previous arg
Returns:
boolean
Nagios_auth_Model::is_authorized_for_servicegroup ( servicegroup  ) 
Parameters:
$servicegroup string
Returns:
boolean

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables

Generated on 14 May 2013 for ninja by  doxygen 1.6.1