mirror of
https://github.com/nextcloud/passman.git
synced 2025-02-24 15:34:11 +08:00
Don't publish an activity if there is no user
Signed-off-by: brantje <brantje@gmail.com>
This commit is contained in:
parent
7d378e681b
commit
fc3c019895
1 changed files with 11 additions and 10 deletions
|
@ -51,6 +51,7 @@ class ActivityService {
|
|||
public function add($subject,$subjectParams=array(),
|
||||
$message='',$messageParams=array(),
|
||||
$link='',$user=null,$type='') {
|
||||
if($user) {
|
||||
$activity = $this->manager->generateEvent();
|
||||
$activity->setType($type);
|
||||
$activity->setApp('passman');
|
||||
|
@ -60,7 +61,7 @@ class ActivityService {
|
|||
$activity->setAuthor($user);
|
||||
$activity->setTimestamp(time());
|
||||
$activity->setMessage($message, $messageParams);
|
||||
print_r($this->manager->publish($activity));
|
||||
}
|
||||
return array('success'=>'ok');
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue