You are here

function masquerade_ctools_masquerade_access_summary in Masquerade Extras 7.2

Same name and namespace in other branches
  1. 6.2 masquerade_ctools/plugins/access/masquerade.inc \masquerade_ctools_masquerade_access_summary()

Provides a simple access summary to administrators for this plugin.

@returns A string which states whether or not the current user is masquerading. @retval string

Parameters

array $conf: The plugin configuration.

array $context: The contexts to evaluate.

1 string reference to 'masquerade_ctools_masquerade_access_summary'
masquerade.inc in masquerade_ctools/plugins/access/masquerade.inc

File

masquerade_ctools/plugins/access/masquerade.inc, line 102

Code

function masquerade_ctools_masquerade_access_summary($conf, $context) {
  $mode = '';

  // Are we evaluating if the user is posing as someone else?
  if ('is_masquerading' == $conf['mode']) {
    $mode = 'posing as another user';
  }
  else {
    if ('is_being_masqueraded' == $conf['mode']) {
      $mode = 'in use by another user';
    }
  }

  // Generate a summary string.
  return t('User: "@username" is "@mode".', array(
    '@username' => $context[0]->identifier,
    '@mode' => $mode,
  ));
}