aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2013-05-28 18:17:36 -0400
committercash <cash.costello@gmail.com>2013-05-28 18:17:36 -0400
commite630f8ceb980ab40fbab57145eae68f592034266 (patch)
tree2c4f29a589edb54ecc47c50c44e5908792251f34
parent59df7550f6e1f1dce4f3161682d9fb3000123d40 (diff)
downloadelgg-e630f8ceb980ab40fbab57145eae68f592034266.tar.gz
elgg-e630f8ceb980ab40fbab57145eae68f592034266.tar.bz2
Fixes #5337 properly checking if admin notice exists
-rw-r--r--engine/lib/admin.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/engine/lib/admin.php b/engine/lib/admin.php
index 243cdef46..7f82108c0 100644
--- a/engine/lib/admin.php
+++ b/engine/lib/admin.php
@@ -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;
}