Skip to content
This repository has been archived by the owner on Sep 23, 2022. It is now read-only.

Commit

Permalink
namespaced renamed to FOS/UserBundle, authentication provider fixed, …
Browse files Browse the repository at this point in the history
…documentation updated and converted to restructuredText
  • Loading branch information
schmittjoh committed Dec 20, 2010
1 parent 1f57889 commit 8fbf0e9
Show file tree
Hide file tree
Showing 68 changed files with 599 additions and 668 deletions.
12 changes: 6 additions & 6 deletions Command/ActivateUserCommand.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;
Expand All @@ -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>
Expand All @@ -23,7 +23,7 @@
* ActivateUserCommand.
*
* @package Bundle
* @subpackage DoctrineUserBundle
* @subpackage FOS\UserBundle
* @author Antoine Hérault <antoine.herault@gmail.com>
*/
class ActivateUserCommand extends BaseCommand
Expand All @@ -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
);
}
Expand All @@ -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) {
Expand Down
20 changes: 10 additions & 10 deletions Command/CreateUserCommand.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;
Expand All @@ -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>
Expand All @@ -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>
*/
Expand All @@ -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'),
Expand All @@ -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
);
Expand All @@ -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'));
Expand Down
14 changes: 7 additions & 7 deletions Command/DeactivateUserCommand.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;
Expand All @@ -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>
Expand All @@ -23,7 +23,7 @@
* DeactivateUserCommand.
*
* @package Bundle
* @subpackage DoctrineUserBundle
* @subpackage FOS\UserBundle
* @author Antoine Hérault <antoine.herault@gmail.com>
*/
class DeactivateUserCommand extends BaseCommand
Expand All @@ -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
);
}
Expand All @@ -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) {
Expand Down
14 changes: 7 additions & 7 deletions Command/DemoteSuperAdminCommand.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;
Expand All @@ -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>
Expand All @@ -23,7 +23,7 @@
* DemoteSuperAdminCommand.
*
* @package Bundle
* @subpackage DoctrineUserBundle
* @subpackage FOS\UserBundle
* @author Antoine Hérault <antoine.herault@gmail.com>
*/
class DemoteSuperAdminCommand extends BaseCommand
Expand All @@ -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
);
}
Expand All @@ -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) {
Expand Down
10 changes: 5 additions & 5 deletions Command/MongoDBMigrateUserPasswordFieldCommand.php
@@ -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
{
Expand All @@ -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');
}

Expand All @@ -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()) {
Expand Down
14 changes: 7 additions & 7 deletions Command/PromoteSuperAdminCommand.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;
Expand All @@ -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>
Expand All @@ -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>
*/
Expand All @@ -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
);
}
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions Controller/SecurityController.php
@@ -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;
Expand All @@ -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,
Expand Down

0 comments on commit 8fbf0e9

Please sign in to comment.