function rb_user_rules_action_info in Rules Bonus Pack 6
Implementation of hook_rules_action_info().
File
- ./
rb_user.module, line 38 - Functions for extending user management with Rules.
Code
function rb_user_rules_action_info() {
// Add the actions relevant for required core modules.
$actions = array(
'rb_user_action_global_user' => array(
'label' => t('Load the acting user'),
'new variables' => array(
'user' => array(
'type' => 'user',
'label' => t('Acting user'),
'save' => TRUE,
),
),
'module' => 'Rules Bonus: User',
),
'rb_user_action_provide_username' => array(
'label' => t('Generate a valid user name'),
'eval input' => array(
'potential_name',
),
'new variables' => array(
'username' => array(
'type' => 'string',
'label' => t('New user name'),
'save' => TRUE,
),
),
'module' => 'Rules Bonus: User',
),
);
// Add actions that depend on non-required modules.
if (module_exists('session_api')) {
$actions['rb_user_action_sid'] = array(
'label' => t('Load session ID for active user'),
'new variables' => array(
'sid' => array(
'type' => 'number',
'label' => t('Session id'),
'save' => TRUE,
),
),
'module' => 'Rules Bonus: User',
);
}
return $actions;
}