Permalink
Browse files

namespaced renamed to FOS/UserBundle, authentication provider fixed, …

…documentation updated and converted to restructuredText
  • Loading branch information...
schmittjoh committed Dec 20, 2010
1 parent 1f57889 commit 8fbf0e9157f5f1d3be8c4ef0e380011015388ebe
Showing with 599 additions and 668 deletions.
  1. +6 −6 Command/ActivateUserCommand.php
  2. +10 −10 Command/CreateUserCommand.php
  3. +7 −7 Command/DeactivateUserCommand.php
  4. +7 −7 Command/DemoteSuperAdminCommand.php
  5. +5 −5 Command/MongoDBMigrateUserPasswordFieldCommand.php
  6. +7 −7 Command/PromoteSuperAdminCommand.php
  7. +2 −2 Controller/SecurityController.php
  8. +45 −45 Controller/UserController.php
  9. +23 −23 DependencyInjection/{DoctrineUserExtension.php → UserExtension.php}
  10. +2 −2 Document/ObjectRepository.php
  11. +2 −2 Document/User.php
  12. +3 −3 Document/UserRepository.php
  13. +2 −2 Entity/Group.php
  14. +2 −2 Entity/ObjectRepository.php
  15. +2 −2 Entity/User.php
  16. +3 −3 Entity/UserRepository.php
  17. +2 −2 Form/ChangePassword.php
  18. +1 −1 Form/ChangePasswordForm.php
  19. +1 −1 Form/UserForm.php
  20. +1 −1 Model/Group.php
  21. +1 −1 Model/RepositoryInterface.php
  22. +2 −2 Model/User.php
  23. +1 −1 Model/UserRepositoryInterface.php
  24. +8 −0 README
  25. +0 −312 README.markdown
  26. +4 −4 Resources/config/controller.xml
  27. +1 −1 ...b/{Bundle.DoctrineUserBundle.Document.User.dcm.xml → Bundle.FOS.UserBundle.Document.User.dcm.xml}
  28. +1 −1 ...a/orm/{Bundle.DoctrineUserBundle.Entity.User.dcm.xml → Bundle.FOS.UserBundle.Entity.User.dcm.xml}
  29. +3 −3 Resources/config/email.xml
  30. +10 −10 Resources/config/form.xml
  31. +3 −3 Resources/config/model.xml
  32. +3 −3 Resources/config/odm.xml
  33. +3 −3 Resources/config/orm.xml
  34. +3 −3 Resources/config/routing/security.xml
  35. +26 −26 Resources/config/routing/user.xml
  36. +2 −2 Resources/config/schema/doctrine_user-1.0.xsd
  37. +14 −14 Resources/config/security.xml
  38. +5 −5 Resources/config/templating.xml
  39. +3 −3 Resources/config/validation.xml
  40. +6 −6 Resources/config/validator.xml
  41. +229 −0 Resources/doc/index.rst
  42. +1 −1 Resources/views/User/edit_content.twig
  43. +2 −2 Resources/views/User/list_content.twig
  44. +1 −1 Resources/views/User/new_content.twig
  45. +1 −1 Resources/views/User/show_content.twig
  46. +25 −15 Security/Authentication/Provider/DaoAuthenticationProvider.php
  47. +2 −2 Security/Encoder/EncoderFactory.php
  48. +1 −1 Security/Encoder/EncoderFactoryAwareInterface.php
  49. +2 −2 Security/Encoder/EncoderFactoryInterface.php
  50. +4 −4 Templating/Helper/SecurityHelper.php
  51. +1 −1 Test/WebTestCase.php
  52. +7 −7 Tests/Command/ActivateUserCommandTest.php
  53. +7 −7 Tests/Command/CreateUserCommandTest.php
  54. +7 −7 Tests/Command/DeactivateUserCommandTest.php
  55. +7 −7 Tests/Command/DemoteSuperUserCommandTest.php
  56. +7 −7 Tests/Command/PromoteSuperUserCommandTest.php
  57. +39 −39 Tests/DependencyInjection/DoctrineUserExtensionTest.php
  58. +3 −3 Tests/Document/UserRepositoryTest.php
  59. +2 −2 Tests/Model/UserTest.php
  60. +6 −6 Tests/Validation/UserValidationTest.php
  61. +1 −1 Tests/Validator/Doctrine/ORM/UniqueValidatorTest.php
  62. +2 −6 DoctrineUserBundle.php → UserBundle.php
  63. +1 −1 Util/String.php
  64. +1 −1 Validator/Doctrine/ODM/MongoDB/UniqueValidator.php
  65. +1 −1 Validator/Doctrine/ORM/UniqueValidator.php
  66. +2 −2 Validator/Password.php
  67. +3 −3 Validator/PasswordValidator.php
  68. +2 −2 Validator/Unique.php
@@ -1,6 +1,6 @@
<?php
namespace Bundle\DoctrineUserBundle\Command;
namespace Bundle\FOS\UserBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\Command as BaseCommand;
use Symfony\Component\Console\Input\InputArgument;
@@ -10,7 +10,7 @@
use Symfony\Component\Console\Output\Output;
/*
* This file is part of the DoctrineUserBundle
* This file is part of the FOS\UserBundle
*
* (c) Matthieu Bontemps <matthieu@knplabs.com>
* (c) Thibault Duplessis <thibault.duplessis@gmail.com>
@@ -23,7 +23,7 @@
* ActivateUserCommand.
*
* @package Bundle
* @subpackage DoctrineUserBundle
* @subpackage FOS\UserBundle
* @author Antoine Hérault <antoine.herault@gmail.com>
*/
class ActivateUserCommand extends BaseCommand
@@ -34,15 +34,15 @@ class ActivateUserCommand extends BaseCommand
protected function configure()
{
$this
->setName('doctrine:user:activate')
->setName('fos:user:activate')
->setDescription('Activate a user')
->setDefinition(array(
new InputArgument('username', InputArgument::REQUIRED, 'The username'),
))
->setHelp(<<<EOT
The <info>doctrine:user:activate</info> command activates a super (will be able to log in)
<info>php app/console doctrine:user:activate matthieu</info>
<info>php app/console fos:user:activate matthieu</info>
EOT
);
}
@@ -52,7 +52,7 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$userRepo = $this->container->get('doctrine_user.repository.user');
$userRepo = $this->container->get('fos_user.repository.user');
$user = $userRepo->findOneByUsername($input->getArgument('username'));
if (!$user) {
@@ -1,6 +1,6 @@
<?php
namespace Bundle\DoctrineUserBundle\Command;
namespace Bundle\FOS\UserBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\Command as BaseCommand;
use Symfony\Component\Console\Input\InputArgument;
@@ -10,7 +10,7 @@
use Symfony\Component\Console\Output\Output;
/*
* This file is part of the DoctrineUserBundle
* This file is part of the FOS\UserBundle
*
* (c) Matthieu Bontemps <matthieu@knplabs.com>
* (c) Thibault Duplessis <thibault.duplessis@gmail.com>
@@ -23,7 +23,7 @@
* CreateUserCommand.
*
* @package Bundle
* @subpackage DoctrineUserBundle
* @subpackage FOS\UserBundle
* @author Matthieu Bontemps <matthieu@knplabs.com>
* @author Thibault Duplessis <thibault.duplessis@gmail.com>
*/
@@ -35,7 +35,7 @@ class CreateUserCommand extends BaseCommand
protected function configure()
{
$this
->setName('doctrine:user:create')
->setName('fos:user:create')
->setDescription('Create a user.')
->setDefinition(array(
new InputArgument('username', InputArgument::REQUIRED, 'The username'),
@@ -45,23 +45,23 @@ protected function configure()
new InputOption('inactive', null, InputOption::VALUE_NONE, 'Set the user as inactive'),
))
->setHelp(<<<EOT
The <info>doctrine:user:create</info> command creates a user:
The <info>fos:user:create</info> command creates a user:
<info>php app/console doctrine:user:create matthieu</info>
<info>php app/console fos:user:create matthieu</info>
This interactive shell will first ask you for a password.
You can alternatively specify the password as a second argument:
<info>php app/console doctrine:user:create matthieu mypassword</info>
<info>php app/console fos:user:create matthieu mypassword</info>
You can create a super admin via the super-admin flag:
<info>php app/console doctrine:user:create admin --super-admin</info>
<info>php app/console fos:user:create admin --super-admin</info>
You can create an inactive user (will not be able to log in):
<info>php app/console doctrine:user:create thibault --inactive</info>
<info>php app/console fos:user:create thibault --inactive</info>
EOT
);
@@ -72,7 +72,7 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$userRepo = $this->container->get('doctrine_user.repository.user');
$userRepo = $this->container->get('fos_user.repository.user');
$user = $userRepo->createObjectInstance();
$user->setUsername($input->getArgument('username'));
$user->setEmail($input->getArgument('email'));
@@ -1,6 +1,6 @@
<?php
namespace Bundle\DoctrineUserBundle\Command;
namespace Bundle\FOS\UserBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\Command as BaseCommand;
use Symfony\Component\Console\Input\InputArgument;
@@ -10,7 +10,7 @@
use Symfony\Component\Console\Output\Output;
/*
* This file is part of the DoctrineUserBundle
* This file is part of the FOS\UserBundle
*
* (c) Matthieu Bontemps <matthieu@knplabs.com>
* (c) Thibault Duplessis <thibault.duplessis@gmail.com>
@@ -23,7 +23,7 @@
* DeactivateUserCommand.
*
* @package Bundle
* @subpackage DoctrineUserBundle
* @subpackage FOS\UserBundle
* @author Antoine Hérault <antoine.herault@gmail.com>
*/
class DeactivateUserCommand extends BaseCommand
@@ -34,15 +34,15 @@ class DeactivateUserCommand extends BaseCommand
protected function configure()
{
$this
->setName('doctrine:user:deactivate')
->setName('fos:user:deactivate')
->setDescription('Deactivate a user')
->setDefinition(array(
new InputArgument('username', InputArgument::REQUIRED, 'The username'),
))
->setHelp(<<<EOT
The <info>doctrine:user:deactivate</info> command deactivates a user (will not be able to log in)
The <info>fos:user:deactivate</info> command deactivates a user (will not be able to log in)
<info>php app/console doctrine:user:deactivate matthieu</info>
<info>php app/console fos:user:deactivate matthieu</info>
EOT
);
}
@@ -52,7 +52,7 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$userRepo = $this->container->get('doctrine_user.repository.user');
$userRepo = $this->container->get('fos_user.repository.user');
$user = $userRepo->findOneByUsername($input->getArgument('username'));
if (!$user) {
@@ -1,6 +1,6 @@
<?php
namespace Bundle\DoctrineUserBundle\Command;
namespace Bundle\FOS\UserBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\Command as BaseCommand;
use Symfony\Component\Console\Input\InputArgument;
@@ -10,7 +10,7 @@
use Symfony\Component\Console\Output\Output;
/*
* This file is part of the DoctrineUserBundle
* This file is part of the FOS\UserBundle
*
* (c) Matthieu Bontemps <matthieu@knplabs.com>
* (c) Thibault Duplessis <thibault.duplessis@gmail.com>
@@ -23,7 +23,7 @@
* DemoteSuperAdminCommand.
*
* @package Bundle
* @subpackage DoctrineUserBundle
* @subpackage FOS\UserBundle
* @author Antoine Hérault <antoine.herault@gmail.com>
*/
class DemoteSuperAdminCommand extends BaseCommand
@@ -34,15 +34,15 @@ class DemoteSuperAdminCommand extends BaseCommand
protected function configure()
{
$this
->setName('doctrine:user:demote')
->setName('fos:user:demote')
->setDescription('Demote a super administrator as a simple user')
->setDefinition(array(
new InputArgument('username', InputArgument::REQUIRED, 'The username'),
))
->setHelp(<<<EOT
The <info>doctrine:user:demote</info> command demotes a super administrator as a simple user
The <info>fos:user:demote</info> command demotes a super administrator as a simple user
<info>php app/console doctrine:user:demote matthieu</info>
<info>php app/console fos:user:demote matthieu</info>
EOT
);
}
@@ -52,7 +52,7 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$userRepo = $this->container->get('doctrine_user.repository.user');
$userRepo = $this->container->get('fos_user.repository.user');
$user = $userRepo->findOneByUsername($input->getArgument('username'));
if (!$user) {
@@ -1,14 +1,14 @@
<?php
namespace Bundle\DoctrineUserBundle\Command;
namespace Bundle\FOS\UserBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\Command as BaseCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\Output;
use Bundle\DoctrineUserBundle\Document\UserRepository;
use Bundle\FOS\UserBundle\Document\UserRepository;
class MongoDBMigrateUserPasswordFieldCommand extends BaseCommand
{
@@ -18,7 +18,7 @@ class MongoDBMigrateUserPasswordFieldCommand extends BaseCommand
protected function configure()
{
$this
->setName('doctrine:user:migrate-password')
->setName('fos:user:migrate-password')
->setDescription('Rename User.passwordHash to User.password in a MongoDB Collection');
}
@@ -27,12 +27,12 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$userRepo = $this->container->get('doctrine_user.repository.user');
$userRepo = $this->container->get('fos_user.repository.user');
if (!$userRepo instanceof UserRepository) {
throw new \RuntimeException('Can only work with MongoDB');
}
$dm = $this->container->get('doctrine_user.object_manager');
$dm = $this->container->get('fos_user.object_manager');
$collection = $dm->getDocumentCollection($userRepo->getObjectClass())->getMongoCollection();
$users = $collection->find(array('passwordHash' => array('$exists' => true)));
if (!$users->count()) {
@@ -1,6 +1,6 @@
<?php
namespace Bundle\DoctrineUserBundle\Command;
namespace Bundle\FOS\UserBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\Command as BaseCommand;
use Symfony\Component\Console\Input\InputArgument;
@@ -10,7 +10,7 @@
use Symfony\Component\Console\Output\Output;
/*
* This file is part of the DoctrineUserBundle
* This file is part of the FOS\UserBundle
*
* (c) Matthieu Bontemps <matthieu@knplabs.com>
* (c) Thibault Duplessis <thibault.duplessis@gmail.com>
@@ -23,7 +23,7 @@
* CreateUserCommand.
*
* @package Bundle
* @subpackage DoctrineUserBundle
* @subpackage FOS\UserBundle
* @author Matthieu Bontemps <matthieu@knplabs.com>
* @author Thibault Duplessis <thibault.duplessis@gmail.com>
*/
@@ -35,15 +35,15 @@ class PromoteSuperAdminCommand extends BaseCommand
protected function configure()
{
$this
->setName('doctrine:user:promote')
->setName('fos:user:promote')
->setDescription('Promotes a user as a super administrator')
->setDefinition(array(
new InputArgument('username', InputArgument::REQUIRED, 'The username'),
))
->setHelp(<<<EOT
The <info>doctrine:user:promote</info> command promotes a user as a super administrator
The <info>fos:user:promote</info> command promotes a user as a super administrator
<info>php app/console doctrine:user:promote matthieu</info>
<info>php app/console fos:user:promote matthieu</info>
EOT
);
}
@@ -53,7 +53,7 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$userRepo = $this->container->get('doctrine_user.repository.user');
$userRepo = $this->container->get('fos_user.repository.user');
$user = $userRepo->findOneByUsername($input->getArgument('username'));
if (!$user) {
@@ -1,6 +1,6 @@
<?php
namespace Bundle\DoctrineUserBundle\Controller;
namespace Bundle\FOS\UserBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Security\SecurityContext;
@@ -17,7 +17,7 @@ public function loginAction()
$this->get('request')->getSession()->remove(SecurityContext::AUTHENTICATION_ERROR);
}
return $this->render('DoctrineUserBundle:Security:login.twig', array(
return $this->render('FOS\UserBundle:Security:login.twig', array(
// last username entered by the user
'last_username' => $this->get('request')->getSession()->get(SecurityContext::LAST_USERNAME),
'error' => $error,
Oops, something went wrong.

0 comments on commit 8fbf0e9

Please sign in to comment.