• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP uc_user_edit函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中uc_user_edit函数的典型用法代码示例。如果您正苦于以下问题:PHP uc_user_edit函数的具体用法?PHP uc_user_edit怎么用?PHP uc_user_edit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了uc_user_edit函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:28,代码来源:UpdateUserInfoAction.php


示例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']);
         }
     }
 }
开发者ID:justinyaoqi,项目名称:qyhr,代码行数:28,代码来源:vs.class.php


示例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;
 }
开发者ID:fujianguo,项目名称:EduSoho,代码行数:7,代码来源:DiscuzAuthProvider.php


示例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);
     }
 }
开发者ID:huangbinzd,项目名称:kppwGit,代码行数:10,代码来源:keke_user_class.php


示例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;
}
开发者ID:noikiy,项目名称:mdwp,代码行数:11,代码来源:uc.php


示例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);
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:14,代码来源:ucuser.class.php


示例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;
 }
开发者ID:hello7921,项目名称:haorizi,代码行数:48,代码来源:ucenter.php


示例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;
     }
 }
开发者ID:keyu199314,项目名称:php,代码行数:37,代码来源:activate.class.php


示例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']));
 }
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:spacecp_profile.php


示例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('密码修改成功!');
    }
}
开发者ID:source-hunter,项目名称:74cms,代码行数:31,代码来源:wap_password.php


示例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']);
}
开发者ID:superman1982,项目名称:ng-cms,代码行数:31,代码来源:do_lostpasswd.php


示例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') . '&nbsp;:&nbsp;[' . $mchannel['cname'] . ']' . $actuser->info['mname'], 'memberdetail', "?entry=member&action=grouptype&mid={$mid}", 4, 1, 1);
        foreach ($grouptypes as $gtid => $grouptype) {
开发者ID:polarlight1989,项目名称:08cms,代码行数:31,代码来源:member.inc.php


示例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');
        }
开发者ID:lemonstory,项目名称:bbs,代码行数:31,代码来源:spacecp.inc.php


示例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');
 }
开发者ID:keyu199314,项目名称:php,代码行数:49,代码来源:index.class.php


示例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']))));
 }
开发者ID:xxjuan,项目名称:php-coffee,代码行数:28,代码来源:Member_model.php


示例16: libfile

         include_once libfile('function/profile');
         foreach ($fields as $fieldid => $fieldtitle) {
             $html = profile_setting($fieldid, $member);
             if ($html) {
                 showsetting($fieldtitle, '', '', $html);
             }
         }
     }
     showsubmit('editsubmit');
     showtablefooter();
     showformfooter();
 } else {
     loaducenter();
     require_once libfile('function/discuzcode');
     $questionid = $_G['gp_clearquestion'] ? 0 : '';
     $ucresult = uc_user_edit($member['username'], $_G['gp_passwordnew'], $_G['gp_passwordnew'], $_G['gp_emailnew'], 1, $questionid);
     if ($ucresult < 0) {
         if ($ucresult == -4) {
             cpmsg('members_email_illegal', '', 'error');
         } elseif ($ucresult == -5) {
             cpmsg('members_email_domain_illegal', '', 'error');
         } elseif ($ucresult == -6) {
             cpmsg('members_email_duplicate', '', 'error');
         }
     }
     if ($_G['gp_clearavatar']) {
         DB::query("UPDATE " . DB::table('common_member') . " SET avatarstatus='0' WHERE uid='{$_G['gp_uid']}'");
         uc_user_deleteavatar($member['muid']);
     }
     $creditsnew = intval($creditsnew);
     $regdatenew = strtotime($_G['gp_regdatenew']);
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:31,代码来源:admincp_members.php


示例17: edit

 /**
  * 编辑会员
  */
 public function edit()
 {
     if (isset($_POST['dosubmit'])) {
         $uid = isset($_POST['uid']) && trim($_POST['uid']) ? trim($_POST['uid']) : showmessage(L('nameerror'), HTTP_REFERER);
         $password = isset($_POST['password']) && trim($_POST['password']) ? trim($_POST['password']) : '';
         $email = isset($_POST['email']) && is_email(trim($_POST['email'])) ? trim($_POST['email']) : showmessage(L('email_format_incorrect'), HTTP_REFERER);
         $updateinfo['random'] = '';
         if (!empty($password)) {
             if (strlen($password) > 20 || strlen($password) < 6) {
                 showmessage(L('password_len_error'), HTTP_REFERER);
             } else {
                 $passwordarr = creat_password($password);
                 $updateinfo['password'] = $passwordarr[0];
                 $updateinfo['random'] = $passwordarr[1];
             }
         }
         if ($this->db->get_one("`email` = '{$email}' AND `uid` != '{$uid}'")) {
             showmessage(L('email_already_exist'), HTTP_REFERER);
         }
         $updateinfo['email'] = $email;
         //是否删除头像
         if (isset($_POST['avatar']) && $_POST['avatar'] == 1) {
             $updateinfo['avatar'] = 0;
             $dir = ps_getavatar($uid, 1);
             ps_unlink($dir);
         }
         //ucenter部份
         if ($this->config['ucuse']) {
             pc_base::load_config('uc_config');
             include PHPCMS_PATH . 'api/uc_client/client.php';
             $userinfo = $this->db->get_one(array('uid' => $uid));
             $r = uc_user_edit($userinfo['username'], '', !empty($password) ? $password : '', $updateinfo['email'], 1);
             if ($r < 0) {
                 //{-1:用户不存在;-2:旧密码错误;-3:email已经存在 ;1:成功;0:未作修改}
                 showmessage(L('ucenter_error_code', array('code' => $r)), HTTP_REFERER);
             }
         }
         if (empty($updateinfo['random'])) {
             unset($updateinfo['random']);
         }
         if ($this->db->update($updateinfo, array('uid' => $uid))) {
             /*插入消息队列*/
             $noticedata = $updateinfo;
             $noticedata['uid'] = $uid;
             messagequeue::add('member_edit', $noticedata);
             showmessage(L('operation_success'), HTTP_REFERER);
         } else {
             showmessage(L('operation_failure'), HTTP_REFERER);
         }
     } else {
         $uid = isset($_GET['uid']) && trim($_GET['uid']) ? trim($_GET['uid']) : showmessage(L('user_not_exist'), HTTP_REFERER);
         if (!($userinfo = $this->db->get_one(array('uid' => $uid)))) {
             showmessage(L('user_not_exist'), HTTP_REFERER);
         }
         include $this->admin_tpl('member_edit');
     }
 }
开发者ID:boylzj,项目名称:omguitar,代码行数:60,代码来源:member.php


示例18: adminmsg

    $link[0]['href'] = $_POST['url'];
    adminmsg('操作成功!', 2, $link);
} elseif ($act == 'userpass_edit') {
    check_token();
    check_permissions($_SESSION['admin_purview'], "com_user_edit");
    if (strlen(trim($_POST['password'])) < 6) {
        adminmsg('新密码必须为6位以上!', 1);
    }
    require_once ADMIN_ROOT_PATH . 'include/admin_user_fun.php';
    $user_info = get_user_inusername($_POST['username']);
    $pwd_hash = $user_info['pwd_hash'];
    $md5password = md5(md5(trim($_POST['password'])) . $pwd_hash . $QS_pwdhash);
    if ($db->query("UPDATE " . table('members') . " SET password = '{$md5password}'  WHERE uid='" . $user_info['uid'] . "'")) {
        if (defined('UC_API')) {
            include_once QISHI_ROOT_PATH . 'uc_client/client.php';
            uc_user_edit($user_info['username'], trim($_POST['password']), trim($_POST['password']), "", 1);
        }
        $link[0]['text'] = "返回列表";
        $link[0]['href'] = $_POST['url'];
        adminmsg('操作成功!', 2, $link);
    } else {
        adminmsg('操作失败!', 1);
    }
} elseif ($act == 'userstatus_edit') {
    check_token();
    check_permissions($_SESSION['admin_purview'], "com_user_edit");
    if (set_user_status(intval($_POST['status']), intval($_POST['userstatus_uid']))) {
        $link[0]['text'] = "返回列表";
        $link[0]['href'] = $_POST['url'];
        adminmsg('操作成功!', 2, $link);
    } else {
开发者ID:dalinhuang,项目名称:yy,代码行数:31,代码来源:admin_company.php


示例19: libfile

         include_once libfile('function/profile');
         foreach ($fields as $fieldid => $fieldtitle) {
             $html = profile_setting($fieldid, $member);
             if ($html) {
                 showsetting($fieldtitle, '', '', $html);
             }
         }
     }
     showsubmit('editsubmit');
     showtablefooter();
     showformfooter();
 } else {
     loaducenter();
     require_once libfile('function/discuzcode');
     $questionid = $_GET['clearquestion'] ? 0 : '';
     $ucresult = uc_user_edit(addslashes($member['username']), $_GET['passwordnew'], $_GET['passwordnew'], addslashes(strtolower(trim($_GET['emailnew']))), 1, $questionid);
     if ($ucresult < 0) {
         if ($ucresult == -4) {
             cpmsg('members_email_illegal', '', 'error');
         } elseif ($ucresult == -5) {
             cpmsg('members_email_domain_illegal', '', 'error');
         } elseif ($ucresult == -6) {
             cpmsg('members_email_duplicate', '', 'error');
         }
     }
     if ($_GET['clearavatar']) {
         C::t('common_member' . $tableext)->update($_GET['uid'], array('avatarstatus' => 0));
         uc_user_deleteavatar($uid);
     }
     $creditsnew = intval($creditsnew);
     $regdatenew = strtotime($_GET['regdatenew']);
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:31,代码来源:admincp_members.php


示例20: trim

    $postusername = trim($_POST['username']) ? trim($_POST['username']) : showmsg('请输入用户名!', 1);
    if (empty($_POST['email']) || !preg_match("/^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*\$/", $_POST['email'])) {
        showmsg('电子邮箱格式错误!', 1);
    }
    require_once QISHI_ROOT_PATH . 'include/fun_user.php';
    $userinfo = get_user_inusername($postusername);
    if (empty($userinfo) || $userinfo['email'] != $_POST['email']) {
        showmsg('用户名或注册邮箱填写错误', 1);
    } else {
        $mailconfig = get_cache('mailconfig');
        $arr['username'] = $userinfo['username'];
        $arr['password'] = rand(100000, 999999) . randstr();
        if (smtp_mail($userinfo['email'], "找回密码", "您的新密码为:" . $arr['password'])) {
            $md5password = md5(md5($arr['password']) . $userinfo['pwd_hash'] . $QS_pwdhash);
            if (!$db->query("UPDATE " . table('members') . " SET password = '{$md5password}'  WHERE uid='{$userinfo['uid']}'")) {
                showmsg('密码修改失败', 1);
            }
            if (defined('UC_API')) {
                include_once QISHI_ROOT_PATH . 'uc_client/client.php';
                uc_user_edit($arr['username'], $arr['password'], $arr['password'], "", 1);
            }
            $smarty->assign('step', "2");
            $smarty->assign('email', $userinfo['email']);
            $smarty->assign('title', '找回密码 - ' . $_CFG['site_name']);
            $smarty->display('user/getpass.htm');
        } else {
            showmsg('邮件发送失败,请联系网站管理员', 0);
        }
    }
}
unset($smarty);
开发者ID:dalinhuang,项目名称:yy,代码行数:31,代码来源:user_getpass.php



注:本文中的uc_user_edit函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP uc_user_login函数代码示例发布时间:2022-05-23
下一篇:
PHP uc_user_deleteavatar函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap