3 require_once( dirname(__FILE__
).'/base/basenotificationset.php' );
6 * Describes a set of objects from livestatus
8 class NotificationSet_Model
extends BaseNotificationSet_Model
{
10 * apply some extra filters to match for the authentication.
12 protected function get_auth_filter() {
13 $auth = Auth
::instance();
14 $all_hosts = $auth->authorized_for('host_view_all');
15 $all_services = $auth->authorized_for('service_view_all');
16 $contact_name = $auth->get_user()->username
;
18 // Authorized for everything? Don't filter anything...
19 if( $all_hosts && $all_services )
22 $auth_filter = new LivestatusFilterOr();
23 $auth_filter->add(new LivestatusFilterMatch('contact_name', $contact_name));
26 $auth_filter->add( new LivestatusFilterMatch('notification_type', nagstat
::HOST_NOTIFICATION
));
29 $auth_filter->add( new LivestatusFilterMatch('notification_type', nagstat
::SERVICE_NOTIFICATION
));
32 $result_filter = new LivestatusFilterAnd();
33 $result_filter->add($this->filter
);
34 $result_filter->add($auth_filter);
35 return $result_filter;