Mercurial > hg > isophonics-drupal-site
comparison core/modules/tracker/src/Controller/TrackerUserRecent.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\tracker\Controller; | |
4 | |
5 use Drupal\Core\Access\AccessResult; | |
6 use Drupal\Core\Controller\ControllerBase; | |
7 use Drupal\Core\Session\AccountInterface; | |
8 use Drupal\user\UserInterface; | |
9 | |
10 /** | |
11 * Controller for tracker.users_recent_content route. | |
12 */ | |
13 class TrackerUserRecent extends ControllerBase { | |
14 | |
15 /** | |
16 * Content callback for the tracker.users_recent_content route. | |
17 */ | |
18 public function getContent(UserInterface $user) { | |
19 module_load_include('inc', 'tracker', 'tracker.pages'); | |
20 return tracker_page($user); | |
21 } | |
22 | |
23 /** | |
24 * Checks access for the users recent content tracker page. | |
25 * | |
26 * @param \Drupal\user\UserInterface $user | |
27 * The user being viewed. | |
28 * @param \Drupal\Core\Session\AccountInterface $account | |
29 * The account viewing the page. | |
30 * | |
31 * @return \Drupal\Core\Access\AccessResult | |
32 * The access result. | |
33 */ | |
34 public function checkAccess(UserInterface $user, AccountInterface $account) { | |
35 return AccessResult::allowedIf($account->isAuthenticated() && $user->id() == $account->id()) | |
36 ->cachePerUser(); | |
37 } | |
38 | |
39 } |