Hi,
Take a look at 2.0.8 release. I’ve added two new operator “IN” and “NOTIN” to process array attributes values.
Best regards.
Hi – can you please clarify the docs
https://wpcassify.wordpress.com/wp-cassify-plugin-documentation/
regarding multi-value attributes?
I’ve got these CAS attributes
<cas:eduPersonAffiliation>student</cas:eduPersonAffiliation>
<cas:eduPersonAffiliation>employee</cas:eduPersonAffiliation>
<cas:eduPersonAffiliation>former_employee</cas:eduPersonAffiliation>
and want to allow if they have the employee affiliation. -CONTAINS inappropriately allows the user if they only have former_employee. I tried various combinations like:
(CAS{eduPersonAffiliation} -IN “employee”) -AND (CAS{eduPersonAffiliation} -NOTIN “_employee”)
(CAS{eduPersonAffiliation} -CONTAINS “employee”) -AND (CAS{eduPersonAffiliation} -NOT -CONTAINS “_employee”)
(CAS{eduPersonAffiliation} -CONTAINS “employee”) -AND -NOT (CAS{eduPersonAffiliation} -CONTAINS “_employee”)
(CAS{eduPersonAffiliation} -CONTAINS “employee”) -NOT (CAS{eduPersonAffiliation} -CONTAINS “_employee”)
I’m also not clear how to test this in test.php. Here’s what I’ve got, which incorrectly yields bool(false):
$mock_cas_object = array(
'first_name' => 'someuser',
'email' => '[email protected]',
'eduPersonAffiliation' => array('employee,student,former_employee')
);
...
$condition = '(CAS{eduPersonAffiliation} -IN "employee")';
I’m using the very latest release.
Actually nvm I figure it out looking at the code — the -IN condition checks for an exact match in that particular CAS attribute’s array of values, so
(CAS{eduPersonAffiliation} -IN “employee”)
will not match the <cas:eduPersonAffiliation>former_employee</cas:eduPersonAffiliation>value