|
15 | 15 | use OCP\IUserManager; |
16 | 16 |
|
17 | 17 | class AppController extends Controller { |
| 18 | + use GetStorageUrlTrait; |
| 19 | + |
| 20 | + protected ServerConfig $config; |
| 21 | + protected IURLGenerator $urlGenerator; |
| 22 | + |
18 | 23 | private $userId; |
19 | 24 | private $userManager; |
20 | | - private $urlGenerator; |
21 | | - private $config; |
22 | 25 |
|
23 | 26 | public function __construct($AppName, IRequest $request, IConfig $config, IUserManager $userManager, IManager $contactsManager, IURLGenerator $urlGenerator, $userId |
24 | | - // , bool $userDomains |
25 | 27 | ){ |
26 | 28 | parent::__construct($AppName, $request); |
27 | 29 | $this->userId = $userId; |
28 | 30 | $this->userManager = $userManager; |
29 | 31 | $this->contactsManager = $contactsManager; |
30 | 32 | $this->request = $request; |
31 | 33 | $this->urlGenerator = $urlGenerator; |
32 | | - $this->config = new \OCA\Solid\ServerConfig($config, $urlGenerator, $userManager); |
33 | | - // $this->userDomains = $userDomains; |
| 34 | + $this->config = new ServerConfig($config, $urlGenerator, $userManager); |
34 | 35 | } |
35 | 36 |
|
36 | 37 | private function getUserApps($userId) { |
@@ -67,14 +68,7 @@ private function getAppsList() { |
67 | 68 | private function getProfilePage() { |
68 | 69 | return $this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkToRoute("solid.profile.handleGet", array("userId" => $this->userId, "path" => "/card"))) . "#me"; |
69 | 70 | } |
70 | | - private function getStorageUrl($userId) { |
71 | | - $storageUrl = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkToRoute("solid.storage.handleHead", array("userId" => $userId, "path" => "foo"))); |
72 | | - $storageUrl = preg_replace('/foo$/', '', $storageUrl); |
73 | | -// if ($this->userDomains) { |
74 | | - $storageUrl = $userId.'.'.$storageUrl; |
75 | | -// } |
76 | | - return $storageUrl; |
77 | | - } |
| 71 | + |
78 | 72 | /** |
79 | 73 | * @NoAdminRequired |
80 | 74 | * @NoCSRFRequired |
|
0 commit comments