Added the possibility to register

This commit is contained in:
Polonkai Gergely
2012-07-07 11:13:13 +02:00
parent 1d82e93176
commit a454dc7483
14 changed files with 270 additions and 5 deletions

View File

@@ -30,6 +30,10 @@ KekRozsak\FrontBundle\Entity\User:
targetEntity: ForumPost
mappedBy: created_by
fetch: EXTRA_LAZY
manyToOne:
accepted_by:
targetEntity: User
fetch: EXTRA_LAZY
manyToMany:
roles:
targetEntity: Role

View File

@@ -11,3 +11,7 @@ services:
doctrine: @doctrine
tags:
- { name: twig.extension }
form.type_extension.help_message:
class: KekRozsak\FrontBundle\Form\Extension\HelpMessageTypeExtension
tags:
- { name: "form.type_extension", alias: "field" }

View File

@@ -0,0 +1,29 @@
KekRozsak\FrontBundle\Entity\User:
constraints:
- Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
fields: username
message: "Ez a felhasználónév már foglalt. Kérlek, válassz egy másikat!"
groups: [ registration ]
- Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
fields: email
message: "Ez az e-mail cím már foglalt. Kérlek, válassz egy másikat!"
groups: [ registration ]
- Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
fields: display_name
message: "Ez a név már foglalt. Kérlek, válassz egy másikat!"
groups: [ registration ]
properties:
username:
- NotBlank: { groups: [ registration ] }
password:
- NotBlank: { groups: [ registration ] }
email:
- NotBlank: { groups: [ registration ] }
- Email: { groups: [ registration ] }
registered_at:
- NotBlank: ~
- Type: \DateTime
display_name:
- NotBlank: { groups: [ registration ] }
KekRozsak\FrontBundle\Form\Type\UserType:

View File

@@ -0,0 +1,10 @@
{% block field_row %}
<tr>
<td>{{ form_label(form) }}</td>
<td>{{ form_widget(form) }}</td>
<td>
{{ help }}
</td>
<td>{{ form_errors(form) }}</td>
</td>
{% endblock %}