예제 #1
0
 /**
  * Edycja profili użytkownika
  */
 public function profilesAction()
 {
     $request = $this->getRequest();
     $id = $request->getParam('id');
     $id = $this->_helper->IdConvert->hexToStr($id);
     $logic = new Logic_User();
     $form = new Logic_User_Form_Profiles();
     if ($request->isPost()) {
         if ($form->isCancelled($this->getRequest()->getPost())) {
             $this->_helper->redirector('index');
             return;
         }
         if ($form->isValid($request->getPost())) {
             try {
                 $logic->updateProfiles($form, $id);
                 $this->_helper->messenger->success('Zmieniono profil użytkownika');
                 $this->_helper->redirector('index');
                 return;
             } catch (Logic_User_Exception $e) {
                 $this->_helper->messenger('error', MSG_ERROR, $e);
             }
         }
     } else {
         $defaults = $logic->getProfiles($id, true);
         $form->setDefaults($defaults);
     }
     $this->view->form = $form;
 }