diff --git a/controller/sharecontroller.php b/controller/sharecontroller.php index df930d6b..d42bc955 100644 --- a/controller/sharecontroller.php +++ b/controller/sharecontroller.php @@ -27,9 +27,7 @@ use OCA\Passman\Service\UserService; class ShareController extends ApiController { private $userId; - private $vaultService; - private $credentialService; - private $userService; + private $activityService; private $groupManager; private $userManager; @@ -42,13 +40,14 @@ class ShareController extends ApiController { IRequest $request, IUser $UserId, IGroupManager $groupManager, - IUserManager $userManager + IUserManager $userManager, + ActivityService $activityService ) { parent::__construct($AppName, $request); $this->userId = $UserId; $this->userManager = $userManager; $this->groupManager = $groupManager; - + $this->activityService = $activityService; } @@ -95,4 +94,13 @@ class ShareController extends ApiController { } + public function share($credential){ + + $link = ''; + $this->activityService->add( + 'item_shared', array($credential->label, $this->userId), + '', array(), + $link, $this->userId, Activity::TYPE_ITEM_ACTION); + } + } \ No newline at end of file diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 1269468e..ca1070bf 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -52,7 +52,8 @@ class Application extends App { $server->getUserManager(), $server->getShareManager(), $server->getURLGenerator(), - $server->getL10N($c->query('AppName')) + $server->getL10N($c->query('AppName')), + $c->query('ActivityService') ); });