function rules_user_condition_info

Implements hook_rules_condition_info() on behalf of the user module.

Related topics

File

modules/user.rules.inc, line 120

Code

function rules_user_condition_info() {
    return array(
        'user_has_role' => array(
            'label' => t('User has role(s)'),
            'parameter' => array(
                'account' => array(
                    'type' => 'user',
                    'label' => t('User'),
                ),
                'roles' => array(
                    'type' => 'list<integer>',
                    'label' => t('Roles'),
                    'options list' => 'rules_user_roles_options_list',
                ),
                'operation' => array(
                    'type' => 'text',
                    'label' => t('Match roles'),
                    'options list' => 'rules_user_condition_operations',
                    'restriction' => 'input',
                    'optional' => TRUE,
                    'default value' => 'AND',
                    'description' => t('If matching against all selected roles, the user must have <em>all</em> the roles selected.'),
                ),
            ),
            'group' => t('User'),
            'access callback' => 'rules_user_integration_access',
            'base' => 'rules_condition_user_has_role',
        ),
        'user_is_blocked' => array(
            'label' => t('User is blocked'),
            'parameter' => array(
                'account' => array(
                    'type' => 'user',
                    'label' => t('User'),
                ),
            ),
            'group' => t('User'),
            'access callback' => 'rules_user_integration_access',
            'base' => 'rules_condition_user_is_blocked',
        ),
    );
}