function notifications_page_check_access in Notifications 6.4
Same name and namespace in other branches
- 7 notifications.pages.inc \notifications_page_check_access()
Check access to current page, included signature
Parameters
$owner: User id, owner of the object in the page (subscription, destination, account)
2 calls to notifications_page_check_access()
- notifications_page_subscribe in ./
notifications.pages.inc - Menu callback add subscription
- notifications_page_unsubscribe in ./
notifications.pages.inc - Menu callback for unsubscribe page
File
- ./
notifications.pages.inc, line 214 - User pages for Notifications
Code
function notifications_page_check_access($owner) {
global $user;
if (user_access('administer notifications')) {
return TRUE;
// Administrator can access all
}
elseif ($owner) {
// Current user is the owner or the URL is signed
return $user->uid == $owner || notifications_page_check_signature();
}
elseif (module_exists('notifications_anonymous')) {
// Owner is anonymous but we just allow it if the module is enabled the URL is signed
return notifications_page_check_signature();
}
}