aboutsummaryrefslogtreecommitdiff
path: root/muamba.misc.inc
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-10-10 21:32:03 -0300
committerSilvio Rhatto <rhatto@riseup.net>2011-10-10 21:32:03 -0300
commit99af5bfd118dc657f3c5c363a237c8cef49039fd (patch)
tree2516ac1f2c83c9afc07f0e69dce9e6d57353335e /muamba.misc.inc
parentdb6fd9706157928ce20fc26689fe9db41d533537 (diff)
downloadmuamba-99af5bfd118dc657f3c5c363a237c8cef49039fd.tar.gz
muamba-99af5bfd118dc657f3c5c363a237c8cef49039fd.tar.bz2
Check if user is logged in
Diffstat (limited to 'muamba.misc.inc')
-rw-r--r--muamba.misc.inc8
1 files changed, 6 insertions, 2 deletions
diff --git a/muamba.misc.inc b/muamba.misc.inc
index 70aa598..d15b056 100644
--- a/muamba.misc.inc
+++ b/muamba.misc.inc
@@ -93,7 +93,7 @@ function muamba_actions($code = NULL) {
* TRUE on success, FALSE otherwise.
*/
function muamba_has_request_access($node) {
- if (!$node || $node->type != MUAMBA_NODE_TYPE || !node_access('view', $node)) {
+ if (!user_is_logged_in() || !$node || $node->type != MUAMBA_NODE_TYPE || !node_access('view', $node)) {
return FALSE;
}
@@ -113,6 +113,10 @@ function muamba_has_request_access($node) {
* TRUE if block exists, FALSE otherwise.
*/
function muamba_user_has_blocked($node, $user) {
+ if (!user_is_logged_in()) {
+ return FALSE;
+ }
+
if (module_exists('pm_block_user')) {
$owner = user_load($node->uid);
if (pm_block_user_has_blocked($user, $owner)) {
@@ -140,7 +144,7 @@ function muamba_has_management_access($node, $user = NULL) {
global $user;
}
- if (!$node || $node->type != MUAMBA_NODE_TYPE || $node->uid != $user->uid) {
+ if (!user_is_logged_in() || !$node || $node->type != MUAMBA_NODE_TYPE || $node->uid != $user->uid) {
return FALSE;
}