function ctools_compare_users_access_check

Check for access.

1 string reference to 'ctools_compare_users_access_check'
compare_users.inc in plugins/access/compare_users.inc
CTools access plugin to provide access/visiblity if two user contexts are equal.

File

plugins/access/compare_users.inc, line 49

Code

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 false if the two bools are the same, and true 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']);
}