Пример #1
0
 public function editUserAction()
 {
     $data = $this->getRequest()->getPost();
     $id = $this->_getParam('id', "");
     $user = new Default_Model_User();
     if ($id != '') {
         $result = $user->editUser($data, $id);
     } else {
         $result = $user->saveUser($data);
     }
     $this->_redirect('/resume');
 }
 public function saveUserAction()
 {
     $data = $this->getRequest()->getPost();
     $id = $this->_getParam('id', "");
     $user = new Default_Model_User();
     if ($id != '') {
         $result = $user->editUser($data, $id);
         $this->_redirect('/profile');
     } else {
         if ($user->checkExists($data['username'], $data['email'])) {
             $this->view->msg = 'Username has exists';
             $data['consultant_id'] = $data['id'];
             $this->view->userInfo = $data;
             $this->render('add-user');
         } else {
             $result = $user->saveUser($data);
             $this->_redirect('/profile');
         }
     }
 }