forked from wingman007/fmi
-
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.
- Loading branch information
1 parent
98e073a
commit a831cb3
Showing
7 changed files
with
252 additions
and
13 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
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,74 @@ | ||
<?php | ||
namespace AuthDoctrine\Form; | ||
|
||
use Zend\InputFilter\Factory as InputFactory; | ||
use Zend\InputFilter\InputFilter; | ||
|
||
class UserFilter extends InputFilter | ||
{ | ||
public function __construct() | ||
{ | ||
// self::__construct(); // parnt::__construct(); - trows and error | ||
$this->add(array( | ||
'name' => 'usr_name', | ||
'required' => false, | ||
'filters' => array( | ||
array('name' => 'StripTags'), | ||
array('name' => 'StringTrim'), | ||
), | ||
'validators' => array( | ||
array( | ||
'name' => 'StringLength', | ||
'options' => array( | ||
'encoding' => 'UTF-8', | ||
'min' => 1, | ||
'max' => 100, | ||
), | ||
), | ||
), | ||
)); | ||
|
||
$this->add(array( | ||
'name' => 'usr_email', | ||
'required' => false, | ||
'validators' => array( | ||
array( | ||
'name' => 'EmailAddress' | ||
), | ||
), | ||
)); | ||
|
||
$this->add(array( | ||
'name' => 'usr_password', | ||
'required' => false, | ||
'filters' => array( | ||
array('name' => 'StripTags'), | ||
array('name' => 'StringTrim'), | ||
), | ||
'validators' => array( | ||
array( | ||
'name' => 'StringLength', | ||
'options' => array( | ||
'encoding' => 'UTF-8', | ||
'min' => 6, | ||
'max' => 12, | ||
), | ||
), | ||
), | ||
)); | ||
|
||
$this->add(array( | ||
'name' => 'usr_active', | ||
'required' => false, | ||
'filters' => array( | ||
array('name' => 'Int'), | ||
), | ||
'validators' => array( | ||
array( | ||
'name' => 'Digits', | ||
), | ||
), | ||
)); | ||
|
||
} | ||
} |
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,162 @@ | ||
<?php | ||
namespace AuthDoctrine\Form; | ||
|
||
use Zend\Form\Form; | ||
|
||
class UserForm extends Form | ||
{ | ||
public function __construct($name = null) | ||
{ | ||
parent::__construct('registration'); | ||
$this->setAttribute('method', 'post'); | ||
|
||
$this->add(array( | ||
'name' => 'usr_name', | ||
'attributes' => array( | ||
'type' => 'text', | ||
), | ||
'options' => array( | ||
'label' => 'Username', | ||
), | ||
)); | ||
|
||
$this->add(array( | ||
'name' => 'usr_password', | ||
'attributes' => array( | ||
'type' => 'password', | ||
), | ||
'options' => array( | ||
'label' => 'Password', | ||
), | ||
)); | ||
|
||
$this->add(array( | ||
'name' => 'usr_email', | ||
'attributes' => array( | ||
'type' => 'email', | ||
), | ||
'options' => array( | ||
'label' => 'E-mail', | ||
), | ||
)); | ||
|
||
$this->add(array( | ||
'name' => 'usrl_id', | ||
'type' => 'Zend\Form\Element\Select', | ||
'options' => array( | ||
'label' => 'Role', | ||
'value_options' => array( | ||
'1' => 'Public', | ||
'2' => 'Member', | ||
'3' => 'Admin', | ||
), | ||
), | ||
)); | ||
|
||
$this->add(array( | ||
'name' => 'lng_id', | ||
'type' => 'Zend\Form\Element\Select', | ||
'options' => array( | ||
'label' => 'Language', | ||
'value_options' => array( | ||
'1' => 'English', | ||
'2' => 'French', | ||
'3' => 'German', | ||
), | ||
), | ||
)); | ||
|
||
$this->add(array( | ||
'name' => 'usr_active', | ||
'type' => 'Zend\Form\Element\Select', | ||
'options' => array( | ||
'label' => 'Active', | ||
'value_options' => array( | ||
'0' => 'No', | ||
'1' => 'Yes', | ||
), | ||
), | ||
)); | ||
|
||
$this->add(array( | ||
'name' => 'usr_question', | ||
'attributes' => array( | ||
'type' => 'text', | ||
), | ||
'options' => array( | ||
'label' => 'Question', | ||
), | ||
)); | ||
|
||
$this->add(array( | ||
'name' => 'usr_answer', | ||
'attributes' => array( | ||
'type' => 'text', | ||
), | ||
'options' => array( | ||
'label' => 'Answer', | ||
), | ||
)); | ||
|
||
$this->add(array( | ||
'name' => 'usr_picture', | ||
'attributes' => array( | ||
'type' => 'text', | ||
), | ||
'options' => array( | ||
'label' => 'Picture URL', | ||
), | ||
)); | ||
|
||
$this->add(array( | ||
'name' => 'usr_password_salt', | ||
'attributes' => array( | ||
'type' => 'text', | ||
), | ||
'options' => array( | ||
'label' => 'Password Salt', | ||
), | ||
)); | ||
|
||
$this->add(array( | ||
'name' => 'usr_registration_date', | ||
'attributes' => array( | ||
'type' => 'Zend\Form\Element\DateTime', // 'text' | ||
), | ||
'options' => array( | ||
'label' => 'Registration Date', | ||
), | ||
)); | ||
|
||
$this->add(array( | ||
'name' => 'usr_registration_token', | ||
'attributes' => array( | ||
'type' => 'text', | ||
), | ||
'options' => array( | ||
'label' => 'Registration Token', | ||
), | ||
)); | ||
|
||
$this->add(array( | ||
'name' => 'usr_email_confirmed', | ||
'type' => 'Zend\Form\Element\Select', | ||
'options' => array( | ||
'label' => 'E-mail was confirmed?', | ||
'value_options' => array( | ||
'0' => 'No', | ||
'1' => 'Yes', | ||
), | ||
), | ||
)); | ||
|
||
$this->add(array( | ||
'name' => 'submit', | ||
'attributes' => array( | ||
'type' => 'submit', | ||
'value' => 'Go', | ||
'id' => 'submitbutton', | ||
), | ||
)); | ||
} | ||
} |
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