mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-21 18:11:10 +00:00
Add option to disable registration
This commit is contained in:
parent
79efca1e6f
commit
de3d716ae4
7 changed files with 54 additions and 1 deletions
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace Wallabag\UserBundle\Controller;
|
||||
|
||||
use FOS\UserBundle\Controller\RegistrationController as FOSRegistrationController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
18
src/Wallabag/UserBundle/Controller/SecurityController.php
Normal file
18
src/Wallabag/UserBundle/Controller/SecurityController.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Wallabag\UserBundle\Controller;
|
||||
|
||||
use FOS\UserBundle\Controller\SecurityController as FOSSecurityController;
|
||||
|
||||
class SecurityController extends FOSSecurityController
|
||||
{
|
||||
protected function renderLogin(array $data)
|
||||
{
|
||||
return $this->render('FOSUserBundle:Security:login.html.twig',
|
||||
array_merge(
|
||||
$data,
|
||||
array('registration_enabled' => $this->container->getParameter('wallabag_user.registration_enabled'))
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue