ucenter1.5與第三方程式整合(asp.net)過程中的經驗分享。

在整合的過程中參照了這個帖子(或將此鏈接拷貝至瀏覽器地址欄打開:http://www.discuz.net/thread-1694755-1-1.html),在此,向分享經驗的同志表示感謝。

整合了discuzx1和ucenter以及自己開發的第三方程式,在discuzx1中需要修改的地方:

在uc_client\control中的user.php的function onedit() :

將:$_ENV['note']->add(‘updatepw’, ‘username=’.urlencode($username).’&password=’);

改為:$_ENV['note']->add(‘updatepw’, ‘username=’.urlencode($username).’&password=’.$newpw.’&email=’.$email);

============拷貝的分割線,下面是從上面給出的帖子地址中拷貝出來的============

discuz修改密码后将修改密码和email的信息通过ucclient传递给ucenter,
ucenter在收到消息后将消息存入cdb_uc_notelist表,
而后从cdb_uc_notelist取出一条close为0的记录,逐一向各个应用发送修改密码的通知。
各位朋友在调试时记得核对下表cdb_uc_notelist中是否有多条close为0的记录影响调试。

uc_client\client.php文件中的

function uc_user_edit($username, $oldpw, $newpw, $email, $ignoreoldpw = 0, $questionid = ”, $answer = ”) {
return call_user_func(UC_API_FUNC, ‘user’, ‘edit’, array(‘username’=>$username, ‘oldpw’=>$oldpw, ‘newpw’=>$newpw, ‘email’=>$email, ‘ignoreoldpw’=>$ignoreoldpw, ‘questionid’=>$questionid, ‘answer’=>$answer));
}

改为

function uc_user_edit($username, $oldpw, $newpw, $email, $ignoreoldpw = 0, $questionid = ”, $answer = ”) {
return call_user_func(‘uc_api_post’, ‘user’, ‘edit’, array(‘username’=>$username, ‘oldpw’=>$oldpw, ‘newpw’=>$newpw, ‘email’=>$email, ‘ignoreoldpw’=>$ignoreoldpw, ‘questionid’=>$questionid, ‘answer’=>$answer));
}

uc_server\control\user.php文件中的 onedit()方法中的

$_ENV['note']->add(‘updatepw’, ‘username=’.urlencode($username).’&password=’);

改为(需要在第三方应用中处理旧密码和密码问答的请再加上$ignoreoldpw、$questionid、$answer等变量)

$_ENV['note']->add(‘updatepw’, ‘username=’.urlencode($username).’&password=’.urlencode($newpw).’&email=’.urlencode($email));

posted on 2010-11-09 14:21  sixiiweb  阅读(468)  评论(2编辑  收藏  举报

导航