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']); } }
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']); } }
/** * 修改密码提交 * @author huajie <*****@*****.**> */ 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']); } }
/** * 修改密码提交 * @author huajie <*****@*****.**> */ 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(); } }
/** * 修改密码提交 * @author huajie <*****@*****.**> */ 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'])); } }
/** * 修改密码提交 * @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(); } }
/** * 修改密码提交 * @author huajie <*****@*****.**> */ 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(); } }
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(); } }
/** * 修改密码提交 * @author huajie <*****@*****.**> */ 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(); } }
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']); } }
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']); } } }
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, '修改失败'); } }
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'); } }