You are here

function masquerade_ctools_is_being_masqueraded in Masquerade Extras 6.2

Same name and namespace in other branches
  1. 7.2 masquerade_ctools/masquerade_ctools.module \masquerade_ctools_is_being_masqueraded()

Checks if the provided account is being masqueraded.

@retval bool

Parameters

stdClass $account: The user account to check.

Return value

TRUE if the provided account is being masqueraded. FALSE otherwise.

2 calls to masquerade_ctools_is_being_masqueraded()
masquerade_ctools_masquerade_access_check in masquerade_ctools/plugins/access/masquerade.inc
Checks masquerade conditions. If no context is provided, this will automatically return FALSE.
masquerade_ctools_user_from_masquerade_context in masquerade_ctools/plugins/relationships/user_from_masquerade.inc
Retrieves the user info from the context.

File

masquerade_ctools/masquerade_ctools.module, line 55
Allows Ctools to look for masquerade plugins.

Code

function masquerade_ctools_is_being_masqueraded($account) {
  $query_is_being_masqueraded = db_query("SELECT `uid_from`\n       FROM {masquerade}\n      WHERE `uid_as` = %d\n      LIMIT 1", $account->uid);
  return (bool) db_result($query_is_being_masqueraded);
}