[求助] Ucenter用户注册函数增加uid参数为什么不行?---已解决

2018-01-12 11:22

本帖最后由 henryspace 于 2016-8-11 11:22 编辑

Ucenter用户注册函数增加uid参数为什么不行?
需求背景是从别的已有的user数据表注册数据到Ucenter,需要用户在访问到一个接口时触发

1,最外层调用
      uc_user_register($param['username'], $param['password'], $param['email'], $param['uid']);

2,然后\uc_client\client.php   参数追加uid
     function uc_user_register($username, $password, $email, $uid, $questionid = '', $answer = '', $regip = '') {

3,  然后\uc_server\control\user.php 参数追加uid
function onregister() {
    $this->init_input();
    $username = $this->input('username');
    $password =  $this->input('password');
    $email = $this->input('email');
    $questionid = $this->input('questionid');
    $answer = $this->input('answer');
    $regip = $this->input('regip');
    $uid   = $this->input('uid');

    if(($status = $this->_check_username($username)) < 0) {
        return $status;
    }
    if(($status = $this->_check_email($email)) < 0) {
        return $status;
    }

    $uid = $_ENV['user']->add_user($username, $password, $email, $uid, $questionid, $answer, $regip);
    return $uid;
}

4,然后\uc_server\model\user.php  这层的add_user函数未做改动,本来就有uid参数
     function add_user($username, $password, $email, $uid = 0, $questionid = '', $answer = '', $regip = '') {

目前状态:注册用户是成功的,但注册时想把uid也传进来,香港赛马会官方论坛网,而不是自增,上面第3步的函数里无法打印传进来的值,求解?