# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. Index: contributions/modules/masquerade/masquerade.module --- contributions/modules/masquerade/masquerade.module Base (1.16.2.46) +++ contributions/modules/masquerade/masquerade.module Locally Modified (Based On 1.16.2.46) @@ -32,18 +32,18 @@ * Implementation of hook_init(). */ function masquerade_init() { - global $user; - - // load from table uid + session id - $uid = db_result(db_query("SELECT uid_from FROM {masquerade} WHERE sid = '%s' AND uid_as = %d", session_id(), $user->uid)); - // using if so that we get unset rather than false if not masqing - if ($uid) { - $_SESSION['masquerading'] = $uid; + if (user_is_logged_in ()) { + // load from table uid + session id + $uid = db_result(db_query("SELECT uid_from FROM {masquerade} WHERE sid = '%s' AND uid_as = %d", session_id(), $GLOBALS['user']->uid)); + // using if so that we get unset rather than false if not masqing + if ($uid) { + $_SESSION['masquerading'] = $uid; + } + // Don't initialize $_SESSION for anonymous users to keep Pressflow compatiblity + elseif (isset($_SESSION['masquerading'])) { + $_SESSION['masquerading'] = NULL; + } } - // Don't initialize $_SESSION for anonymous users to keep Pressflow compatiblity - elseif (isset($_SESSION['masquerading'])) { - $_SESSION['masquerading'] = NULL; - } } /**