]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #5337 properly checking if admin notice exists
authorcash <cash.costello@gmail.com>
Tue, 28 May 2013 22:17:36 +0000 (18:17 -0400)
committercash <cash.costello@gmail.com>
Tue, 28 May 2013 22:17:36 +0000 (18:17 -0400)
engine/lib/admin.php

index 243cdef4626df693ff87f52bf22c7e2a2133cd1f..7f82108c02e639b83bc87c5f6f9c3f64d0674433 100644 (file)
@@ -134,11 +134,11 @@ function elgg_delete_admin_notice($id) {
 }
 
 /**
- * List all admin messages.
+ * Get admin notices. An admin must be logged in since the notices are private.
  *
  * @param int $limit Limit
  *
- * @return array List of admin notices
+ * @return array Array of admin notices
  * @since 1.8.0
  */
 function elgg_get_admin_notices($limit = 10) {
@@ -158,11 +158,13 @@ function elgg_get_admin_notices($limit = 10) {
  * @since 1.8.0
  */
 function elgg_admin_notice_exists($id) {
+       $old_ia = elgg_set_ignore_access(true);
        $notice = elgg_get_entities_from_metadata(array(
                'type' => 'object',
                'subtype' => 'admin_notice',
                'metadata_name_value_pair' => array('name' => 'admin_notice_id', 'value' => $id)
        ));
+       elgg_set_ignore_access($old_ia);
 
        return ($notice) ? TRUE : FALSE;
 }