public function UserActivityActionHandler::valid in Activity 7
Determine if the current Action is valid for this object.
Parameters
$eid: The entity id for the activity.
$actor: The uid of the actor for this activity.
$timestamp: Unix timestamp when this activity occurred.
array $objects: The collection of objects for this action.
mixed $argument1: The first argument passed to the action callback.
mixed $argument2: The second argument passed to the action callback.
Return value
boolean
Overrides ActivityActionHandler::valid
File
- ./
activity_action_handlers.inc, line 874
Class
- UserActivityActionHandler
- Activity Action Handler for the user triggers.
Code
public function valid($eid, $actor, $timestamp, $objects, $argument1, $argument2) {
$roles = array_filter($this->options['roles']);
if (!empty($roles)) {
$user_roles = array_keys($objects['user']->roles);
$intersect = array_intersect($user_roles, $roles);
return parent::valid($eid, $actor, $timestamp, $objects, $argument1, $argument2) && !empty($intersect);
}
return parent::valid($eid, $actor, $timestamp, $objects, $argument1, $argument2);
}