# 琢思磋文轩

:: :: :: :: :: :: :: :: 93 随笔 :: 0 文章 :: 117 评论 :: 2 引用

JSP网站与phpwind论坛同步登入的解决思路 Cookie("winduser",StrCode($winduid."\t".$windpwd."\t".$safecv),$cktime);

function Cookie($ck_Var,$ck_Value,$ck_Time='F',$p=true){ }

!isset($pre) &&$pre = substr(md5($GLOBALS['db_sitehash']),0,5); return$pre;

}

$logininfo = checkpass($pwuser, $md5_pwpwd,$safecv, $lgt); list($winduid, $groupid,$windpwd, $showmsginfo) =$logininfo;

function checkpass($username,$password, $safecv,$lgt=0) { }

$windpwd = PwdCode($password);

return md5($GLOBALS['pwServer']['HTTP_USER_AGENT'].$pwd.$GLOBALS['db_hash']); } 这样就明白了，$windpwd其实就是Request请求中的User-Agent头信息的字符串、用md5加密过的用户密码、pw_config表中数据db_hash所对应值，三者依次拼接而成的字符串进行一次md5加密之后所产生的字符串，真是够复杂的，看来phpwind为了安全也是煞费苦心啊！

$question =$question=='-1' ? $customquest :$question;

return $question ? substr(md5(md5($question).md5($answer)),8,10) : ''; }$safecv的产生过程也够复杂的，相信大家通过上面的讲解也能明白这个产生过程了，那么笔者也就不多费口舌，太累人了！

list($winduid,$windpwd,$safecv)=explode("\t",addslashes(StrCode(GetCookie('winduser'),'DECODE'))); 其重点在于StrCode(GetCookie('winduser'),'DECODE')，作用是将从Cookie中获取的值采用base64方式进行解码。解码之后的字符串用"\t"分割为三段，第一段是uid，第二段是由上文所提到的PwdCode函数生成的字符串，第三段是由上文所提到的questcode函数生成的字段串，分别存入$winduid$windpwd$safecv中。之后就可以通过该uid来获取用户信息，并验证相关的密码与安全问题是否一致了。

三、实现与phpwind论坛同步登入和同步退出的思路
{"ft_lang_label":"__label__zh","ft_lang_prob":0.8024121,"math_prob":0.9832097,"size":4141,"snap":"2020-24-2020-29","text_gpt3_token_len":2414,"char_repetition_ratio":0.13947305,"word_repetition_ratio":0.0,"special_character_ratio":0.17049022,"punctuation_ratio":0.19148937,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97053236,"pos_list":[0,1,2,3,4,5,6],"im_url_duplicate_count":[null,null,null,null,null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-06-07T01:17:45Z\",\"WARC-Record-ID\":\"<urn:uuid:4f1de6e6-00c1-4447-bef3-94a61ef37ad5>\",\"Content-Length\":\"28675\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:30b5ff74-16f7-44de-97ac-668d7037021e>\",\"WARC-Concurrent-To\":\"<urn:uuid:174fdb45-3622-4ec4-ad29-97e255f3ede6>\",\"WARC-IP-Address\":\"118.31.180.41\",\"WARC-Target-URI\":\"https://www.cnblogs.com/dev2dev/archive/2010/03/25/1696131.html\",\"WARC-Payload-Digest\":\"sha1:3JCNZUBY5TZODB3566ATTE2IOTGMFWWI\",\"WARC-Block-Digest\":\"sha1:M3MESTACGHHAQ24U26BMNGMTS6II42M5\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-24/CC-MAIN-2020-24_segments_1590348521325.84_warc_CC-MAIN-20200606222233-20200607012233-00045.warc.gz\"}"}