Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/Resources/views/invoice/login.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
{# <h3 class="panel-title"><?php if (isset($_GET['successRegister'])): ?>You just registered successfully <?php endif ?>Please Sign In</h3>#}
</div>
<div class="panel-body">
{% for flash_message in app.session.flashbag.get('success') %}
<div class="alert-success">
{{ flash_message }}
</div>
{% endfor %}
<form role="form" action="{{ path('login_check') }}" method="POST">
<fieldset>
<div class="form-group <?php if (isset($loginErrors['email'])): ?>has-error<?php endif ?>">
Expand All @@ -66,4 +71,4 @@
</div>
</div>

{% endblock body %}
{% endblock body %}
43 changes: 1 addition & 42 deletions app/Resources/views/invoice/register.html.twig
Original file line number Diff line number Diff line change
@@ -1,48 +1,7 @@
{#% extends 'base.html.twig' %#}

{% block body %}
{#<div class="container">
<div class="row">
<div class="col-md-4 col-md-offset-4">
<div class="login-panel panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Register</h3>
</div>
<div class="panel-body">
<form role="form" action="{% path('registerUser') %}" method="POST">
<fieldset>
<div class="form-group <?php if (isset($registerErrors['email'])): ?>has-error<?php endif ?>">
<?php if (isset($registerErrors['email'])): ?>
<label class="control-label" for="register-email"><?php echo $registerErrors['email'] ?></label>
<?php endif ?>
<input class="form-control" placeholder="E-mail" name="email" type="email" autofocus id="register-email">
</div>
<div class="form-group <?php if (isset($registerErrors['password'])): ?>has-error<?php endif ?>">
<?php if (isset($registerErrors['password'])): ?>
<label class="control-label" for="register-password"><?php echo $registerErrors['password'] ?></label>
<?php endif ?>
<input class="form-control" placeholder="Password" name="password" type="password" value="" id="register-password">
</div>
<div class="form-group <?php if (isset($registerErrors['vat'])): ?>has-error<?php endif ?>">
<?php if (isset($registerErrors['vat'])): ?>
<label class="control-label" for="register-vat"><?php echo $registerErrors['vat'] ?></label>
<?php endif ?>
<input class="form-control" placeholder="Vat Number" name="vat" type="text" value="" id="register-vat">
</div>
<!-- Change this to a button or input when using this as a form -->
<input type="submit" class="btn btn-lg btn-success btn-block" value="Register" />
</fieldset>
</form>
</div>
</div>
</div>
</div>
</div>#}

{{ form_start(form) }}
{{ form_widget(form) }}
{{ form_end(form) }}



{% endblock %}
{% endblock %}
7 changes: 2 additions & 5 deletions app/config/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,21 @@ security:

main:
pattern: ^/
#http_basic: ~
provider: db_provider

form_login:
provider: db_provider
login_path: /login
check_path: /login_check
use_forward: true
# logout: true
# anonymous: true
#anonymous: ~
# #secured_area:
anonymous: true
logout:
path: /logout
target: /
#
access_control:
- { path: /login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: /register, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/, roles: ROLE_USER }
# activate different ways to authenticate

Expand Down
14 changes: 14 additions & 0 deletions app/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,17 @@ services:
class: L3l0Labs\Adapters\DbalAdapter\InvoiceViewRegistry
arguments:
- @database_connection

system_account_registry:
class: AppBundle\SystemAccess\SystemAccountRegistry
arguments:
- @doctrine.orm.default_entity_manager

system_account_factory:
class: AppBundle\SystemAccess\SystemAccountFactory

register_user:
class: L3l0Labs\SystemAccess\UseCase\Registration
arguments:
- @system_account_registry
- @system_account_factory
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
"behat/behat": "~3.0.14",
"phpspec/phpspec": "~2.1.0",
"phpunit/phpunit": "4.7.*@dev",
"sensio/generator-bundle": "~2.3"
"sensio/generator-bundle": "~2.3",
"behat/mink-extension": "*@dev",
"behat/mink-browserkit-driver": "*@dev",
"behat/symfony2-extension": "*@dev"
},
"scripts": {
"post-install-cmd": [
Expand Down
242 changes: 239 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading