Initial commit after migrating from core 3 code
Fixed optional queries to which the hostgroup option applies
Fixed issues in Core 4 status JSON CGI with host status
objectjson: Host details now use *member lists for hosts/services

Until now, the list of parent hosts and child hosts were generated
by iterating over all hosts to find the relationships. Now the lists
are generated based on the parent and child host structure members.
Similarly, the service list for a host was generated by iterating
over the list of all services and finding all services for the host.
Now the list uses the services structure member.
Merge branch 'master' into json

* master: (36 commits)
  Fixed Bug 499: Security issue in daemon-init.in, function check_config
  Fixed Bug 470: statusmap doesn't display info
  Updated version for 4.0.1 release
  Updated Changelog for 4.0.1 release
  Reverted commit f99a9a7b which set check_interval to 1 if it was configured as zero.
  Added compiler flags in RPM spec file to reduce compiler noise (Dan Wittenberg)
  Removed unused variable (Dan Wittenberg)
  logging: Corrected order of arguments when logging unknown hosts/services
  base/nebmod: Added logging of failure in dlclose() call
  downtime: Downtime initialized before retention data read
  test/test-downtime: Fixes to single-run code
  test/test-downtime: Updates for core 4 and fixes
  Patches to make RPM build again (Dan Wittenberg)
  Added a simple query handler interface, nagios-qh.rb (Dan Wittenberg)
  Make cgi's build again
  Updated Changelog for core 4 release
  downtime: Ensure that scheduled_downtime_depth never drops below zero
  downtime: Handle error checking in downtime_add()
  downtime: Handle scheduled_downtime_list from downtime_{add,remove}
  downtime: Make the downtime list a doubly-linked one
  ...
Added name of the CGI executed to the results object
Added name of the query requested to the results object
Cleaned up functions with const arguments
Added unique identifer for objects into the object itself

Previously the when Nagios objects in the JSON object were indexed
by their unique identifier (usually a name, but sometimes an ID),
the unique identifier was left out of the JSON object. Now it is
included.

Thanks to Andy Brist <abrist@nagios.com> for this suggestion.
Merge branch 'master' into json

* master:
  Fixed bug 514: scheduled downtime not showing in web interface
  Fixed bug 526: sort_downtime() corrupts scheduled_downtime_list causing segfault (Adam James)
  Fixed bug 492: Nagios 4 fails to remove/add checks upon reload
  Fixed bug 492: Nagios 4 fails to remove/add checks upon reload
  Really fixed bug #484 - Output from checks not getting back into Core
  A couple hacks to make checks return output on RHEL/CentOS 5.
  Moved iobroker method determination to configure stage
  Cleaned up configure's options
  Fixed changing ownership on nagios.debug file.
  Re-enabled user-supplied coordinates for host objects
Merge branch 'master' into json

* master:
  Fixed bug 494: nagios.spec fixes (with patch) (Karsten Weiss)
  Fixed bug 529: Core Worker failed to reap child in 4.0.1
Added authorization checks for availability query.

The individual hosts and services that might become part of the
output in the availability query are now checked to see whether
the requesting user is authorized for the host or service.

In the event that a single host or service is requested, if the
requestor is not authorized for the host or service, the query
will fail silently and no data will be returned. This should not
be an issue because, if the requestor is not authorized for
a host or service, they would not know (from Nagios) that it
exists and therefore would not know to ask about it.
Merge branch 'master' into json

* master:
  Added HTML comment to the possible states in the html_encode() state machine.
  Fixed bug #502: 4.0.0: Configuration -> Service Escalations = incomplete list
  Added explict include of sys/time.h in lib/nsutils.h
  Changelog for previous commit.
  Fixed bug #524: URLs returned in plugin check results are not correctly displayed
  Prep for 4.0.2 release
  Prep for 4.0.2rc1 release
  Fixed bug 507: Nagios 4.0.0 - Problem during log rotate (Stefano Ghelfi)
JSON Archive: Fixed availability reporting for single hosts/services.

Code now attempts to find the host or service object object before
verifying that the current user is authorized for it. This is better
than passing the is_authorized* functions a null pointer.
JSON status: Added comment type selector for comment count and list queries

The comment type is either host or service.
JSON status: Added comment entry selector for comment count and list queries

The entry type is either user, downtime, flapping, or acknowledgement.
JSON status: Added persistence selector for comment count and list queries

The persistence is either yes, no, or both
JSON status: Added expiration selector for comment count and list queries

The expiration is either yes, no, or both
No longer encode quotes within HTML
Corrected logic calculating tag depth in html_encode()