simple form for adding a user to the database, only available for admin users.

This commit is contained in:
Naomi 2010-12-17 17:56:01 -05:00
parent 2830137d23
commit 1fc21819cc
30 changed files with 445 additions and 222 deletions

View 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',
));
}
}