Hello!

I think there is an error in the new rule.

I added a rule and defined, if Logged In User = User Viewed, then display an other panel than the usual user/%user panel.

The rule works only, if I select Not equal. Maybe this the error is in this piece of code:

user_compare.inc

/**
 * Check for access.
 */
function ctools_compare_users_access_check($conf, $context) {

  if (empty($context) || count($context) != 2 || empty($context[0]->data) || empty($context[1]->data)) {
    return FALSE;
  }
  $account1 = $context[0]->data;
  $account2 = $context[1]->data;

  // xor returns true if the two bools are the same, and false if they are not.
  // i.e, if we asked for equality and they are equal, return true.
  // If we asked for inequality and they are equal, return false.
  return ($account1->uid == $account2->uid) xor !empty($conf['equality']);
}

Comments

merlinofchaos’s picture

Status: Active » Fixed

Fixed in CVS. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.