forked from Sylius/Sylius
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from BartoszSiejka/registration-and-login
login and register
- Loading branch information
Showing
18 changed files
with
268 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ | |
/vendor/ | ||
/bin/ | ||
/composer.phar | ||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
app_core: | ||
resource: "@AppCoreBundle/Resources/config/routing.yml" | ||
prefix: / | ||
|
||
fos_user_security: | ||
resource: "@FOSUserBundle/Resources/config/routing/security.xml" | ||
|
||
fos_user_profile: | ||
resource: "@FOSUserBundle/Resources/config/routing/profile.xml" | ||
prefix: /profile | ||
|
||
fos_user_register: | ||
resource: "@FOSUserBundle/Resources/config/routing/registration.xml" | ||
prefix: /register | ||
|
||
fos_user_resetting: | ||
resource: "@FOSUserBundle/Resources/config/routing/resetting.xml" | ||
prefix: /resetting | ||
|
||
fos_user_change_password: | ||
resource: "@FOSUserBundle/Resources/config/routing/change_password.xml" | ||
prefix: /profile |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,36 @@ | ||
security: | ||
|
||
|
||
providers: | ||
in_memory: | ||
memory: ~ | ||
fos_userbundle: | ||
id: fos_user.user_provider.username | ||
|
||
encoders: | ||
FOS\UserBundle\Model\UserInterface: sha512 | ||
|
||
firewalls: | ||
main: | ||
pattern: ^/ | ||
form_login: | ||
provider: fos_userbundle | ||
login_path: /login | ||
check_path: /login_check | ||
csrf_provider: form.csrf_provider | ||
logout: true | ||
anonymous: true | ||
dev: | ||
pattern: ^/(_(profiler|wdt)|css|images|js)/ | ||
security: false | ||
|
||
default: | ||
anonymous: ~ | ||
|
||
access_control: | ||
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } | ||
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY } | ||
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY } | ||
- { path: ^/admin/, role: ROLE_ADMIN } | ||
|
||
role_hierarchy: | ||
ROLE_ADMIN: ROLE_USER | ||
ROLE_SUPER_ADMIN: ROLE_ADMIN |
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace App\Bundle\CoreBundle; | ||
|
||
use Symfony\Component\HttpKernel\Bundle\Bundle; | ||
|
||
class AppCoreBundle extends Bundle | ||
{ | ||
} |
13 changes: 13 additions & 0 deletions
13
src/App/Bundle/CoreBundle/Controller/DefaultController.php
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace App\Bundle\CoreBundle\Controller; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
|
||
class DefaultController extends Controller | ||
{ | ||
public function indexAction($name) | ||
{ | ||
return $this->render('AppCoreBundle:Default:index.html.twig', array('name' => $name)); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/App/Bundle/CoreBundle/DependencyInjection/AppCoreExtension.php
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace App\Bundle\CoreBundle\DependencyInjection; | ||
|
||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\Config\FileLocator; | ||
use Symfony\Component\HttpKernel\DependencyInjection\Extension; | ||
use Symfony\Component\DependencyInjection\Loader; | ||
|
||
/** | ||
* This is the class that loads and manages your bundle configuration | ||
* | ||
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html} | ||
*/ | ||
class AppCoreExtension extends Extension | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function load(array $configs, ContainerBuilder $container) | ||
{ | ||
$configuration = new Configuration(); | ||
$config = $this->processConfiguration($configuration, $configs); | ||
|
||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); | ||
$loader->load('services.yml'); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/App/Bundle/CoreBundle/DependencyInjection/Configuration.php
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace App\Bundle\CoreBundle\DependencyInjection; | ||
|
||
use Symfony\Component\Config\Definition\Builder\TreeBuilder; | ||
use Symfony\Component\Config\Definition\ConfigurationInterface; | ||
|
||
/** | ||
* This is the class that validates and merges configuration from your app/config files | ||
* | ||
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class} | ||
*/ | ||
class Configuration implements ConfigurationInterface | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getConfigTreeBuilder() | ||
{ | ||
$treeBuilder = new TreeBuilder(); | ||
$rootNode = $treeBuilder->root('app_core'); | ||
|
||
// Here you should define the parameters that are allowed to | ||
// configure your bundle. See the documentation linked above for | ||
// more information on that topic. | ||
|
||
return $treeBuilder; | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace App\Bundle\CoreBundle\Entity; | ||
|
||
use FOS\UserBundle\Entity\User as BaseUser; | ||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
/** | ||
* @ORM\Entity | ||
* @ORM\Table(name="fos_user") | ||
*/ | ||
class User extends BaseUser | ||
{ | ||
/** | ||
* @ORM\Id | ||
* @ORM\Column(type="integer") | ||
* @ORM\GeneratedValue(strategy="AUTO") | ||
*/ | ||
protected $id; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
// your own logic | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
app_core_homepage: | ||
path: /hello/{name} | ||
defaults: { _controller: AppCoreBundle:Default:index } |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
services: | ||
# app_core.example: | ||
# class: App\Bundle\CoreBundle\Example | ||
# arguments: [@service_id, "plain_value", %parameter%] |
Empty file.
11 changes: 11 additions & 0 deletions
11
src/App/Bundle/CoreBundle/Resources/translations/messages.fr.xlf
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0"?> | ||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> | ||
<file source-language="en" datatype="plaintext" original="file.ext"> | ||
<body> | ||
<trans-unit id="1"> | ||
<source>Symfony2 is great</source> | ||
<target>J'aime Symfony2</target> | ||
</trans-unit> | ||
</body> | ||
</file> | ||
</xliff> |
1 change: 1 addition & 0 deletions
1
src/App/Bundle/CoreBundle/Resources/views/Default/index.html.twig
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello {{ name }}! |
17 changes: 17 additions & 0 deletions
17
src/App/Bundle/CoreBundle/Tests/Controller/DefaultControllerTest.php
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace App\Bundle\CoreBundle\Tests\Controller; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||
|
||
class DefaultControllerTest extends WebTestCase | ||
{ | ||
public function testIndex() | ||
{ | ||
$client = static::createClient(); | ||
|
||
$crawler = $client->request('GET', '/hello/Fabien'); | ||
|
||
$this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0); | ||
} | ||
} |