validation.xml 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <?xml version="1.0" ?>
  2. <constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping
  5. http://symfony.com/schema/dic/services/constraint-mapping-1.0.xsd">
  6. <class name="FOS\UserBundle\Model\User">
  7. <constraint name="FOS\UserBundle\Validator\Unique">
  8. <option name="property">usernameCanonical</option>
  9. <option name="message">The username is already used</option>
  10. <option name="groups">
  11. <value>Registration</value>
  12. <value>Profile</value>
  13. </option>
  14. </constraint>
  15. <constraint name="FOS\UserBundle\Validator\Unique">
  16. <option name="property">emailCanonical</option>
  17. <option name="message">The email is already used</option>
  18. <option name="groups">
  19. <value>Registration</value>
  20. <value>Profile</value>
  21. </option>
  22. </constraint>
  23. <property name="username">
  24. <constraint name="NotBlank">
  25. <option name="message">Please enter a username</option>
  26. <option name="groups">
  27. <value>Registration</value>
  28. <value>Profile</value>
  29. </option>
  30. </constraint>
  31. <constraint name="MinLength">
  32. <option name="limit">6</option>
  33. <option name="message">The username is too short</option>
  34. <option name="groups">
  35. <value>Registration</value>
  36. <value>Profile</value>
  37. </option>
  38. </constraint>
  39. <constraint name="MaxLength">
  40. <option name="limit">32</option>
  41. <option name="message">The username is too long</option>
  42. <option name="groups">
  43. <value>Registration</value>
  44. <value>Profile</value>
  45. </option>
  46. </constraint>
  47. </property>
  48. <property name="email">
  49. <constraint name="NotBlank">
  50. <option name="message">Please enter an email</option>
  51. <option name="groups">
  52. <value>Registration</value>
  53. <value>Profile</value>
  54. </option>
  55. </constraint>
  56. <constraint name="MinLength">
  57. <option name="limit">2</option>
  58. <option name="message">The email is too short</option>
  59. <option name="groups">
  60. <value>Registration</value>
  61. <value>Profile</value>
  62. </option>
  63. </constraint>
  64. <constraint name="MaxLength">
  65. <option name="limit">255</option>
  66. <option name="message">The email is too long</option>
  67. <option name="groups">
  68. <value>Registration</value>
  69. <value>Profile</value>
  70. </option>
  71. </constraint>
  72. <constraint name="Email">
  73. <option name="message">The email is not valid</option>
  74. <option name="groups">
  75. <value>Registration</value>
  76. <value>Profile</value>
  77. </option>
  78. </constraint>
  79. </property>
  80. <property name="plainPassword">
  81. <constraint name="NotBlank">
  82. <option name="message">Please enter a password</option>
  83. <option name="groups">Registration</option>
  84. </constraint>
  85. <constraint name="MinLength">
  86. <option name="limit">2</option>
  87. <option name="message">The password is too short</option>
  88. <option name="groups">
  89. <value>Registration</value>
  90. <value>Profile</value>
  91. </option>
  92. </constraint>
  93. </property>
  94. </class>
  95. <class name="FOS\UserBundle\Form\Model\CheckPassword">
  96. <constraint name="FOS\UserBundle\Validator\Password">
  97. <option name="passwordProperty">current</option>
  98. <option name="userProperty">user</option>
  99. <option name="groups">
  100. <value>ChangePassword</value>
  101. <value>Profile</value>
  102. </option>
  103. </constraint>
  104. </class>
  105. <class name="FOS\UserBundle\Form\Model\ChangePassword">
  106. <property name="new">
  107. <constraint name="NotBlank">
  108. <option name="message">Please enter a new password</option>
  109. <option name="groups">ChangePassword</option>
  110. </constraint>
  111. <constraint name="MinLength">
  112. <option name="limit">2</option>
  113. <option name="message">The new password is too short</option>
  114. <option name="groups">ChangePassword</option>
  115. </constraint>
  116. </property>
  117. </class>
  118. <class name="FOS\UserBundle\Form\Model\ResetPassword">
  119. <property name="new">
  120. <constraint name="NotBlank">
  121. <option name="message">Please enter a new password</option>
  122. <option name="groups">ResetPassword</option>
  123. </constraint>
  124. <constraint name="MinLength">
  125. <option name="limit">2</option>
  126. <option name="message">The new password is too short</option>
  127. <option name="groups">ResetPassword</option>
  128. </constraint>
  129. </property>
  130. </class>
  131. <class name="FOS\UserBundle\Model\Group">
  132. <property name="name">
  133. <constraint name="NotBlank">
  134. <option name="message">Please enter a name</option>
  135. <option name="groups">Registration</option>
  136. </constraint>
  137. <constraint name="MinLength">
  138. <option name="limit">2</option>
  139. <option name="message">The name is too short</option>
  140. <option name="groups">Registration</option>
  141. </constraint>
  142. <constraint name="MaxLength">
  143. <option name="limit">255</option>
  144. <option name="message">The name is too long</option>
  145. <option name="groups">Registration</option>
  146. </constraint>
  147. </property>
  148. </class>
  149. </constraint-mapping>