function rules_user_action_info
Implements hook_rules_action_info() on behalf of the user module.
Related topics
File
-
modules/
user.rules.inc, line 177
Code
function rules_user_action_info() {
$defaults = array(
'parameter' => array(
'account' => array(
'type' => 'user',
'label' => t('User'),
'description' => t('The user whose roles should be changed.'),
'save' => TRUE,
),
'roles' => array(
'type' => 'list<integer>',
'label' => t('Roles'),
'options list' => 'rules_user_roles_options_list',
),
),
'group' => t('User'),
'access callback' => 'rules_user_role_change_access',
);
$items['user_add_role'] = $defaults + array(
'label' => t('Add user role'),
'base' => 'rules_action_user_add_role',
);
$items['user_remove_role'] = $defaults + array(
'label' => t('Remove user role'),
'base' => 'rules_action_user_remove_role',
);
$defaults = array(
'parameter' => array(
'account' => array(
'type' => 'user',
'label' => t('User'),
'save' => TRUE,
),
),
'group' => t('User'),
'access callback' => 'rules_user_integration_access',
);
$items['user_block'] = $defaults + array(
'label' => t('Block a user'),
'base' => 'rules_action_user_block',
);
$items['user_unblock'] = $defaults + array(
'label' => t('Unblock a user'),
'base' => 'rules_action_user_unblock',
);
$items['user_send_account_email'] = array(
'label' => t('Send account e-mail'),
'parameter' => array(
'account' => array(
'type' => 'user',
'label' => t('Account'),
),
'email_type' => array(
'type' => 'text',
'label' => t('E-mail type'),
'description' => t("Select the e-mail based on your site's account settings to send to the user."),
'options list' => 'rules_user_account_email_options_list',
),
),
'group' => t('User'),
'base' => 'rules_action_user_send_account_email',
'access callback' => 'rules_user_integration_access',
);
return $items;
}