/** * * @do my data * * @access public * @author Nick * @copyright rockhippo * @param - * @return - * */ public function mydataAction() { global $G_X; $user = XSession::Get("TA_user"); $userModel = new PSys_UserModel(); if ($this->ispost) { $where = array(); $where['user_id'] = $user['id']; $data = array(); $data['nick'] = reqstr("nick", ""); $data['age'] = reqstr("age", ""); $data['phone'] = reqstr("phone", ""); $data['address'] = reqstr("address", ""); $data['photo'] = reqstr("photo", ""); $return = $userModel->UpdateOne($data, $where, "ta_user_information"); if ($return) { $this->jump("Edit success.", "success", "/index/mydata", 1); } else { $this->jump("Edit failed.", "errors", "/index/mydata", 1); } exit; } $where = array(); $where['id'] = $user['id']; $data = $userModel->GetOne($where, "*", "view_user"); $timestamp = time(); $timestamp_token = md5($G_X['upload']['unique_salt'] . $timestamp); $this->smarty->assign("timestamp", $timestamp); $this->smarty->assign("timestamp_token", $timestamp_token); $this->smarty->assign("data", $data); $this->forward = "mydata"; }