亚洲综合社区欧美综合色-欧美逼逼一区二区三区-国产老熟女高潮精品网站-国产日韩最新视频在线看

始創(chuàng)于2000年 股票代碼:831685
咨詢熱線:0371-60135900 注冊有禮 登錄
  • 掛牌上市企業(yè)
  • 60秒人工響應(yīng)
  • 99.99%連通率
  • 7*24h人工
  • 故障100倍補償
全部產(chǎn)品
您的位置: 網(wǎng)站首頁 > 幫助中心>文章內(nèi)容

有關(guān)UCenter修改用戶名無效的問題

發(fā)布時間:  2012/8/28 19:22:58

有些站長在UCenter修改用戶名后,Discuz! 并沒有顯示出來效果,造成無效的原因主要是通信問題, 如果你的站點顯示通信成功且配置文件和UCenter應(yīng)用管理當(dāng)中的一致,則在UCenter修改用戶信息后,會自動通知Discuz!修改相關(guān)用戶信息 的,如果修改之前,通信失敗,修復(fù)通信后,可以到UCenter的通知列表里,點擊發(fā)送通知,一樣會修改Discuz! 的用戶信息的。在UCenter里執(zhí)行修改用戶信息時,調(diào)用onedit函數(shù)
 

01 function onedit() {  
02           $uid = getgpc('uid');  
03           $status = 0;  
04           if(!$this->user['isfounder']) {    //判斷是否受保護用戶  
05                    $isprotected = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."protectedmembers WHERE uid = '$uid'");  
06                    if($isprotected) {  
07                              $this->message('user_edit_noperm');  
08                    }  
09           }  
10    
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');  
18                    $sqladd = '';  
19                    if($username != $newusername) {    //是否更新用戶名  
20                              if($_ENV['user']->get_user_by_username($newusername)) {  
21                                       $this->message('admin_user_exists');  
22                              }  
23                              $sqladd .= "username='$newusername', ";  
24                              $this->load('note');  
25                              $_ENV['note']->add('renameuser', 'uid='.$uid.'&oldusername='.urlencode($username).'&newusername='.
26 urlencode($newusername));//保存記錄  
27                    }  
28                    if($password) {    //密碼是否更新  
29                              $salt = substr(uniqid(rand()), 0, 6);  
30                              $orgpassword = $password
function onedit() {  
02           $uid = getgpc('uid');  
03           $status = 0;  
04           if(!$this->user['isfounder']) {    //判斷是否受保護用戶  
05                    $isprotected = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."protectedmembers WHERE uid = '$uid'");  
06                    if($isprotected) {  
07                              $this->message('user_edit_noperm');  
08                    }  
09           }  
10    
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');  
18                    $sqladd = '';  
19                    if($username != $newusername) {    //是否更新用戶名  
20                              if($_ENV['user']->get_user_by_username($newusername)) {  
21                                       $this->message('admin_user_exists');  
22                              }  
23                              $sqladd .= "username='$newusername', ";  
24                              $this->load('note');  
25                              $_ENV['note']->add('renameuser', 'uid='.$uid.'&oldusername='.urlencode($username).'&newusername='.
26 urlencode($newusername));//保存記錄  
27                    }  
28                    if($password) {    //密碼是否更新  
29                              $salt = substr(uniqid(rand()), 0, 6);  
30                              $orgpassword = $password;  
31                              $password = md5(md5($password).$salt);  
32                              $sqladd .= "password='$password', salt='$salt', ";  
33                              $this->load('note');  
34                              $_ENV['note']->add('updatepw', 'username='.urlencode($username).'&password=');//保存記錄  
35                    }  
36                    if($rmrecques) {   //驗證問答  
37                              $sqladd .= "secques='', ";  
38                    }  
39                    if(!empty($delavatar)) {    //刪除頭像  
40                              $_ENV['user']->delete_useravatar($uid);  
41                    }  
42    
43                    $this->db->query("UPDATE ".UC_DBTABLEPRE."members SET $sqladd email='$email' WHERE uid='$uid'");  
44                    $status = $this->db->errno() ? -1 : 1;  
45           }                  
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');  
53 }

有些站長在UCenter修改用戶名后,Discuz! 并沒有顯示出來效果,造成無效的原因主要是通信問題, 如果你的站點顯示通信成功且配置文件和UCenter應(yīng)用管理當(dāng)中的一致,則在UCenter修改用戶信息后,會自動通知Discuz!修改相關(guān)用戶信息 的,如果修改之前,通信失敗,修復(fù)通信后,可以到UCenter的通知列表里,點擊發(fā)送通知,一樣會修改Discuz! 的用戶信息的。在UCenter里執(zhí)行修改用戶信息時,調(diào)用onedit函數(shù)
 

01 function onedit() {  
02           $uid = getgpc('uid');  
03           $status = 0;  
04           if(!$this->user['isfounder']) {    //判斷是否受保護用戶  
05                    $isprotected = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."protectedmembers WHERE uid = '$uid'");  
06                    if($isprotected) {  
07                              $this->message('user_edit_noperm');  
08                    }  
09           }  
10    
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');  
18                    $sqladd = '';  
19                    if($username != $newusername) {    //是否更新用戶名  
20                              if($_ENV['user']->get_user_by_username($newusername)) {  
21                                       $this->message('admin_user_exists');  
22                              }  
23                              $sqladd .= "username='$newusername', ";  
24                              $this->load('note');  
25                              $_ENV['note']->add('renameuser', 'uid='.$uid.'&oldusername='.urlencode($username).'&newusername='.
26 urlencode($newusername));//保存記錄  
27                    }  
28                    if($password) {    //密碼是否更新  
29                              $salt = substr(uniqid(rand()), 0, 6);  
30                              $orgpassword = $password;  
31                              $password = md5(md5($password).$salt);  
32                              $sqladd .= "password='$password', salt='$salt', ";  
33                              $this->load('note');  
34                              $_ENV['note']->add('updatepw', 'username='.urlencode($username).'&password=');//保存記錄  
35                    }  
36                    if($rmrecques) {   //驗證問答  
37                              $sqladd .= "secques='', ";  
38                    }  
39                    if(!empty($delavatar)) {    //刪除頭像  
40                              $_ENV['user']->delete_useravatar($uid);  
41                    }  
42    
43                    $this->db->query("UPDATE ".UC_DBTABLEPRE."members SET $sqladd email='$email' WHERE uid='$uid'");  
44                    $status = $this->db->errno() ? -1 : 1;  
45           }                  
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');  
53 }
這個函數(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]

  • 您可能在找
  • 億恩北京公司:
  • 經(jīng)營性ICP/ISP證:京B2-20150015
  • 億恩鄭州公司:
  • 經(jīng)營性ICP/ISP/IDC證:豫B1.B2-20060070
  • 億恩南昌公司:
  • 經(jīng)營性ICP/ISP證:贛B2-20080012
  • 服務(wù)器/云主機 24小時售后服務(wù)電話:0371-60135900
  • 虛擬主機/智能建站 24小時售后服務(wù)電話:0371-60135900
  • 專注服務(wù)器托管17年
    掃掃關(guān)注-微信公眾號
    0371-60135900
    Copyright© 1999-2019 ENKJ All Rights Reserved 億恩科技 版權(quán)所有  地址:鄭州市高新區(qū)翠竹街1號總部企業(yè)基地億恩大廈  法律顧問:河南亞太人律師事務(wù)所郝建鋒、杜慧月律師   京公網(wǎng)安備41019702002023號
      0
     
     
     
     

    0371-60135900
    7*24小時客服服務(wù)熱線