Passed
Pull Request — master (#177)
by
unknown
08:34
created

UserController::saveSettingsAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 7
rs 10
1
<?php
2
namespace EWW\Dpf\Controller;
3
4
/*
5
 * This file is part of the TYPO3 CMS project.
6
 *
7
 * It is free software; you can redistribute it and/or modify it under
8
 * the terms of the GNU General Public License, either version 2
9
 * of the License, or any later version.
10
 *
11
 * For the full copyright and license information, please read the
12
 * LICENSE.txt file that was distributed with this source code.
13
 *
14
 * The TYPO3 project - inspiring people to share!
15
 */
16
17
use EWW\Dpf\Domain\Model\FrontendUser;
18
19
/**
20
 * Controller for the "workspace"/"my publications" area.
21
 */
22
class UserController  extends AbstractController
23
{
24
    /**
25
     * benutzerRepository
26
     *
27
     * @var EWW\Dpf\Domain\Repository\FrontendUserRepository
0 ignored issues
show
Bug introduced by
The type EWW\Dpf\Controller\EWW\D...\FrontendUserRepository was not found. Did you mean EWW\Dpf\Domain\Repository\FrontendUserRepository? If so, make sure to prefix the type with \.
Loading history...
28
     * @inject
29
     */
30
    protected $frontendUserRepository;
31
32
    public function settingsAction() {
33
34
        $currentUser = $this->frontendUserRepository->findByUid($GLOBALS['TSFE']->fe_user->user['uid']);
35
36
        $this->view->assign('frontendUser', $currentUser);
37
    }
38
39
    public function saveSettingsAction(FrontendUser $frontendUser) {
40
41
        $this->frontendUserRepository->update($frontendUser);
42
        $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::OK;
43
        $this->addFlashMessage("Success", '', $severity,false);
44
45
        $this->forward('settings');
46
    }
47
48
}
49