user_inactive/0000755000175000017500000000000011246051542012330 5ustar fagofagouser_inactive/user_inactive.module0000644000175000017500000000006311246050627016401 0ustar fagofago array( 'rules_user_inactive_block' => array( 'arguments' => array( 'user' => array( 'label' => 'User', 'type' => 'user', ), ), 'label' => 'Block inactive user', 'status' => 'default', 'categories' => array( 'user_inactive' => 'user_inactive', ), ), 'rules_user_inactive_notify' => array( 'arguments' => array( 'user' => array( 'label' => 'User', 'type' => 'user', ), ), 'label' => 'Notify inactive user', 'status' => 'default', 'categories' => array( 'user_inactive' => 'user_inactive', ), ), ), 'rules' => array( 'user_inactive_2' => array( '#type' => 'rule', '#set' => 'rules_user_inactive_block', '#label' => 'Block user', '#active' => 1, '#weight' => '0', '#categories' => array( 'user_inactive' => 'user_inactive', ), '#status' => 'default', '#conditions' => array(), '#actions' => array( '0' => array( '#weight' => 0, '#info' => array( 'module' => 'User', 'arguments' => array( 'user' => array( 'label' => 'User', 'type' => 'user', ), ), 'label' => 'Block a user', 'base' => 'rules_core_action_execute', 'action_name' => 'user_block_user_action', 'configurable' => FALSE, ), '#name' => 'rules_core_user_block_user_action', '#settings' => array( '#argument map' => array( 'user' => 'user', ), ), '#type' => 'action', ), ), '#version' => 6003, ), 'user_inactive_3' => array( '#type' => 'rule', '#set' => 'rules_user_inactive_notify', '#label' => 'Send email', '#active' => 1, '#weight' => '0', '#categories' => array( 'user_inactive' => 'user_inactive', ), '#status' => 'default', '#conditions' => array(), '#actions' => array( '0' => array( '#weight' => 0, '#type' => 'action', '#settings' => array( 'from' => '', 'subject' => 'Account is going to be blocked!', 'message' => 'Dear [user:user], your account on [user:site-name] is going to be blocked in three days, because you have not logged in for 6 months! You have 1 week left to login... [user:site-name]', '#argument map' => array( 'user' => 'user', ), '#eval input' => array( 'token_rules_input_evaluator' => array( 'message' => array( '0' => 'user', ), ), ), ), '#name' => 'rules_action_mail_to_user', '#info' => array( 'label' => 'Send a mail to a user', 'arguments' => array( 'user' => array( 'type' => 'user', 'label' => 'Recipient', ), ), 'module' => 'System', 'eval input' => array( '0' => 'subject', '1' => 'message', '2' => 'from', ), ), ), ), '#version' => 6003, ), 'user_inactive_4' => array( '#type' => 'rule', '#set' => 'rules_user_inactive_notify', '#label' => 'Schedule blocking', '#active' => 1, '#weight' => '0', '#categories' => array( 'user_inactive' => 'user_inactive', ), '#status' => 'default', '#conditions' => array(), '#actions' => array( '0' => array( '#weight' => 0, '#info' => array( 'arguments' => array( 'task_identifier' => array( 'type' => 'string', 'label' => 'Identifier', 'description' => 'User provided string to identify the task. Existing tasks for this rule set with the same identifier will be replaced', ), 'task_date' => array( 'type' => 'date', 'label' => 'Scheduled evaluation date', ), 'user' => array( 'label' => 'User', 'type' => 'user', ), ), 'label' => 'Schedule "Block inactive user"', 'status' => 'custom', 'categories' => array(), 'module' => 'Rule Scheduler', 'base' => 'rules_scheduler_action', 'set' => 'rules_user_inactive_block', ), '#name' => 'rules_action_schedule_set_rules_user_inactive_block', '#settings' => array( 'task_identifier' => 'user_[user:uid]', 'task_date' => '1 week', '#argument map' => array( 'user' => 'user', ), '#eval input' => array( 'token_rules_input_evaluator' => array( 'task_identifier' => array( '0' => 'user', ), ), ), ), '#type' => 'action', ), ), '#version' => 6003, ), 'user_inactive_1' => array( '#type' => 'rule', '#set' => 'event_user_login', '#label' => 'React on user inactivity', '#active' => 1, '#weight' => '0', '#categories' => array( 'user_inactive' => 'user_inactive', ), '#status' => 'default', '#conditions' => array( '0' => array( '#weight' => 0, '#type' => 'condition', '#settings' => array( 'roles' => array( '0' => 3, ), 'operation' => 'OR', '#argument map' => array( 'user' => 'account', ), ), '#name' => 'rules_condition_user_hasrole', '#negate' => 1, '#info' => array( 'label' => 'User has role admin', 'label callback' => FALSE, 'arguments' => array( 'user' => array( 'type' => 'user', 'label' => 'User', ), ), 'module' => 'User', ), ), ), '#actions' => array( '1' => array( '#type' => 'action', '#settings' => array( 'task_identifier' => 'user_[account:uid]', 'ruleset' => 'rules_user_inactive_block', '#eval input' => array( 'token_rules_input_evaluator' => array( 'task_identifier' => array( '0' => 'account', ), ), ), ), '#name' => 'rules_action_delete_scheduled_set', '#info' => array( 'label' => 'Abort blocking user', 'label callback' => FALSE, 'module' => 'Rule Scheduler', 'base' => 'rules_scheduler_action_delete', 'arguments' => array( 'task_identifier' => array( 'type' => 'string', 'label' => 'Identifier', 'description' => 'All tasks that are annotated with this user provided identifier will be deleted.', ), 'ruleset' => array( 'type' => 'string', 'label' => 'Rule set', 'description' => 'All tasks that execute this rule set will be deleted.', ), ), ), '#weight' => 0, ), '2' => array( '#weight' => 0, '#type' => 'action', '#settings' => array( 'task_identifier' => 'user_[account:uid]', 'task_date' => '6 months', '#argument map' => array( 'user' => 'account', ), '#eval input' => array( 'token_rules_input_evaluator' => array( 'task_identifier' => array( '0' => 'account', ), ), ), ), '#name' => 'rules_action_schedule_set_rules_user_inactive_notify', '#info' => array( 'arguments' => array( 'task_identifier' => array( 'type' => 'string', 'label' => 'Identifier', 'description' => 'User provided string to identify the task. Existing tasks for this rule set with the same identifier will be replaced', ), 'task_date' => array( 'type' => 'date', 'label' => 'Scheduled evaluation date', ), 'user' => array( 'label' => 'User', 'type' => 'user', ), ), 'label' => 'Schedule "Notify inactive user"', 'status' => 'custom', 'categories' => array(), 'module' => 'Rule Scheduler', 'base' => 'rules_scheduler_action', 'set' => 'rules_user_inactive_notify', ), ), ), '#version' => 6003, ), ), ); }