if (!hc)
return Empty;
- return CompatUtility::GetServiceNotificationUsers(hc);
+ Array::Ptr contacts = CompatUtility::GetServiceNotificationUsers(hc);
+ Array::Ptr contact_names = boost::make_shared<Array>();
+
+ ObjectLock olock(contacts);
+ BOOST_FOREACH(const User::Ptr& user, contacts) {
+ contact_names->Add(user->GetName());
+ }
+
+ return contact_names;
}
Value HostsTable::DowntimesAccessor(const Value& row)
if (!hc)
return Empty;
- return CompatUtility::GetServiceNotificationUserGroups(hc);
+ Array::Ptr contactgroups = CompatUtility::GetServiceNotificationUserGroups(hc);
+
+ Array::Ptr contactgroup_names = boost::make_shared<Array>();
+
+ ObjectLock olock(contactgroups);
+ BOOST_FOREACH(const UserGroup::Ptr& usergroup, contactgroups) {
+ contactgroup_names->Add(usergroup->GetName());
+ }
+
+ return contactgroup_names;
}
Value HostsTable::ServicesAccessor(const Value& row)
Value ServicesTable::ContactsAccessor(const Value& row)
{
- return CompatUtility::GetServiceNotificationUsers(static_cast<Service::Ptr>(row));
+ Array::Ptr contacts = CompatUtility::GetServiceNotificationUsers(static_cast<Service::Ptr>(row));
+ Array::Ptr contact_names = boost::make_shared<Array>();
+
+ ObjectLock olock(contacts);
+ BOOST_FOREACH(const User::Ptr& user, contacts) {
+ contact_names->Add(user->GetName());
+ }
+
+ return contact_names;
}
Value ServicesTable::DowntimesAccessor(const Value& row)
Value ServicesTable::ContactGroupsAccessor(const Value& row)
{
- return CompatUtility::GetServiceNotificationUserGroups(static_cast<Service::Ptr>(row));
+ Array::Ptr contactgroups = CompatUtility::GetServiceNotificationUserGroups(static_cast<Service::Ptr>(row));
+
+ Array::Ptr contactgroup_names = boost::make_shared<Array>();
+
+ ObjectLock olock(contactgroups);
+ BOOST_FOREACH(const UserGroup::Ptr& usergroup, contactgroups) {
+ contactgroup_names->Add(usergroup->GetName());
+ }
+
+ return contactgroup_names;
}
}
BOOST_FOREACH(const User::Ptr& user, allUsers) {
- contacts->Add(user->GetName());
+ contacts->Add(user);
}
return contacts;
ObjectLock olock(notification);
BOOST_FOREACH(const UserGroup::Ptr& ug, notification->GetUserGroups()) {
- contactgroups->Add(ug->GetName());
+ contactgroups->Add(ug);
}
}