security updates

have to check views and entityreference for custom patches
This commit is contained in:
Bachir Soussi Chiadmi
2015-04-19 20:45:16 +02:00
parent 802ec0c6f3
commit b3221c71e2
516 changed files with 14267 additions and 7349 deletions

View File

@@ -169,7 +169,12 @@ class ctools_context_required {
function select($contexts, $context) {
if (!is_array($contexts)) {
$contexts = array($contexts);
if (is_object($contexts) && $contexts instanceof ctools_context) {
$contexts = array($contexts->id => $contexts);
}
else {
$contexts = array($contexts);
}
}
// If we had requested a $context but that $context doesn't exist
@@ -328,13 +333,15 @@ function _ctools_context_selector($contexts, $required, $default, $num = 0) {
$title = $num ? t('Context %count', array('%count' => $num)) : t('Context');
}
return array(
$form = array(
'#type' => 'select',
'#options' => $options,
'#title' => $title,
'#default_value' => $default,
);
}
return $form;
}
/**
@@ -1400,8 +1407,7 @@ function ctools_get_relevant_access_plugins($contexts) {
* Create a context for the logged in user.
*/
function ctools_access_get_loggedin_context() {
global $user;
$context = ctools_context_create('entity:user', $user);
$context = ctools_context_create('entity:user', array('type' => 'current'), TRUE);
$context->identifier = t('Logged in user');
$context->keyword = 'viewer';
$context->id = 0;
@@ -1588,7 +1594,9 @@ function ctools_access_add_restrictions($settings, $contexts) {
$required_context = isset($plugin['required context']) ? $plugin['required context'] : array();
$context = isset($test['context']) ? $test['context'] : array();
$contexts = ctools_context_select($contexts, $required_context, $context);
$function($test['settings'], $contexts);
if ($contexts !== FALSE) {
$function($test['settings'], $contexts);
}
}
}
}