Use BaseController

This commit is contained in:
Benoît Burnichon
2015-04-02 13:35:44 +02:00
parent 447029bc6a
commit 5f8dab86fd
9 changed files with 18 additions and 332 deletions

View File

@@ -13,6 +13,7 @@ namespace Alchemy\Phrasea\Controller\Admin;
use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Authentication\ACLProvider;
use Alchemy\Phrasea\Authentication\Authenticator;
use Alchemy\Phrasea\Controller\Controller;
use Alchemy\Phrasea\Core\Response\CSVFileResponse;
use Alchemy\Phrasea\Helper\User as UserHelper;
use Alchemy\Phrasea\Model\Entities\FtpCredential;
@@ -30,16 +31,8 @@ use Goodby\CSV\Import\Standard\Interpreter;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class UserController
class UserController extends Controller
{
/** @var Application */
private $app;
public function __construct(Application $app)
{
$this->app = $app;
}
public function editRightsAction(Request $request)
{
$rights = $this->getUserEditHelper($request);
@@ -925,19 +918,6 @@ class UserController
];
}
/**
* @param string $name
* @param array $context
* @return string
*/
private function render($name, array $context = [])
{
/** @var \Twig_Environment $twig */
$twig = $this->app['twig'];
return $twig->render($name, $context);
}
/**
* @param Request $request
* @return UserHelper\Edit
@@ -983,16 +963,6 @@ class UserController
return $exporter;
}
/**
* @return User|null
*/
private function getAuthenticatedUser()
{
/** @var Authenticator $authenticator */
$authenticator = $this->app['authentication'];
return $authenticator->getUser();
}
/**
* @param array $template
* @return array
@@ -1031,17 +1001,6 @@ class UserController
return $deny;
}
/**
* @param User $user
* @return \ACL
*/
private function getAclForUser(User $user)
{
/** @var ACLProvider $aclProvider */
$aclProvider = $this->app['acl'];
return $aclProvider->get($user);
}
/**
* @return RegistrationManipulator
*/