歡迎光臨, 訪客. 請先 登入註冊一個帳號.
四月 24, 2024, 03:01:52 上午
19595 文章 在 3865 主題 由 4580 會員
最新註冊會員: aa123aa1
LifeType 中文開發論壇  |  測試  |  LifeType 1.1 測試  |  lt1.1的外部整合接口中,authenticateUser不支持中文用户名,哪里修改使之支持 « 上篇主題 下篇主題 »
頁: [1]
作者 主題: lt1.1的外部整合接口中,authenticateUser不支持中文用户名,哪里修改使之支持  (閱讀 11542 次)
Tbreeze
初級會員
**
文章: 78


檢視個人資料
« 於: 七月 09, 2006, 10:53:40 下午 »

这个接口文件:class\dao\userdata\simplepostnukeuserdataprovider.class.php中的authenticateUser( $username, $pass )不支持中文名,请问修改哪里让它可以支持中文用户名,谢谢
引用
        function authenticateUser( $username, $pass )
        {
           // Check if we find the user in the LifeType DB
            $user = $this->getUserInfoFromUsername( $username );         
           if( $user ) {
                return( $user->getPassword() == md5($pass));
           }
          
            // Check if the user is available in the PostNuke database...
            else {
              $query = "SELECT * FROM ".$this->_postnukedbprefix."users WHERE pn_uname = '".Db::qstr( $username )."' AND pn_pass = '".md5( $pass )."'";
                $result = $this->_dbc->Execute( $query );
               
                if( (!$result) || ($result == false) ) {         
                    return false;
                }
                // let's add the user to the lt userbase
                elseif ( $result->RecordCount() == 1 ) {
                    $result->Close();
                    $pnUserdata = $this->getUserInfoFromPostNukeUser( $username );

                    $user = new UserInfo( $pnUserdata["pn_uname"],
                                       $pnUserdata["pn_pass"],
                                  $pnUserdata["pn_email"],
                                  "",
                                  $pnUserdata["pn_name"],
                                  0,
                                  serialize(Array())
                                        );
                                 
                    $user->setStatus( USER_STATUS_ACTIVE );
                   
                   
                    $newUserId = $this->addUser( $user );
                    if( !$newUserId ) {
                        return false;                 
                    }

                    //add Blog
                    $this->_PostNukeAddBlog($username, $newUserId);

                    return true;
                }
                else{
                        // TODO: shouldn't ever happen?
                    $result->Close();
                }
                                       
               
                // return false if user authentication failed on both databases
                return false;
           }
        } // authenticateUser
已記錄
markwu
系統管理員
超級會員
*****
文章: 3928


Mark Wu


檢視個人資料 個人網站
« 回覆文章 #1 於: 七月 10, 2006, 05:37:35 下午 »

這樣沒辦法幫你啦,你要不要把執行的結果跟預期的結果列出來,比較好查。  微笑

因為就這個程式來看他並沒有卡user name 的 encoding 。

Mark
« 最後編輯時間: 七月 10, 2006, 09:49:56 下午 由 markwu » 已記錄

Tbreeze
初級會員
**
文章: 78


檢視個人資料
« 回覆文章 #2 於: 七月 11, 2006, 09:32:51 上午 »

我也查找了一下 是没有限制中英文 我估计的编码不同引起的 我再调试看看

问题已解决,是由于外部数据不是UTF-8编码引起的
« 最後編輯時間: 七月 11, 2006, 03:58:15 下午 由 Tbreeze » 已記錄
頁: [1]
LifeType 中文開發論壇  |  測試  |  LifeType 1.1 測試  |  lt1.1的外部整合接口中,authenticateUser不支持中文用户名,哪里修改使之支持 « 上篇主題 下篇主題 »
    前往: