]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3989 fixed access of non-object property in access lib
authorCash Costello <cash.costello@gmail.com>
Fri, 21 Oct 2011 11:24:57 +0000 (07:24 -0400)
committerCash Costello <cash.costello@gmail.com>
Fri, 21 Oct 2011 11:24:57 +0000 (07:24 -0400)
engine/lib/access.php

index ae64f832a16f86627f7e1ab21232a5d14f2ad606..002413baa41d9db71b90d549b8c7efa266598ced 100644 (file)
@@ -981,17 +981,17 @@ function access_init() {
  */
 function elgg_override_permissions($hook, $type, $value, $params) {
        $user = elgg_extract('user', $params);
-       if (!$user) {
-               $user = elgg_get_logged_in_user_entity();
+       if ($user) {
+               $user_guid = $user->getGUID();
+       } else {
+               $user_guid = elgg_get_logged_in_user_guid();
        }
 
-       // don't do this so ignore access still works.
+       // don't do this so ignore access still works with no one logged in
 //     if (!$user instanceof ElggUser) {
 //             return false;
 //     }
 
-       $user_guid = $user->guid;
-
        // check for admin
        if ($user_guid && elgg_is_admin_user($user_guid)) {
                return true;