This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ###FORM_LOGIN_AUTH | |
| security.config: | |
| encoders: | |
| Symfony\Component\Security\User\User: plaintext | |
| providers: | |
| main: | |
| users: | |
| foo: { password: bar, roles: ROLE_USER } | |
| firewalls: | |
| login: { pattern: /login, security: true, anonymous: true } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace Application\MyBundle\Document; | |
| use Bundle\DoctrineUserBundle\Document\UserRepository as BaseUserRepository; | |
| class UserRepository extends BaseUserRepository | |
| { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace Application\MyBundle\Document; | |
| use Bundle\DoctrineUserBundle\Document\User as BaseUser; | |
| /** | |
| * @mongodb:Document(collection="users" ,repositoryClass="Application\MyBundle\Document\UserRepository") | |
| */ | |
| class User extends BaseUser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //MyRoutes | |
| $collection->add('admin', new Route('/admin', array( | |
| '_controller' => 'MyBundle:Admin:index', | |
| ))); | |
| //Security Routes | |
| $collection->add('_security_login', new Route('/login', array( | |
| '_controller' => 'DoctrineUserBundle:Security:login', | |
| ))); | |
| $collection->add('_security_check', new Route('login_check', array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $container->loadFromExtension('doctrine_user', 'config', array( | |
| 'db_driver' => 'odm', | |
| 'password_encoder' => 'sha1', | |
| 'class' => array('model' => array( | |
| 'user' => 'Application\MyBundle\Document\User', | |
| 'property' => 'username', | |
| )), | |
| )); | |
| $container->loadFromExtension('security', 'config', array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| new Symfony\Bundle\DoctrineMongoDBBundle\DoctrineMongoDBBundle(), | |
| new Bundle\DoctrineUserBundle\DoctrineUserBundle(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd src/ | |
| mkdir Bundle | |
| git clone https://github.com/knplabs/DoctrineUserBundle.git -b symfony2Security |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Security Routes | |
| $collection->add('_security_login', new Route('/login', array( | |
| '_controller' => 'DoctrineUserBundle:Security:login', | |
| ))); | |
| $collection->add('_security_check', new Route('/login_check', array( | |
| '_controller' => 'DoctrineUserBundle:Security:login', | |
| ))); | |
| $collection->add('_security_logout', new Route('/logout', array( | |
| '_controller' => 'DoctrineUserBundle:Security:logout', | |
| ))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $container->loadFromExtension('security', 'config', array( | |
| 'provider' => array( | |
| 'main' => array( | |
| 'password_encoder' => 'sha1', | |
| 'document' => array( | |
| 'class' => 'Application/BlogBundle/Document/User', | |
| 'property' => 'username' | |
| ) | |
| )), | |
| 'firewalls' => array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace app\models; | |
| use lithium\util\collection\Filters; | |
| use \lithium\util\Inflector; | |
| Filters::apply('app\models\Post', 'save', function($self, $params, $chain) { | |
| // Custom pre-dispatch logic goes here | |
| //create a slug for new posts. |