本文整理汇总了PHP中User\Api\UserApi::updateInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP UserApi::updateInfo方法的具体用法?PHP UserApi::updateInfo怎么用?PHP UserApi::updateInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User\Api\UserApi
的用法示例。
在下文中一共展示了UserApi::updateInfo方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: resetPwd
public function resetPwd()
{
$id = I('post.id');
$newpassword = I('post.password');
$data['password'] = $newpassword;
empty($newpassword) && $this->mtReturn(300, '请输入新密码');
if (strlen($newpassword) < 6) {
$this->mtReturn(300, '密码长度必须大于6个字符!');
}
$Api = new UserApi();
$res = $Api->updateInfo($id, 'admin', $data);
if ($res['status']) {
// $this->success('修改密码成功!');
$this->mtReturn(200, '密码修改成功!');
} else {
$this->mtReturn(300, $res['info']);
}
}
示例2: changucenter
public function changucenter()
{
if (!is_login()) {
$this->error('您还没有登陆', U('User/login'));
}
//获取参数
$uid = is_login();
$oldpassword = I('post.oldpassword');
$repassword = I('post.repassword');
$password = I('post.password');
// $data['email'] = I('post.email');
if ($password != $repassword) {
$this->error('两次密码输入不一致');
}
if (!empty($password)) {
$data['password'] = $password;
}
$data['id'] = $uid;
$Api = new UserApi();
$res = $Api->updateInfo($uid, $oldpassword, $data);
if ($res['status']) {
$this->success('修改成功!');
} else {
$this->error($res['info']);
}
}
示例3: submitPassword
/**
* 修改密码提交
* @author huajie <banhuajie@163.com>
*/
public function submitPassword()
{
//获取参数
$password = I('post.old');
empty($password) && $this->error('请输入原密码');
$data['password'] = I('post.password');
empty($data['password']) && $this->error('请输入新密码');
$repassword = I('post.repassword');
empty($repassword) && $this->error('请输入确认密码');
if ($data['password'] !== $repassword) {
$this->error('您输入的新密码与确认密码不一致');
}
$Api = new UserApi();
$res = $Api->updateInfo(UID, $password, $data);
if ($res['status']) {
$this->success('修改密码成功!');
} else {
$this->error($res['info']);
}
}
示例4: profile
/**
* 修改密码提交
* @author huajie <banhuajie@163.com>
*/
public function profile()
{
if (!is_login()) {
$this->error('您还没有登陆', U('User/login'));
}
if (IS_POST) {
//获取参数
$uid = is_login();
$password = I('post.old');
$repassword = I('post.repassword');
$data['password'] = I('post.password');
empty($password) && $this->error('请输入原密码');
empty($data['password']) && $this->error('请输入新密码');
empty($repassword) && $this->error('请输入确认密码');
if ($data['password'] !== $repassword) {
$this->error('您输入的新密码与确认密码不一致');
}
$Api = new UserApi();
$res = $Api->updateInfo($uid, $password, $data);
if ($res['status']) {
$this->success('修改密码成功!');
} else {
$this->error($res['info']);
}
} else {
$this->display();
}
}
示例5: submitPassword
/**
* 修改密码提交
* @author huajie <banhuajie@163.com>
*/
public function submitPassword()
{
//获取参数
$password = I('post.old');
empty($password) && $this->error(L('_PLEASE_ENTER_THE_ORIGINAL_PASSWORD_'));
$data['password'] = I('post.password');
empty($data['password']) && $this->error(L('_PLEASE_ENTER_A_NEW_PASSWORD_'));
$repassword = I('post.repassword');
empty($repassword) && $this->error(L('_PLEASE_ENTER_THE_CONFIRMATION_PASSWORD_'));
if ($data['password'] !== $repassword) {
$this->error(L('_YOUR_NEW_PASSWORD_IS_NOT_CONSISTENT_WITH_THE_CONFIRMATION_PASSWORD_'));
}
$Api = new UserApi();
$res = $Api->updateInfo(UID, $password, $data);
if ($res['status']) {
$this->success(L('_CHANGE_PASSWORD_SUCCESS_'));
} else {
$this->error(UCenterMember()->getErrorMessage($res['info']));
}
}
示例6: profile
/**
* 修改密码提交
* @author
*/
public function profile()
{
if (IS_POST) {
if (!($uid = is_login())) {
$this->ajaxError("您还没有登陆,请先登陆");
}
//获取参数
$password = I("post.old");
$repassword = I("post.repassword");
$data["password"] = I("post.password");
empty($password) && $this->ajaxError("请输入原密码");
empty($data["password"]) && $this->ajaxError("请输入新密码");
empty($repassword) && $this->ajaxError("请输入确认密码");
if ($data["password"] !== $repassword) {
$this->ajaxError("您输入的新密码与确认密码不一致");
}
$Api = new UserApi();
$res = $Api->updateInfo($uid, $password, $data);
if ($res['status']) {
$Api->logout();
$this->ajaxSuccess("修改密码成功!请重新登录");
} else {
$this->ajaxError($res["info"]);
}
} else {
if (!($uid = is_login())) {
$this->error("您还没有登陆,请先登陆", U('/'), 2);
}
$this->meta_title = '修改密码';
$this->display();
}
}
示例7: profile
/**
* 修改密码提交
* @author huajie <banhuajie@163.com>
*/
public function profile()
{
if (!is_login()) {
$this->error(L('_ERROR_NOT_LOGIN_'), U('User/login'));
}
if (IS_POST) {
//获取参数
$uid = is_login();
$password = I('post.old');
$repassword = I('post.repassword');
$data['password'] = I('post.password');
empty($password) && $this->error(L('_ERROR_INPUT_ORIGIN_PASSWORD_'));
empty($data['password']) && $this->error(L('_ERROR_INPUT_NEW_PASSWORD_'));
empty($repassword) && $this->error(L('_ERROR_CONFIRM_PASSWORD_'));
if ($data['password'] !== $repassword) {
$this->error(L('_ERROR_NOT_SAME_PASSWORD_'));
}
$Api = new UserApi();
$res = $Api->updateInfo($uid, $password, $data);
if ($res['status']) {
$this->success(L('_SUCCESS_CHANGE_PASSWORD_') . L('_EXCLAMAITON_'));
} else {
$this->error($res['info']);
}
} else {
$this->display();
}
}
示例8: resetPassword
public function resetPassword()
{
$this->isLogin();
if (IS_POST) {
$oldPassWord = I('oldPassWord');
$data['password'] = I('newPassWord');
$newPassWord2 = I('newPassWord2');
if ($data['password'] != $newPassWord2) {
$this->error('两次密码不一致');
}
$Api = new UserApi();
$res = $Api->updateInfo(UID, $oldPassWord, $data);
if ($res['status']) {
$this->success('修改密码成功!');
} else {
$this->error($res['info']);
}
} else {
$this->display();
}
}
示例9: changePwd
public function changePwd()
{
//获取参数
$uid = is_login();
$password = I('post.oldpassword');
$newpassword = I('post.password');
$repassword = I('post.repassword');
$data['password'] = $newpassword;
empty($password) && $this->mtReturn(300, '请输入原密码');
empty($newpassword) && $this->mtReturn(300, '请输入新密码');
empty($repassword) && $this->mtReturn(300, '请输入确认密码');
if ($data['password'] !== $repassword) {
$this->mtReturn(300, '您输入的新密码与确认密码不一致');
}
$Api = new UserApi();
$res = $Api->updateInfo($uid, $password, $data);
if ($res['status']) {
// $this->success('修改密码成功!');
$this->mtReturn(200, '密码修改成功!');
} else {
$this->mtReturn(300, $res['info']);
}
}
示例10: ajax_change_password
public function ajax_change_password()
{
if (IS_POST) {
$uid = UID;
$password = I('post.password', '', 'strtolower');
$repassword = I('post.renewpassword', '', 'strtolower');
$data['password'] = I('post.newpassword', '', 'strtolower');
empty($password) && $this->error('请输入原密码');
empty($data['password']) && $this->error('请输入新密码');
empty($repassword) && $this->error('请输入确认密码');
if ($data['password'] !== $repassword) {
$this->error('您输入的新密码与确认密码不一致');
}
$Api = new UserApi();
$res = $Api->updateInfo($uid, $password, $data);
if ($res['status']) {
$this->success('修改密码成功', U('personal'));
} else {
$this->error($res['info']);
}
}
}
示例11: changepwd
public function changepwd()
{
// if(IS_POST){
$arr = I('post.');
if (!$arr['oldpwd'] || !$arr['password']) {
$this->apiError(0, '参数错误');
}
$user = new UserApi();
$data['password'] = $arr['password'];
$res = $user->updateInfo($this->uid, $arr['oldpwd'], $data);
// }
if ($res['status']) {
$this->apiSuccess('success');
} else {
$this->apiError(0, '修改失败');
}
}
示例12: changephone
public function changephone()
{
$uid = is_login();
if (!$uid) {
$this->error('您还没有登陆', U('User/login'));
}
if (IS_POST) {
$password = $_POST['password'];
$phone = $_POST['mobile'];
$code = session($phone);
if ($_POST['code'] != $code) {
$this->error('输入验证码不正确');
}
$data = array('mobile' => $_POST['mobile'], 'password' => $password);
$Api = new UserApi();
$res = $Api->updateInfo($uid, $password, $data);
if ($res['status']) {
$this->success('手机号码更改成功。');
} else {
if ($res['info'] < 0) {
$message = $this->showRegError($res['info']);
$this->error($message);
} else {
$this->error($res['info']);
}
}
} else {
$this->pageTitle = "修改手机号码";
$this->display('changephone');
}
}