forked from afup/aperophp
-
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 afup#13 from Koin/master
Finalisation de la partie membre
- Loading branch information
Showing
31 changed files
with
15,713 additions
and
1,769 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 |
---|---|---|
|
@@ -7,3 +7,4 @@ deps.lock | |
.buildpath | ||
.project | ||
.settings/ | ||
*.*~ |
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
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 |
---|---|---|
|
@@ -8,22 +8,21 @@ | |
use Symfony\Component\Validator\Constraints; | ||
|
||
/** | ||
* Signup form. | ||
* Edit member form. | ||
* | ||
* @author Koin <[email protected]> | ||
* @since 22 janv. 2012 | ||
* @version 1.0 - 22 janv. 2012 - Koin <[email protected]> | ||
* @since 4 févr. 2012 | ||
* @version 1.0 - 4 févr. 2012 - Koin <[email protected]> | ||
*/ | ||
class Signup extends AbstractType | ||
class EditMemberType extends AbstractType | ||
{ | ||
public function buildForm(FormBuilder $builder, array $options) | ||
{ | ||
$builder | ||
->add('lastname', 'text') | ||
->add('firstname', 'text') | ||
->add('username', 'text') | ||
->add('lastname', 'text', array('label' => 'Nom', 'required' => false, 'attr' => array('placeholder' => 'Facultatif.'))) | ||
->add('firstname', 'text', array('label' => 'Prénom', 'required' => false, 'attr' => array('placeholder' => 'Facultatif.'))) | ||
->add('email', 'email') | ||
->add('password', 'password'); | ||
->add('password', 'password', array('label' => 'Mot de passe', 'required' => false)); | ||
} | ||
|
||
public function getDefaultOptions(array $options) | ||
|
@@ -32,9 +31,11 @@ public function getDefaultOptions(array $options) | |
'fields' => array( | ||
'lastname' => new Constraints\MaxLength(array('limit' => 80)), | ||
'firstname' => new Constraints\MaxLength(array('limit' => 80)), | ||
'username' => new Constraints\MaxLength(array('limit' => 80)), | ||
'email' => new Constraints\Email(), | ||
'password' => new Constraints\NotNull(), | ||
'email' => array( | ||
new Constraints\Email(), | ||
new Constraints\NotNull(), | ||
), | ||
'password' => new Constraints\MaxLength(array('limit' => 80)), | ||
), | ||
'allowExtraFields' => false, | ||
)); | ||
|
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,49 @@ | ||
<?php | ||
|
||
namespace Aperophp\Form; | ||
|
||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\FormBuilder; | ||
|
||
use Symfony\Component\Validator\Constraints; | ||
|
||
/** | ||
* Signin form. | ||
* | ||
* @author Koin <[email protected]> | ||
* @since 4 févr. 2012 | ||
* @version 1.0 - 4 févr. 2012 - Koin <[email protected]> | ||
*/ | ||
class SigninType extends AbstractType | ||
{ | ||
public function buildForm(FormBuilder $builder, array $options) | ||
{ | ||
$builder | ||
->add('username', 'text', array('label' => 'Identifiant')) | ||
->add('password', 'password', array('label' => 'Mot de passe')); | ||
} | ||
|
||
public function getDefaultOptions(array $options) | ||
{ | ||
$collectionConstraint = new Constraints\Collection(array( | ||
'fields' => array( | ||
'username' => array( | ||
new Constraints\MaxLength(array('limit' => 80)), | ||
new Constraints\NotNull(), | ||
), | ||
'password' => array( | ||
new Constraints\MaxLength(array('limit' => 80)), | ||
new Constraints\NotNull(), | ||
), | ||
), | ||
'allowExtraFields' => false, | ||
)); | ||
|
||
return array('validation_constraint' => $collectionConstraint); | ||
} | ||
|
||
public function getName() | ||
{ | ||
return 'signin'; | ||
} | ||
} |
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,58 @@ | ||
<?php | ||
|
||
namespace Aperophp\Form; | ||
|
||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\FormBuilder; | ||
|
||
use Symfony\Component\Validator\Constraints; | ||
|
||
/** | ||
* Signup form. | ||
* | ||
* @author Koin <[email protected]> | ||
* @since 22 janv. 2012 | ||
* @version 1.0 - 22 janv. 2012 - Koin <[email protected]> | ||
*/ | ||
class SignupType extends AbstractType | ||
{ | ||
public function buildForm(FormBuilder $builder, array $options) | ||
{ | ||
$builder | ||
->add('lastname', 'text', array('label' => 'Nom', 'required' => false, 'attr' => array('placeholder' => 'Facultatif.'))) | ||
->add('firstname', 'text', array('label' => 'Prénom', 'required' => false, 'attr' => array('placeholder' => 'Facultatif.'))) | ||
->add('username', 'text', array('label' => 'Identifiant')) | ||
->add('email', 'email') | ||
->add('password', 'password', array('label' => 'Mot de passe')); | ||
} | ||
|
||
public function getDefaultOptions(array $options) | ||
{ | ||
$collectionConstraint = new Constraints\Collection(array( | ||
'fields' => array( | ||
'lastname' => new Constraints\MaxLength(array('limit' => 80)), | ||
'firstname' => new Constraints\MaxLength(array('limit' => 80)), | ||
'username' => array( | ||
new Constraints\MaxLength(array('limit' => 80)), | ||
new Constraints\NotNull(), | ||
), | ||
'email' => array( | ||
new Constraints\Email(), | ||
new Constraints\NotNull(), | ||
), | ||
'password' => array( | ||
new Constraints\MaxLength(array('limit' => 80)), | ||
new Constraints\NotNull(), | ||
), | ||
), | ||
'allowExtraFields' => false, | ||
)); | ||
|
||
return array('validation_constraint' => $collectionConstraint); | ||
} | ||
|
||
public function getName() | ||
{ | ||
return 'signup'; | ||
} | ||
} |
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,37 @@ | ||
<?php | ||
|
||
namespace Aperophp\Lib; | ||
|
||
/** | ||
* Aperophp utils. | ||
* | ||
* @author Koin <[email protected]> | ||
* @since 4 févr. 2012 | ||
* @version 1.0 - 4 févr. 2012 - Koin <[email protected]> | ||
*/ | ||
class Utils | ||
{ | ||
protected | ||
$app; | ||
|
||
public function __construct($app) | ||
{ | ||
$this->app = $app; | ||
} | ||
|
||
/** | ||
* Hash my string. | ||
* | ||
* @author Koin <[email protected]> | ||
* @since 4 févr. 2012 | ||
* @version 1.1 - 4 févr. 2012 - Koin <[email protected]> | ||
* @param string $str | ||
* @param string $salt | ||
* @return string | ||
*/ | ||
public function hash($str, $salt = null) | ||
{ | ||
$salt = $salt ? $salt : $this->app['secret']; | ||
return sha1($str.$salt); | ||
} | ||
} |
Oops, something went wrong.