有些站長在UCenter修改用戶名后,Discuz! 并沒有顯示出來效果,造成無效的原因主要是通信問題, 如果你的站點顯示通信成功且配置文件和UCenter應(yīng)用管理當(dāng)中的一致,則在UCenter修改用戶信息后,會自動通知Discuz!修改相關(guān)用戶信息 的,如果修改之前,通信失敗,修復(fù)通信后,可以到UCenter的通知列表里,點擊發(fā)送通知,一樣會修改Discuz! 的用戶信息的。在UCenter里執(zhí)行修改用戶信息時,調(diào)用onedit函數(shù)
04 |
if (! $this ->user[ 'isfounder' ]) { |
05 |
$isprotected = $this ->db->result_first( "SELECT COUNT(*) FROM " .UC_DBTABLEPRE. "protectedmembers WHERE uid = '$uid'" ); |
07 |
$this ->message( 'user_edit_noperm' ); |
11 |
if ( $this ->submitcheck()) { |
12 |
$username = getgpc( 'username' , 'P' ); |
13 |
$newusername = getgpc( 'newusername' , 'P' ); |
14 |
$password = getgpc( 'password' , 'P' ); |
15 |
$email = getgpc( 'email' , 'P' ); |
16 |
$delavatar = getgpc( 'delavatar' , 'P' ); |
17 |
$rmrecques = getgpc( 'rmrecques' , 'P' ); |
19 |
if ( $username != $newusername ) { |
20 |
if ( $_ENV [ 'user' ]->get_user_by_username( $newusername )) { |
21 |
$this ->message( 'admin_user_exists' ); |
23 |
$sqladd .= "username='$newusername', " ; |
25 |
$_ENV [ 'note' ]->add( 'renameuser' , 'uid=' . $uid . '&oldusername=' .urlencode( $username ). '&newusername=' . |
26 |
urlencode( $newusername )); |
29 |
$salt = substr (uniqid(rand()), 0, 6); |
30 |
$orgpassword = $password |
|
04 |
if (! $this ->user[ 'isfounder' ]) { |
05 |
$isprotected = $this ->db->result_first( "SELECT COUNT(*) FROM " .UC_DBTABLEPRE. "protectedmembers WHERE uid = '$uid'" ); |
07 |
$this ->message( 'user_edit_noperm' ); |
11 |
if ( $this ->submitcheck()) { |
12 |
$username = getgpc( 'username' , 'P' ); |
13 |
$newusername = getgpc( 'newusername' , 'P' ); |
14 |
$password = getgpc( 'password' , 'P' ); |
15 |
$email = getgpc( 'email' , 'P' ); |
16 |
$delavatar = getgpc( 'delavatar' , 'P' ); |
17 |
$rmrecques = getgpc( 'rmrecques' , 'P' ); |
19 |
if ( $username != $newusername ) { |
20 |
if ( $_ENV [ 'user' ]->get_user_by_username( $newusername )) { |
21 |
$this ->message( 'admin_user_exists' ); |
23 |
$sqladd .= "username='$newusername', " ; |
25 |
$_ENV [ 'note' ]->add( 'renameuser' , 'uid=' . $uid . '&oldusername=' .urlencode( $username ). '&newusername=' . |
26 |
urlencode( $newusername )); |
29 |
$salt = substr (uniqid(rand()), 0, 6); |
30 |
$orgpassword = $password ; |
31 |
$password = md5(md5( $password ). $salt ); |
32 |
$sqladd .= "password='$password', salt='$salt', " ; |
34 |
$_ENV [ 'note' ]->add( 'updatepw' , 'username=' .urlencode( $username ). '&password=' ); |
37 |
$sqladd .= "secques='', " ; |
39 |
if (! empty ( $delavatar )) { |
40 |
$_ENV [ 'user' ]->delete_useravatar( $uid ); |
43 |
$this ->db->query( "UPDATE " .UC_DBTABLEPRE. "members SET $sqladd email='$email' WHERE uid='$uid'" ); |
44 |
$status = $this ->db->errno() ? -1 : 1; |
46 |
$user = $this ->db->fetch_first( "SELECT * FROM " .UC_DBTABLEPRE. "members WHERE uid='$uid'" ); |
47 |
$user [ 'bigavatar' ] = '<img src="avatar.php?uid=' . $uid . '&size=big">' ; |
48 |
$user [ 'bigavatarreal' ] = '<img src="avatar.php?uid=' . $uid . '&size=big&type=real">' ; |
49 |
$this ->view->assign( 'uid' , $uid ); |
50 |
$this ->view->assign( 'user' , $user ); |
51 |
$this ->view->assign( 'status' , $status ); |
52 |
$this ->view->display( 'admin_user' ); |
有些站長在UCenter修改用戶名后,Discuz! 并沒有顯示出來效果,造成無效的原因主要是通信問題, 如果你的站點顯示通信成功且配置文件和UCenter應(yīng)用管理當(dāng)中的一致,則在UCenter修改用戶信息后,會自動通知Discuz!修改相關(guān)用戶信息 的,如果修改之前,通信失敗,修復(fù)通信后,可以到UCenter的通知列表里,點擊發(fā)送通知,一樣會修改Discuz! 的用戶信息的。在UCenter里執(zhí)行修改用戶信息時,調(diào)用onedit函數(shù)
04 |
if (! $this ->user[ 'isfounder' ]) { |
05 |
$isprotected = $this ->db->result_first( "SELECT COUNT(*) FROM " .UC_DBTABLEPRE. "protectedmembers WHERE uid = '$uid'" ); |
07 |
$this ->message( 'user_edit_noperm' ); |
11 |
if ( $this ->submitcheck()) { |
12 |
$username = getgpc( 'username' , 'P' ); |
13 |
$newusername = getgpc( 'newusername' , 'P' ); |
14 |
$password = getgpc( 'password' , 'P' ); |
15 |
$email = getgpc( 'email' , 'P' ); |
16 |
$delavatar = getgpc( 'delavatar' , 'P' ); |
17 |
$rmrecques = getgpc( 'rmrecques' , 'P' ); |
19 |
if ( $username != $newusername ) { |
20 |
if ( $_ENV [ 'user' ]->get_user_by_username( $newusername )) { |
21 |
$this ->message( 'admin_user_exists' ); |
23 |
$sqladd .= "username='$newusername', " ; |
25 |
$_ENV [ 'note' ]->add( 'renameuser' , 'uid=' . $uid . '&oldusername=' .urlencode( $username ). '&newusername=' . |
26 |
urlencode( $newusername )); |
29 |
$salt = substr (uniqid(rand()), 0, 6); |
30 |
$orgpassword = $password ; |
31 |
$password = md5(md5( $password ). $salt ); |
32 |
$sqladd .= "password='$password', salt='$salt', " ; |
34 |
$_ENV [ 'note' ]->add( 'updatepw' , 'username=' .urlencode( $username ). '&password=' ); |
37 |
$sqladd .= "secques='', " ; |
39 |
if (! empty ( $delavatar )) { |
40 |
$_ENV [ 'user' ]->delete_useravatar( $uid ); |
43 |
$this ->db->query( "UPDATE " .UC_DBTABLEPRE. "members SET $sqladd email='$email' WHERE uid='$uid'" ); |
44 |
$status = $this ->db->errno() ? -1 : 1; |
46 |
$user = $this ->db->fetch_first( "SELECT * FROM " .UC_DBTABLEPRE. "members WHERE uid='$uid'" ); |
47 |
$user [ 'bigavatar' ] = '<img src="avatar.php?uid=' . $uid . '&size=big">' ; |
48 |
$user [ 'bigavatarreal' ] = '<img src="avatar.php?uid=' . $uid . '&size=big&type=real">' ; |
49 |
$this ->view->assign( 'uid' , $uid ); |
50 |
$this ->view->assign( 'user' , $user ); |
51 |
$this ->view->assign( 'status' , $status ); |
52 |
$this ->view->display( 'admin_user' ); |
|
這個函數(shù)首先判斷是該用戶受保護,然后就是判斷是否提交了修改,當(dāng)提交后,判斷用戶名是否修改,密碼是否做了修改,驗證問題及頭像等是否修改,如果做了修 改,調(diào)用add()方法在notelist表保存更新內(nèi)容,當(dāng)修改成功后,二次調(diào)用send方法時,會自動向各個UCenter應(yīng)用發(fā)出執(zhí)行命令,更新對 應(yīng)用戶的信息,并保存通知,如果不成功,提示通知失敗,并指向鏈接,手動通知。 本文出自:億恩科技【1tcdy.com】
服務(wù)器租用/服務(wù)器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|