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

UserController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 8
c 1
b 0
f 1
dl 0
loc 24
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A settingsAction() 0 5 1
A saveSettingsAction() 0 7 1
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