simple form for adding a user to the database, only available for admin users.
This commit is contained in:
parent
2830137d23
commit
1fc21819cc
30 changed files with 445 additions and 222 deletions
60
application/forms/AddUser.php
Normal file
60
application/forms/AddUser.php
Normal file
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
class Application_Form_AddUser extends Zend_Form
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
// Add login element
|
||||
$this->addElement('text', 'login', array(
|
||||
'label' => 'Username:',
|
||||
'required' => true,
|
||||
'filters' => array('StringTrim'),
|
||||
'validators' => array('NotEmpty')
|
||||
));
|
||||
|
||||
// Add password element
|
||||
$this->addElement('text', 'password', array(
|
||||
'label' => 'Password:',
|
||||
'required' => true,
|
||||
'filters' => array('StringTrim'),
|
||||
'validators' => array('NotEmpty')
|
||||
));
|
||||
|
||||
// Add first name element
|
||||
$this->addElement('text', 'first_name', array(
|
||||
'label' => 'Firstname:',
|
||||
'required' => true,
|
||||
'filters' => array('StringTrim'),
|
||||
'validators' => array('NotEmpty')
|
||||
));
|
||||
|
||||
// Add last name element
|
||||
$this->addElement('text', 'last_name', array(
|
||||
'label' => 'Lastname:',
|
||||
'required' => true,
|
||||
'filters' => array('StringTrim'),
|
||||
'validators' => array('NotEmpty')
|
||||
));
|
||||
|
||||
//Add type select
|
||||
$this->addElement('select', 'type', array(
|
||||
'required' => true,
|
||||
'multiOptions' => array(
|
||||
"A" => "admin",
|
||||
"H" => "host",
|
||||
"G" => "guest",
|
||||
),
|
||||
));
|
||||
|
||||
// Add the submit button
|
||||
$this->addElement('submit', 'submit', array(
|
||||
'ignore' => true,
|
||||
'label' => 'Submit',
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue