sintonia/application/controllers/UserController.php

51 lines
980 B
PHP
Raw Normal View History

<?php
class UserController extends Zend_Controller_Action
{
public function init()
{
$ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('get-hosts', 'json')
->initContext();
}
public function indexAction()
{
2011-01-27 03:43:56 +01:00
}
public function addUserAction()
{
2011-01-27 03:43:56 +01:00
$this->view->headLink()->appendStylesheet('/css/pro_dropdown_3.css');
$this->view->headLink()->appendStylesheet('/css/styles.css');
$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;
}
public function getHostsAction()
{
$search = $this->_getParam('term');
$this->view->hosts = User::getHosts($search);
}
}