public function modifyAction($uid) { $uid = intval($uid); $user = $this->acl->getUser($uid, true); if (empty($user)) { $this->error('访问错误'); } if (IS_POST) { $input = $this->validateForm(true); $ret = $this->acl->modifyUser($uid, $input); if (is_error($ret)) { $this->error($ret['message']); } else { $this->success('保存成功'); exit; } } $this->assign('user', $user); $this->display('form'); }
public function profileAction() { $user = session('user'); $u = new Acl(); $user = $u->getUser($user['username']); if (IS_POST) { $user['password'] = I('post.password'); $ret = $u->modifyUser($user['uid'], $user); if ($ret === false) { $this->error('保存用户信息失败, 请稍后重试'); } else { $this->success('保存成功'); exit; } } $this->assign('user', $user); $this->display('profile'); }