Exemplo n.º 1
0
 public function indexAction()
 {
     $_user = new User_Model_Db_User();
     $_profile = new User_Model_Db_UserProfile();
     try {
         $user = $_user->getList(array('uname' => $this->_params['user']));
         if (isset($user[0]['uid'])) {
             $pf = $_profile->getById($user[0]['uid']);
             $this->view->user = $user[0];
         } else {
             throw new Exception('Page Not Found');
         }
         $pf['desc'] = Common_Util_Format::richEditFilter($pf['desc']);
     } catch (Exception $e) {
         throw new Exception('Page Not Found');
     }
     $this->view->profile = $pf;
     $this->loadLayout('layout-simple');
 }
Exemplo n.º 2
0
 public function doAction()
 {
     $params = $this->_params;
     if (User_Model_Profile_Validate::isValid($params, $message)) {
         try {
             $_pf = new User_Model_Profile();
             $where = array('uid = ?' => $this->_session->uid);
             $_pf->update($params, $where);
             $msg = Common_Message::get('success', 'OK');
         } catch (Exception $e) {
             $msg = Common_Message::get('error', 'ERROR' . $e->getMessage());
         }
     } else {
         $msg = Common_Message::get('error', $message);
     }
     $params['desc'] = Common_Util_Format::richEditFilter($params['desc']);
     $params['desc'] = htmlspecialchars($params['desc'], ENT_NOQUOTES);
     $this->view->profile = $params;
     if (isset($msg)) {
         $this->view->message = $msg;
     }
     $this->loadLayout('layout-simple');
     $this->render('index');
 }