| 20 | { } |
| 21 | |
| 22 | Dictionary::Ptr UserDbObject::GetConfigFields() const |
| 23 | { |
| 24 | User::Ptr user = static_pointer_cast<User>(GetObject()); |
| 25 | |
| 26 | int typeFilter = user->GetTypeFilter(); |
| 27 | int stateFilter = user->GetStateFilter(); |
| 28 | |
| 29 | return new Dictionary({ |
| 30 | { "alias", user->GetDisplayName() }, |
| 31 | { "email_address", user->GetEmail() }, |
| 32 | { "pager_address", user->GetPager() }, |
| 33 | { "host_timeperiod_object_id", user->GetPeriod() }, |
| 34 | { "service_timeperiod_object_id", user->GetPeriod() }, |
| 35 | { "host_notifications_enabled", user->GetEnableNotifications() }, |
| 36 | { "service_notifications_enabled", user->GetEnableNotifications() }, |
| 37 | { "can_submit_commands", 1 }, |
| 38 | { "notify_service_recovery", (typeFilter & NotificationRecovery) ? 1 : 0 }, |
| 39 | { "notify_service_warning", (stateFilter & StateFilterWarning) ? 1 : 0 }, |
| 40 | { "notify_service_unknown", (stateFilter & StateFilterUnknown) ? 1 : 0 }, |
| 41 | { "notify_service_critical", (stateFilter & StateFilterCritical) ? 1 : 0 }, |
| 42 | { "notify_service_flapping", (typeFilter & (NotificationFlappingStart | NotificationFlappingEnd)) ? 1 : 0 }, |
| 43 | { "notify_service_downtime", (typeFilter & (NotificationDowntimeStart | NotificationDowntimeEnd | NotificationDowntimeRemoved)) ? 1 : 0 }, |
| 44 | { "notify_host_recovery", (typeFilter & NotificationRecovery) ? 1 : 0 }, |
| 45 | { "notify_host_down", (stateFilter & StateFilterDown) ? 1 : 0 }, |
| 46 | { "notify_host_flapping", (typeFilter & (NotificationFlappingStart | NotificationFlappingEnd)) ? 1 : 0 }, |
| 47 | { "notify_host_downtime", (typeFilter & (NotificationDowntimeStart | NotificationDowntimeEnd | NotificationDowntimeRemoved)) ? 1 : 0 } |
| 48 | }); |
| 49 | } |
| 50 | |
| 51 | Dictionary::Ptr UserDbObject::GetStatusFields() const |
| 52 | { |