Skip to content
Snippets Groups Projects
Commit d9452c1d authored by Earl Miles's avatar Earl Miles
Browse files

#418346: Fix ctools_access() logic if using "or" and no rule passes.

parent 0fc931c9
No related branches found
No related tags found
No related merge requests found
...@@ -1309,14 +1309,18 @@ function ctools_access($settings, $contexts = array()) { ...@@ -1309,14 +1309,18 @@ function ctools_access($settings, $contexts = array()) {
} }
if ($pass && $settings['logic'] == 'or') { if ($pass && $settings['logic'] == 'or') {
// Pass if 'or' and this rule passed.
return TRUE; return TRUE;
} }
else if (!$pass && $settings['logic'] == 'and') { else if (!$pass && $settings['logic'] == 'and') {
// Fail if 'and' and htis rule failed.
return FALSE; return FALSE;
} }
} }
return TRUE; // Return TRUE if logic was and, meaning all rules passed.
// Return FALSE if logic was or, meaning no rule passed.
return $settings['logic'] == 'and';
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment