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
36
application/controllers/UserController.php
Normal file
36
application/controllers/UserController.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
class UserController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
/* Initialize action controller here */
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
// action body
|
||||
}
|
||||
|
||||
public function addUserAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$form = new Application_Form_AddUser();
|
||||
|
||||
if ($request->isPost()) {
|
||||
if ($form->isValid($request->getPost())) {
|
||||
|
||||
$formdata = $form->getValues();
|
||||
User::addUser($formdata);
|
||||
$form->reset();
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->form = $form;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue