Esempio n. 1
0
 public function createAction()
 {
     // cria form
     $form = new C3op_Form_UserCreate();
     $this->view->form = $form;
     if ($this->getRequest()->isPost()) {
         $postData = $this->getRequest()->getPost();
         if ($form->isValid($postData)) {
             $form->process($postData);
             $this->_helper->getHelper('FlashMessenger')->addMessage('The record was successfully updated.');
             $this->_redirect('/auth/user/success-create');
         } else {
             throw new C3op_Auth_UserException("A user must have a valid title.");
         }
     } else {
     }
 }
Esempio n. 2
0
 public function init()
 {
     parent::init();
     // initialize form
     $this->setName('editUserForm')->setAction('/auth/user/edit')->setMethod('post');
     $password = $this->getElement('password');
     $password->setRequired(false);
     $id = new Zend_Form_Element_Hidden('id');
     $id->addValidator('Int')->addFilter('StringTrim');
     $this->addElement($id);
 }