本文整理汇总了PHP中uc_user_edit函数的典型用法代码示例。如果您正苦于以下问题:PHP uc_user_edit函数的具体用法?PHP uc_user_edit怎么用?PHP uc_user_edit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了uc_user_edit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _updatePass
private function _updatePass($res, $oldpassword, $newpassword)
{
global $_G;
$oldpassword = $oldpassword ? urldecode($oldpassword) : '';
$newpassword = $newpassword ? urldecode($newpassword) : '';
if (!empty($newpassword) && $newpassword != addslashes($newpassword)) {
// 抱歉,密码空或包含非法字符:新密码
return $this->makeErrorInfo($res, lang('message', 'profile_passwd_illegal'));
}
loaducenter();
$ucresult = uc_user_edit(addslashes($_G['username']), $oldpassword, $newpassword);
if ($ucresult == -1) {
// 原密码不正确,您不能修改密码或 Email 或安全提问
return $this->makeErrorInfo($res, lang('message', 'profile_passwd_wrong'));
}
$setarr['password'] = md5(random(10));
C::t('common_member')->update($_G['uid'], $setarr);
$secretStr = AppbymeUserAccess::getSecretStr($_G['uid'], $newpassword);
$newAccessSecret = $secretStr['accessSecret'];
$data = array('user_access_secret' => $newAccessSecret);
$result = AppbymeUserAccess::updateUserAccess($data, $_G['uid']);
// if (!$result) {
// return $this->makeErrorInfo($res, 'user_info_edit_error');
// }
$res['token'] = $secretStr['accessToken'];
$res['secret'] = $newAccessSecret;
return $res;
}
示例2: save_action
function save_action()
{
if ($_POST['submit']) {
$info = $this->obj->DB_select_once("member", "`uid`='" . $this->uid . "'", "`salt`,`password`,`name_repeat`,`username`");
if (is_array($info)) {
$oldpass = md5(md5($_POST['oldpassword']) . $info['salt']);
if ($info['password'] != $oldpass) {
$this->ACT_layer_msg("原始密码错误!", 8, "index.php?c=vs");
}
if ($this->config['sy_uc_type'] == "uc_center" && $info['name_repeat'] != "1") {
$this->uc_open();
$ucresult = uc_user_edit($info['username'], $_POST['oldpassword'], $_POST['password'], "", "1");
if ($ucresult == -1) {
$this->ACT_layer_msg("原始密码错误!", 8, "index.php?c=vs");
}
} else {
$salt = substr(uniqid(rand()), -6);
$pass2 = md5(md5($_POST['password']) . $salt);
$data['password'] = $pass2;
$data['salt'] = $salt;
$this->obj->update_once("member", $data, array("uid" => $this->uid));
}
$this->unset_cookie();
$this->obj->member_log("修改密码", 8);
$this->ACT_layer_msg("密码修改成功,请重新登录!", 9, $this->config['sy_weburl'] . "/index.php?m=login&usertype=" . $_POST['usertype']);
}
}
}
示例3: changePassword
public function changePassword($userId, $oldPassword, $newPassword)
{
$this->initDiscuzApi();
$user = uc_get_user($userId, 1);
$result = uc_user_edit($user[1], null, $newPassword, null, 1);
return $result == 1;
}
示例4: user_edit
static function user_edit($username, $oldpwd, $newpwd, $email, $nocheckold = 1, $uid = '')
{
global $kekezu;
if ($kekezu->_sys_config['user_intergration'] == 1) {
return 1;
} elseif ($kekezu->_sys_config['user_intergration'] == 2) {
require_once S_ROOT . '/uc_client/client.php';
return uc_user_edit($username, $oldpwd, $newpwd, $email, $nocheckold);
}
}
示例5: zuitu_uc_updatepw
function zuitu_uc_updatepw($email, $username, $password) {
if (!function_exists('uc_user_login')) return true;
if (!defined('UC_API')) return true;
if (strtolower(UC_CHARSET)!='utf-8') {
$username = mb_convert_encoding($username, UC_CHARSET, 'UTF-8');
$email = mb_convert_encoding($email, UC_CHARSET, 'UTF-8');
}
$rid = uc_user_edit($username, $oldpw, $password, $email, 1);
DB::Query('SET NAMES UTF8;');
return $rid >= 0;
}
示例6: edit
function edit($uid, $oldname, $info)
{
require_once R_P . 'uc_client/uc_client.php';
$errmsg = null;
$errcode = array('-1' => 'illegal_username', '-2' => 'username_same', '-3' => 'illegal_email', '-4' => 'reg_email_have_same');
$ucstatus = uc_user_edit($uid, $oldname, $info['username'], $info['password'], $info['email']);
if ($ucstatus < 0) {
$errmsg = $errcode[$ucstatus];
}
if ($ucstatus == 2) {
$this->alterName($uid, $oldname, $info['username']);
}
return array($ucstatus, $errmsg);
}
示例7: edit
public function edit($uid, $old_password, $data, $force = false)
{
$this->_ucenter_init();
$new_pwd = $new_email = '';
if (isset($data['password'])) {
$new_pwd = $data['password'];
}
if (isset($data['email'])) {
$new_email = $data['email'];
}
$uc_uid = D('user')->where(array('id' => $uid))->getField('uc_uid');
$info = $this->get($uc_uid);
if (empty($info)) {
$this->_error('no_such_user');
return false;
}
$result = uc_user_edit($info['username'], $old_password, $new_pwd, $new_email, $force);
if ($result != 1) {
switch ($result) {
case 0:
case -7:
break;
case -1:
$this->_error = L('auth_failed');
break;
case -4:
$this->_error = L('email_error');
break;
case -5:
$this->_error = L('blocked_email');
break;
case -6:
$this->_error = L('email_exists');
break;
case -8:
$this->_error = L('user_protected');
break;
default:
$this->_error = L('unknow_error');
break;
}
return false;
}
if (isset($data['password'])) {
$data['password'] = md5($data['password']);
}
return $data;
}
示例8: editpw_action
function editpw_action()
{
if ($_POST['username'] && $_POST['code'] && $_POST['pass']) {
if (!is_numeric($_POST['code']) || !$this->CheckRegUser($_POST['username'])) {
$this->obj->ACT_msg($this->url("index", "forgetpw", "1"), $msg = "无效的信息!", $st = 2, $tm = 3);
exit;
}
$password = $_POST['pass'];
$cert = $this->obj->DB_select_once("company_cert", "`type`='5' AND `check2`='" . $_POST['username'] . "' AND `check`='" . $_POST['code'] . "' order by id desc", "`uid`,`check2`,`ctime`");
if (!$cert['uid']) {
$this->obj->ACT_msg($this->url("index", "forgetpw", "1"), $msg = "验证码填写错误!", $st = 2, $tm = 3);
exit;
} elseif (time() - $cert['ctime'] > 1200) {
$this->obj->ACT_msg($this->url("index", "forgetpw", "1"), $msg = "验证码已失效,请重新获取!", $st = 2, $tm = 3);
exit;
}
$info = $this->obj->DB_select_once("member", "`uid`='" . $cert['uid'] . "'", "`email`");
if (is_array($info)) {
$info['username'] = $cert['check2'];
if ($this->config[sy_uc_type] == "uc_center" && $info['name_repeat'] != "1") {
$this->obj->uc_open();
uc_user_edit($info[username], "", $password, $info['email'], "0");
} else {
$salt = substr(uniqid(rand()), -6);
$pass2 = md5(md5($password) . $salt);
$value = "`password`='{$pass2}',`salt`='{$salt}'";
$this->obj->DB_update_all("member", $value, "`uid`='" . $cert['uid'] . "'");
}
$this->obj->ACT_msg($this->url("index", "login", "1"), $msg = "密码修改成功!", $st = 1, $tm = 3);
} else {
$this->obj->ACT_msg($this->url("index", "forgetpw", "1"), $msg = "对不起!没有该用户!", $st = 2, $tm = 3);
}
} else {
$this->obj->ACT_msg($this->url("index", "forgetpw", "1"), $msg = "请完整填写信息!", $st = 2, $tm = 3);
exit;
}
}
示例9: showmessage
showmessage('profile_passwd_empty');
}
}
if ($_G['gp_questionidnew'] === '') {
$_G['gp_questionidnew'] = $_G['gp_answernew'] = '';
} else {
$secquesnew = $_G['gp_questionidnew'] > 0 ? random(8) : '';
}
if (!empty($_G['gp_newpassword']) && $_G['gp_newpassword'] != addslashes($_G['gp_newpassword'])) {
showmessage('profile_passwd_illegal', '', array(), array('return' => true));
}
if (!empty($_G['gp_newpassword']) && $_G['gp_newpassword'] != $_G['gp_newpassword2']) {
showmessage('profile_passwd_notmatch', '', array(), array('return' => true));
}
loaducenter();
$ucresult = uc_user_edit($_G['username'], $_G['gp_oldpassword'], $_G['gp_newpassword'], $emailnew != $_G['member']['email'] ? $emailnew : '', $ignorepassword, $_G['gp_questionidnew'], $_G['gp_answernew']);
if ($ucresult == -1) {
showmessage('profile_passwd_wrong', '', array(), array('return' => true));
} elseif ($ucresult == -4) {
showmessage('profile_email_illegal', '', array(), array('return' => true));
} elseif ($ucresult == -5) {
showmessage('profile_email_domain_illegal', '', array(), array('return' => true));
} elseif ($ucresult == -6) {
showmessage('profile_email_duplicate', '', array(), array('return' => true));
}
if (!empty($_G['gp_newpassword']) || $secquesnew) {
$setarr['password'] = md5(random(10));
}
if ($_G['setting']['connect']['allow']) {
DB::update('common_member_connect', array('conisregister' => 0), array('uid' => $_G['uid']));
}
示例10: trim
$arr['password'] = trim($_POST['password']) ? trim($_POST['password']) : exit('请输入新密码!');
if ($arr['password'] != trim($_POST['password1'])) {
exit('两次输入密码不相同,请重新输入!');
}
//edit_password()修改密码的方法
$info = edit_password($arr);
if ($info == -1) {
exit('旧密码输入错误,请重新输入!');
}
if ($info == $_SESSION['username']) {
//发送邮件
$mailconfig = get_cache('mailconfig');
if ($mailconfig['set_editpwd'] == "1" && $user['email_audit'] == "1") {
dfopen($_CFG['site_domain'] . $_CFG['site_dir'] . "plus/asyn_mail.php?uid=" . $_SESSION['uid'] . "&key=" . asyn_userkey($_SESSION['uid']) . "&act=set_editpwd&newpassword=" . $arr['password']);
}
//邮件发送完毕
//sms
$sms = get_cache('sms_config');
if ($sms['open'] == "1" && $sms['set_editpwd'] == "1" && $user['mobile_audit'] == "1") {
dfopen($_CFG['site_domain'] . $_CFG['site_dir'] . "plus/asyn_sms.php?uid=" . $_SESSION['uid'] . "&key=" . asyn_userkey($_SESSION['uid']) . "&act=set_editpwd&newpassword=" . $arr['password']);
}
//sms
if (defined('UC_API')) {
include_once QISHI_ROOT_PATH . 'uc_client/client.php';
uc_user_edit($arr['username'], $arr['oldpassword'], $arr['password']);
}
//往会员日志表里记录
write_memberslog($_SESSION['uid'], 2, 1004, $_SESSION['username'], "修改密码");
exit('密码修改成功!');
}
}
示例11: intval
$_POST['uid'] = intval($_POST['uid']);
$_POST['id'] = trim($_POST['id']);
$_POST['email'] = trim($_POST['email']);
$_POST['newpasswd'] = trim($_POST['newpasswd']);
$_POST['newpasswd_check'] = trim($_POST['newpasswd_check']);
if ($_POST['newpasswd'] != $_POST['newpasswd_check']) {
showmessage('password_inconsistency', geturl('action/login'));
}
$query = $_SGLOBAL['db']->query("SELECT uid, username, authstr, groupid FROM " . tname('members') . " WHERE uid='{$_POST['uid']}'");
$member = $_SGLOBAL['db']->fetch_array($query);
// 管理员组, 有站点设置权限, 受保护用户不可找回密码
if ($member['groupid'] == 1 && checkperm('managesettings', $member['groupid']) || $member['flag']) {
showmessage('getpasswd_account_invalid', geturl('action/login'));
}
checkuser($_POST['id'], $member['authstr']);
uc_user_edit(addslashes($member['username']), $_POST['newpasswd'], $_POST['newpasswd'], $_POST['email'], 1);
updatetable('members', array('authstr' => ''), array('uid' => $_POST['uid']));
showmessage('getpasswd_succeed', geturl('action/login'));
}
$_GET['op'] = trim($_GET['op']);
if ($_GET['op'] == 'reset') {
$_GET['uid'] = intval($_GET['uid']);
$_GET['id'] = trim($_GET['id']);
$query = $_SGLOBAL['db']->query("SELECT uid, username, authstr FROM " . tname('members') . " WHERE uid='{$_GET['uid']}'");
$member = $_SGLOBAL['db']->fetch_array($query);
if (empty($member)) {
showmessage('user_does_not_exist', geturl('action/login'));
}
$user = uc_get_user($member['username']);
checkuser($_GET['id'], $member['authstr']);
}
示例12: amessage
$c_upload->rollback();
amessage($a_field->error, M_REFERER);
}
$actuser->updatefield($k, $a_field->newvalue, $v['tbl']);
if ($arr = multi_val_arr($a_field->newvalue, $v)) {
foreach ($arr as $x => $y) {
$actuser->updatefield($k . '_' . $x, $y, $v['tbl']);
}
}
}
}
unset($a_field);
if ($enable_uc && $actuser->info['password'] != $minfosnew['password']) {
require_once M_ROOT . './include/ucenter/config.inc.php';
require_once M_ROOT . './uc_client/client.php';
if (1 != uc_user_edit($actuser->info['mname'], '', $minfosnew['password'], '', 1)) {
amessage('mempassmodfai');
}
}
$actuser->updatedb();
$c_upload->closure(1, $mid, 'members');
$c_upload->saveuptotal(1);
adminlog(lang('detail_edit_member'));
amessage('membermodifyfinish', M_REFERER);
}
} elseif ($action == 'grouptype' && $mid) {
if (!submitcheck('bmemberdetail')) {
$a_field = new cls_field();
$submitstr = '';
tabheader(lang('usergroup_msg') . ' : [' . $mchannel['cname'] . ']' . $actuser->info['mname'], 'memberdetail', "?entry=member&action=grouptype&mid={$mid}", 4, 1, 1);
foreach ($grouptypes as $gtid => $grouptype) {
示例13: lang
}
if (in_array(4, $_G['setting']['strongpw']) && !preg_match("/[^a-zA-z0-9]+/", $_GET['newpassword1'])) {
$strongpw_str[] = lang('member/template', 'strongpw_4');
}
if ($strongpw_str) {
showmessage(lang('member/template', 'password_weak') . implode(',', $strongpw_str));
}
}
if ($_GET['newpassword1'] !== $_GET['newpassword2']) {
showmessage('profile_passwd_notmatch');
}
if (!$_GET['newpassword1'] || $_GET['newpassword1'] != addslashes($_GET['newpassword1'])) {
showmessage('profile_passwd_illegal');
}
loaducenter();
uc_user_edit(addslashes($_G['member']['username']), null, $_GET['newpassword1'], null, 1);
C::t('common_member')->update($_G['uid'], array('password' => md5(random(10))));
if ($_G['wechat']['setting']['wechat_qrtype']) {
C::t('#wechat#common_member_wechatmp')->update($_G['uid'], array('status' => 1));
} else {
C::t('#wechat#common_member_wechat')->update($_G['uid'], array('isregister' => 0));
}
showmessage('wechat:wsq_password_reset', dreferer());
} elseif (submitcheck('unbindsubmit')) {
require_once libfile('function/member');
if ($_G['wechat']['setting']['wechat_qrtype']) {
require_once DISCUZ_ROOT . './source/plugin/wechat/wsq.class.php';
$member = C::t('#wechat#common_member_wechatmp')->fetch($_G['uid']);
if (!$member || !wsq::userunbind($_G['uid'], $member['openid'])) {
showmessage('wechat:wechat_message_unbind_fail');
}
示例14: password_action
function password_action()
{
if ($_POST['submit']) {
$member = $this->obj->DB_select_once("member", "`uid`='" . $this->uid . "'");
$pw = md5(md5($_POST['oldpassword']) . $member['salt']);
if ($pw != $member['password']) {
$data['msg'] = "旧密码不正确,请重新输入!";
$data['url'] = 'index.php?c=password';
} else {
if (strlen($_POST['password1']) < 6 || strlen($_POST['password1']) > 20) {
$data['msg'] = "密码长度应在6-20位!";
$data['url'] = 'index.php?c=password';
} else {
if ($_POST['password1'] != $_POST['password2']) {
$data['msg'] = "新密码和确认密码不一致!";
$data['url'] = 'index.php?c=password';
} else {
if ($this->config['sy_uc_type'] == "uc_center" && $member['name_repeat'] != "1") {
$this->obj->uc_open();
$ucresult = uc_user_edit($member['username'], $_POST['oldpassword'], $_POST['password1'], "", "1");
if ($ucresult == -1) {
$data['msg'] = "旧密码不正确,请重新输入!";
$data['url'] = 'index.php?c=password';
}
} else {
$salt = substr(uniqid(rand()), -6);
$pass2 = md5(md5($_POST['password1']) . $salt);
$this->obj->DB_update_all("member", "`password`='" . $pass2 . "',`salt`='" . $salt . "'", "`uid`='" . $this->uid . "'");
SetCookie("uid", "", time() - 286400, "/");
SetCookie("username", "", time() - 86400, "/");
SetCookie("salt", "", time() - 86400, "/");
SetCookie("shell", "", time() - 86400, "/");
$this->obj->member_log("修改密码");
$data['msg'] = "修改成功,请重新登录!";
$data['url'] = $this->config['sy_weburl'] . '/wap/index.php?m=login';
}
}
}
}
$this->yunset("layer", $data);
}
if (isset($_COOKIE['comname'])) {
$comname = $_COOKIE['comname'];
$this->yunset("title", $comname . "会员中心");
} else {
$this->yunset("title", "拓普网会员中心");
}
$this->waptpl('password');
}
示例15: edit_email_password
public function edit_email_password($username, $data)
{
// 验证本站会员
if (!preg_match('/^[\\w\\-\\.]+@[\\w\\-\\.]+(\\.\\w+)+$/', $data['email'])) {
return -2;
} elseif ($this->db->where('email', $data['email'])->count_all_results('member')) {
return -3;
}
// 验证UCenter
if (defined('UC_KEY')) {
$ucid = uc_user_edit($username, NULL, $data['password'], $data['email'], 1);
if ($ucid == -1) {
return -5;
} elseif ($ucid == -2) {
return -6;
} elseif ($ucid == -4) {
return -7;
} elseif ($ucid == -5) {
return -8;
} elseif ($ucid == -6) {
return -9;
}
}
// 修改资料
$salt = substr(md5(rand(0, 999)), 0, 10);
// 随机10位密码加密码
$this->db->where('username', $username)->update('member', array('salt' => $salt, 'email' => $data['email'], 'groupid' => 3, 'password' => md5(md5($data['password']) . $salt . md5($data['password']))));
}