1 | <?php |
||
52 | class AccountsController extends Controller { |
||
53 | |||
54 | /** @var AccountService */ |
||
55 | private $accountService; |
||
56 | |||
57 | /** @var string */ |
||
58 | private $currentUserId; |
||
59 | |||
60 | /** @var AutoConfig */ |
||
61 | private $autoConfig; |
||
62 | |||
63 | /** @var Folder */ |
||
64 | private $userFolder; |
||
65 | |||
66 | /** @var Logger */ |
||
67 | private $logger; |
||
68 | |||
69 | /** @var IL10N */ |
||
70 | private $l10n; |
||
71 | |||
72 | /** @var ICrypto */ |
||
73 | private $crypto; |
||
74 | |||
75 | /** @var AddressCollector */ |
||
76 | private $addressCollector; |
||
77 | |||
78 | private $aliasesService; |
||
79 | |||
80 | /** |
||
81 | * @param string $appName |
||
82 | * @param IRequest $request |
||
83 | * @param AccountService $accountService |
||
84 | * @param $UserId |
||
85 | * @param $userFolder |
||
86 | * @param AutoConfig $autoConfig |
||
87 | * @param Logger $logger |
||
88 | * @param IL10N $l10n |
||
89 | * @param ICrypto $crypto |
||
90 | */ |
||
91 | 15 | public function __construct($appName, |
|
92 | IRequest $request, |
||
93 | AccountService $accountService, |
||
94 | $UserId, |
||
95 | $userFolder, |
||
96 | AutoConfig $autoConfig, |
||
97 | Logger $logger, |
||
98 | IL10N $l10n, |
||
99 | ICrypto $crypto, |
||
100 | AddressCollector $addressCollector, |
||
101 | AliasesService $aliasesService |
||
102 | ) { |
||
103 | 15 | parent::__construct($appName, $request); |
|
104 | 15 | $this->accountService = $accountService; |
|
105 | 15 | $this->currentUserId = $UserId; |
|
106 | 15 | $this->userFolder = $userFolder; |
|
107 | 15 | $this->autoConfig = $autoConfig; |
|
108 | 15 | $this->logger = $logger; |
|
109 | 15 | $this->l10n = $l10n; |
|
110 | 15 | $this->crypto = $crypto; |
|
111 | 15 | $this->addressCollector = $addressCollector; |
|
112 | 15 | $this->aliasesService = $aliasesService; |
|
113 | 15 | } |
|
114 | |||
115 | /** |
||
116 | * @NoAdminRequired |
||
117 | * @NoCSRFRequired |
||
118 | * |
||
119 | * @return JSONResponse |
||
120 | */ |
||
121 | 1 | public function index() { |
|
122 | 1 | $mailAccounts = $this->accountService->findByUserId($this->currentUserId); |
|
123 | |||
124 | 1 | $json = []; |
|
125 | 1 | foreach ($mailAccounts as $mailAccount) { |
|
126 | 1 | $json[] = $mailAccount->getConfiguration(); |
|
127 | 1 | } |
|
128 | 1 | foreach ($json as $key => $mailAccount) { |
|
129 | 1 | $json[$key]['aliases'] = $this->aliasesService->findAll($mailAccount['accountId'], $this->currentUserId); |
|
130 | } |
||
131 | return new JSONResponse($json); |
||
132 | } |
||
133 | |||
134 | /** |
||
135 | * @NoAdminRequired |
||
136 | * |
||
137 | * @param int $accountId |
||
138 | * @return JSONResponse |
||
139 | */ |
||
140 | 2 | public function show($accountId) { |
|
141 | try { |
||
142 | 2 | $account = $this->accountService->find($this->currentUserId, $accountId); |
|
143 | |||
144 | 2 | return new JSONResponse($account->getConfiguration()); |
|
145 | 1 | } catch (DoesNotExistException $e) { |
|
|
|||
146 | 1 | return new JSONResponse([], 404); |
|
147 | } |
||
148 | } |
||
149 | |||
150 | /** |
||
151 | * @NoAdminRequired |
||
152 | */ |
||
153 | public function update() { |
||
158 | |||
159 | /** |
||
160 | * @NoAdminRequired |
||
161 | * |
||
162 | * @param int $accountId |
||
163 | * @return JSONResponse |
||
164 | */ |
||
165 | 2 | public function destroy($accountId) { |
|
174 | |||
175 | /** |
||
176 | * @NoAdminRequired |
||
177 | * |
||
178 | * @param string $accountName |
||
179 | * @param string $emailAddress |
||
180 | * @param string $password |
||
181 | * @param string $imapHost |
||
182 | * @param int $imapPort |
||
183 | * @param string $imapSslMode |
||
184 | * @param string $imapUser |
||
185 | * @param string $imapPassword |
||
186 | * @param string $smtpHost |
||
187 | * @param int $smtpPort |
||
188 | * @param string $smtpSslMode |
||
189 | * @param string $smtpUser |
||
190 | * @param string $smtpPassword |
||
191 | * @param bool $autoDetect |
||
192 | * @return JSONResponse |
||
193 | */ |
||
194 | 2 | public function create($accountName, $emailAddress, $password, |
|
254 | |||
255 | /** |
||
256 | * @NoAdminRequired |
||
257 | * |
||
258 | * @param int $accountId |
||
259 | * @param string $folderId |
||
260 | * @param string $subject |
||
261 | * @param string $body |
||
262 | * @param string $to |
||
263 | * @param string $cc |
||
264 | * @param string $bcc |
||
265 | * @param int $draftUID |
||
266 | * @param string $messageId |
||
267 | * @param mixed $attachments |
||
268 | * @return JSONResponse |
||
269 | */ |
||
270 | 4 | public function send($accountId, $folderId, $subject, $body, $to, $cc, |
|
356 | |||
357 | /** |
||
358 | * @NoAdminRequired |
||
359 | * |
||
360 | * @param int $accountId |
||
361 | * @param string $subject |
||
362 | * @param string $body |
||
363 | * @param string $to |
||
364 | * @param string $cc |
||
365 | * @param string $bcc |
||
366 | * @param int $uid |
||
367 | * @param string $messageId |
||
368 | * @return JSONResponse |
||
369 | */ |
||
370 | 4 | public function draft($accountId, $subject, $body, $to, $cc, $bcc, $uid, $messageId) { |
|
413 | |||
414 | } |
||
415 |
Scrutinizer analyzes your
composer.json
/composer.lock
file if available to determine the classes, and functions that are defined by your dependencies.It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.