Proper parameter name, simplify logic & phpdoc

This commit is contained in:
Thomas Citharel 2016-07-24 11:41:04 +02:00 committed by Jeremy Benoist
parent de3d716ae4
commit 7149aa5781
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
3 changed files with 7 additions and 6 deletions

View file

@ -51,7 +51,7 @@ wallabag_core:
reading_speed: 1
wallabag_user:
registration_enabled: "%registration_enabled%"
registration_enabled: "%fosuser_registration%"
wallabag_import:
allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain']

View file

@ -10,11 +10,9 @@ class RegistrationController extends FOSRegistrationController
public function registerAction(Request $request)
{
if ($this->container->getParameter('wallabag_user.registration_enabled')) {
parent::registerAction($request);
}
else
{
return $this->redirectToRoute('fos_user_security_login', array(), 301);
return parent::registerAction($request);
}
return $this->redirectToRoute('fos_user_security_login', array(), 301);
}
}

View file

@ -4,6 +4,9 @@ namespace Wallabag\UserBundle\Controller;
use FOS\UserBundle\Controller\SecurityController as FOSSecurityController;
/**
* Extends login form in order to pass the registration_enabled parameter.
*/
class SecurityController extends FOSSecurityController
{
protected function renderLogin(array $data)