aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/admin.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2012-01-01 15:29:39 -0500
committerCash Costello <cash.costello@gmail.com>2012-01-01 15:29:39 -0500
commit96e403d69956434aadd588fcfb08fb6f0a329d9c (patch)
tree764da068235f5d79b1143624178c5f2cbba328db /engine/lib/admin.php
parent2603dcebf460c71e4504b105f3df62b021be55e0 (diff)
downloadelgg-96e403d69956434aadd588fcfb08fb6f0a329d9c.tar.gz
elgg-96e403d69956434aadd588fcfb08fb6f0a329d9c.tar.bz2
Fixes #4168 ignoring access when saving an admin notice
Diffstat (limited to 'engine/lib/admin.php')
-rw-r--r--engine/lib/admin.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/engine/lib/admin.php b/engine/lib/admin.php
index a191d740b..1f085eee4 100644
--- a/engine/lib/admin.php
+++ b/engine/lib/admin.php
@@ -79,6 +79,10 @@ function elgg_add_admin_notice($id, $message) {
if (elgg_admin_notice_exists($id)) {
return false;
}
+
+ // need to handle when no one is logged in
+ $old_ia = elgg_set_ignore_access(true);
+
$admin_notice = new ElggObject();
$admin_notice->subtype = 'admin_notice';
// admins can see ACCESS_PRIVATE but no one else can.
@@ -86,13 +90,16 @@ function elgg_add_admin_notice($id, $message) {
$admin_notice->admin_notice_id = $id;
$admin_notice->description = $message;
- return $admin_notice->save();
+ $result = $admin_notice->save();
+
+ elgg_set_ignore_access($old_ia);
+
+ return (bool)$result;
}
- return FALSE;
+ return false;
}
-
/**
* Remove an admin notice by ID.
*